summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pkcs12/p12_mutl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_mutl.c')
-rw-r--r--src/lib/libcrypto/pkcs12/p12_mutl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c
index bf88c78270..56a4964a34 100644
--- a/src/lib/libcrypto/pkcs12/p12_mutl.c
+++ b/src/lib/libcrypto/pkcs12/p12_mutl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_mutl.c,v 1.21 2015/09/30 17:30:15 jsing Exp $ */ 1/* $OpenBSD: p12_mutl.c,v 1.22 2016/11/08 20:01:06 miod Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -89,8 +89,10 @@ PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
89 saltlen = p12->mac->salt->length; 89 saltlen = p12->mac->salt->length;
90 if (!p12->mac->iter) 90 if (!p12->mac->iter)
91 iter = 1; 91 iter = 1;
92 else 92 else if ((iter = ASN1_INTEGER_get(p12->mac->iter)) <= 0) {
93 iter = ASN1_INTEGER_get(p12->mac->iter); 93 PKCS12err(PKCS12_F_PKCS12_GEN_MAC, PKCS12_R_DECODE_ERROR);
94 return 0;
95 }
94 if (!(md_type = EVP_get_digestbyobj( 96 if (!(md_type = EVP_get_digestbyobj(
95 p12->mac->dinfo->algor->algorithm))) { 97 p12->mac->dinfo->algor->algorithm))) {
96 PKCS12err(PKCS12_F_PKCS12_GEN_MAC, 98 PKCS12err(PKCS12_F_PKCS12_GEN_MAC,