diff options
author | Kinichiro Inoguchi <inoguchi@cvs.openbsd.org> | 2020-01-12 07:11:14 +0000 |
---|---|---|
committer | Kinichiro Inoguchi <inoguchi@cvs.openbsd.org> | 2020-01-12 07:11:14 +0000 |
commit | 43ef7ede8b9a5eb9c22115bb387ddd52e577abf3 (patch) | |
tree | 1a86547acd58c223640c36c81b9b86fe63b8b967 | |
parent | f74a383c8bf01aae4a7f66e18dd8161466f94af4 (diff) |
Avoid leak in error path of PKCS5_PBE_keyivgen
ok jsing@ tb@
-rw-r--r-- | lib/libcrypto/evp/p5_crpt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libcrypto/evp/p5_crpt.c b/lib/libcrypto/evp/p5_crpt.c index 75a631bf989..98e4549db10 100644 --- a/lib/libcrypto/evp/p5_crpt.c +++ b/lib/libcrypto/evp/p5_crpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p5_crpt.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: p5_crpt.c,v 1.19 2020/01/12 07:11:13 inoguchi Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -108,6 +108,7 @@ PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, iter = 1; else if ((iter = ASN1_INTEGER_get(pbe->iter)) <= 0) { EVPerror(EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS); + PBEPARAM_free(pbe); return 0; } salt = pbe->salt->data; |