Blame SOURCES/net-snmp-5.9-openssl-3.0.patch

a4676a
diff -urNp a/include/net-snmp/library/snmp_openssl.h b/include/net-snmp/library/snmp_openssl.h
a4676a
--- a/include/net-snmp/library/snmp_openssl.h	2021-09-15 07:55:39.829901038 +0200
a4676a
+++ b/include/net-snmp/library/snmp_openssl.h	2021-09-15 07:56:18.656412998 +0200
a4676a
@@ -44,7 +44,6 @@ extern          "C" {
a4676a
     /*
a4676a
      * misc
a4676a
      */
a4676a
-    void netsnmp_openssl_err_log(const char *prefix);
a4676a
     void netsnmp_openssl_null_checks(SSL *ssl, int *nullAuth, int *nullCipher);
a4676a
 
a4676a
     /*
a4676a
diff -urNp a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c
a4676a
--- a/snmplib/snmp_openssl.c	2021-09-15 07:55:39.785900458 +0200
a4676a
+++ b/snmplib/snmp_openssl.c	2021-09-15 07:57:30.914417600 +0200
a4676a
@@ -937,20 +937,6 @@ netsnmp_openssl_cert_issued_by(X509 *iss
a4676a
     return (X509_check_issued(issuer, cert) == X509_V_OK);
a4676a
 }
a4676a
 
a4676a
-
a4676a
-#ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG
a4676a
-void
a4676a
-netsnmp_openssl_err_log(const char *prefix)
a4676a
-{
a4676a
-    unsigned long err;
a4676a
-    for (err = ERR_get_error(); err; err = ERR_get_error()) {
a4676a
-        snmp_log(LOG_ERR,"%s: %ld\n", prefix ? prefix: "openssl error", err);
a4676a
-        snmp_log(LOG_ERR, "library=%d, function=%d, reason=%d\n",
a4676a
-                 ERR_GET_LIB(err), ERR_GET_FUNC(err), ERR_GET_REASON(err));
a4676a
-    }
a4676a
-}
a4676a
-#endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG */
a4676a
-
a4676a
 void
a4676a
 netsnmp_openssl_null_checks(SSL *ssl, int *null_auth, int *null_cipher)
a4676a
 {
bc6b3f
diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c
bc6b3f
--- a/snmplib/transports/snmpTLSBaseDomain.c	2021-05-18 11:15:09.247472175 +0200
bc6b3f
+++ b/snmplib/transports/snmpTLSBaseDomain.c	2021-05-24 09:39:29.297494727 +0200
bc6b3f
@@ -54,17 +54,6 @@ netsnmp_feature_require(cert_util);
bc6b3f
 
bc6b3f
 int openssl_local_index;
bc6b3f
 
bc6b3f
-#ifndef HAVE_ERR_GET_ERROR_ALL
bc6b3f
-/* A backport of the OpenSSL 1.1.1e ERR_get_error_all() function. */
bc6b3f
-static unsigned long ERR_get_error_all(const char **file, int *line,
bc6b3f
-                                       const char **func,
bc6b3f
-                                       const char **data, int *flags)
bc6b3f
-{
bc6b3f
-    *func = NULL;
bc6b3f
-    return ERR_get_error_line_data(file, line, data, flags);
bc6b3f
-}
bc6b3f
-#endif
bc6b3f
-
bc6b3f
 /* this is called during negotiation */
bc6b3f
 int verify_callback(int ok, X509_STORE_CTX *ctx) {
bc6b3f
     int err, depth;
a4676a
@@ -1187,27 +1176,6 @@ void _openssl_log_error(int rc, SSL *con
a4676a
                  ERR_reason_error_string(ERR_get_error()));
bc6b3f
 
a4676a
     }
a4676a
-
a4676a
-    /* other errors */
bc6b3f
-    while ((numerical_reason =
a4676a
-            ERR_get_error_all(&file, &line, &func, &data, &flags)) != 0) {
a4676a
-        snmp_log(LOG_ERR, "%s (file %s, func %s, line %d)\n",
bc6b3f
-                 ERR_error_string(numerical_reason, NULL), file, func, line);
a4676a
-
a4676a
-        /* if we have a text translation: */
bc6b3f
-        if (data && (flags & ERR_TXT_STRING)) {
bc6b3f
-            snmp_log(LOG_ERR, "  Textual Error: %s\n", data);
a4676a
-            /*
a4676a
-             * per openssl man page: If it has been allocated by
a4676a
-             * OPENSSL_malloc(), *flags&ERR_TXT_MALLOCED is true.
a4676a
-             *
a4676a
-             * arggh... stupid openssl prototype for ERR_get_error_line_data
a4676a
-             * wants a const char **, but returns something that we might
a4676a
-             * need to free??
a4676a
-             */
bc6b3f
-            if (flags & ERR_TXT_MALLOCED)
a4676a
-                OPENSSL_free(NETSNMP_REMOVE_CONST(void *, data));        }
bc6b3f
-    }
bc6b3f
     
bc6b3f
     snmp_log(LOG_ERR, "---- End of OpenSSL Errors ----\n");
bc6b3f
 }