On Mon, 2013-02-18 at 04:00 -0500, Jeffrey Walton wrote: > The signature is X509 *d2i_X509_fp(FILE *fp, X509 **x); >
Please re-read my previous response. I'm not having a problem w/ the code involving x509. I included it in my last response to point out that while it works fine, calling d2i_RSAPrivateKey_fp in a similar manner causes a seg fault. > You might be sending junk into OpenSSL for processing. My understanding is that the input to the function comes from the file pointer, the second param is for the output. Considering the same file pointer works fine when NULL is passed for the second param, I'm confident that valid data is being passed in for processing. > Perhaps the > following would be better (let the optimizer decide what constitutes a > dead write); > > X509 x509 = NULL; > X509 *pX509 = d2i_X509_fp(pFile, &x509); > This does not compile. As I mentioned in my original post, if I pass the address of a NULL ptr for the second param, the code works fine. I'm trying to understand how to pass the address of a non-NULL pointer as the second param (or if that's even possible). In short, is this not valid? RSA rsa; RSA *pTmpRsa(&rsa); RSA *pRSA = d2i_RSAPrivateKey_fp(pFile, &pTmpRsa); Nick ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org