summaryrefslogtreecommitdiffstats
path: root/test/evp_pkey_provided_test.c
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-02-25 15:08:16 +0100
committerTomas Mraz <tomas@openssl.org>2021-02-26 18:43:34 +0100
commitd2ccfb9caa9f69d4980f8fe49a15a043c91b40c5 (patch)
tree32d89cd27549051e0b6edb21520c6d93c39ae94b /test/evp_pkey_provided_test.c
parent4519ea90eb8137ce3f00860a705f8320f41b6057 (diff)
evp_pkey_provided_test: Improve diagnostic output
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14316)
Diffstat (limited to 'test/evp_pkey_provided_test.c')
-rw-r--r--test/evp_pkey_provided_test.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c
index fd0dcdd38a..18b62d4645 100644
--- a/test/evp_pkey_provided_test.c
+++ b/test/evp_pkey_provided_test.c
@@ -361,15 +361,16 @@ static int test_fromdata_rsa(void)
|| !TEST_false(EVP_PKEY_copy_parameters(copy_pk, pk)))
goto err;
+ ret = test_print_key_using_pem("RSA", pk)
+ && test_print_key_using_encoder("RSA", pk);
+ err:
+ /* for better diagnostics always compare key params */
for (i = 0; fromdata_params[i].key != NULL; ++i) {
if (!TEST_true(BN_set_word(bn_from, key_numbers[i]))
|| !TEST_true(EVP_PKEY_get_bn_param(pk, fromdata_params[i].key, &bn))
|| !TEST_BN_eq(bn, bn_from))
- goto err;
+ ret = 0;
}
- ret = test_print_key_using_pem("RSA", pk)
- && test_print_key_using_encoder("RSA", pk);
- err:
BN_free(bn_from);
BN_free(bn);
EVP_PKEY_free(pk);