mirror of
https://github.com/openssl/openssl.git
synced 2025-04-24 20:51:14 +08:00
evp_pkey_provided_test: Improve diagnostic output
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14316)
This commit is contained in:
parent
4519ea90eb
commit
d2ccfb9caa
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user