evp_extra_test2: Test DH param checks with non-NULL libctx
authorTomas Mraz <tomas@openssl.org>
Fri, 11 Nov 2022 11:29:52 +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)

test/evp_extra_test2.c

index 3daa2e19858e56011133a3ee8519b5b8f09976ee..44ce4aed0115e97b0c1998753d9247724401938e 100644 (file)
@@ -376,6 +376,13 @@ static int test_dh_paramgen(void)
           && TEST_true(EVP_PKEY_paramgen(gctx, &pkey))
           && TEST_ptr(pkey);
 
+    EVP_PKEY_CTX_free(gctx);
+    gctx = NULL;
+
+    ret = ret && TEST_ptr(gctx = EVP_PKEY_CTX_new_from_pkey(mainctx, pkey, NULL))
+              && TEST_int_eq(EVP_PKEY_param_check(gctx), 1)
+              && TEST_int_eq(EVP_PKEY_param_check_quick(gctx), 1);
+
     EVP_PKEY_CTX_free(gctx);
     EVP_PKEY_free(pkey);
     return ret;