diff --git a/tests/unittests/torture_pki_rsa.c b/tests/unittests/torture_pki_rsa.c index 34f76040..0d5e97fa 100644 --- a/tests/unittests/torture_pki_rsa.c +++ b/tests/unittests/torture_pki_rsa.c @@ -352,6 +352,7 @@ static void torture_pki_rsa_duplicate_key(void **state) rc = ssh_pki_import_pubkey_file(LIBSSH_RSA_TESTKEY ".pub", &pubkey); assert_true(rc == 0); + assert_non_null(pubkey); rc = ssh_pki_export_pubkey_base64(pubkey, &b64_key); assert_true(rc == 0); @@ -366,13 +367,15 @@ static void torture_pki_rsa_duplicate_key(void **state) assert_non_null(privkey); privkey_dup = ssh_key_dup(privkey); - assert_true(privkey_dup != NULL); + assert_non_null(privkey_dup); rc = ssh_pki_export_privkey_to_pubkey(privkey, &pubkey); assert_true(rc == SSH_OK); + assert_non_null(pubkey); rc = ssh_pki_export_pubkey_base64(pubkey, &b64_key_gen); assert_true(rc == 0); + assert_non_null(b64_key_gen); assert_string_equal(b64_key, b64_key_gen); @@ -493,6 +496,7 @@ static void torture_pki_rsa_write_privkey(void **state) NULL, &origkey); assert_true(rc == 0); + assert_non_null(origkey); unlink(LIBSSH_RSA_TESTKEY); @@ -509,6 +513,7 @@ static void torture_pki_rsa_write_privkey(void **state) NULL, &privkey); assert_true(rc == 0); + assert_non_null(privkey); rc = ssh_key_cmp(origkey, privkey, SSH_KEY_CMP_PRIVATE); assert_true(rc == 0); @@ -523,6 +528,7 @@ static void torture_pki_rsa_write_privkey(void **state) NULL, &origkey); assert_true(rc == 0); + assert_non_null(origkey); unlink(LIBSSH_RSA_TESTKEY_PASSPHRASE); rc = ssh_pki_export_privkey_file(origkey,