Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: host/lib/crossystem.c

Issue 6685075: Add TPM version checking (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/linktest/main.c ('k') | utility/crossystem_main.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: host/lib/crossystem.c
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 6ba67e6460800ea0e84f30ae4a56a05e7664f91a..ca61f74fcf34ac41b01bbee5ea37b843f1dfda3c 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;
« no previous file with comments | « firmware/linktest/main.c ('k') | utility/crossystem_main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698