diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-08-19 11:03:31 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-08-19 11:03:31 +0200 |
commit | 765b42e68ac60f6eda53b6b90fea06a7b0b753cc (patch) | |
tree | 5366843d3dc6d2cc48e632fe1624a19ff48db32f /tests/unittests | |
parent | 2615f8bc949ff87eba3051ad9eb0f1e41cd8afb4 (diff) | |
download | libssh-765b42e68ac60f6eda53b6b90fea06a7b0b753cc.tar.gz libssh-765b42e68ac60f6eda53b6b90fea06a7b0b753cc.tar.xz libssh-765b42e68ac60f6eda53b6b90fea06a7b0b753cc.zip |
tests: Improve pki_import_privkey_base64 test.
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/torture_pki.c | 7 |
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); } |