summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-12-28 21:49:07 +0000
committertb <>2023-12-28 21:49:07 +0000
commit568addccf1a236c9956def9ef0ec0cbaa474980e (patch)
treea5dc0d60ce37bdd1e9f5ae760622b3579be3bc09 /src/lib
parent16776370acb9e2b9734a640096c08eade32f50cb (diff)
downloadopenbsd-568addccf1a236c9956def9ef0ec0cbaa474980e.tar.gz
openbsd-568addccf1a236c9956def9ef0ec0cbaa474980e.tar.bz2
openbsd-568addccf1a236c9956def9ef0ec0cbaa474980e.zip
Fix another EVP_PKEY_assign_GOST() call
Again this can't actually fail, but if it did, things would leak. Call GOST_KEY_free() in the error path. ok jsing CID 471706 (false positive)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/gost/gostr341001_ameth.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/gost/gostr341001_ameth.c b/src/lib/libcrypto/gost/gostr341001_ameth.c
index 9ef7cdf461..9098797ade 100644
--- a/src/lib/libcrypto/gost/gostr341001_ameth.c
+++ b/src/lib/libcrypto/gost/gostr341001_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gostr341001_ameth.c,v 1.20 2022/11/26 16:08:53 tb Exp $ */ 1/* $OpenBSD: gostr341001_ameth.c,v 1.21 2023/12/28 21:49:07 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 3 * Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
4 * Copyright (c) 2005-2006 Cryptocom LTD 4 * Copyright (c) 2005-2006 Cryptocom LTD
@@ -101,8 +101,10 @@ decode_gost01_algor_params(EVP_PKEY *pkey, const unsigned char **p, int len)
101 GOSTerror(ERR_R_MALLOC_FAILURE); 101 GOSTerror(ERR_R_MALLOC_FAILURE);
102 return 0; 102 return 0;
103 } 103 }
104 if (EVP_PKEY_assign_GOST(pkey, ec) == 0) 104 if (EVP_PKEY_assign_GOST(pkey, ec) == 0) {
105 GOST_KEY_free(ec);
105 return 0; 106 return 0;
107 }
106 } 108 }
107 109
108 group = EC_GROUP_new_by_curve_name(param_nid); 110 group = EC_GROUP_new_by_curve_name(param_nid);