diff options
author | markus <> | 2004-04-25 16:09:39 +0000 |
---|---|---|
committer | markus <> | 2004-04-25 16:09:39 +0000 |
commit | e08da0ab0251d3adb572c3ee5b05bf485a44faec (patch) | |
tree | ce82b9e5dd620b03590f9f21f5425f65b2cdef2c | |
parent | 49a9312f22484a507e4ebb22377b56024c60caf1 (diff) | |
download | openbsd-e08da0ab0251d3adb572c3ee5b05bf485a44faec.tar.gz openbsd-e08da0ab0251d3adb572c3ee5b05bf485a44faec.tar.bz2 openbsd-e08da0ab0251d3adb572c3ee5b05bf485a44faec.zip |
from openssl, 1.50.2.9, make S/MIME encrypt work again.
-rw-r--r-- | src/lib/libcrypto/pkcs7/pk7_doit.c | 13 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/pkcs7/pk7_doit.c | 13 |
2 files changed, 18 insertions, 8 deletions
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) | |||
257 | bio=BIO_new(BIO_s_null()); | 257 | bio=BIO_new(BIO_s_null()); |
258 | else | 258 | else |
259 | { | 259 | { |
260 | ASN1_OCTET_STRING *os; | 260 | if (PKCS7_type_is_signed(p7)) |
261 | os = PKCS7_get_octet_string(p7->d.sign->contents); | 261 | { |
262 | if (os && os->length > 0) | 262 | ASN1_OCTET_STRING *os; |
263 | bio = BIO_new_mem_buf(os->data, os->length); | 263 | os = PKCS7_get_octet_string( |
264 | p7->d.sign->contents); | ||
265 | if (os && os->length > 0) | ||
266 | bio = BIO_new_mem_buf(os->data, | ||
267 | os->length); | ||
268 | } | ||
264 | if(bio == NULL) | 269 | if(bio == NULL) |
265 | { | 270 | { |
266 | bio=BIO_new(BIO_s_mem()); | 271 | 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) | |||
257 | bio=BIO_new(BIO_s_null()); | 257 | bio=BIO_new(BIO_s_null()); |
258 | else | 258 | else |
259 | { | 259 | { |
260 | ASN1_OCTET_STRING *os; | 260 | if (PKCS7_type_is_signed(p7)) |
261 | os = PKCS7_get_octet_string(p7->d.sign->contents); | 261 | { |
262 | if (os && os->length > 0) | 262 | ASN1_OCTET_STRING *os; |
263 | bio = BIO_new_mem_buf(os->data, os->length); | 263 | os = PKCS7_get_octet_string( |
264 | p7->d.sign->contents); | ||
265 | if (os && os->length > 0) | ||
266 | bio = BIO_new_mem_buf(os->data, | ||
267 | os->length); | ||
268 | } | ||
264 | if(bio == NULL) | 269 | if(bio == NULL) |
265 | { | 270 | { |
266 | bio=BIO_new(BIO_s_mem()); | 271 | bio=BIO_new(BIO_s_mem()); |