Combine PRK and IDK_S generation VTL calls - #1130
Conversation
cdef9e4 to
e06c50f
Compare
Signed-off-by: Angelina Vu <angelinavu@microsoft.com>
e06c50f to
b60829c
Compare
…neration. Signed-off-by: Angelina Vu <angelinavu@microsoft.com>
b60829c to
56260e3
Compare
|
🤖 SemverChecks 🤖 Click for details |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
No description provided.