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 =3D 1;
$s =3D new SNMP::Session (DestHost=3D>'localhost', Version=3D>3,
SecName=3D>'MyUser');
---8<---

But none of the following:
---8<---
use SNMP;
$SNMP::verbose =3D 1;
$s =3D new SNMP::Session (DestHost=3D>'localhost', Version=3D>3,
SecName=3D>'MyUser', SecLevel=3D>'authNoPriv', AuthProto=3D>'SHA',
AuthPass=3D>'mypassword');
---8<---
---8<---
use SNMP;
$SNMP::verbose =3D 1;
$s =3D new SNMP::Session (DestHost=3D>'localhost', Version=3D>3,
SecName=3D>'MyUser', SecLevel=3D>'authPriv', AuthProto=3D>'SHA',
AuthPass=3D>'mypassword', PrivProto=3D>'AES', PrivPass=3D>'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 =3D USM_AUTH_KU_LEN;
if (generate_Ku(session.securityAuthProto,
session.securityAuthProtoLen,
(u_char *)auth_pass,
strlen(auth_pass),
session.securityAuthKey,
&session.securityAuthKeyLen) !=3D
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=B6=E6 wys=B3ana 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?p...orge&CID=3DDE=
VDEV
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders