mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
tests: Add null checks in torture_threads_pki_rsa.c
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 63aa274f4b)
This commit is contained in:
committed by
Andreas Schneider
parent
b5c7f07064
commit
83f6ce0928
@@ -274,12 +274,14 @@ static void *thread_pki_rsa_publickey_from_privatekey(void *threadid)
|
|||||||
NULL,
|
NULL,
|
||||||
&key);
|
&key);
|
||||||
assert_true(rc == 0);
|
assert_true(rc == 0);
|
||||||
|
assert_non_null(key);
|
||||||
|
|
||||||
ok = ssh_key_is_private(key);
|
ok = ssh_key_is_private(key);
|
||||||
assert_true(ok);
|
assert_true(ok);
|
||||||
|
|
||||||
rc = ssh_pki_export_privkey_to_pubkey(key, &pubkey);
|
rc = ssh_pki_export_privkey_to_pubkey(key, &pubkey);
|
||||||
assert_true(rc == SSH_OK);
|
assert_true(rc == SSH_OK);
|
||||||
|
assert_non_null(pubkey);
|
||||||
|
|
||||||
ssh_key_free(key);
|
ssh_key_free(key);
|
||||||
ssh_key_free(pubkey);
|
ssh_key_free(pubkey);
|
||||||
|
|||||||
Reference in New Issue
Block a user