diff options
author | Vadim Sukhomlinov <sukhomlinov@google.com> | 2023-04-28 09:37:20 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-04-28 17:14:45 +0000 |
commit | 305d327c25490bb51a39580126ac2ff500519f76 (patch) | |
tree | df851e86d9cc5800935ace9a79ed972cdc0d1419 | |
parent | 9dd981cb5282a17c69507b073f193cef1c46546a (diff) | |
download | chrome-ec-305d327c25490bb51a39580126ac2ff500519f76.tar.gz |
cr50: set EPS seed length in NV state upon creation
Currently EPS seed when created during endorsement is immediately stored
to flash and copied to global state of TPM. However, its length in state
is not set. It seems that it was ok as state eventually was reloaded
from NV and size updated. But if TPM receives command shortly after
boot this may not be the case.
BUG=b:278028110,b:262324344
TEST=make; TCG tests
Change-Id: Ifac259ea3817d6d139d9b5ba2af4fc66d07df4ef
Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4489113
Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Auto-Submit: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
Code-Coverage: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Commit-Queue: Andrey Pronin <apronin@chromium.org>
Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r-- | board/cr50/tpm2/endorsement.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/board/cr50/tpm2/endorsement.c b/board/cr50/tpm2/endorsement.c index 9c066e10be..20cdf24715 100644 --- a/board/cr50/tpm2/endorsement.c +++ b/board/cr50/tpm2/endorsement.c @@ -489,6 +489,7 @@ static int store_eps(const uint8_t eps[PRIMARY_SEED_SIZE]) { /* gp is a TPM global state structure, declared in Global.h. */ memcpy(gp.EPSeed.t.buffer, eps, PRIMARY_SEED_SIZE); + gp.EPSeed.t.size = PRIMARY_SEED_SIZE; /* Persist the seed to flash. */ NvWriteReserved(NV_EP_SEED, &gp.EPSeed); |