diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/pkcs7/pk7_doit.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c index 50e4fe39c1..bd873143c1 100644 --- a/src/lib/libcrypto/pkcs7/pk7_doit.c +++ b/src/lib/libcrypto/pkcs7/pk7_doit.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pk7_doit.c,v 1.38 2015/09/30 18:41:06 jsing Exp $ */ | 1 | /* $OpenBSD: pk7_doit.c,v 1.39 2016/11/05 15:19:07 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -811,11 +811,7 @@ PKCS7_dataFinal(PKCS7 *p7, BIO *bio) | |||
811 | 811 | ||
812 | j = OBJ_obj2nid(si->digest_alg->algorithm); | 812 | j = OBJ_obj2nid(si->digest_alg->algorithm); |
813 | 813 | ||
814 | btmp = bio; | 814 | if ((btmp = PKCS7_find_digest(&mdc, bio, j)) == NULL) |
815 | |||
816 | btmp = PKCS7_find_digest(&mdc, btmp, j); | ||
817 | |||
818 | if (btmp == NULL) | ||
819 | goto err; | 815 | goto err; |
820 | 816 | ||
821 | /* We now have the EVP_MD_CTX, lets do the | 817 | /* We now have the EVP_MD_CTX, lets do the |
@@ -997,7 +993,10 @@ PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, BIO *bio, | |||
997 | PKCS7err(PKCS7_F_PKCS7_DATAVERIFY, ERR_R_X509_LIB); | 993 | PKCS7err(PKCS7_F_PKCS7_DATAVERIFY, ERR_R_X509_LIB); |
998 | goto err; | 994 | goto err; |
999 | } | 995 | } |
1000 | X509_STORE_CTX_set_purpose(ctx, X509_PURPOSE_SMIME_SIGN); | 996 | if (X509_STORE_CTX_set_purpose(ctx, X509_PURPOSE_SMIME_SIGN) == 0) { |
997 | X509_STORE_CTX_cleanup(ctx); | ||
998 | goto err; | ||
999 | } | ||
1001 | i = X509_verify_cert(ctx); | 1000 | i = X509_verify_cert(ctx); |
1002 | if (i <= 0) { | 1001 | if (i <= 0) { |
1003 | PKCS7err(PKCS7_F_PKCS7_DATAVERIFY, ERR_R_X509_LIB); | 1002 | PKCS7err(PKCS7_F_PKCS7_DATAVERIFY, ERR_R_X509_LIB); |