summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-11-02 11:39:16 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2020-11-02 11:39:42 +0100
commit0123f75b5d5bcd76603da1acecf6687a08145b68 (patch)
tree2bcaa733f823d573afc3a171037d61b1f5c0fd8e
parent83738281eb9f2577eda1c76a6acfe644d6fcc6c1 (diff)
parent9690ded288624e8ebb8f331ff305fed9a134e5e3 (diff)
downloadphp-git-0123f75b5d5bcd76603da1acecf6687a08145b68.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #70461: disable md5 code when it is not supported in net-snmp
-rw-r--r--NEWS4
-rw-r--r--ext/snmp/snmp.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index c6f445ee83..3710589bc9 100644
--- a/NEWS
+++ b/NEWS
@@ -52,6 +52,10 @@ PHP NEWS
. Fixed bug #65825 (PDOStatement::fetch() does not throw exception on broken
server connection). (Nikita)
+- SNMP:
+ . Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
+ (Alexander Bergmann, cmb)
+
29 Oct 2020, PHP 7.4.12
- Core:
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index f2f55d19b5..3ecd461f0c 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1204,10 +1204,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 {