diff options
author | slontis <shane.lontis@oracle.com> | 2021-09-02 16:49:37 +1000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-09-03 12:35:04 +0200 |
commit | f161e0ace02526b6b78dfb2f7120ee0e100f3acd (patch) | |
tree | 7141d130447561589e56272a559fe4375339aab2 /providers/implementations | |
parent | 9d924c4fd4d901d5e698f221afc4c9fc6761940f (diff) |
Fix dh dupctx refcount error
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16495)
(cherry picked from commit 21a0d9f3edda78d27d12cd7704de9e32976393ba)
Diffstat (limited to 'providers/implementations')
-rw-r--r-- | providers/implementations/exchange/dh_exch.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/providers/implementations/exchange/dh_exch.c b/providers/implementations/exchange/dh_exch.c index 1dffc8d112..ea05b3177e 100644 --- a/providers/implementations/exchange/dh_exch.c +++ b/providers/implementations/exchange/dh_exch.c @@ -238,7 +238,6 @@ static int dh_derive(void *vpdhctx, unsigned char *secret, return 0; } - static void dh_freectx(void *vpdhctx) { PROV_DH_CTX *pdhctx = (PROV_DH_CTX *)vpdhctx; @@ -271,12 +270,12 @@ static void *dh_dupctx(void *vpdhctx) dstctx->kdf_ukm = NULL; dstctx->kdf_cekalg = NULL; - if (dstctx->dh != NULL && !DH_up_ref(srcctx->dh)) + if (srcctx->dh != NULL && !DH_up_ref(srcctx->dh)) goto err; else dstctx->dh = srcctx->dh; - if (dstctx->dhpeer != NULL && !DH_up_ref(srcctx->dhpeer)) + if (srcctx->dhpeer != NULL && !DH_up_ref(srcctx->dhpeer)) goto err; else dstctx->dhpeer = srcctx->dhpeer; |