snmp3 calls using authPriv or authNoPriv immediately return false

Resolves: #2104630
This commit is contained in:
Remi Collet 2022-08-01 11:05:34 +02:00
parent 0bfd00cc6c
commit 1a6664275d
2 changed files with 10 additions and 7 deletions

View File

@ -61,12 +61,12 @@ index 69d6549405b17..f0917501751f5 100644
#include "ext/spl/spl_exceptions.h" #include "ext/spl/spl_exceptions.h"
#include "snmp_arginfo.h" #include "snmp_arginfo.h"
@@ -938,16 +939,48 @@ static int netsnmp_session_set_auth_prot @@ -938,16 +939,48 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
if (!strcasecmp(prot, "MD5")) { if (!strcasecmp(prot, "MD5")) {
s->securityAuthProto = usmHMACMD5AuthProtocol; s->securityAuthProto = usmHMACMD5AuthProtocol;
s->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN; s->securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
- } else - } else
+ return true; + return 0;
+ } + }
#endif #endif
+ +
@ -76,7 +76,7 @@ index 69d6549405b17..f0917501751f5 100644
- } else { - } else {
- zend_value_error("Authentication protocol must be either \"MD5\" or \"SHA\""); - zend_value_error("Authentication protocol must be either \"MD5\" or \"SHA\"");
- return (-1); - return (-1);
+ return true; + return 0;
} }
- return (0); - return (0);
+ +
@ -84,7 +84,7 @@ index 69d6549405b17..f0917501751f5 100644
+ if (!strcasecmp(prot, "SHA256")) { + if (!strcasecmp(prot, "SHA256")) {
+ s->securityAuthProto = usmHMAC192SHA256AuthProtocol; + s->securityAuthProto = usmHMAC192SHA256AuthProtocol;
+ s->securityAuthProtoLen = sizeof(usmHMAC192SHA256AuthProtocol) / sizeof(oid); + s->securityAuthProtoLen = sizeof(usmHMAC192SHA256AuthProtocol) / sizeof(oid);
+ return true; + return 0;
+ } + }
+#endif +#endif
+ +
@ -92,7 +92,7 @@ index 69d6549405b17..f0917501751f5 100644
+ if (!strcasecmp(prot, "SHA512")) { + if (!strcasecmp(prot, "SHA512")) {
+ s->securityAuthProto = usmHMAC384SHA512AuthProtocol; + s->securityAuthProto = usmHMAC384SHA512AuthProtocol;
+ s->securityAuthProtoLen = sizeof(usmHMAC384SHA512AuthProtocol) / sizeof(oid); + s->securityAuthProtoLen = sizeof(usmHMAC384SHA512AuthProtocol) / sizeof(oid);
+ return true; + return 0;
+ } + }
+#endif +#endif
+ +
@ -111,7 +111,7 @@ index 69d6549405b17..f0917501751f5 100644
+ smart_string_0(&err); + smart_string_0(&err);
+ zend_value_error("%s", err.c); + zend_value_error("%s", err.c);
+ smart_string_free(&err); + smart_string_free(&err);
+ return false; + return -1;
} }
/* }}} */ /* }}} */

View File

@ -62,7 +62,7 @@
Summary: PHP scripting language for creating dynamic web sites Summary: PHP scripting language for creating dynamic web sites
Name: php Name: php
Version: %{upver}%{?rcver:~%{rcver}} Version: %{upver}%{?rcver:~%{rcver}}
Release: 2%{?dist} Release: 3%{?dist}
# All files licensed under PHP version 3.01, except # All files licensed under PHP version 3.01, except
# Zend is licensed under Zend # Zend is licensed under Zend
# TSRM is licensed under BSD # TSRM is licensed under BSD
@ -1537,6 +1537,9 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
%changelog %changelog
* Mon Aug 1 2022 Remi Collet <rcollet@redhat.com> - 8.0.20-3
- snmp3 calls using authPriv or authNoPriv immediately return false #2104630
* Mon Jun 13 2022 Remi Collet <rcollet@redhat.com> - 8.0.20-2 * Mon Jun 13 2022 Remi Collet <rcollet@redhat.com> - 8.0.20-2
- fix patch41 not applied (use system nikic/php-parser when available) - fix patch41 not applied (use system nikic/php-parser when available)