Using OpenSSL 0.9.7c

I'm trying to parse an S/MIME encoded (signed) PKCS#7, but I simply can't get it to 
work with SMIME_read_PKCS7().
I have the data in a memory BIO and I always get the error:
error:0D06B08E:asn1 encoding routines:ASN1_d2i_bio:not enough data

However, if I flush the data to a file and create a file BIO like:
BIO* mybio = BIO_new_file("C:\\myfile.p7m", "rb");
...and use that BIO instead, everything works fine.

I suspect some problems with the <CR>/<LF> characters for the following reasons:
If I look at the data that I feed to the memory BIO, it only contains <LF> characters 
to separate the Base64 lines. This BIO, as mentioned earlier, can not be parsed by 
SMIME_read_PKCS7().
But if I write the data to a file, Windows automatically replaces <LF> with <CR><LF>. 
This (BIO) file is parsed by SMIME_read_PKCS7() without problems.

Could this be the problem?
ANY help appreciated!

Best regards

Kim Hellan





___________________________________________________________________
www.kmd.dk   www.kundenet.kmd.dk   www.eboks.dk   www.civitas.dk   www.netborger.dk

Hvis du har modtaget denne mail ved en fejl vil jeg gerne, at du informerer mig og 
sletter den.
KMD skaber it-services, der fremmer effektivitet hos det offentlige, erhvervslivet og 
borgerne.

If you received this e-mail by mistake, please notify me and delete it. Thank you.
Our mission is to enhance the efficiency of the public sector and improve its service 
of the general public. 

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to