diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2016-11-04 08:21:39 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2016-11-04 08:21:39 +0100 |
commit | e9ba2da9e99f32572241226938ff0fc2904aff75 (patch) | |
tree | 39b217fcdefea5b7bdb5724ecb73df55b1da0e32 /tests | |
parent | 5b84772343d0496d67402b24fd247d3f6884b6f2 (diff) | |
download | libssh-e9ba2da9e99f32572241226938ff0fc2904aff75.tar.gz libssh-e9ba2da9e99f32572241226938ff0fc2904aff75.tar.xz libssh-e9ba2da9e99f32572241226938ff0fc2904aff75.zip |
tests: Some cleanup for torture_pki
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/torture_pki.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unittests/torture_pki.c b/tests/unittests/torture_pki.c index a2bfdbc6..8e6e2b63 100644 --- a/tests/unittests/torture_pki.c +++ b/tests/unittests/torture_pki.c @@ -332,12 +332,13 @@ static void torture_pki_import_privkey_base64_passphrase(void **state) { NULL, NULL, &key); - assert_true(rc == 0); + assert_return_code(rc, errno); rc = ssh_key_is_private(key); assert_true(rc == 1); ssh_key_free(key); + key = NULL; /* test if it returns -1 if passphrase is wrong */ 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, &key); - assert_true(rc == 0); + assert_return_code(rc, errno); rc = ssh_key_is_private(key); assert_true(rc == 1); ssh_key_free(key); + key = NULL; /* test if it returns -1 if passphrase is wrong */ 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); ssh_key_free(key); + key = NULL; /* test if it returns -1 if passphrase is wrong */ rc = ssh_pki_import_privkey_base64(torture_get_testkey(SSH_KEYTYPE_ED25519, 0, 1), |