Combine PRK and IDK_S generation VTL calls - #1130
Conversation
cdef9e4 to
e06c50f
Compare
b60829c to
56260e3
Compare
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.
Signed-off-by: Angelina Vu <angelinavu@microsoft.com>
…neration. Signed-off-by: Angelina Vu <angelinavu@microsoft.com>
Undo changes to fill_bytes_crng interface Set trusted seed through Vtl1Gate to use in LVBS fill_bytes_crng implementation Signed-off-by: Angelina Vu <angelinavu@microsoft.com>
9b656a6 to
1289e09
Compare
097b043 to
5e2ba4e
Compare
|
🤖 SemverChecks 🤖 Click for details |
Sangho Lee (sangho2)
left a comment
There was a problem hiding this comment.
Overall, looks good to me. I left some comments and suggestion.
| } | ||
|
|
||
| fn crng_seed_from_prk_and_rdrand(prk: &[u8; PRK_LEN], rdrand_seed: CrngSeed) -> CrngSeed { | ||
| fn crng_seed_from_tpm_and_rdrand(seed: &[u8], rdrand_seed: CrngSeed) -> CrngSeed { |
There was a problem hiding this comment.
tpm -> rot/hrot?
It'd be better to use &[u8; CRNG_SEED_LEN].
| } | ||
| VsmFunction::ExchangeSecrets => vtl1 | ||
| .set_platform_root_key(params[0]) | ||
| .and_then(|()| vtl1.set_crng_seed(params[0] + PRK_LEN as u64)) |
There was a problem hiding this comment.
nits: let's use checked_add to catch integer overflow.
|
|
||
| impl LvbsCrng { | ||
| fn new(prk: &[u8; PRK_LEN], rdrand_seed: CrngSeed) -> Self { | ||
| fn new(seed: &[u8], rdrand_seed: CrngSeed) -> Self { |
There was a problem hiding this comment.
seed: &[u8; CRNG_SEED_LEN] would be better.
| } | ||
| VsmFunction::ExchangeSecrets => vtl1 | ||
| .set_platform_root_key(params[0]) | ||
| .and_then(|()| vtl1.set_crng_seed(params[0] + PRK_LEN as u64)) |
There was a problem hiding this comment.
This depends on the ABI, but, at least for now, separating set_platform_root_key and set_crng_seed is a bit bad for performance and atomicity (redundant page mapping/copying and potential partial failure). That is, we can copy 64 bytes at once, rather than copy two 32 bytes in order. Anyway, it depends on VTL0-side argument passing, so it's up to you.
No description provided.