Hello,
I'm having problems with Net-SNMP Perl module. I'm currently running version
5.3.1, with OpenSSL support enabled.
I need to use SNMPv3. Authentication and encryption support works fine with
command line tools like snmpget/snmpset and so on.
But when it comes to the Perl module, I only succeed when I use security
level no higher than noAuthNoPriv - that is, unless I don't use anything
which involves Ku calculating, everything is OK.
So, the following Perl code works:
---8<---
use SNMP;
$SNMP::verbose = 1;
$s = new SNMP::Session (DestHost=>'localhost', Version=>3,
SecName=>'MyUser');
---8<---
But none of the following:
---8<---
use SNMP;
$SNMP::verbose = 1;
$s = new SNMP::Session (DestHost=>'localhost', Version=>3,
SecName=>'MyUser', SecLevel=>'authNoPriv', AuthProto=>'SHA',
AuthPass=>'mypassword');
---8<---
---8<---
use SNMP;
$SNMP::verbose = 1;
$s = new SNMP::Session (DestHost=>'localhost', Version=>3,
SecName=>'MyUser', SecLevel=>'authPriv', AuthProto=>'SHA',
AuthPass=>'mypassword', PrivProto=>'AES', PrivPass=>'myauthpass');
---8<---
The error message I get (after enabling verbose):
error:snmp_new_v3_session:Error generating Ku from authentication password.
unable to create session at
c:/Software/ActiveState/ActivePerl/site/lib/SNMP.pm line 534.
I'm glancing through the code of the Perl module (SNMP.xs) and I found out
this snippet:
---8<---
if (strlen(auth_pass) > 0) {
session.securityAuthKeyLen = USM_AUTH_KU_LEN;
if (generate_Ku(session.securityAuthProto,
session.securityAuthProtoLen,
(u_char *)auth_pass,
strlen(auth_pass),
session.securityAuthKey,
&session.securityAuthKeyLen) !=
SNMPERR_SUCCESS) {
if (verbose)
warn("error:snmp_new_v3_session:Error
generating Ku from authentication password.\n");
goto end;
}
---8<---
What's the problem with generate_Ku which causes the error? I'm not very
sure about the value USM_AUTH_KU_LEN which is assigned on the beggining of
the block - it's 20 now, should it be 20?
Anyway, is anyone experiencing similar problems?
Is there a way to help it?
Thanks in advance.
--
best regards,
ML
________________________________________________
Wiadomość wysłana z HornetWebmail
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders