summaryrefslogtreecommitdiffstats
path: root/regress/unittests/sshkey/test_sshkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/unittests/sshkey/test_sshkey.c')
-rw-r--r--regress/unittests/sshkey/test_sshkey.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/regress/unittests/sshkey/test_sshkey.c b/regress/unittests/sshkey/test_sshkey.c
index c1cbb11..5bf4b65 100644
--- a/regress/unittests/sshkey/test_sshkey.c
+++ b/regress/unittests/sshkey/test_sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test_sshkey.c,v 1.24 2024/01/11 01:45:58 djm Exp $ */
+/* $OpenBSD: test_sshkey.c,v 1.25 2024/08/15 00:52:23 djm Exp $ */
/*
* Regress test for sshkey.h key management API
*
@@ -204,7 +204,7 @@ sshkey_tests(void)
TEST_START("new/free KEY_RSA");
k1 = sshkey_new(KEY_RSA);
ASSERT_PTR_NE(k1, NULL);
- ASSERT_PTR_NE(k1->rsa, NULL);
+ ASSERT_PTR_NE(k1->pkey, NULL);
sshkey_free(k1);
TEST_DONE();
@@ -221,7 +221,7 @@ sshkey_tests(void)
TEST_START("new/free KEY_ECDSA");
k1 = sshkey_new(KEY_ECDSA);
ASSERT_PTR_NE(k1, NULL);
- ASSERT_PTR_EQ(k1->ecdsa, NULL); /* Can't allocate without NID */
+ ASSERT_PTR_EQ(k1->pkey, NULL); /* Can't allocate without NID */
sshkey_free(k1);
TEST_DONE();
#endif
@@ -270,7 +270,7 @@ sshkey_tests(void)
SSH_ERR_KEY_LENGTH);
ASSERT_INT_EQ(sshkey_generate(KEY_RSA, 1024, &kr), 0);
ASSERT_PTR_NE(kr, NULL);
- ASSERT_PTR_NE(kr->rsa, NULL);
+ ASSERT_PTR_NE(EVP_PKEY_get0_RSA(kr->pkey), NULL);
ASSERT_PTR_NE(rsa_n(kr), NULL);
ASSERT_PTR_NE(rsa_e(kr), NULL);
ASSERT_PTR_NE(rsa_p(kr), NULL);
@@ -291,9 +291,11 @@ sshkey_tests(void)
TEST_START("generate KEY_ECDSA");
ASSERT_INT_EQ(sshkey_generate(KEY_ECDSA, 256, &ke), 0);
ASSERT_PTR_NE(ke, NULL);
- ASSERT_PTR_NE(ke->ecdsa, NULL);
- ASSERT_PTR_NE(EC_KEY_get0_public_key(ke->ecdsa), NULL);
- ASSERT_PTR_NE(EC_KEY_get0_private_key(ke->ecdsa), NULL);
+ ASSERT_PTR_NE(EVP_PKEY_get0_EC_KEY(ke->pkey), NULL);
+ ASSERT_PTR_NE(EC_KEY_get0_public_key(EVP_PKEY_get0_EC_KEY(ke->pkey)),
+ NULL);
+ ASSERT_PTR_NE(EC_KEY_get0_private_key(EVP_PKEY_get0_EC_KEY(ke->pkey)),
+ NULL);
TEST_DONE();
#endif /* OPENSSL_HAS_ECC */
#endif /* WITH_OPENSSL */
@@ -312,7 +314,7 @@ sshkey_tests(void)
ASSERT_PTR_NE(k1, NULL);
ASSERT_PTR_NE(kr, k1);
ASSERT_INT_EQ(k1->type, KEY_RSA);
- ASSERT_PTR_NE(k1->rsa, NULL);
+ ASSERT_PTR_NE(EVP_PKEY_get0_RSA(k1->pkey), NULL);
ASSERT_PTR_NE(rsa_n(k1), NULL);
ASSERT_PTR_NE(rsa_e(k1), NULL);
ASSERT_PTR_EQ(rsa_p(k1), NULL);
@@ -346,10 +348,12 @@ sshkey_tests(void)
ASSERT_PTR_NE(k1, NULL);
ASSERT_PTR_NE(ke, k1);
ASSERT_INT_EQ(k1->type, KEY_ECDSA);
- ASSERT_PTR_NE(k1->ecdsa, NULL);
+ ASSERT_PTR_NE(EVP_PKEY_get0_EC_KEY(k1->pkey), NULL);
ASSERT_INT_EQ(k1->ecdsa_nid, ke->ecdsa_nid);
- ASSERT_PTR_NE(EC_KEY_get0_public_key(ke->ecdsa), NULL);
- ASSERT_PTR_EQ(EC_KEY_get0_private_key(k1->ecdsa), NULL);
+ ASSERT_PTR_NE(EC_KEY_get0_public_key(EVP_PKEY_get0_EC_KEY(ke->pkey)),
+ NULL);
+ ASSERT_PTR_EQ(EC_KEY_get0_private_key(EVP_PKEY_get0_EC_KEY(k1->pkey)),
+ NULL);
TEST_DONE();
TEST_START("equal KEY_ECDSA/demoted KEY_ECDSA");