mirror of
https://github.com/openssl/openssl.git
synced 2024-12-09 05:51:54 +08:00
test_evp_extra_test.c: don't rely on exact parameter position
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10920)
This commit is contained in:
parent
505b41fc5a
commit
0cb3f4f985
@ -1288,23 +1288,20 @@ static int test_EVP_PKEY_CTX_get_set_params(void)
|
|||||||
*/
|
*/
|
||||||
params = EVP_PKEY_CTX_settable_params(ctx);
|
params = EVP_PKEY_CTX_settable_params(ctx);
|
||||||
if (!TEST_ptr(params)
|
if (!TEST_ptr(params)
|
||||||
|| !TEST_int_eq(strcmp(params[0].key,
|
|| !TEST_ptr(OSSL_PARAM_locate_const(params,
|
||||||
OSSL_SIGNATURE_PARAM_DIGEST_SIZE), 0)
|
OSSL_SIGNATURE_PARAM_DIGEST_SIZE))
|
||||||
|| !TEST_int_eq(strcmp(params[1].key, OSSL_SIGNATURE_PARAM_DIGEST),
|
|| !TEST_ptr(OSSL_PARAM_locate_const(params,
|
||||||
0)
|
OSSL_SIGNATURE_PARAM_DIGEST)))
|
||||||
/* The final key should be NULL */
|
|
||||||
|| !TEST_ptr_null(params[2].key))
|
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/* Gettable params are the same as the settable ones */
|
|
||||||
params = EVP_PKEY_CTX_gettable_params(ctx);
|
params = EVP_PKEY_CTX_gettable_params(ctx);
|
||||||
if (!TEST_ptr(params)
|
if (!TEST_ptr(params)
|
||||||
|| !TEST_int_eq(strcmp(params[0].key,
|
|| !TEST_ptr(OSSL_PARAM_locate_const(params,
|
||||||
OSSL_SIGNATURE_PARAM_DIGEST_SIZE), 0)
|
OSSL_SIGNATURE_PARAM_ALGORITHM_ID))
|
||||||
|| !TEST_int_eq(strcmp(params[1].key, OSSL_SIGNATURE_PARAM_DIGEST),
|
|| !TEST_ptr(OSSL_PARAM_locate_const(params,
|
||||||
0)
|
OSSL_SIGNATURE_PARAM_DIGEST_SIZE))
|
||||||
/* The final key should be NULL */
|
|| !TEST_ptr(OSSL_PARAM_locate_const(params,
|
||||||
|| !TEST_ptr_null(params[2].key))
|
OSSL_SIGNATURE_PARAM_DIGEST)))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user