1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-05-17 19:21:11 +03:00

tests: Improve pki_import_privkey_base64 test.

This commit is contained in:
Andreas Schneider 2011-08-19 11:03:31 +02:00
parent 2615f8bc94
commit 765b42e68a

View File

@ -119,6 +119,7 @@ static void torture_pki_import_privkey_base64_RSA(void **state) {
char *key_str; char *key_str;
ssh_key key; ssh_key key;
const char *passphrase = LIBSSH_PASSPHRASE; const char *passphrase = LIBSSH_PASSPHRASE;
enum ssh_keytypes_e type;
key_str = read_file(LIBSSH_RSA_TESTKEY); key_str = read_file(LIBSSH_RSA_TESTKEY);
assert_true(key_str != NULL); 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); rc = ssh_pki_import_privkey_base64(key_str, passphrase, NULL, NULL, &key);
assert_true(rc == 0); 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); free(key_str);
ssh_key_free(key); ssh_key_free(key);
} }