summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pkcs12/p12_kiss.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_kiss.c')
-rw-r--r--src/lib/libcrypto/pkcs12/p12_kiss.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_kiss.c b/src/lib/libcrypto/pkcs12/p12_kiss.c
index eb2c3a76d5..102ca3563b 100644
--- a/src/lib/libcrypto/pkcs12/p12_kiss.c
+++ b/src/lib/libcrypto/pkcs12/p12_kiss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_kiss.c,v 1.18 2016/12/30 15:08:22 jsing Exp $ */ 1/* $OpenBSD: p12_kiss.c,v 1.19 2017/01/29 17:49:23 beck 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 */
@@ -87,8 +87,7 @@ PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
87 /* Check for NULL PKCS12 structure */ 87 /* Check for NULL PKCS12 structure */
88 88
89 if (!p12) { 89 if (!p12) {
90 PKCS12err(PKCS12_F_PKCS12_PARSE, 90 PKCS12error(PKCS12_R_INVALID_NULL_PKCS12_POINTER);
91 PKCS12_R_INVALID_NULL_PKCS12_POINTER);
92 return 0; 91 return 0;
93 } 92 }
94 93
@@ -111,24 +110,23 @@ PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
111 else if (PKCS12_verify_mac(p12, "", 0)) 110 else if (PKCS12_verify_mac(p12, "", 0))
112 pass = ""; 111 pass = "";
113 else { 112 else {
114 PKCS12err(PKCS12_F_PKCS12_PARSE, 113 PKCS12error(PKCS12_R_MAC_VERIFY_FAILURE);
115 PKCS12_R_MAC_VERIFY_FAILURE);
116 goto err; 114 goto err;
117 } 115 }
118 } else if (!PKCS12_verify_mac(p12, pass, -1)) { 116 } else if (!PKCS12_verify_mac(p12, pass, -1)) {
119 PKCS12err(PKCS12_F_PKCS12_PARSE, PKCS12_R_MAC_VERIFY_FAILURE); 117 PKCS12error(PKCS12_R_MAC_VERIFY_FAILURE);
120 goto err; 118 goto err;
121 } 119 }
122 120
123 /* Allocate stack for other certificates */ 121 /* Allocate stack for other certificates */
124 ocerts = sk_X509_new_null(); 122 ocerts = sk_X509_new_null();
125 if (!ocerts) { 123 if (!ocerts) {
126 PKCS12err(PKCS12_F_PKCS12_PARSE, ERR_R_MALLOC_FAILURE); 124 PKCS12error(ERR_R_MALLOC_FAILURE);
127 return 0; 125 return 0;
128 } 126 }
129 127
130 if (!parse_pk12 (p12, pass, -1, pkey, ocerts)) { 128 if (!parse_pk12 (p12, pass, -1, pkey, ocerts)) {
131 PKCS12err(PKCS12_F_PKCS12_PARSE, PKCS12_R_PARSE_ERROR); 129 PKCS12error(PKCS12_R_PARSE_ERROR);
132 goto err; 130 goto err;
133 } 131 }
134 132