Skip to content

Commit 729cb58

Browse files
ahasztagjukkar
authored andcommitted
cracen: imported FWENC key used for AES-GCM
The key was imported from SICR for usage with ECB, which made it impossible to decrypt the firmware. Signed-off-by: Artur Hadasz <[email protected]>
1 parent 31f49ba commit 729cb58

File tree

1 file changed

+6
-2
lines changed
  • subsys/nrf_security/src/drivers/cracen/cracenpsa/src/platform_keys

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,12 @@ psa_status_t cracen_platform_get_builtin_key(psa_drv_slot_number_t slot_number,
352352
psa_set_key_algorithm(attributes, PSA_ALG_PURE_EDDSA);
353353
psa_set_key_usage_flags(attributes, PSA_KEY_USAGE_VERIFY_MESSAGE);
354354
} else if (key.sicr.type == PSA_KEY_TYPE_AES) {
355-
/* This will be AES-KW when it is supported. */
356-
psa_set_key_algorithm(attributes, PSA_ALG_ECB_NO_PADDING);
355+
/* Currently AES-KW is not supported, so the key stored in SICR
356+
* is directly used to decrypt the firmware (using AES-GCM).
357+
* When AES-KW is supported, this will possibly need to be extended
358+
* so that both AES-KW and direct decryption can be supported.
359+
*/
360+
psa_set_key_algorithm(attributes, PSA_ALG_GCM);
357361
psa_set_key_usage_flags(attributes, PSA_KEY_USAGE_DECRYPT);
358362

359363
if (PSA_BITS_TO_BYTES(key.sicr.bits) > sizeof(decrypted_key)) {

0 commit comments

Comments
 (0)