From e08da0ab0251d3adb572c3ee5b05bf485a44faec Mon Sep 17 00:00:00 2001 From: markus <> Date: Sun, 25 Apr 2004 16:09:39 +0000 Subject: from openssl, 1.50.2.9, make S/MIME encrypt work again. --- src/lib/libcrypto/pkcs7/pk7_doit.c | 13 +++++++++---- src/lib/libssl/src/crypto/pkcs7/pk7_doit.c | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c index 35c7dcd0b3..b78e22819c 100644 --- a/src/lib/libcrypto/pkcs7/pk7_doit.c +++ b/src/lib/libcrypto/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()); diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c b/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c index 35c7dcd0b3..b78e22819c 100644 --- a/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c +++ b/src/lib/libssl/src/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()); -- cgit v1.2.3-55-g6feb