From 765b42e68ac60f6eda53b6b90fea06a7b0b753cc Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 19 Aug 2011 11:03:31 +0200 Subject: tests: Improve pki_import_privkey_base64 test. --- tests/unittests/torture_pki.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unittests/torture_pki.c b/tests/unittests/torture_pki.c index 3d6da3d..f40ecfc 100644 --- a/tests/unittests/torture_pki.c +++ b/tests/unittests/torture_pki.c @@ -119,6 +119,7 @@ static void torture_pki_import_privkey_base64_RSA(void **state) { char *key_str; ssh_key key; const char *passphrase = LIBSSH_PASSPHRASE; + enum ssh_keytypes_e type; key_str = read_file(LIBSSH_RSA_TESTKEY); assert_true(key_str != NULL); @@ -126,6 +127,12 @@ static void torture_pki_import_privkey_base64_RSA(void **state) { rc = ssh_pki_import_privkey_base64(key_str, passphrase, NULL, NULL, &key); assert_true(rc == 0); + type = ssh_key_type(key); + assert_true(type == SSH_KEYTYPE_RSA); + + rc = ssh_key_is_public(key); + assert_true(rc == 1); + free(key_str); ssh_key_free(key); } -- cgit v1.2.3