PMHager wrote:
First you fill the rsa structure with the private key,
  PEM_read_bio_RSAPrivateKey(in,&rsa,NULL,NULL);

then you overwrite it with the public key.
PEM_read_bio_RSA_PUBKEY(in, &rsa, NULL, NULL);

Thanks for hint.. I thought you had to load both public and private keys. I stopped the loading of the public key. Now its working thanks.


RSA_private_decrypt() which points to RSA_eay_private_decrypt() requires the private exponent rsa->d which is NULL now.

Peter

-----Original Message-----
From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] 
On Behalf
Of Neil Dugan
Sent: Sunday, August 02, 2009 8:01 AM
To: openssl-users@openssl.org
Subject: newbie program crashing.

Hi,

I have been trying to figure out why this is crashing with a 'Segmentation fault', as far as I can see all the buffers etc. are getting setup and passed around correctly.

If I comment out line 51 with the call to RSA_private_decrypt() I don't get the 'Segmentation fault'.

Help Please.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to