From a177e699b3ca40af234cbac4d0e54a0b1bbb5e43 Mon Sep 17 00:00:00 2001 From: J-N-K Date: Sat, 25 May 2024 10:10:54 +0200 Subject: [PATCH] [snmp] Upgrade SNMP4J and fix AUTH_NO_PRIV (#16801) Signed-off-by: Jan N. Klug --- bundles/org.openhab.binding.snmp/pom.xml | 6 +++--- .../org/openhab/binding/snmp/internal/SnmpServiceImpl.java | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.snmp/pom.xml b/bundles/org.openhab.binding.snmp/pom.xml index 3ea0bd53aaf..a53a670b5db 100644 --- a/bundles/org.openhab.binding.snmp/pom.xml +++ b/bundles/org.openhab.binding.snmp/pom.xml @@ -16,9 +16,9 @@ - org.apache.servicemix.bundles - org.apache.servicemix.bundles.snmp4j - 2.6.3_1 + org.snmp4j + snmp4j + 2.8.6 compile diff --git a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java index d10d569bb8c..86e223feb38 100644 --- a/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java +++ b/bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java @@ -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);