Skip to content

Commit 2c2743d

Browse files
Vge0rgerlubos
authored andcommitted
nrf_security: Allow the IAK to be exported in Cracen
The Cracen builtin keys now have a list of allowed owners which dictates which owner can use each key. This has an issue with the IAK because this key should only be usable by the TF-M attestation partition but at the same time it should be possible for the application to export the public key of it. This updates the logic in the export_public_key function in the Cracen PSA driver to skip checking for ownerhip for the IKG keys of Cracen for this function. Signed-off-by: Georgios Vasilakis <[email protected]>
1 parent a4e658f commit 2c2743d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,14 @@ psa_status_t cracen_export_public_key(const psa_key_attributes_t *attributes,
895895
return PSA_ERROR_INVALID_ARGUMENT;
896896
}
897897

898-
if (!cracen_builtin_key_user_allowed(attributes)) {
898+
/* The public key of the IAK needs to be allowed to get exported because there is no
899+
* way to provide the public key through the attestation service at the moment.
900+
* The check for IKG keys is skipped since the only IKG key that can use this operation
901+
* is the IAK.
902+
*/
903+
if (!cracen_builtin_key_user_allowed(attributes) &&
904+
PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes)) !=
905+
PSA_KEY_LOCATION_CRACEN) {
899906
return PSA_ERROR_NOT_PERMITTED;
900907
}
901908

0 commit comments

Comments
 (0)