Skip to content

Commit c1624a6

Browse files
committed
nrf_security: cracenpsa: KMU: Key buffer size check fix
Fix for an invalid check for key size. Signed-off-by: Anton Zyma <anton.zyma@nordicsemi.no>
1 parent d3e1192 commit c1624a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen_mac_cmac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ psa_status_t cracen_cmac_setup(cracen_mac_operation_t *operation,
2222
{
2323
int sx_status;
2424
psa_status_t status = PSA_SUCCESS;
25+
psa_key_location_t location =
26+
PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
2527

2628
/* Only AES-CMAC is supported */
2729
if (psa_get_key_type(attributes) != PSA_KEY_TYPE_AES) {
2830
return PSA_ERROR_NOT_SUPPORTED;
2931
}
3032

31-
if (key_buffer_size < AES_BLOCK_SIZE) {
33+
if (key_buffer_size < AES_BLOCK_SIZE && location != PSA_KEY_LOCATION_CRACEN_KMU) {
3234
return PSA_ERROR_INVALID_ARGUMENT;
3335
}
3436

0 commit comments

Comments
 (0)