Hi,
Try calling RAND_screen() first.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Marco Donati
> Sent: Friday, May 19, 2000 7:56 AM
> To: OpenSSL Users (E-mail)
> Subject: RSA_public_encrypt and randomness
>
>
> I have problems using the RSA_public_encrypt function, since it always
> return -1
> (by the way, the return value is the length of the envrypted data, isn't
> it?)
>
> Since I've compiled openssl 0.9.5a in debug mode (as a static library on
> Windows NT), I was able to observe this sequence of calls:
>
> RSA_public_encrypt,
>
> rsa->meth->rsa_pub_enc(flen, from, to, rsa, padding),
>
> RSA_eay_public_encrypt(int flen, unsigned char *from, unsigned
> char *to, RSA
> *rsa, int padding),
>
> RSA_padding_add_PKCS1_type_2(buf,num,from,flen),
>
> RAND_bytes(p,j),
>
> rand_meth->bytes(buf,num).
>
> The latest functions detect an entropy less than needed and sets
> the ''ok''
> to false (actually, NON TRUE), so that at the end of the function, the
> following branch is executed:
>
> ...
> RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED);
> return(0);
> ...
>
> Consequently, all calling functions fail.
>
> Is this a bug or am I (probably) missing something?
>
> Thanks in advance
>
>
>
>
>
>
>
>
>
> --------------------------------------------------------------------------
> Marco Donati
> Context Security -  Software
> P.zza Liberazione, 25 - 20013 Magenta (MI)
> Phone: ++39-02-97291291,         Fax: ++39-02-97298225
> E-Mail: [EMAIL PROTECTED],   Web site:http://www.csg.it
> --------------------------------------------------------------------------
>
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to