On Fri, Apr 07, 2006, Tatsuya Tsurukawa wrote:

> Dear Steve,
> 
> I've tried it with the following code, but I couldn't get the correct data
> yet. Could you please point out the wrong point of the following code.
> 
> // variables
> int iResult = 0;
> unsigned char cert[2000];
> BIO *bioPtr;
> X509 *certPtr;
> unsigned char *tbs;
>   :
> // make X509 structure
> bioPtr = BIO_new_mem_buf(cert, -1);
> certPtr = PEM_read_bio_X509(bioPtr, NULL, NULL, NULL);
> 
> // get binary data size of tbs
> iResult = i2d_X509_CINF(certPtr->cert_info, NULL);
> 
> // prepare buffer for tbs
> tbs = (unsigned char *)malloc(iResult);
> 
> // get der binary data of tbs
> iResult = i2d_X509_CINF(certPtr->cert_info, &tbs);
> 
> tbs is filled with data, but it is different from correct data.
> 

Read the FAQ.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to