summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pkcs12/p12_crpt.c
diff options
context:
space:
mode:
authorbeck <>2017-01-29 17:49:23 +0000
committerbeck <>2017-01-29 17:49:23 +0000
commit957b11334a7afb14537322f0e4795b2e368b3f59 (patch)
tree1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/pkcs12/p12_crpt.c
parentdf96e020e729c6c37a8c7fe311fdd1fe6a8718c5 (diff)
downloadopenbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.gz
openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.bz2
openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.zip
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
Diffstat (limited to 'src/lib/libcrypto/pkcs12/p12_crpt.c')
-rw-r--r--src/lib/libcrypto/pkcs12/p12_crpt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_crpt.c b/src/lib/libcrypto/pkcs12/p12_crpt.c
index f2d635fc62..d1f7d71fd3 100644
--- a/src/lib/libcrypto/pkcs12/p12_crpt.c
+++ b/src/lib/libcrypto/pkcs12/p12_crpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_crpt.c,v 1.13 2016/11/08 20:01:06 miod Exp $ */ 1/* $OpenBSD: p12_crpt.c,v 1.14 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 */
@@ -82,20 +82,20 @@ PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
82 /* Extract useful info from parameter */ 82 /* Extract useful info from parameter */
83 if (param == NULL || param->type != V_ASN1_SEQUENCE || 83 if (param == NULL || param->type != V_ASN1_SEQUENCE ||
84 param->value.sequence == NULL) { 84 param->value.sequence == NULL) {
85 PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_DECODE_ERROR); 85 PKCS12error(PKCS12_R_DECODE_ERROR);
86 return 0; 86 return 0;
87 } 87 }
88 88
89 pbuf = param->value.sequence->data; 89 pbuf = param->value.sequence->data;
90 if (!(pbe = d2i_PBEPARAM(NULL, &pbuf, param->value.sequence->length))) { 90 if (!(pbe = d2i_PBEPARAM(NULL, &pbuf, param->value.sequence->length))) {
91 PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_DECODE_ERROR); 91 PKCS12error(PKCS12_R_DECODE_ERROR);
92 return 0; 92 return 0;
93 } 93 }
94 94
95 if (!pbe->iter) 95 if (!pbe->iter)
96 iter = 1; 96 iter = 1;
97 else if ((iter = ASN1_INTEGER_get(pbe->iter)) <= 0) { 97 else if ((iter = ASN1_INTEGER_get(pbe->iter)) <= 0) {
98 PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_DECODE_ERROR); 98 PKCS12error(PKCS12_R_DECODE_ERROR);
99 PBEPARAM_free(pbe); 99 PBEPARAM_free(pbe);
100 return 0; 100 return 0;
101 } 101 }
@@ -103,13 +103,13 @@ PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
103 saltlen = pbe->salt->length; 103 saltlen = pbe->salt->length;
104 if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_KEY_ID, 104 if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_KEY_ID,
105 iter, EVP_CIPHER_key_length(cipher), key, md)) { 105 iter, EVP_CIPHER_key_length(cipher), key, md)) {
106 PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_KEY_GEN_ERROR); 106 PKCS12error(PKCS12_R_KEY_GEN_ERROR);
107 PBEPARAM_free(pbe); 107 PBEPARAM_free(pbe);
108 return 0; 108 return 0;
109 } 109 }
110 if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_IV_ID, 110 if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_IV_ID,
111 iter, EVP_CIPHER_iv_length(cipher), iv, md)) { 111 iter, EVP_CIPHER_iv_length(cipher), iv, md)) {
112 PKCS12err(PKCS12_F_PKCS12_PBE_KEYIVGEN, PKCS12_R_IV_GEN_ERROR); 112 PKCS12error(PKCS12_R_IV_GEN_ERROR);
113 PBEPARAM_free(pbe); 113 PBEPARAM_free(pbe);
114 return 0; 114 return 0;
115 } 115 }