1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00

tests: Add ed25519 encrypted keys import

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Aris Adamantiadis
2015-01-21 14:21:52 +01:00
committed by Andreas Schneider
parent 423fa6818b
commit b76d37b341
2 changed files with 35 additions and 1 deletions

View File

@ -350,6 +350,24 @@ static void torture_pki_import_privkey_base64_passphrase(void **state) {
assert_true(rc == -1);
#endif
/* same for ED25519 */
rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_ED25519, 0, 1),
passphrase,
NULL,
NULL,
&key);
assert_true(rc == 0);
ssh_key_free(key);
/* test if it returns -1 if passphrase is wrong */
rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_ED25519, 0, 1),
"wrong passphrase !!",
NULL,
NULL,
&key);
assert_true(rc == -1);
}
static void torture_pki_import_privkey_base64_ed25519(void **state){