File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -955,19 +955,31 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
955
955
Set the security protocol in the snmpv3 session */
956
956
static int netsnmp_session_set_sec_protocol (struct snmp_session * s , char * prot )
957
957
{
958
+ #ifndef NETSNMP_DISABLE_DES
958
959
if (!strcasecmp (prot , "DES" )) {
959
960
s -> securityPrivProto = usmDESPrivProtocol ;
960
961
s -> securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN ;
962
+ } else
963
+ #endif
961
964
#ifdef HAVE_AES
962
- } else if (!strcasecmp (prot , "AES128" ) || !strcasecmp (prot , "AES" )) {
965
+ if (!strcasecmp (prot , "AES128" ) || !strcasecmp (prot , "AES" )) {
963
966
s -> securityPrivProto = usmAESPrivProtocol ;
964
967
s -> securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN ;
968
+ } else
965
969
#endif
966
- } else {
970
+ {
967
971
#ifdef HAVE_AES
972
+ #ifndef NETSNMP_DISABLE_DES
968
973
zend_value_error ("Security protocol must be one of \"DES\", \"AES128\", or \"AES\"" );
969
974
#else
975
+ zend_value_error ("Security protocol must be one of \"AES128\", or \"AES\"" );
976
+ #endif
977
+ #else
978
+ #ifndef NETSNMP_DISABLE_DES
970
979
zend_value_error ("Security protocol must be \"DES\"" );
980
+ #else
981
+ zend_value_error ("No security protocol supported" );
982
+ #endif
971
983
#endif
972
984
return (-1 );
973
985
}
You can’t perform that action at this time.
0 commit comments