On Mon, Sep 22, 2003, Markus Lorch wrote: > Hi, > > I was under the impression that the following two code fragments are > equivalent. But the first can successfully decode a BER encoded > certificate (in "value"), while the second fails - data too long. When should > ASN1_item_d2i_bio be used? > > > cert = d2i_X509(NULL,(unsigned char **) &value, valueLen); > > > in = BIO_new_mem_buf(value, valueLen); > cert = (X509 *) ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509), in, NULL); > > > Am I missing something? >
Erm did you call them exactly like that and in that order so that value gets modified and now points past the real data? Steve. -- Dr Stephen N. Henson. Core developer of the OpenSSL project: http://www.openssl.org/ Freelance consultant see: http://www.drh-consultancy.demon.co.uk/ Email: [EMAIL PROTECTED], PGP key: via homepage. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]