mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-05-16 08:04:30 +03:00
tests: Improve pki_import_privkey_base64 test.
This commit is contained in:
parent
2615f8bc94
commit
765b42e68a
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user