diff --git a/NEWS b/NEWS index c6f445ee838..3710589bc95 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 f2f55d19b57..3ecd461f0c5 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 {