Make S/MIME encrypt work again.

This commit is contained in:
Dr. Stephen Henson 2004-03-25 00:58:59 +00:00
parent d349b2fffe
commit d0344d06a8

View File

@ -256,11 +256,16 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
if (PKCS7_is_detached(p7)) if (PKCS7_is_detached(p7))
bio=BIO_new(BIO_s_null()); bio=BIO_new(BIO_s_null());
else else
{
if (PKCS7_type_is_signed(p7))
{ {
ASN1_OCTET_STRING *os; ASN1_OCTET_STRING *os;
os = PKCS7_get_octet_string(p7->d.sign->contents); os = PKCS7_get_octet_string(
p7->d.sign->contents);
if (os && os->length > 0) if (os && os->length > 0)
bio = BIO_new_mem_buf(os->data, os->length); bio = BIO_new_mem_buf(os->data,
os->length);
}
if(bio == NULL) if(bio == NULL)
{ {
bio=BIO_new(BIO_s_mem()); bio=BIO_new(BIO_s_mem());