]> git.basschouten.com Git - openhab-addons.git/commitdiff
[snmp] Upgrade SNMP4J and fix AUTH_NO_PRIV (#16801)
authorJ-N-K <github@klug.nrw>
Sat, 25 May 2024 08:10:54 +0000 (10:10 +0200)
committerGitHub <noreply@github.com>
Sat, 25 May 2024 08:10:54 +0000 (10:10 +0200)
Signed-off-by: Jan N. Klug <github@klug.nrw>
bundles/org.openhab.binding.snmp/pom.xml
bundles/org.openhab.binding.snmp/src/main/java/org/openhab/binding/snmp/internal/SnmpServiceImpl.java

index 3ea0bd53aaf62dacbc5f41360fd8e20220e8a45d..a53a670b5dbdae898c2f59871f35ff9a92aaa6ce 100644 (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>
index d10d569bb8cec7347916fb7d679632b313399147..86e223feb38f9f314e8692b7b2b130712b6d3b47 100644 (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);