diff options
| author | Aris Adamantiadis <aris@0xbadc0de.be> | 2015-01-21 14:21:52 +0100 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2015-02-02 14:45:52 +0100 |
| commit | b76d37b341c48ef9865183d6fe287bbf4029ccb6 (patch) | |
| tree | a0a694a711b1093116815ed2e27f860ff1f2868c /tests/unittests | |
| parent | 423fa6818bcce491d4e4dafc8e5306905f5e5255 (diff) | |
tests: Add ed25519 encrypted keys import
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/unittests')
| -rw-r--r-- | tests/unittests/torture_pki.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unittests/torture_pki.c b/tests/unittests/torture_pki.c index bd2c942f..a99f2084 100644 --- a/tests/unittests/torture_pki.c +++ b/tests/unittests/torture_pki.c @@ -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){ |
