[snmp] Upgrade SNMP4J and fix AUTH_NO_PRIV (#16801)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2024-05-25 10:10:54 +02:00 committed by GitHub
parent f8cbca62b7
commit a177e699b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -16,9 +16,9 @@
<dependencies>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.snmp4j</artifactId>
<version>2.6.3_1</version>
<groupId>org.snmp4j</groupId>
<artifactId>snmp4j</artifactId>
<version>2.8.6</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -166,8 +166,10 @@ public class SnmpServiceImpl implements SnmpService {
@Override
public void addUser(String userName, SnmpAuthProtocol snmpAuthProtocol, @Nullable String authPassphrase,
SnmpPrivProtocol snmpPrivProtocol, @Nullable String privPassphrase, byte[] engineId) {
UsmUser usmUser = new UsmUser(new OctetString(userName), snmpAuthProtocol.getOid(),
authPassphrase != null ? new OctetString(authPassphrase) : null, snmpPrivProtocol.getOid(),
UsmUser usmUser = new UsmUser(new OctetString(userName),
authPassphrase != null ? snmpAuthProtocol.getOid() : null,
authPassphrase != null ? new OctetString(authPassphrase) : null,
privPassphrase != null ? snmpPrivProtocol.getOid() : null,
privPassphrase != null ? new OctetString(privPassphrase) : null);
OctetString securityNameOctets = new OctetString(userName);