SHA256
1
0
forked from pool/openhpi
openhpi/openhpi-3.6.0_fix_net-snmp_disable_MD5.patch

24 lines
1.2 KiB
Diff

diff -Nurp openhpi-3.6.0-orig/plugins/snmp_bc/snmp_bc_session.c openhpi-3.6.0/plugins/snmp_bc/snmp_bc_session.c
--- openhpi-3.6.0-orig/plugins/snmp_bc/snmp_bc_session.c 2015-09-17 12:40:43.357513842 +0200
+++ openhpi-3.6.0/plugins/snmp_bc/snmp_bc_session.c 2015-09-17 13:54:53.386358885 +0200
@@ -201,14 +201,17 @@ void *snmp_bc_open(GHashTable *handler_c
}
custom_handle->session.securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
+#ifndef DISABLE_MD5
if (!authtype || !g_ascii_strncasecmp(authtype, "MD5", sizeof("MD5"))) {
custom_handle->session.securityAuthProto = usmHMACMD5AuthProtocol;
custom_handle->session.securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
- } else if (!g_ascii_strncasecmp(authtype, "SHA", sizeof("SHA"))) {
+ } else
+#endif
+ if (!g_ascii_strncasecmp(authtype, "SHA", sizeof("SHA"))) {
custom_handle->session.securityAuthProto = usmHMACSHA1AuthProtocol;
custom_handle->session.securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
} else {
- err("Unrecognized authenication type=%s.", authtype);
+ err("Unrecognized or unsupported authenication type=%s.", authtype);
return NULL;
}