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); 

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

Peter

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
On Behalf
Of Neil Dugan
Sent: Sunday, August 02, 2009 8:01 AM
To: [email protected]
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                    [email protected]
Automated List Manager                           [email protected]

Reply via email to