summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd/usm.c
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2023-11-08 20:07:15 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2023-11-08 20:07:15 +0000
commitcbd476f01dadd880334016b05c2af56b8143c034 (patch)
tree7158627fa25a2137da6dbe745d64e568130a24c8 /usr.sbin/snmpd/usm.c
parentcdfdca3fd767cc4ed4ba7f32706e96dd0a96e131 (diff)
Let usm_make_report() utilize appl_report(). usm_make_report utilized
mps_getstr(), which after moving the SNMPv2-SMI::snmpV2 into application_internal returned a noSuchObject. This doesn't seem to have broken any tools that I'm aware of, but this returns the correct result. OK tb@
Diffstat (limited to 'usr.sbin/snmpd/usm.c')
-rw-r--r--usr.sbin/snmpd/usm.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/usr.sbin/snmpd/usm.c b/usr.sbin/snmpd/usm.c
index a3df1ac0f31..586925c0eee 100644
--- a/usr.sbin/snmpd/usm.c
+++ b/usr.sbin/snmpd/usm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usm.c,v 1.26 2023/05/08 12:25:23 gerhard Exp $ */
+/* $OpenBSD: usm.c,v 1.27 2023/11/08 20:07:14 martijn Exp $ */
/*
* Copyright (c) 2012 GeNUA mbH
@@ -39,6 +39,7 @@
#include <openssl/evp.h>
#include <openssl/hmac.h>
+#include "application.h"
#include "snmpd.h"
#include "mib.h"
@@ -569,16 +570,7 @@ usm_finalize_digest(struct snmp_message *msg, char *buf, ssize_t len)
void
usm_make_report(struct snmp_message *msg)
{
- struct ber_oid usmstat = OID(MIB_usmStats, 0, 0);
-
- msg->sm_pdutype = SNMP_C_REPORT;
- usmstat.bo_id[OIDIDX_usmStats] = msg->sm_usmerr;
- usmstat.bo_n = OIDIDX_usmStats + 2;
- if (msg->sm_varbindresp != NULL)
- ober_free_elements(msg->sm_varbindresp);
- msg->sm_varbindresp = ober_add_sequence(NULL);
- mps_getreq(NULL, msg->sm_varbindresp, &usmstat, msg->sm_version);
- return;
+ appl_report(msg, 0, &OID(MIB_usmStats, msg->sm_usmerr, 0));
}
int