Skip to content

Commit

Permalink
Add test for EVP_PKEY_Q_keygen
Browse files Browse the repository at this point in the history
Test for #19736

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #19761)

(cherry picked from commit 667a850)
  • Loading branch information
t8m committed Nov 25, 2022
1 parent d0f33da commit 5462d8d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/evp_extra_test2.c
Expand Up @@ -413,6 +413,19 @@ static int test_ecx_tofrom_data_select(void)
}
#endif

#ifndef OPENSSL_NO_SM2
static int test_sm2_tofrom_data_select(void)
{
int ret;
EVP_PKEY *key = NULL;

ret = TEST_ptr(key = EVP_PKEY_Q_keygen(mainctx, NULL, "SM2"))
&& TEST_true(do_pkey_tofrom_data_select(key, "SM2"));
EVP_PKEY_free(key);
return ret;
}
#endif

static int test_rsa_tofrom_data_select(void)
{
int ret;
Expand Down Expand Up @@ -1151,6 +1164,9 @@ int setup_tests(void)
#else
ADD_ALL_TESTS(test_d2i_PrivateKey_ex, 1);
#endif
#ifndef OPENSSL_NO_SM2
ADD_TEST(test_sm2_tofrom_data_select);
#endif
#ifndef OPENSSL_NO_DSA
ADD_TEST(test_dsa_todata);
ADD_TEST(test_dsa_tofrom_data_select);
Expand Down

0 comments on commit 5462d8d

Please sign in to comment.