Skip to content

Introduce device-specific derived key support#781

Merged
jaybosamiya-ms merged 4 commits intomainfrom
jayb/device-specific-keys
Apr 17, 2026
Merged

Introduce device-specific derived key support#781
jaybosamiya-ms merged 4 commits intomainfrom
jayb/device-specific-keys

Conversation

@jaybosamiya-ms
Copy link
Copy Markdown
Member

This PR adds support for derived keys through a DerivedKeyProvider platform trait. This design manages the tradeoffs between some requirements for OP-TEE and strictness of wrapping.

The strictest version of this design looks similar to a TPM, in that the platform would never expose the root key to anything else, only ingesting context and outputting a derived key. However, this design does not fit some constraints required by the OP-TEE shim, which (for reasons) wants to specify its own key derivation function. The naive way to support this is through the platform revealing the device-specific key directly, but this (unsurprisingly) can lead to proliferation of key usage, rather than keeping it strictly confined. Indeed, direct exposing of such keys cannot even be supported by some platforms (e.g., TPM).

As a middle ground, the platform can choose to use a shim-provided KDF if it wishes to (if it makes sense for some shim/platform pairs) while for other more-distrustful platforms can choose to do their own KDF in addition to the shim-provided KDF, or even to ignore the shim-provided KDF entirely. Effectively, the platform is the true arbiter of how the secret gets protected.

This PR introduces this interface, as well as implements it for the Linux userland platform to demonstrate one concrete implementation of it.

Copy link
Copy Markdown
Contributor

@sangho2 sangho2 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

There are some minor comments.

Comment thread litebox/src/platform/mod.rs Outdated
Comment thread litebox/src/platform/mod.rs Outdated
Comment thread litebox/src/platform/mod.rs Outdated
@jaybosamiya-ms
Copy link
Copy Markdown
Member Author

jaybosamiya-ms commented Apr 16, 2026

CI failures due to new Rust version released today which introduces new clippy lints, I'll open a PR to fix things soon. Those are unrelated to the changes in this PR.

Edit: #782

@jaybosamiya-ms jaybosamiya-ms force-pushed the jayb/device-specific-keys branch from b3e297f to 1607acd Compare April 17, 2026 00:53
@jaybosamiya-ms
Copy link
Copy Markdown
Member Author

@sangho2 please resolve the comment if the tweak to support shim-level errors looks good to you, and it'll auto-merge, thanks!

@github-actions
Copy link
Copy Markdown

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

@jaybosamiya-ms jaybosamiya-ms added this pull request to the merge queue Apr 17, 2026
Merged via the queue into main with commit 26032b9 Apr 17, 2026
14 checks passed
@jaybosamiya-ms jaybosamiya-ms deleted the jayb/device-specific-keys branch April 17, 2026 01:20
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.

2 participants