diff options
author | Andrey Pronin <apronin@chromium.org> | 2016-11-09 20:19:32 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-11 10:05:28 -0800 |
commit | 1afcfc13661b4f34a2afbeae8e740cd61ae571be (patch) | |
tree | 000d85153cfc3b1968930fc117409dd37ae13f13 /firmware/include/tpm2_tss_constants.h | |
parent | d28b4e1444372e709729787be6e81490e46c202d (diff) | |
download | vboot-1afcfc13661b4f34a2afbeae8e740cd61ae571be.tar.gz |
tpm2_lite: implement TlclGetPermissions
Implement TlclGetPermissions, which sends a TPM2_NV_ReadPublic command
and returns the attributes of the NV Index (TPM2 Spec, Part 3, Section 31.6).
BUG=chrome-os-partner:58873
BUG=chrome-os-partner:55210
BRANCH=none
TEST=Run "tpmc def" with various permissions to define new indexes,
verify that "tpmc getp" returns matching permissions for them.
Change-Id: I2ad7163332ae8793cd717875645f19baef513b26
Reviewed-on: https://chromium-review.googlesource.com/409618
Commit-Ready: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'firmware/include/tpm2_tss_constants.h')
-rw-r--r-- | firmware/include/tpm2_tss_constants.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/firmware/include/tpm2_tss_constants.h b/firmware/include/tpm2_tss_constants.h index f24c7694..454bf81a 100644 --- a/firmware/include/tpm2_tss_constants.h +++ b/firmware/include/tpm2_tss_constants.h @@ -27,6 +27,7 @@ #define TPM2_Shutdown ((TPM_CC)0x00000145) #define TPM2_NV_Read ((TPM_CC)0x0000014E) #define TPM2_NV_ReadLock ((TPM_CC)0x0000014F) +#define TPM2_NV_ReadPublic ((TPM_CC)0x00000169) #define TPM2_GetCapability ((TPM_CC)0x0000017A) /* TCG Spec defined, verify for TPM2. @@ -106,7 +107,7 @@ typedef uint32_t TPMA_NV; typedef struct { uint16_t size; uint8_t *buffer; -} TPM2B, TPM2B_DIGEST, TPM2B_AUTH; +} TPM2B, TPM2B_DIGEST, TPM2B_AUTH, TPM2B_NAME; typedef union { struct { @@ -168,6 +169,10 @@ struct tpm2_nv_write_lock_cmd { TPMI_RH_NV_INDEX nvIndex; }; +struct tpm2_nv_read_public_cmd { + TPMI_RH_NV_INDEX nvIndex; +}; + struct tpm2_hierarchy_control_cmd { TPMI_RH_ENABLES enable; TPMI_YES_NO state; @@ -230,12 +235,18 @@ struct get_capability_response { TPMS_CAPABILITY_DATA capability_data; } __attribute__((packed)); +struct nv_read_public_response { + TPMS_NV_PUBLIC nvPublic; + TPM2B_NAME nvName; +} __attribute__((packed)); + struct tpm2_response { struct tpm_header hdr; union { struct nv_read_response nvr; struct tpm2_session_header def_space; struct get_capability_response cap; + struct nv_read_public_response nv_read_public; }; }; |