diff options
author | Martijn van Duren <martijn@cvs.openbsd.org> | 2023-12-22 13:03:17 +0000 |
---|---|---|
committer | Martijn van Duren <martijn@cvs.openbsd.org> | 2023-12-22 13:03:17 +0000 |
commit | a94d1218ed00be16e315c16c3f76dec642957b13 (patch) | |
tree | cfb795463fb54301b22112ce4b717b6340425a51 /usr.sbin/snmpd | |
parent | da2996452b3c0e255087b232ee36be19f99664f4 (diff) |
Remove a log_debug from usm_checkuser(). It would only display what is in
the config and was never actually displayed because of insufficient
verbosity level during config-parsing and would display the wrong auth
algorithm for SHA2.
OK tb@
Diffstat (limited to 'usr.sbin/snmpd')
-rw-r--r-- | usr.sbin/snmpd/usm.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/usr.sbin/snmpd/usm.c b/usr.sbin/snmpd/usm.c index 21538825470..93324b557a9 100644 --- a/usr.sbin/snmpd/usm.c +++ b/usr.sbin/snmpd/usm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usm.c,v 1.29 2023/12/21 12:43:31 martijn Exp $ */ +/* $OpenBSD: usm.c,v 1.30 2023/12/22 13:03:16 martijn Exp $ */ /* * Copyright (c) 2012 GeNUA mbH @@ -208,8 +208,6 @@ usm_finduser(char *name) int usm_checkuser(struct usmuser *up, const char **errp) { - char *auth = NULL, *priv = NULL; - if (up->uu_auth != AUTH_NONE && up->uu_authkey == NULL) { *errp = "missing auth passphrase"; goto fail; @@ -230,45 +228,26 @@ usm_checkuser(struct usmuser *up, const char **errp) switch (up->uu_auth) { case AUTH_NONE: - auth = "none"; break; case AUTH_MD5: - up->uu_seclevel |= SNMP_MSGFLAG_AUTH; - auth = "HMAC-MD5-96"; - break; case AUTH_SHA1: - up->uu_seclevel |= SNMP_MSGFLAG_AUTH; - auth = "HMAC-SHA1-96"; - break; case AUTH_SHA224: - up->uu_seclevel |= SNMP_MSGFLAG_AUTH; - auth = "usmHMAC128SHA224AuthProtocol"; case AUTH_SHA256: - up->uu_seclevel |= SNMP_MSGFLAG_AUTH; - auth = "usmHMAC192SHA256AuthProtocol"; case AUTH_SHA384: - up->uu_seclevel |= SNMP_MSGFLAG_AUTH; - auth = "usmHMAC256SHA384AuthProtocol"; case AUTH_SHA512: up->uu_seclevel |= SNMP_MSGFLAG_AUTH; - auth = "usmHMAC384SHA512AuthProtocol"; + break; } switch (up->uu_priv) { case PRIV_NONE: - priv = "none"; break; case PRIV_DES: - up->uu_seclevel |= SNMP_MSGFLAG_PRIV; - priv = "CBC-DES"; - break; case PRIV_AES: up->uu_seclevel |= SNMP_MSGFLAG_PRIV; - priv = "CFB128-AES-128"; break; } - log_debug("user \"%s\" auth %s enc %s", up->uu_name, auth, priv); return 0; fail: |