diff options
-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()); |