Re: [SNMP4J] SNMPv3 -> SNMP4J 3.0.2 (also 3.0.x?)

2018-10-15 Thread Frank Fock
Hi Marian,
Have you added a localized user to the USM? It seems that not the code is wrong 
but the localization of the passphrases is missing.
Best regards 
Frank

> Am 15.10.2018 um 10:16 schrieb Marian Wendt :
> 
> Hi,
> 
> I experience some behaviour that makes me think there is something wrong with 
> USM.java
> Near line 380 the authetication key and privacy key is not retrieved from 
> "UsmUser" and result in NULL.
> I corrected this with the following changes...
> 
>AuthenticationProtocol auth = 
> securityProtocols.getAuthenticationProtocol(user.getUsmUser().getAuthenticationProtocol());
>PrivacyProtocol priv = 
> securityProtocols.getPrivacyProtocol(user.getUsmUser().getPrivacyProtocol());
> 
>usmSecurityParams.setAuthenticationProtocol(auth);
>usmSecurityParams.setPrivacyProtocol(priv);
> 
>
> //usmSecurityParams.setAuthenticationKey(user.getAuthenticationKey());
>
> usmSecurityParams.setAuthenticationKey(user.getUsmUser().getAuthenticationPassphrase().toByteArray());
>//usmSecurityParams.setPrivacyKey(user.getPrivacyKey());
>
> usmSecurityParams.setPrivacyKey(user.getUsmUser().getPrivacyPassphrase().toByteArray());
> 
>usmSecurityParams.setUserName(user.getUsmUser().getSecurityName());
>usmSecurityParams.setAuthoritativeEngineID(secEngineID.getValue());
> 
> After that, the SNMPv3 trap sending is working correct but still has:
> 
> trace: usm_parse_security_parameters(): snmpusm.c, 2052:
> dumph_recv: msgAuthenticationParameters
> trace: usm_process_in_msg(): snmpusm.c, 2385:
> usm: Parsing failed (rc -1).
> trace: snmpv3_parse(): snmp_api.c, 3784:
> dumph_recv: ScopedPDU
> trace: _snmp_parse(): snmp_api.c, 4162:
> snmp_parse: Parsed SNMPv3 message (secName:your-security-name, 
> secLevel:authPriv): USM parse error
> trace: _sess_process_packet(): snmp_api.c, 5249:
> sess_process_packet: received message id#6744 reqid#0 len 210
> trace: _sess_process_packet(): snmp_api.c, 5252:
> sess_process_packet: parse fail
> trace: _sess_read(): snmp_api.c, 5542:
> sess_read: not reading 7 (fdset 0x7ffce2c22a60 set 0)
> trace: _sess_read(): snmp_api.c, 5542:
> sess_read: not reading 5 (fdset 0x7ffce2c22a60 set 0)
> trace: _sess_read(): snmp_api.c, 5542:
> sess_read: not reading 3 (fdset 0x7ffce2c22a60 set 0)
> trace: snmp_sess_select_info2_flags(): snmp_api.c, 6051:
> sess_select: for all sessions: 9 7 5 3
> 
> (log output from snmptrapd on linux)
> So I think there is still something wrong with the library...
> 
> Best regards
> 
> ibes AG - we create more value with IT.
> 
> Management board: Tino M?ller, Jens Schwendel, Frank Lippmann
> Chairman of the supervisory board: Prof. Dr. Reinhardt Nindel
> Trade register: Amtsgericht Chemnitz HRB 28538
> i...@ibes.ag | www.ibes.ag | www.sercam.de
> 
> This e-mail may contain confidential and/or privileged information. If you 
> are not the intended recipient (or have received this e-mail in error) please 
> notify the sender immediately and destroy this e-mail. Any unauthorized 
> copying, disclosure or distribution of the material in this e-mail is 
> strictly forbidden.
> ___
> SNMP4J mailing list
> SNMP4J@agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j

___
SNMP4J mailing list
SNMP4J@agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j


[SNMP4J] SNMPv3 -> SNMP4J 3.0.2 (also 3.0.x?)

2018-10-15 Thread Marian Wendt
Hi,

I experience some behaviour that makes me think there is something wrong with 
USM.java
Near line 380 the authetication key and privacy key is not retrieved from 
"UsmUser" and result in NULL.
I corrected this with the following changes...

AuthenticationProtocol auth = 
securityProtocols.getAuthenticationProtocol(user.getUsmUser().getAuthenticationProtocol());
PrivacyProtocol priv = 
securityProtocols.getPrivacyProtocol(user.getUsmUser().getPrivacyProtocol());

usmSecurityParams.setAuthenticationProtocol(auth);
usmSecurityParams.setPrivacyProtocol(priv);


//usmSecurityParams.setAuthenticationKey(user.getAuthenticationKey());

usmSecurityParams.setAuthenticationKey(user.getUsmUser().getAuthenticationPassphrase().toByteArray());
//usmSecurityParams.setPrivacyKey(user.getPrivacyKey());

usmSecurityParams.setPrivacyKey(user.getUsmUser().getPrivacyPassphrase().toByteArray());

usmSecurityParams.setUserName(user.getUsmUser().getSecurityName());
usmSecurityParams.setAuthoritativeEngineID(secEngineID.getValue());

After that, the SNMPv3 trap sending is working correct but still has:

trace: usm_parse_security_parameters(): snmpusm.c, 2052:
dumph_recv: msgAuthenticationParameters
trace: usm_process_in_msg(): snmpusm.c, 2385:
usm: Parsing failed (rc -1).
trace: snmpv3_parse(): snmp_api.c, 3784:
dumph_recv: ScopedPDU
trace: _snmp_parse(): snmp_api.c, 4162:
snmp_parse: Parsed SNMPv3 message (secName:your-security-name, 
secLevel:authPriv): USM parse error
trace: _sess_process_packet(): snmp_api.c, 5249:
sess_process_packet: received message id#6744 reqid#0 len 210
trace: _sess_process_packet(): snmp_api.c, 5252:
sess_process_packet: parse fail
trace: _sess_read(): snmp_api.c, 5542:
sess_read: not reading 7 (fdset 0x7ffce2c22a60 set 0)
trace: _sess_read(): snmp_api.c, 5542:
sess_read: not reading 5 (fdset 0x7ffce2c22a60 set 0)
trace: _sess_read(): snmp_api.c, 5542:
sess_read: not reading 3 (fdset 0x7ffce2c22a60 set 0)
trace: snmp_sess_select_info2_flags(): snmp_api.c, 6051:
sess_select: for all sessions: 9 7 5 3

(log output from snmptrapd on linux)
So I think there is still something wrong with the library...

Best regards

ibes AG - we create more value with IT.

Management board: Tino M?ller, Jens Schwendel, Frank Lippmann
Chairman of the supervisory board: Prof. Dr. Reinhardt Nindel
Trade register: Amtsgericht Chemnitz HRB 28538
i...@ibes.ag | www.ibes.ag | www.sercam.de

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
SNMP4J mailing list
SNMP4J@agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j