aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-19 11:03:31 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-19 11:03:31 +0200
commit765b42e68ac60f6eda53b6b90fea06a7b0b753cc (patch)
tree5366843d3dc6d2cc48e632fe1624a19ff48db32f
parent2615f8bc949ff87eba3051ad9eb0f1e41cd8afb4 (diff)
downloadlibssh-765b42e68ac60f6eda53b6b90fea06a7b0b753cc.tar.gz
libssh-765b42e68ac60f6eda53b6b90fea06a7b0b753cc.tar.xz
libssh-765b42e68ac60f6eda53b6b90fea06a7b0b753cc.zip
tests: Improve pki_import_privkey_base64 test.
-rw-r--r--tests/unittests/torture_pki.c7
1 files changed, 7 insertions, 0 deletions
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);
}