summaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2011-03-17 17:58:56 -0700
committerRandall Spangler <rspangler@chromium.org>2011-03-17 17:58:56 -0700
commit5ac39bfff0d9e2ad2c3e1fe9b3fd3f314b50a472 (patch)
treeb92352d8dfb4e721ec9127efdb142e77c182187b /host
parentf4ba19d81d4fefa0dba4efbdd57dc863138fde3a (diff)
downloadvboot-5ac39bfff0d9e2ad2c3e1fe9b3fd3f314b50a472.tar.gz
Add TPM version checking
Change-Id: Ic32b7bcf0bc5501e21dc84e79419a256d9b0d095 R=semenzato@chromium.org,reinauer@chromium.org BUG=chrome-os-partner:2832 TEST=manual crossystem tpm_fwver tpm_kernver On a debug system, this will return 0x00010001 0x00010001 Review URL: http://codereview.chromium.org/6685075
Diffstat (limited to 'host')
-rw-r--r--host/lib/crossystem.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 6ba67e64..ca61f74f 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -101,7 +101,9 @@ typedef enum VdatStringField {
/* Fields that GetVdatInt() can get */
typedef enum VdatIntField {
- VDAT_INT_FLAGS = 0 /* Flags */
+ VDAT_INT_FLAGS = 0, /* Flags */
+ VDAT_INT_FW_VERSION_TPM, /* Current firmware version in TPM */
+ VDAT_INT_KERNEL_VERSION_TPM /* Current kernel version in TPM */
} VdatIntField;
@@ -670,7 +672,12 @@ int GetVdatInt(VdatIntField field) {
case VDAT_INT_FLAGS:
value = (int)sh->flags;
break;
-
+ case VDAT_INT_FW_VERSION_TPM:
+ value = (int)sh->fw_version_tpm;
+ break;
+ case VDAT_INT_KERNEL_VERSION_TPM:
+ value = (int)sh->kernel_version_tpm;
+ break;
}
Free(ab);
@@ -747,6 +754,10 @@ int VbGetSystemPropertyInt(const char* name) {
value = VbGetCrosDebug();
} else if (!strcasecmp(name,"vdat_flags")) {
value = GetVdatInt(VDAT_INT_FLAGS);
+ } else if (!strcasecmp(name,"tpm_fwver")) {
+ value = GetVdatInt(VDAT_INT_FW_VERSION_TPM);
+ } else if (!strcasecmp(name,"tpm_kernver")) {
+ value = GetVdatInt(VDAT_INT_KERNEL_VERSION_TPM);
}
return value;