1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Store key sizes in 16 bits in attributes

This is larger than the maximum key size introduced in the previous
commit, by design.

Make some room for flags (not used yet).
This commit is contained in:
Gilles Peskine
2019-07-30 17:42:47 +02:00
parent c744d99386
commit 68cc433b5b
2 changed files with 18 additions and 7 deletions

View File

@ -710,7 +710,7 @@ psa_status_t psa_import_key_into_slot( psa_key_slot_t *slot,
/* Ensure that the bytes-to-bit conversion doesn't overflow. */
if( data_length > SIZE_MAX / 8 )
return( PSA_ERROR_NOT_SUPPORTED );
/* Ensure that the key is not overly large. */
/* Ensure that the bit size fits in its representation type. */
if( bit_size > PSA_MAX_KEY_BITS )
return( PSA_ERROR_NOT_SUPPORTED );
status = prepare_raw_data_slot( slot->type, bit_size,