]> granicus.if.org Git - php/commitdiff
Fix #70461: disable md5 code when it is not supported in net-snmp
authorChristoph M. Becker <cmbecker69@gmx.de>
Wed, 28 Oct 2020 14:30:49 +0000 (15:30 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 2 Nov 2020 10:36:26 +0000 (11:36 +0100)
Patch contributed by Alexander Bergmann.

Closes GH-6389.

NEWS
ext/snmp/snmp.c

diff --git a/NEWS b/NEWS
index 72b47f29943ed81a2a07ffb31b139f683adbe1cc..f6963784d8343040eb33dcfd89b0d0446d8fb9fd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,10 @@ PHP                                                                        NEWS
 - ODBC:
   . Fixed bug #44618 (Fetching may rely on uninitialized data). (cmb)
 
+- SNMP:
+  . Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
+    (Alexander Bergmann, cmb)
+
 29 Oct 2020, PHP 7.3.24
 
 - Core:
index ef23d1ba810d2c5adb02a9fa9e76331527e63c43..1c2bbe5e35e814420412375e9d25f574037bb469 100644 (file)
@@ -1208,10 +1208,13 @@ static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
    Set the authentication protocol in the snmpv3 session */
 static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
 {
+#ifndef DISABLE_MD5
        if (!strcasecmp(prot, "MD5")) {
                s->securityAuthProto = usmHMACMD5AuthProtocol;
                s->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
-       } else if (!strcasecmp(prot, "SHA")) {
+       } else
+#endif
+       if (!strcasecmp(prot, "SHA")) {
                s->securityAuthProto = usmHMACSHA1AuthProtocol;
                s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
        } else {