]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
DH_check[_params]() use libctx of the dh for prime checks
authorTomas Mraz <tomas@openssl.org>
Fri, 11 Nov 2022 11:29:44 +0000 (12:29 +0100)
committerHugo Landau <hlandau@openssl.org>
Fri, 18 Nov 2022 06:57:17 +0000 (06:57 +0000)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19656)

crypto/dh/dh_check.c

index e7f567bd3d76b47949876c8f065d7ac30245927f..0b8a17c67582300d58eea2f326e8d72c660fe0c8 100644 (file)
@@ -73,7 +73,7 @@ int DH_check_params(const DH *dh, int *ret)
     BN_CTX *ctx = NULL;
 
     *ret = 0;
-    ctx = BN_CTX_new();
+    ctx = BN_CTX_new_ex(dh->libctx);
     if (ctx == NULL)
         goto err;
     BN_CTX_start(ctx);
@@ -155,7 +155,7 @@ int DH_check(const DH *dh, int *ret)
     if (!DH_check_params(dh, ret))
         return 0;
 
-    ctx = BN_CTX_new();
+    ctx = BN_CTX_new_ex(dh->libctx);
     if (ctx == NULL)
         goto err;
     BN_CTX_start(ctx);