summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2004-03-25 00:58:59 +0000
committerDr. Stephen Henson <steve@openssl.org>2004-03-25 00:58:59 +0000
commitd0344d06a8e4213f361823a50d51da3d01490ef7 (patch)
tree2e0668c34dfc1fd315083d10e92e2cc92e74ac1e
parentd349b2fffe1f22ecb55b71a4f8e3fabb132a0d79 (diff)
Make S/MIME encrypt work again.
-rw-r--r--crypto/pkcs7/pk7_doit.c13
1 files changed, 9 insertions, 4 deletions
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());