diff options
author | Valerio Setti <valerio.setti@nordicsemi.no> | 2024-03-19 09:54:46 +0100 |
---|---|---|
committer | Valerio Setti <valerio.setti@nordicsemi.no> | 2024-03-19 09:54:46 +0100 |
commit | da47518554b5e56e3c5d08fdad304fb282baaba4 (patch) | |
tree | 4fa1b2bd9bd5bebca90b47ec5b84d25e05ee54c6 | |
parent | 8ad5be0e5d8b15626f6cbe43ecbb3b7af79b96fa (diff) | |
download | mbedtls-da47518554b5e56e3c5d08fdad304fb282baaba4.tar.gz |
test_suite_pk: always test verify_ext with opaque keys in pk_psa_wrap_sign_ext()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
-rw-r--r-- | tests/suites/test_suite_pk.function | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function index ce590de52..808abcff3 100644 --- a/tests/suites/test_suite_pk.function +++ b/tests/suites/test_suite_pk.function @@ -2060,8 +2060,7 @@ void pk_psa_wrap_sign_ext(int pk_type, int key_bits, int key_pk_type, int md_alg sig, sizeof(sig), &sig_len, mbedtls_test_rnd_std_rand, NULL), 0); - /* Trying to perform a verify_ext() using the opaque context is not supported - * so here we verify that this does not crash. */ + /* verify_ext() is not supported when using an opaque context. */ if (key_pk_type == MBEDTLS_PK_RSASSA_PSS) { mbedtls_pk_rsassa_pss_options pss_opts = { .mgf1_hash_id = md_alg, @@ -2070,6 +2069,10 @@ void pk_psa_wrap_sign_ext(int pk_type, int key_bits, int key_pk_type, int md_alg TEST_EQUAL(mbedtls_pk_verify_ext(key_pk_type, &pss_opts, &pk, md_alg, hash, hash_len, sig, sig_len), MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE); + } else { + TEST_EQUAL(mbedtls_pk_verify_ext(key_pk_type, NULL, &pk, md_alg, + hash, hash_len, sig, sig_len), + MBEDTLS_ERR_PK_TYPE_MISMATCH); } mbedtls_pk_free(&pk); |