[SNMP4J] AES encryption problem

laurent.gousenbourger at alcatel.be laurent.gousenbourger at alcatel.be
Fri Mar 18 16:13:16 CET 2005


I want to execute a SNMP V3 GET with Authentication and AES encryption.
For AES128, it works fine. For AES192 and AES256, it doesn't work.

The only difference between the 3 cases is in the following line:

snmp.getUSM().addUser(new OctetString("noAuthUser"),
                      new UsmUser(new OctetString("noAuthUser"),
                                  AuthMD5.ID,
                                  new OctetString("centerparc"),
                                  PrivAES192.ID,
                                  new OctetString("itworksfine")));

In case of AES128, the OID PrivAES128.ID is used.
In case of AES192, the OID PrivAES192.ID is used.
In case of AES256, the OID PrivAES256.ID is used.

After some code, the PDU is sent

snmp.send(pdu, target);

where pdu is of the type ScopedPDU
      target is of the type UserTarget

The characteristics of the variable Target are:
- address = "127.0.0.1/161",
- authoritativeEngineID = "",
- maxSizeRequestPDU = 65535,
- retries = 1,
- securityLevel = 3,
- securitymodel = 0,
- securityName = "noAuthUser",
- timeout = 5000,
- version = 3.

The characteristics of the type pdu are:
- contextEngineID = "",
- contextName = "",
- errorIndex = 0,
- errorStatus = 0,
- requestID = 0,
- type = -96,
- variableBinding = "[1.3.6.1.2.1.11.30.0 = Null]"

The call of the function snmp.send generates the following exception:

Encrypt Exception java.lang.SecurityException: Unsupported keysize or algorithm parameters Unsupported keysize or algorithm parameters
PrivAES - Encrypt Exception Unsupported keysize or algorithm parameters
org.snmp4j.MessageException: Message processing model 3 returned error: 1405

Can someone of you help me. I have really no idea what is that problem?

The GET access works fine with DES and AES128. This problem happens only with AES192 and AES256.

Thanks,
Laurent GOUSENBOURGER




More information about the SNMP4J mailing list