In message <002501c1efce$2dd63900$0300000a@yoke> on Tue, 30 Apr 2002 00:35:34 +0200, 
"Lidia" <[EMAIL PROTECTED]> said:

lidia.castillejo01> EVP_PKEY *clave_publica=NULL;
lidia.castillejo01> clave_publica = EVP_PKEY_new();
lidia.castillejo01> 
lidia.castillejo01> int  lee_clave_publica(char *fichero_publica)
lidia.castillejo01> {
lidia.castillejo01>     BIO *bp_publica;
lidia.castillejo01>     OpenSSL_add_all_algorithms(); 
lidia.castillejo01>     SSLeay_add_all_algorithms();
lidia.castillejo01> 
lidia.castillejo01>     bp_publica=BIO_new(BIO_s_file());
lidia.castillejo01>    
lidia.castillejo01>     if (BIO_read_filename(bp_publica,fichero_publica) <= 0)
lidia.castillejo01>      {
lidia.castillejo01>             printf("ERROR");
lidia.castillejo01>             BIO_free(bp_publica);
lidia.castillejo01>             return 0;
lidia.castillejo01>      }
lidia.castillejo01>    
lidia.castillejo01>    if 
((clave_publica=PEM_read_bio_PUBKEY(bp_publica,NULL,0,NULL)==NULL)  
lidia.castillejo01>                 /*Always clave_publica==NULL !!!!!!!!!!!!!*/
lidia.castillejo01>    {
lidia.castillejo01>         printf("ERROR"); 

How about adding the following line here:

                            ERR_print_errors_fp(stdout);

lidia.castillejo01>         BIO_free(bp_publica);
lidia.castillejo01>         return 0;
lidia.castillejo01>     }
lidia.castillejo01>     
lidia.castillejo01>    BIO_free(bp_publica);
lidia.castillejo01>    return 1;  
lidia.castillejo01> }

I'm sure that line will give you some information that might help you.

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Redakteur@Stacken  \ S-168 35  BROMMA  \ T: +46-8-26 52 47
                    \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to