summaryrefslogtreecommitdiff
path: root/main/openssl/crypto/pkcs7/pk7_doit.c
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-06-15 22:21:10 +0200
committerArne Schwabe <arne@rfc2549.org>2014-06-15 22:21:10 +0200
commitc35453897494d2b488961f7a446b4df8e24c6f31 (patch)
treea454987f969b676b446a518ed51e70e9bc9e00ca /main/openssl/crypto/pkcs7/pk7_doit.c
parent5d397e6220daa87129883a93353286cd6ffd18e8 (diff)
Update OpenSSL to 1.0.1h
Diffstat (limited to 'main/openssl/crypto/pkcs7/pk7_doit.c')
-rw-r--r--main/openssl/crypto/pkcs7/pk7_doit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/openssl/crypto/pkcs7/pk7_doit.c b/main/openssl/crypto/pkcs7/pk7_doit.c
index 77fda3b8..d91aa116 100644
--- a/main/openssl/crypto/pkcs7/pk7_doit.c
+++ b/main/openssl/crypto/pkcs7/pk7_doit.c
@@ -440,6 +440,11 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
{
case NID_pkcs7_signed:
data_body=PKCS7_get_octet_string(p7->d.sign->contents);
+ if (!PKCS7_is_detached(p7) && data_body == NULL)
+ {
+ PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_INVALID_SIGNED_DATA_TYPE);
+ goto err;
+ }
md_sk=p7->d.sign->md_algs;
break;
case NID_pkcs7_signedAndEnveloped:
@@ -928,6 +933,7 @@ int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si)
if (EVP_DigestSignUpdate(&mctx,abuf,alen) <= 0)
goto err;
OPENSSL_free(abuf);
+ abuf = NULL;
if (EVP_DigestSignFinal(&mctx, NULL, &siglen) <= 0)
goto err;
abuf = OPENSSL_malloc(siglen);