Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing "ERR_GET_FUNC" #343

Closed
gvanem opened this issue Sep 8, 2021 · 1 comment
Closed

Missing "ERR_GET_FUNC" #343

gvanem opened this issue Sep 8, 2021 · 1 comment

Comments

@gvanem
Copy link
Contributor

gvanem commented Sep 8, 2021

In the function netsnmp_openssl_err_log() there is this:

        snmp_log(LOG_ERR, "library=%d, function=%d, reason=%d\n",
                 ERR_GET_LIB(err), ERR_GET_FUNC(err), ERR_GET_REASON(err));

According to https://www.openssl.org/news/changelog.html, the ERR_GET_FUNC() macro (?) was removed some time ago.
Could this be patched like this:

--- a/snmplib/snmp_openssl.c 2021-09-08 09:10:44
+++ b/snmplib/snmp_openssl.c 2021-09-08 11:33:34
@@ -939,6 +939,10 @@


 #ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG
+#ifndef ERR_GET_FUNC
+#define ERR_GET_FUNC(e)  (int)(((e) >> 12L) & 0xFFFL) /* removed in OpenSSL 3.0 */
+#endif
+
 void
 netsnmp_openssl_err_log(const char *prefix)

I see no reference to NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG. So this function is always compiled AFAICS.

@bvanassche
Copy link
Contributor

Please take a look at commits 19e7574 (v5.9 branch) and 8518baf (master branch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants