Re: Problem with reading a RSA public ey

2004-08-25 Thread El hallabi-Kettani Abderrahmane
--- Sid Hegde <[EMAIL PROTECTED]> a écrit : > Hi, > > Thanks for the tip. Your code did not work, but it > work after being modified. Below is the modified > code > > fp = BIO_new_file("private.pem", "r"); > pkey = PEM_read_bio_PrivateKey(fp, 0, 0, 0); > if (pkey != NULL) > key = EVP_PKEY

EVP_read_pw_string() bug?

2004-08-25 Thread kageyama . hiroyoshi
Hi, I find EVP_read_pw_string() bug in openssl0.9.7, perhaps. line 91 in crypto/evp/evp_key.c 91 int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) 92 { 93 int ret; 94 char buff[BUFSIZ]; 95 UI *ui; 96 97 if ((prompt == NULL) && (prompt_string[0] != '\

Re: Problem with reading a RSA public ey

2004-08-25 Thread Sid Hegde
Hi, Thanks for the tip. Your code did not work, but it work after being modified. Below is the modified code fp = BIO_new_file("private.pem", "r"); pkey = PEM_read_bio_PrivateKey(fp, 0, 0, 0); if (pkey != NULL) key = EVP_PKEY_get1_RSA(pkey); EVP_PKEY_free(pkey); The main problem is that

Re: Problem with reading a RSA public ey

2004-08-25 Thread Sid Hegde
I also managed to get the error string. ERR_error_string returns error:0906D06C:lib(9):func(109):reason(108) ERR_reason_error_string, ERR_lib_error_string, ERR_func_error_string all return NULL Hope this helps - Sid --- Sid Hegde <[EMAIL PROTECTED]> wrote: > Hi, > > I am using WinXP, VC++ .ne

Re: Problem with reading a RSA public ey

2004-08-25 Thread El hallabi-Kettani Abderrahmane
Use this : if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); pkey = load_key(bio_err,argv[1],FORMAT_PEM, 1, NULL, NULL, "Private Key"); if (pkey != NULL) rsa = pkey == NULL ? NULL : EVP_PKEY_get1_RSA(pkey); E

Problem with reading a RSA public ey

2004-08-25 Thread Sid Hegde
Hi, I am using WinXP, VC++ .net 2003, OpenSSL 0.9.7d. I have created a key pair and written both of them to seperate files, but I am having a problem with reading an RSA public key back into the RSA struct. In short, this is the code that I am using to load the private.pem file fp = BIO_new_fil