From: Dr. Stephen Henson Date: Thu, 25 Mar 2004 00:57:23 +0000 (+0000) Subject: Make S/MIME encrypt work again. X-Git-Tag: OpenSSL_0_9_7e~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0cac0ff75b9425ecf1abe26d35a9befbe150136;p=openssl Make S/MIME encrypt work again. --- diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 35c7dcd0b3..b78e22819c 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -257,10 +257,15 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio) bio=BIO_new(BIO_s_null()); else { - ASN1_OCTET_STRING *os; - os = PKCS7_get_octet_string(p7->d.sign->contents); - if (os && os->length > 0) - bio = BIO_new_mem_buf(os->data, os->length); + if (PKCS7_type_is_signed(p7)) + { + ASN1_OCTET_STRING *os; + os = PKCS7_get_octet_string( + p7->d.sign->contents); + if (os && os->length > 0) + bio = BIO_new_mem_buf(os->data, + os->length); + } if(bio == NULL) { bio=BIO_new(BIO_s_mem());