Skip to content

Commit abaa94c

Browse files
57300tejlmand
authored andcommitted
nrf_security: cracen: Add generic IKG personalization
On Haltium devices, each CRACEN built-in key ID is expected to reference a different IKG-generated key for each domain. This used to be a part of SUIT SDFW's platform key implementation, which is now unused and will be removed soon. When no personalization string is passed, all domains have the same IAK, MKEK, and MEXT keys. To solve this, introduce a more generic key personalization scheme that leverages the owner ID already passed from `cracen_load_ikg_keyref()`. It's hidden behind a new Kconfig option, which is disabled by default, as it only makes sense when MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER. Ref: NCSDK-35202 Signed-off-by: Grzegorz Swiderski <[email protected]>
1 parent 7309b55 commit abaa94c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

subsys/nrf_security/src/drivers/cracen/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ config CRACEN_IKG_SEED_KMU_SLOT
8383
This defines the KMU slot (along with the two following it) to which
8484
the IKG seed is provisioned and that is pushed when loading the IKG seed.
8585

86+
config CRACEN_IKG_PERSONALIZED_KEYS
87+
bool "CRACEN IKG personalized keys"
88+
help
89+
Personalize each IKG-generated key for the associated key owner.
90+
If an owner ID is encoded into the mbedtls_svc_key_id_t type,
91+
it will be passed to the IKG as a personalization string.
92+
8693
config CRACEN_USE_INTERRUPTS
8794
bool "Use cracen with interrupts"
8895
default y

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,10 @@ int cracen_prepare_ik_key(const uint8_t *user_data)
734734
}
735735
#endif
736736

737+
#ifdef CONFIG_CRACEN_IKG_PERSONALIZED_KEYS
738+
cfg.key_bundle = (const uint32_t *)user_data;
739+
cfg.key_bundle_sz = 1; /* size of the owner_id is one 32-bit word */
740+
#endif
737741

738742
#if defined(CONFIG_CRACEN_IKG)
739743
return sx_pk_ik_derive_keys(&cfg);

0 commit comments

Comments
 (0)