Skip to content

Commit 9690ded

Browse files
committed
Fix #70461: disable md5 code when it is not supported in net-snmp
Patch contributed by Alexander Bergmann. Closes phpGH-6389.
1 parent ee3227a commit 9690ded

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ PHP NEWS
2525
- ODBC:
2626
. Fixed bug #44618 (Fetching may rely on uninitialized data). (cmb)
2727

28+
- SNMP:
29+
. Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
30+
(Alexander Bergmann, cmb)
31+
2832
29 Oct 2020, PHP 7.3.24
2933

3034
- Core:

ext/snmp/snmp.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1208,10 +1208,13 @@ static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
12081208
Set the authentication protocol in the snmpv3 session */
12091209
static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
12101210
{
1211+
#ifndef DISABLE_MD5
12111212
if (!strcasecmp(prot, "MD5")) {
12121213
s->securityAuthProto = usmHMACMD5AuthProtocol;
12131214
s->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
1214-
} else if (!strcasecmp(prot, "SHA")) {
1215+
} else
1216+
#endif
1217+
if (!strcasecmp(prot, "SHA")) {
12151218
s->securityAuthProto = usmHMACSHA1AuthProtocol;
12161219
s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
12171220
} else {

0 commit comments

Comments
 (0)