diff options
author | jsg <> | 2015-05-15 11:00:14 +0000 |
---|---|---|
committer | jsg <> | 2015-05-15 11:00:14 +0000 |
commit | 5e21cdbca851c965cd196f1d77d376bda7ff1e4f (patch) | |
tree | f00dd64612742b35f7b46f91be93e5056960a0c1 /src/lib/libcrypto/pem | |
parent | dfd58b2d262bb801a9048813d922b51c08607ba1 (diff) | |
download | openbsd-5e21cdbca851c965cd196f1d77d376bda7ff1e4f.tar.gz openbsd-5e21cdbca851c965cd196f1d77d376bda7ff1e4f.tar.bz2 openbsd-5e21cdbca851c965cd196f1d77d376bda7ff1e4f.zip |
Fix return paths with missing EVP_CIPHER_CTX_cleanup() calls.
ok doug@
Diffstat (limited to 'src/lib/libcrypto/pem')
-rw-r--r-- | src/lib/libcrypto/pem/pvkfmt.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/libcrypto/pem/pvkfmt.c b/src/lib/libcrypto/pem/pvkfmt.c index 2009c9db80..025381bcc0 100644 --- a/src/lib/libcrypto/pem/pvkfmt.c +++ b/src/lib/libcrypto/pem/pvkfmt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pvkfmt.c,v 1.12 2014/10/22 13:02:04 jsing Exp $ */ | 1 | /* $OpenBSD: pvkfmt.c,v 1.13 2015/05/15 11:00:14 jsg 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 2005. | 3 | * project 2005. |
4 | */ | 4 | */ |
@@ -731,17 +731,16 @@ do_PVK_body(const unsigned char **in, unsigned int saltlen, | |||
731 | inlen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u); | 731 | inlen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u); |
732 | if (inlen <= 0) { | 732 | if (inlen <= 0) { |
733 | PEMerr(PEM_F_DO_PVK_BODY, PEM_R_BAD_PASSWORD_READ); | 733 | PEMerr(PEM_F_DO_PVK_BODY, PEM_R_BAD_PASSWORD_READ); |
734 | return NULL; | 734 | goto err; |
735 | } | 735 | } |
736 | enctmp = malloc(keylen + 8); | 736 | enctmp = malloc(keylen + 8); |
737 | if (!enctmp) { | 737 | if (!enctmp) { |
738 | PEMerr(PEM_F_DO_PVK_BODY, ERR_R_MALLOC_FAILURE); | 738 | PEMerr(PEM_F_DO_PVK_BODY, ERR_R_MALLOC_FAILURE); |
739 | return NULL; | 739 | goto err; |
740 | } | 740 | } |
741 | if (!derive_pvk_key(keybuf, p, saltlen, (unsigned char *)psbuf, | 741 | if (!derive_pvk_key(keybuf, p, saltlen, (unsigned char *)psbuf, |
742 | inlen)) { | 742 | inlen)) { |
743 | free(enctmp); | 743 | goto err; |
744 | return NULL; | ||
745 | } | 744 | } |
746 | p += saltlen; | 745 | p += saltlen; |
747 | /* Copy BLOBHEADER across, decrypt rest */ | 746 | /* Copy BLOBHEADER across, decrypt rest */ |
@@ -749,8 +748,7 @@ do_PVK_body(const unsigned char **in, unsigned int saltlen, | |||
749 | p += 8; | 748 | p += 8; |
750 | if (keylen < 8) { | 749 | if (keylen < 8) { |
751 | PEMerr(PEM_F_DO_PVK_BODY, PEM_R_PVK_TOO_SHORT); | 750 | PEMerr(PEM_F_DO_PVK_BODY, PEM_R_PVK_TOO_SHORT); |
752 | free(enctmp); | 751 | goto err; |
753 | return NULL; | ||
754 | } | 752 | } |
755 | inlen = keylen - 8; | 753 | inlen = keylen - 8; |
756 | q = enctmp + 8; | 754 | q = enctmp + 8; |