Lutz 

thanks . Your guess is right. I tried with error option and I got this
printed.

"RSA key error: PRNG not seeded"

This is my simple code. could not find out documentation on how to seed
PRNG. 
Here is my test program.
==================
int genarateKeys()
{
        RSA *rsa, *pub_rsa,*priv_rsa;
        unsigned char md[MD5_DIGEST_LENGTH];
        unsigned char buffer[1024], *rsaret;
        ERR_load_crypto_strings();      

        CRYPTO_malloc_init();

        rsa = RSA_generate_key(512, RSA_F4, callback, NULL);
        
        ....
        ...

}


==================


I could see that , rsa is returning null. 

Can you please tell me where and how I can see PRNG.

Thanks
Praveen



List:     openssl-dev
Subject:  Re: Prime number returns NULL ( BN_generate_prime)
From:     Lutz Jaenicke <[EMAIL PROTECTED]>
Date:     2002-06-01 11:53:37
[Download message RAW]

On Fri, May 31, 2002 at 06:59:05PM -0700, Praveen Dulam wrote:
> Hi
> 
> I am testng my application on Vxworks.
> I am calling  rsa = RSA_generate_key(512, RSA_F4, NULL, NULL);
> this is barfing. 
> 
> When I debugged I could see the 
> rsa->p=BN_generate_prime(NULL,bitsp,0,NULL,NULL,callback,cb_arg);
> is resturning NULL.
> 
> Can some one let me know if I miss some thing ...

OpenSSL records errors it finds in its error queue. Please use the
ERR_get_error() family of functions to get an indication about
what was wrong.

Best regards,
        Lutz
PS. If I should give a guess, without digging deeper into it, all
key-generation routines require random numbers. Did you seed the
PRNG?
-- 
Lutz Jaenicke                             [EMAIL PROTECTED]
http://www.aet.TU-Cottbus.DE/personen/jaenicke/
BTU Cottbus, Allgemeine Elektrotechnik
Universitaetsplatz 3-4, D-03044 Cottbus
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to