On Sat, Feb 14, 2009, openssl-us...@coreland.ath.cx wrote:

> I have the following program that runs without error but for
> some reason appears to write a truncated or invalid signed message:
> 

[snip]

>   {
>     char *data;
>     int size = BIO_get_mem_data (mem_buf, &data);
>     printf ("%s", data);
>     size = 0; /* unused var warning */
>   }
>   return 0;
> }

The PKCS#7 DER data is not a C string it can contain embedded zeros so
printf() wont work. You should use fwrite() instead.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
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                           majord...@openssl.org

Reply via email to