com php-src: Fix #70461: disable md5 code when it is not supported in net-snmp: NEWS ext/snmp/snmp.c

From: Date: Mon, 02 Nov 2020 10:36:26 +0000
Subject: com php-src: Fix #70461: disable md5 code when it is not supported in net-snmp: NEWS ext/snmp/snmp.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-114012@lists.php.net to get a copy of this message
Commit: 9690ded288624e8ebb8f331ff305fed9a134e5e3 Author: Christoph M. Becker <cmbecker69@gmx.de> Wed, 28 Oct 2020 15:30:49 +0100 Parents: ee3227af48bb0db6f29117dca7d8a30bb21bde5e Branches: PHP-7.3 PHP-7..4 PHP-8.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9690ded288624e8ebb8f331ff305fed9a134e5e3 Log: Fix #70461: disable md5 code when it is not supported in net-snmp Patch contributed by Alexander Bergmann. Closes GH-6389. Bugs: https://bugs.php.net/70461 Changed paths: M NEWS M ext/snmp/snmp.c Diff: diff --git a/NEWS b/NEWS index 72b47f29943..f6963784d83 100644 --- 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: diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index ef23d1ba810..1c2bbe5e35e 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 {

« previous php.cvs (#114012) next »