RE: pkcs7 cert loading, why this code doesn't work?

2010-04-05 Thread sean wang
thanks Mounir! yes the 'write' thing was a typo. the second issue was the problem. sean your are right the pass in type should be a Date: Sun, 4 Apr 2010 02:22:29 +0200 From: mounir.idra...@idrix.net To: openssl-users@openssl.org Subject: Re: pkcs7 cert loading, why

Re: pkcs7 cert loading, why this code doesn't work?

2010-04-03 Thread Mounir IDRASSI
Hi, There are two bugs in your code: First, you only need calls to BIO_read not BIO_write, and in order to avoid the crash you have to pass a pointer equal to inbuf instead of inbuf directly because d2i_PKCS7 increment the pointer internally. So, a more correct version of the code will be :

pkcs7 cert loading, why this code doesn't work?

2010-04-02 Thread sean wang
Hello, I have a pkcs7 encoded cert which i want to load. the following code block works fine: ( I am doing a base64 decoding first, will explain the reason in the second half): BIO *bio, *b64; PKCS7 * p7; b64 = BIO_new(BIO_f_base64()); BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);