File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -944,21 +944,32 @@ static bool netsnmp_session_set_auth_protocol(struct snmp_session *s, zend_strin
944
944
/* {{{ Set the security protocol in the snmpv3 session */
945
945
static bool netsnmp_session_set_sec_protocol (struct snmp_session * s , zend_string * prot )
946
946
{
947
+ #ifndef NETSNMP_DISABLE_DES
947
948
if (zend_string_equals_literal_ci (prot , "DES" )) {
948
949
s -> securityPrivProto = usmDESPrivProtocol ;
949
950
s -> securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN ;
951
+ } else
952
+ #endif
950
953
#ifdef HAVE_AES
951
- } else if (zend_string_equals_literal_ci (prot , "AES128" )
954
+ if (zend_string_equals_literal_ci (prot , "AES128" )
952
955
|| zend_string_equals_literal_ci (prot , "AES" )
953
- ) {
954
956
s -> securityPrivProto = usmAESPrivProtocol ;
955
957
s -> securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN ;
958
+ } else
956
959
#endif
957
- } else {
960
+ {
958
961
#ifdef HAVE_AES
962
+ #ifndef NETSNMP_DISABLE_DES
959
963
zend_value_error ("Security protocol must be one of \"DES\", \"AES128\", or \"AES\"" );
960
964
#else
965
+ zend_value_error ("Security protocol must be one of \"AES128\", or \"AES\"" );
966
+ #endif
967
+ #else
968
+ #ifndef NETSNMP_DISABLE_DES
961
969
zend_value_error ("Security protocol must be \"DES\"" );
970
+ #else
971
+ zend_value_error ("No security protocol supported" );
972
+ #endif
962
973
#endif
963
974
return false;
964
975
}
You can’t perform that action at this time.
0 commit comments