diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-28 15:30:49 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-11-02 11:36:26 +0100 |
commit | 9690ded288624e8ebb8f331ff305fed9a134e5e3 (patch) | |
tree | 59534e9f11182ae2d2b584c3dae7b6381dd834a4 /ext | |
parent | ee3227af48bb0db6f29117dca7d8a30bb21bde5e (diff) | |
download | php-git-9690ded288624e8ebb8f331ff305fed9a134e5e3.tar.gz |
Fix #70461: disable md5 code when it is not supported in net-snmp
Patch contributed by Alexander Bergmann.
Closes GH-6389.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/snmp/snmp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index ef23d1ba81..1c2bbe5e35 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -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 { |