Hello!
I have found something strange while upgrading my pet project from SNMP4J 2.5.0 to 3.2.1. I have managed to narrow it to a short test case:
//creating snmpv3 user
OctetString userName = new OctetString("SnmpUser1");
UsmUser usmUser = new UsmUser(userName, AuthSHA.ID, new OctetString("auth5678"), PrivAES128.ID, new OctetString("priv5678"));
UsmUserEntry userEntry1 = usm.getUser(new OctetString(), userName);
//we add the user, but the engineId is not known yet
usm.addUser(new OctetString(userName), new OctetString(), usmUser);
UsmUserEntry userEntry2 = usm.getUser(new OctetString(), userName);
//we get the engineid from database and assign it to the address
OctetString engineId = new OctetString("EngineID1");
//this call fails with 3.2.1, but is ok with 2.5.0
UsmUserEntry userEntry3 = usm.getUser(engineId, userName);
//java.lang.NullPointerException
// at org.snmp4j.security.USM.addLocalizedUsmUserEntry(USM.java:282)
// at org.snmp4j.security.USM.getUser(USM.java:263)
Did I miss something in the changelog? Or is this code snipplet wrong in some way?
Kind regards,
Zoltan