Introduce device-specific derived key support#781
Merged
jaybosamiya-ms merged 4 commits intomainfrom Apr 17, 2026
Merged
Conversation
sangho2
approved these changes
Apr 16, 2026
Contributor
sangho2
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks!
There are some minor comments.
Member
Author
|
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 |
b3e297f to
1607acd
Compare
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! |
|
🤖 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for derived keys through a
DerivedKeyProviderplatform 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.