summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/p5_pbev2.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/asn1/p5_pbev2.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/asn1/p5_pbev2.c')
-rw-r--r--src/lib/libcrypto/asn1/p5_pbev2.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/libcrypto/asn1/p5_pbev2.c b/src/lib/libcrypto/asn1/p5_pbev2.c
index 155e2b0b3e..0105c59549 100644
--- a/src/lib/libcrypto/asn1/p5_pbev2.c
+++ b/src/lib/libcrypto/asn1/p5_pbev2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_pbev2.c,v 1.24 2016/12/30 16:04:34 jsing Exp $ */ 1/* $OpenBSD: p5_pbev2.c,v 1.25 2017/01/29 17:49:22 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-2004. 3 * project 1999-2004.
4 */ 4 */
@@ -193,8 +193,7 @@ PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, unsigned char *salt,
193 193
194 alg_nid = EVP_CIPHER_type(cipher); 194 alg_nid = EVP_CIPHER_type(cipher);
195 if (alg_nid == NID_undef) { 195 if (alg_nid == NID_undef) {
196 ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, 196 ASN1error(ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
197 ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
198 goto err; 197 goto err;
199 } 198 }
200 obj = OBJ_nid2obj(alg_nid); 199 obj = OBJ_nid2obj(alg_nid);
@@ -223,8 +222,7 @@ PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, unsigned char *salt,
223 if (!EVP_CipherInit_ex(&ctx, cipher, NULL, NULL, iv, 0)) 222 if (!EVP_CipherInit_ex(&ctx, cipher, NULL, NULL, iv, 0))
224 goto err; 223 goto err;
225 if (EVP_CIPHER_param_to_asn1(&ctx, scheme->parameter) < 0) { 224 if (EVP_CIPHER_param_to_asn1(&ctx, scheme->parameter) < 0) {
226 ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, 225 ASN1error(ASN1_R_ERROR_SETTING_CIPHER_PARAMS);
227 ASN1_R_ERROR_SETTING_CIPHER_PARAMS);
228 EVP_CIPHER_CTX_cleanup(&ctx); 226 EVP_CIPHER_CTX_cleanup(&ctx);
229 goto err; 227 goto err;
230 } 228 }
@@ -275,7 +273,7 @@ PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, unsigned char *salt,
275 return ret; 273 return ret;
276 274
277merr: 275merr:
278 ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, ERR_R_MALLOC_FAILURE); 276 ASN1error(ERR_R_MALLOC_FAILURE);
279 277
280err: 278err:
281 PBE2PARAM_free(pbe2); 279 PBE2PARAM_free(pbe2);
@@ -367,7 +365,7 @@ PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, int prf_nid,
367 return keyfunc; 365 return keyfunc;
368 366
369merr: 367merr:
370 ASN1err(ASN1_F_PKCS5_PBKDF2_SET, ERR_R_MALLOC_FAILURE); 368 ASN1error(ERR_R_MALLOC_FAILURE);
371 PBKDF2PARAM_free(kdf); 369 PBKDF2PARAM_free(kdf);
372 X509_ALGOR_free(keyfunc); 370 X509_ALGOR_free(keyfunc);
373 return NULL; 371 return NULL;