RE: encryption generation errors:: update::really stumped

This is a discussion on RE: encryption generation errors:: update::really stumped within the SNMP Users forums, part of the Networking and Network Related category; Hello, I finally figured out why my call to generate_ku for authPriv is failing: It is this code snippet in ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-14-2006
M.Daulat Rai
 
Posts: n/a
Default RE: encryption generation errors:: update::really stumped

Hello,

I finally figured out why my call to generate_ku for authPriv
is failing:

It is this code snippet in keytools.c:

----------
/*
* Setup for the transform type.
*/
#ifdef USE_OPENSSL

#ifndef DISABLE_MD5
if (ISTRANSFORM(hashtype, HMACMD5Auth))
EVP_DigestInit(ctx, EVP_md5());
else
#endif
if (ISTRANSFORM(hashtype, HMACSHA1Auth))
EVP_DigestInit(ctx, EVP_sha1());
else {
free(ctx);
return (SNMPERR_GENERR);
}
#else
MDbegin(&MD);
#endif /* USE_OPENSSL */

----------
It would appear that there is NO support for authPriv via
the programming interface....interestingly enough, it works
(i.e., DES) from the command line interface!

SO what gives? I checked the CVS and I seem to have the current
version of keytools.c.

H-E-L-P!!

Thanks!

--daulat
-----Original Message-----
From: net-snmp-users-admin@lists.sourceforge.net
[mailto:net-snmp-users-admin@lists.sourceforge.net] On Behalf Of M.Daulat
Rai
Sent: Friday, April 14, 2006 10:29 AM
To: Net-snmp-users@lists.sourceforge.net
Subject: encryption generation errors

Hello All,

I can run a "c" program with authNoPriv successfully;
I modified it to use "authPriv" and the generate_ku()
function fails.

Here is the relevant code snippet:
----------------
cnst char *our_v3_passphrase = "The Net-SNMP Demo Password";
/* set the encryption method to DES */
session.securityPrivProto = usmDESPrivProtocol;
session.securityPrivProtoLen = sizeof(usmDESPrivProtocol)/sizeof(oid);
session.securityPrivKeyLen = USM_PRIV_KU_LEN;


/* set the encryption to a DES encrypted version of our
passphrase */
if (generate_Ku(session.securityPrivProto,
session.securityPrivProtoLen,
(u_char *) our_v3_passphrase, strlen(our_v3_passphrase),
session.securityPrivKey,
&session.securityPrivKeyLen) != SNMPERR_SUCCESS)
{
==========
Please note the following command works:
snmpget -v 3 -u MD5DESUser -a MD5 -A "The Net-SNMP Demo Password" -x DES -X
"The Net-SNMP Demo Password" -l authPriv test.net-snmp.org system


Please help!

What I am missing in my call?

Thanks!

--daulat




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=...720&dat=121642
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:54 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0