Skip to content

Commit

Permalink
Update mbedtls v3 compatibility
Browse files Browse the repository at this point in the history
Bump version 174.11
  • Loading branch information
thess committed May 13, 2024
1 parent f69d91a commit 85f25a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
27 changes: 9 additions & 18 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_PREREQ([2.71])
AC_INIT([pianod],
174.10-sc,
[174.11-sc],
[[email protected]],
,[http://deviousfish.com/pianod])
[],[http://deviousfish.com/pianod])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_HEADERS([config.h])

Expand Down Expand Up @@ -121,12 +121,9 @@ AC_SEARCH_LIBS([crypt],[crypt], [],

# IPv6 support
AC_MSG_CHECKING([PF_INET6/IPv6 support])
AC_TRY_COMPILE([#include <sys/socket.h>],
[ int f = PF_INET6; ],
[ AC_MSG_RESULT(yes)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = PF_INET6; ]])],[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IPV6, [1],
[Define this symbol if you have IPV6 support]) ],
[ AC_MSG_RESULT(no)])
[Define this symbol if you have IPV6 support]) ],[ AC_MSG_RESULT(no)])

# res_init availability
AC_SEARCH_LIBS([res_init],[resolv])
Expand All @@ -152,20 +149,14 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([
# There are 'net references to an SO_NOSIGNAL, but I suspect it is an
# erroneous portmanteau of the other two.
AC_MSG_CHECKING([MSG_NOSIGNAL])
AC_TRY_COMPILE([#include <sys/socket.h>],
[ int f = MSG_NOSIGNAL; ],
[ AC_MSG_RESULT(yes)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_NOSIGNAL; ]])],[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MSG_NOSIGNAL, [1],
[Define this symbol if you have MSG_NOSIGNAL]) ],
[ AC_MSG_RESULT(no)])
[Define this symbol if you have MSG_NOSIGNAL]) ],[ AC_MSG_RESULT(no)])

AC_MSG_CHECKING([SO_NOSIGPIPE])
AC_TRY_COMPILE([#include <sys/socket.h>],
[ int f = SO_NOSIGPIPE; ],
[ AC_MSG_RESULT(yes)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = SO_NOSIGPIPE; ]])],[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SO_NOSIGPIPE, [1],
[Define this symbol if you have SO_NOSIGPIPE]) ],
[ AC_MSG_RESULT(no)])
[Define this symbol if you have SO_NOSIGPIPE]) ],[ AC_MSG_RESULT(no)])

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h crypt.h gcrypt.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h strings.h sys/socket.h unistd.h json-c/json.h json/json.h json.h])
Expand Down
2 changes: 1 addition & 1 deletion src/libwaitress/waitress.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ static WaitressReturn_t WaitressTlsVerify (const WaitressHandle_t *waith) {
return WAITRESS_RET_TLS_HANDSHAKE_ERR;
}

#if MBEDTLS_VERSION_NUMBER >= 0x02070000
#if (MBEDTLS_VERSION_NUMBER >= 0x0207000) && (MBEDTLS_VERSION_NUMBER < 0x03000000)
mbedtls_sha1_ret (cert->raw.p, cert->raw.len, fingerprint);
#else
mbedtls_sha1 (cert->raw.p, cert->raw.len, fingerprint);
Expand Down

0 comments on commit 85f25a5

Please sign in to comment.