summaryrefslogtreecommitdiff
path: root/drivers/tpm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-18 14:18:01 -0600
committerSimon Glass <sjg@chromium.org>2021-08-01 09:05:24 -0600
commit46aed06cb7bbdc0e01c6c43a5d446d12e75e62b4 (patch)
tree4960eb4d862f696121a833f0e160e8aad78f0826 /drivers/tpm
parent7f350a959c1a9562b1b84d145e1084e90fa86353 (diff)
sandbox: tpm: Finish comments for struct sandbox_tpm2
Tidy up the missing comments for this struct. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/tpm')
-rw-r--r--drivers/tpm/tpm2_tis_sandbox.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c
index 24c804a564..5e0bd30469 100644
--- a/drivers/tpm/tpm2_tis_sandbox.c
+++ b/drivers/tpm/tpm2_tis_sandbox.c
@@ -45,19 +45,31 @@ static const u8 sandbox_extended_once_pcr[] = {
0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b,
};
+/*
+ * Information about our TPM emulation. This is preserved in the sandbox
+ * state file if enabled.
+ *
+ * @init_done: true if open() has been called
+ * @startup_done: true if TPM2_CC_STARTUP has been processed
+ * @tests_done: true if TPM2_CC_SELF_TEST has be processed
+ * @pw: TPM password per hierarchy
+ * @pw_sz: Size of each password in bytes
+ * @properties: TPM properties
+ * @pcr: TPM Platform Configuration Registers. Each of these holds a hash and
+ * can be 'extended' a number of times, meaning another hash is added into
+ * its value (initial value all zeroes)
+ * @pcr_extensions: Number of times each PCR has been extended (starts at 0)
+ * @nvdata: non-volatile data, used to store important things for the platform
+ */
struct sandbox_tpm2 {
/* TPM internal states */
bool init_done;
bool startup_done;
bool tests_done;
- /* TPM password per hierarchy */
char pw[TPM2_HIERARCHY_NB][TPM2_DIGEST_LEN + 1];
int pw_sz[TPM2_HIERARCHY_NB];
- /* TPM properties */
u32 properties[TPM2_PROPERTY_NB];
- /* TPM PCRs */
u8 pcr[SANDBOX_TPM_PCR_NB][TPM2_DIGEST_LEN];
- /* TPM PCR extensions */
u32 pcr_extensions[SANDBOX_TPM_PCR_NB];
};