diff -Nru net-snmp-5.9+dfsg/debian/changelog net-snmp-5.9+dfsg/debian/changelog --- net-snmp-5.9+dfsg/debian/changelog 2021-10-07 12:21:20.000000000 +0200 +++ net-snmp-5.9+dfsg/debian/changelog 2021-11-17 14:58:54.000000000 +0100 @@ -1,3 +1,10 @@ +net-snmp (5.9+dfsg-3ubuntu4) jammy; urgency=medium + + * d/p/lp1945960-*: backport patches for the OpenSSL3 transition + (LP: #1945960) + + -- Simon Chopin Wed, 17 Nov 2021 14:58:54 +0100 + net-snmp (5.9+dfsg-3ubuntu3) impish; urgency=medium * No-change rebuild to build packages with zstd compression. diff -Nru net-snmp-5.9+dfsg/debian/patches/lp1945960-configure-static-linking-Fix-SSL-checks.patch net-snmp-5.9+dfsg/debian/patches/lp1945960-configure-static-linking-Fix-SSL-checks.patch --- net-snmp-5.9+dfsg/debian/patches/lp1945960-configure-static-linking-Fix-SSL-checks.patch 1970-01-01 01:00:00.000000000 +0100 +++ net-snmp-5.9+dfsg/debian/patches/lp1945960-configure-static-linking-Fix-SSL-checks.patch 2021-11-17 14:58:54.000000000 +0100 @@ -0,0 +1,64 @@ +From bd59be8e4e339870a1400f6866a7b73ca11f6460 Mon Sep 17 00:00:00 2001 +From: Giulio Benetti +Date: Wed, 12 Sep 2018 20:16:39 +0200 +Subject: [PATCH] configure, static linking: Fix SSL checks +Origin: https://github.com/net-snmp/net-snmp/commit/bd59be8e4e339870a1400f6866a7b73ca11f6460 + +During checking of DTLS_method, the stub program is linked only with -ssl +libssl.a lacks some function from -lcrypto: +RAND_*() +ERR_*() +BUF_MEM_*() +etc. +and -lz: +- inflate() +- deflate() + +Append -lcrypto and -lz to LIBS variable when checking DTLS_method. + +See also https://sourceforge.net/p/net-snmp/patches/1374/. + +Signed-off-by: Giulio Benetti +[bvanassche: Edited subject / rewrote this patch] + +schopin: Dropped the configure part of the patch as Debian/Ubuntu build +as it didn't apply cleanly and the packaging uses autoreconf anyway. +--- + configure | 52 ++++++++++++++++++++++++++++++++++--- + configure.d/config_os_libs2 | 14 +++++++--- + 2 files changed, 58 insertions(+), 8 deletions(-) + +--- a/configure.d/config_os_libs2 ++++ b/configure.d/config_os_libs2 +@@ -302,13 +302,19 @@ + LIBS="$netsnmp_save_LIBS" + + if test x$CRYPTO = x; then +- AC_CHECK_LIB([crypto], [EVP_md5], [CRYPTO="crypto"]) +- fi ++ AC_CHECK_LIB([crypto], [EVP_md5], ++ [CRYPTO="crypto"; LIBCRYPTO="-lcrypto"], [ ++ AC_CHECK_LIB([crypto], [EVP_md5], ++ [CRYPTO="crypto"; LIBCRYPTO="-lcrypto -lz"], [], ++ [-lz]) ++ ]) ++ else ++ LIBCRYPTO="-l${CRYPTO}" ++ fi + + if test x$CRYPTO != x; then + AC_DEFINE(HAVE_LIBCRYPTO, 1, + [Define to 1 if you have the OpenSSL library (-lcrypto or -leay32).]) +- LIBCRYPTO="-l${CRYPTO}" + netsnmp_save_LIBS="$LIBS" + LIBS="$LIBCRYPTO" + AC_CHECK_FUNCS([AES_cfb128_encrypt]dnl +@@ -338,7 +344,7 @@ + LIBS="$netsnmp_save_LIBS" + fi + netsnmp_save_LIBS="$LIBS" +- LIBS="-lssl" ++ LIBS="-lssl $LIBCRYPTO" + AC_CHECK_FUNCS([TLS_method TLSv1_method DTLS_method DTLSv1_method]dnl + [SSL_library_init SSL_load_error_strings]dnl + [ERR_get_error_all]) diff -Nru net-snmp-5.9+dfsg/debian/patches/lp1945960-Fix-the-build-against-OpenSSL-3.0.patch net-snmp-5.9+dfsg/debian/patches/lp1945960-Fix-the-build-against-OpenSSL-3.0.patch --- net-snmp-5.9+dfsg/debian/patches/lp1945960-Fix-the-build-against-OpenSSL-3.0.patch 1970-01-01 01:00:00.000000000 +0100 +++ net-snmp-5.9+dfsg/debian/patches/lp1945960-Fix-the-build-against-OpenSSL-3.0.patch 2021-11-17 14:58:54.000000000 +0100 @@ -0,0 +1,30 @@ +From 19e75743173cb8d49d49fd685b8e0249e83cc820 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Wed, 8 Sep 2021 20:39:42 -0700 +Subject: [PATCH] libsnmp: Fix the build against OpenSSL 3.0 +Origin: https://github.com/net-snmp/net-snmp/commit/19e75743173cb8d49d49fd685b8e0249e83cc820 + +Fixes: https://github.com/net-snmp/net-snmp/issues/343 +--- + snmplib/snmp_openssl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c +index c092a007a..eb4856c57 100644 +--- a/snmplib/snmp_openssl.c ++++ b/snmplib/snmp_openssl.c +@@ -899,6 +899,11 @@ netsnmp_openssl_cert_issued_by(X509 *issuer, X509 *cert) + + + #ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG ++#ifndef ERR_GET_FUNC ++/* removed in OpenSSL 3.0 */ ++#define ERR_GET_FUNC(e) -1 ++#endif ++ + void + netsnmp_openssl_err_log(const char *prefix) + { +-- +2.32.0 + diff -Nru net-snmp-5.9+dfsg/debian/patches/series net-snmp-5.9+dfsg/debian/patches/series --- net-snmp-5.9+dfsg/debian/patches/series 2021-05-26 01:03:31.000000000 +0200 +++ net-snmp-5.9+dfsg/debian/patches/series 2021-11-17 14:58:54.000000000 +0100 @@ -39,3 +39,5 @@ perl_makefile_man3pods lp1912389-libsnmp-Handle-certificate-loading-errors-gracefully.patch lp1912389-libsnmp-SSL-Increase-extension-buffer-size-to-preven.patch +lp1945960-configure-static-linking-Fix-SSL-checks.patch +lp1945960-Fix-the-build-against-OpenSSL-3.0.patch