>From: owner-openssl-us...@openssl.org On Behalf Of Mohammad Khodaei
>Sent: Monday, 17 September, 2012 05:01

>I've got a problem regarding BIO* to PKCS7* conversion. I want to 
>call PKCS7_decrypt() function to decrypt a cipher text. Before that, 
>I have this section of code:

>in = BIO_new_mem_buf(chEnc, iLength);
>if (!in) { <snip>
>p7 = d2i_PKCS7_bio(in, NULL);
>if (!p7) { <snip>
>140172957116064:error:0D0680A8:asn1 encoding routines:
ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1319: 
>140172957116064:error:0D07803A:asn1 encoding routines:
ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=PKCS7

>Any idea how to fix it? Is it the problem due to encoding? 
>or is it a conversion problem?

Yes, it is encoding. The data you supplied isn't correct DER -- 
perhaps not DER at all, that's an easy way to get this wrong.
Check your data is DER and is exactly, octet for octet, that 
produced by a correct sender (encoder).


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to