diff options
author | Richard Levitte <levitte@openssl.org> | 2020-01-22 20:59:56 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-01-28 08:08:22 +0100 |
commit | 0cb3f4f985aa52688ddc90075f480ba612d34fe3 (patch) | |
tree | ed1d15d49e96a34a7418b8c5ee0cdbbfdb5dec91 /test | |
parent | 505b41fc5a7a3cb255d2f62cf4902a1a5c1db2dd (diff) |
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)
Diffstat (limited to 'test')
-rw-r--r-- | test/evp_extra_test.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 5f2bcc1a51..57f5010381 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -1288,23 +1288,20 @@ static int test_EVP_PKEY_CTX_get_set_params(void) */ params = EVP_PKEY_CTX_settable_params(ctx); if (!TEST_ptr(params) - || !TEST_int_eq(strcmp(params[0].key, - OSSL_SIGNATURE_PARAM_DIGEST_SIZE), 0) - || !TEST_int_eq(strcmp(params[1].key, OSSL_SIGNATURE_PARAM_DIGEST), - 0) - /* The final key should be NULL */ - || !TEST_ptr_null(params[2].key)) + || !TEST_ptr(OSSL_PARAM_locate_const(params, + OSSL_SIGNATURE_PARAM_DIGEST_SIZE)) + || !TEST_ptr(OSSL_PARAM_locate_const(params, + OSSL_SIGNATURE_PARAM_DIGEST))) goto err; - /* Gettable params are the same as the settable ones */ params = EVP_PKEY_CTX_gettable_params(ctx); if (!TEST_ptr(params) - || !TEST_int_eq(strcmp(params[0].key, - OSSL_SIGNATURE_PARAM_DIGEST_SIZE), 0) - || !TEST_int_eq(strcmp(params[1].key, OSSL_SIGNATURE_PARAM_DIGEST), - 0) - /* The final key should be NULL */ - || !TEST_ptr_null(params[2].key)) + || !TEST_ptr(OSSL_PARAM_locate_const(params, + OSSL_SIGNATURE_PARAM_ALGORITHM_ID)) + || !TEST_ptr(OSSL_PARAM_locate_const(params, + OSSL_SIGNATURE_PARAM_DIGEST_SIZE)) + || !TEST_ptr(OSSL_PARAM_locate_const(params, + OSSL_SIGNATURE_PARAM_DIGEST))) goto err; /* |