From f68a9cf1e7a6e97c79aa39fad46f82ea881b9c69 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 16 Feb 2021 18:28:56 +0100 Subject: [PATCH] Fix test code under MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER Signed-off-by: Gilles Peskine --- .../test_suite_psa_crypto_not_supported.function | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/suites/test_suite_psa_crypto_not_supported.function b/tests/suites/test_suite_psa_crypto_not_supported.function index ca62eee9d..e3253d840 100644 --- a/tests/suites/test_suite_psa_crypto_not_supported.function +++ b/tests/suites/test_suite_psa_crypto_not_supported.function @@ -3,7 +3,7 @@ #include "psa/crypto.h" #include "test/psa_crypto_helpers.h" -#define INVALID_KEY_ID 0xfedcba98 +#define INVALID_KEY_ID mbedtls_svc_key_id_make( 0, 0xfedcba98 ) /* END_HEADER */ @@ -16,7 +16,7 @@ void import_not_supported( int key_type, data_t *key_material ) { psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - psa_key_id_t key_id = INVALID_KEY_ID; + mbedtls_svc_key_id_t key_id = INVALID_KEY_ID; PSA_ASSERT( psa_crypto_init( ) ); psa_set_key_type( &attributes, key_type ); @@ -24,7 +24,7 @@ void import_not_supported( int key_type, data_t *key_material ) key_material->x, key_material->len, &key_id ), PSA_ERROR_NOT_SUPPORTED ); - TEST_EQUAL( key_id, 0 ); + TEST_ASSERT( mbedtls_svc_key_id_equal( key_id, MBEDTLS_SVC_KEY_ID_INIT ) ); exit: psa_destroy_key( key_id ); @@ -36,14 +36,14 @@ exit: void generate_not_supported( int key_type, int bits ) { psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; - psa_key_id_t key_id = INVALID_KEY_ID; + mbedtls_svc_key_id_t key_id = INVALID_KEY_ID; PSA_ASSERT( psa_crypto_init( ) ); psa_set_key_type( &attributes, key_type ); psa_set_key_bits( &attributes, bits ); TEST_EQUAL( psa_generate_key( &attributes, &key_id ), PSA_ERROR_NOT_SUPPORTED ); - TEST_EQUAL( key_id, 0 ); + TEST_ASSERT( mbedtls_svc_key_id_equal( key_id, MBEDTLS_SVC_KEY_ID_INIT ) ); exit: psa_destroy_key( key_id );