On Tue, Jan 19, 2010, Ujwal Chinthala wrote: > Hi, > > I am new to OpenSSL. > > I am trying to verify the compressed XML data, signed using PKCS#7. Then a > four byte crc is appended to it and the whole data is now base64 encoded. > All the above is done using windows libraries. The verification works fine in > windows. > > Now I am trying to verify the above data(signed using windows libs) using > OpenSSL. > > The data is decoded from base64 to bytes, crc is verified. Then I try to use > the command d2i_pkcs7 to create the PKCS7 structure which results in > the following error , error:0D0680A8:asn1 encoding > routines:ASN1_CHECK_TLEN:wrong tag. > > The code I am using to do this is as follows: > > const unsigned char *q; > q = (const unsigned char*)nBytes; > PKCS7 *p7 = NULL; // I want to use this p7 structure in PKCS7_verify > p7 = d2i_PKCS7(NULL, &q, nCountOfBytes);// error occurs here > > > where nBytes is a BYTE array storing the data. I don't have a clue what this > error means, am I missing something here? >
That isn't actually a PKCS#7 structure. It is a CMS ContentInfo structure which is a superset of PKCS#7. You need to use the CMS routines instead. Steve. -- Dr Stephen N. Henson. OpenSSL project core developer. Commercial tech support now available see: http://www.openssl.org ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org