From 045bd50a78a3d8d639ea470c79300eb6331bedff Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Tue, 26 Jun 2018 14:00:08 +0100 Subject: [PATCH] psa: Use key slot type in mbedtls_psa_crypto_free() To avoid a possible loss of precision, and to be semantically correct, use psa_key_slot_t (which is 16 bits) instead of size_t (which is 32 or 64 bits on common platforms) in mbedtls_psa_crypto_free(). --- library/psa_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 7d7882745..4b17e5594 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -2941,7 +2941,7 @@ psa_status_t psa_generate_key( psa_key_slot_t key, void mbedtls_psa_crypto_free( void ) { - size_t key; + psa_key_slot_t key; for( key = 1; key < PSA_KEY_SLOT_COUNT; key++ ) psa_destroy_key( key ); mbedtls_ctr_drbg_free( &global_data.ctr_drbg );