tests: Cover recent changes for importing certs to keys

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
This commit is contained in:
Jakub Jelen
2023-09-25 16:39:52 +02:00
committed by Sahana Prasad
parent 4f903812e6
commit 7d4f210234
3 changed files with 32 additions and 1 deletions

View File

@@ -337,6 +337,11 @@ static void torture_pki_ecdsa_import_cert_file(void **state)
enum ssh_keytypes_e type;
struct pki_st *test_state = *((struct pki_st **)state);
/* Importing public key as cert should fail */
rc = ssh_pki_import_cert_file(LIBSSH_ECDSA_TESTKEY ".pub", &cert);
assert_int_equal(rc, SSH_ERROR);
assert_null(cert);
rc = ssh_pki_import_cert_file(LIBSSH_ECDSA_TESTKEY "-cert.pub", &cert);
assert_int_equal(rc, 0);
assert_non_null(cert);