Skip to content

Conversation

@57300
Copy link
Contributor

@57300 57300 commented Oct 29, 2025

If the target key ID is in the built-in range, then creation of the key should be handled by a driver. Otherwise, there's no way for the key to be persisted.

I don't know if this is acceptable upstream, since Mbed TLS and Oberon openly state that they don't support creating built-in keys through the PSA Crypto API, even though there are ways around this limitation.

manifest-pr-skip

Copy link
Contributor

@tomi-font tomi-font left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: ARM-software/psa-api#261
It's not yet implemented in Mbed TLS but will it cover your use case?

@57300
Copy link
Contributor Author

57300 commented Oct 30, 2025

FYI: ARM-software/psa-api#261 It's not yet implemented in Mbed TLS but will it cover your use case?

Interesting, thanks!

It's hard to say. As far as I can see, psa_attach_key() is used to register keys that are provisioned outside of the PSA API. However, in IronSide SE, we want our own "built-in keys" to be provisioned using psa_import_key().

@tomi-font
Copy link
Contributor

I'll let @frkv have a look as he's more involved (and opinionated) with this.

@tomi-font tomi-font requested a review from frkv October 30, 2025 10:01
@frkv
Copy link
Contributor

frkv commented Oct 30, 2025

Just a generic comment. Attaching keys leads to much more memory management, which is seen as a negative. We are talking about a generic routing of calls with keys, which are supposed to be owned by a certain component in the system (here it is implemented as a driver)

The topic of domain ownership as well as driver support is raised in the ongoing effort to standardize the PSA crypto driver API (multiple vendors cooperating with Arm). We have expressed a wish from Nordics side to make it possible to map e.g. a storage location (in lifetime) to a fully opaque PSA crypto driver. If this is supported it is easy to handle generic keys without complex key ID mapping.

We will discuss relevant topics offline with @57300 on the follow-through on this, as there is an expectancy that the driver API will change due to driver spec standardization....

Copy link
Contributor

@tomi-font tomi-font left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change seems fine to me but expecting @frkv to chime in and drive this.

If the target key ID is in the built-in range, then creation of the key
should be handled by a driver. Otherwise, there's no way for the key to
be persisted.

I don't know if this is acceptable upstream, since Mbed TLS and Oberon
openly state that they don't support creating built-in keys through the
PSA Crypto API, even though there are ways around this limitation.

At first, out of abundance of caution, this change will only be applied
for a single platform: Haltium (nRF54H, nRF92).

Signed-off-by: Grzegorz Swiderski <[email protected]>
Copy link
Contributor

@tomi-font tomi-font left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the ref at the bottom of the commit message?

Copy link
Contributor

@frkv frkv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

(Note that this pattern will be nRF54H-specific as nRF54L devices classify KMU keys as external meaning copying is disallowed already)

@nordicjm nordicjm merged commit 0257d9c into nrfconnect:main Nov 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants