Skip to content

Combine PRK and IDK_S generation VTL calls - #1130

Open
Angelina Vu (athvu) wants to merge 2 commits into
mainfrom
avu/keys
Open

Combine PRK and IDK_S generation VTL calls#1130
Angelina Vu (athvu) wants to merge 2 commits into
mainfrom
avu/keys

Conversation

@athvu

Copy link
Copy Markdown
Contributor

No description provided.

@athvu
Angelina Vu (athvu) force-pushed the avu/keys branch 2 times, most recently from cdef9e4 to e06c50f Compare August 6, 2026 20:33
Signed-off-by: Angelina Vu <angelinavu@microsoft.com>
…neration.

Signed-off-by: Angelina Vu <angelinavu@microsoft.com>
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 ⚠️ Potential breaking API changes detected ⚠️

Click for details
--- failure trait_method_parameter_count_changed: pub trait method parameter count changed ---

Description:
A trait method now takes a different number of parameters.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/trait_method_parameter_count_changed.ron

Failed in:
  CrngProvider::fill_bytes_crng now takes 2 instead of 1 parameters, in file /home/runner/work/litebox/litebox/litebox/src/platform/mod.rs:602

--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_variant_added.ron

Failed in:
  variant VsmFunction:SetPlatformRootKeyAndGenerateIdentitySigningKey in /home/runner/work/litebox/litebox/litebox_common_lvbs/src/lib.rs:77

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_variant_missing.ron

Failed in:
  variant VsmFunction::SetPlatformRootKey, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_lvbs/src/lib.rs:79
  variant VsmFunction::GenerateIdentitySigningKey, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_lvbs/src/lib.rs:80

--- failure pub_module_level_const_missing: pub module-level const is missing ---

Description:
A public const is missing or renamed
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/pub_module_level_const_missing.ron

Failed in:
  VSM_VTL_CALL_FUNC_ID_GENERATE_IDENTITY_SIGNING_KEY in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_lvbs/src/lib.rs:55
  VSM_VTL_CALL_FUNC_ID_SET_PLATFORM_ROOT_KEY in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/2457d20326c59d1c65d9a3185978915131264947/litebox_common_lvbs/src/lib.rs:52

--- failure function_parameter_count_changed: pub fn parameter count changed ---

Description:
A publicly-visible function now takes a different number of parameters.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/function_parameter_count_changed.ron

Failed in:
  litebox_shim_optee::idk::generate_identity_signing_key now takes 3 parameters instead of 2, in /home/runner/work/litebox/litebox/litebox_shim_optee/src/idk.rs:44

@athvu
Angelina Vu (athvu) marked this pull request as ready for review August 13, 2026 22:34

@sangho2 Sangho Lee (sangho2) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Angelina,

Thank you for your effort! I have one recommendation: rather than modifying the fill_bytes_crng interface in the litebox crate, could you install a trusted seed throughVtl1Gate (e.g., set a new global var) and use that seed in LVBS's fill_bytes_crng implementation? As you already observed, the litebox crate is a shared common interface/abstraction. any changes of it affect many other subsystems, such that we require strong justification.

let key_alg = params[2];
litebox_shim_optee::idk::generate_identity_signing_key(public_key_pa, key_alg)
VsmFunction::SetPlatformRootKeyAndGenerateIdentitySigningKey => {
let tpm_random_pa = params[1];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nits: Is this the address of an RNG seed? Technically, LiteBox doesn't know or doesn't care whether this is from TPM or not (e.g., could be from Pluton, HSM, ...). A generic name might be better (e.g., trusted seed, ...)

}

litebox_shim_optee::idk::generate_identity_signing_key(
tpm_random_pa + PRK_LEN as u64,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like this is a concatenation of two data: PRK || seed ? then, something like prk_and_seed might be better.

/// or greater than `IDENTITY_SIGNING_PUBLIC_KEY_LEN`.
fn generate_identity_signing_key_inner(public_key_pa: u64, key_alg: u64) -> Result<i64, Errno> {
fn generate_identity_signing_key_inner(
tpm_random_pa: u64,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I got confused here because it looks like tpm_random_pa = tpm_random_pa + PRK_LEN. Anyway, as noted above, I think it is better not to be tpm_random.

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