mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +03: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>
This commit is contained in:
committed by
Andreas Schneider
parent
8170e30073
commit
63aa274f4b
@ -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