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

"M.Daulat Rai" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Organization Sita Enterprises, Inc.
Message-ID <008201c66014$cb1e2280$0301a8c0@anjani>
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: [email protected]
[mailto:[email protected]] On Behalf Of M.Daulat
Rai
Sent: Friday, April 14, 2006 10:29 AM
To: [email protected]
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=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.