Did you do an   SSL_load_error_strings( ); anywhere in your code? If not
give that a try.

Bill Browning

-----Original Message-----
From: Jason Wang [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 16, 2001 10:11 AM
To: [EMAIL PROTECTED]
Subject: how to understand the error code?


Please help...

I was trying to read RSA private key that was written with encryption.
error occured.  I got the error printed out, but have no idea how to
read it.  I checked the err manual page and err.h.

a clean up version of the code segment is as follows:

 FILE * fp;
 fp = fopen("output/rsa.private.key","w");
 char * password = "password";
 PEM_write_RSAPrivateKey(fp,rsa,EVP_des_ede3_cbc(),NULL,0,NULL,password)
;
.......

  fp = fopen("output/rsa.private.key","r");

.......
 pRsa = PEM_read_RSAPrivateKey(fp,NULL,NULL,password);
 if(pRsa == NULL)
 {
  printf("\n---- Read is failed ---\n");
  char * buf = new char[256];
  ERR_error_string(ERR_get_error(),buf);
  printf("\n err is : %s\n", buf);
  delete buf; buf = 0;
  return 0;
 }
...

the error is as follows:
10302:error:0906B072:lib(9):func(107):reason(114):pem_lib.c:506:

Thanks,

Jason

PS, I compiled the library with -ggdb option, if that makes any
difference.

______________________________________________________________________
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