summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-04-25 16:09:40 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-04-25 16:09:40 +0000
commit9c7c3ed77e016ad9de406d897d85c16505424d9d (patch)
tree7d9eead6d5343556efd401c40528eedc4a2d9b78 /lib/libssl
parent3dd82480be3e4d5e7670686a9a71c1f2d4e3c470 (diff)
from openssl, 1.50.2.9, make S/MIME encrypt work again.
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/src/crypto/pkcs7/pk7_doit.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/libssl/src/crypto/pkcs7/pk7_doit.c b/lib/libssl/src/crypto/pkcs7/pk7_doit.c
index 35c7dcd0b3e..b78e22819cd 100644
--- a/lib/libssl/src/crypto/pkcs7/pk7_doit.c
+++ b/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());