mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
tests: Some cleanup for torture_pki
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -332,12 +332,13 @@ static void torture_pki_import_privkey_base64_passphrase(void **state) {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&key);
|
&key);
|
||||||
assert_true(rc == 0);
|
assert_return_code(rc, errno);
|
||||||
|
|
||||||
rc = ssh_key_is_private(key);
|
rc = ssh_key_is_private(key);
|
||||||
assert_true(rc == 1);
|
assert_true(rc == 1);
|
||||||
|
|
||||||
ssh_key_free(key);
|
ssh_key_free(key);
|
||||||
|
key = NULL;
|
||||||
|
|
||||||
/* test if it returns -1 if passphrase is wrong */
|
/* test if it returns -1 if passphrase is wrong */
|
||||||
rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_RSA, 0, 1),
|
rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_RSA, 0, 1),
|
||||||
@@ -365,12 +366,13 @@ static void torture_pki_import_privkey_base64_passphrase(void **state) {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&key);
|
&key);
|
||||||
assert_true(rc == 0);
|
assert_return_code(rc, errno);
|
||||||
|
|
||||||
rc = ssh_key_is_private(key);
|
rc = ssh_key_is_private(key);
|
||||||
assert_true(rc == 1);
|
assert_true(rc == 1);
|
||||||
|
|
||||||
ssh_key_free(key);
|
ssh_key_free(key);
|
||||||
|
key = NULL;
|
||||||
|
|
||||||
/* test if it returns -1 if passphrase is wrong */
|
/* test if it returns -1 if passphrase is wrong */
|
||||||
rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_DSS, 0, 1),
|
rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_DSS, 0, 1),
|
||||||
@@ -404,6 +406,7 @@ static void torture_pki_import_privkey_base64_passphrase(void **state) {
|
|||||||
assert_true(rc == 1);
|
assert_true(rc == 1);
|
||||||
|
|
||||||
ssh_key_free(key);
|
ssh_key_free(key);
|
||||||
|
key = NULL;
|
||||||
|
|
||||||
/* test if it returns -1 if passphrase is wrong */
|
/* test if it returns -1 if passphrase is wrong */
|
||||||
rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_ED25519, 0, 1),
|
rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_ED25519, 0, 1),
|
||||||
|
|||||||
Reference in New Issue
Block a user