File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1035,6 +1035,11 @@ psa_status_t psa_destroy_key( psa_key_handle_t handle )
1035
1035
/* Return the size of the key in the given slot, in bits. */
1036
1036
static size_t psa_get_key_slot_bits ( const psa_key_slot_t * slot )
1037
1037
{
1038
+ #if defined(MBEDTLS_PSA_CRYPTO_SE_C )
1039
+ if ( psa_get_se_driver ( slot -> lifetime , NULL , NULL ) )
1040
+ return ( slot -> data .se .bits );
1041
+ #endif /* defined(MBEDTLS_PSA_CRYPTO_SE_C) */
1042
+
1038
1043
if ( key_type_is_raw_bytes ( slot -> type ) )
1039
1044
return ( slot -> data .raw .bytes * 8 );
1040
1045
#if defined(MBEDTLS_RSA_C )
@@ -1489,6 +1494,10 @@ static psa_status_t psa_start_key_creation(
1489
1494
(void ) psa_crypto_stop_transaction ( );
1490
1495
return ( status );
1491
1496
}
1497
+
1498
+ /* TOnogrepDO: validate bits. How to do this depends on the key
1499
+ * creation method, so setting bits might not belong here. */
1500
+ slot -> data .se .bits = psa_get_key_bits ( attributes );
1492
1501
}
1493
1502
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
1494
1503
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ typedef struct
64
64
struct se
65
65
{
66
66
psa_key_slot_number_t slot_number ;
67
+ size_t bits ;
67
68
} se ;
68
69
} data ;
69
70
} psa_key_slot_t ;
You can’t perform that action at this time.
0 commit comments