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

Unified Diff: host/lib/crossystem.c

Issue 6711045: Use VbSharedData instead of VbNvStorage for fwb_tries and kernkey_vfy (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/lib/vboot_nvstorage.c ('k') | tests/vboot_nvstorage_test.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 ca61f74fcf34ac41b01bbee5ea37b843f1dfda3c..e841bad6f302c2c153ce7484c6c98050ed36288a 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -101,9 +101,12 @@ typedef enum VdatStringField {
/* Fields that GetVdatInt() can get */
typedef enum VdatIntField {
- 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 */
+ 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 */
+ VDAT_INT_TRIED_FIRMWARE_B, /* Tried firmware B due to fwb_tries */
+ VDAT_INT_KERNEL_KEY_VERIFIED /* Kernel key verified using
+ * signature, not just hash */
} VdatIntField;
@@ -678,6 +681,12 @@ int GetVdatInt(VdatIntField field) {
case VDAT_INT_KERNEL_VERSION_TPM:
value = (int)sh->kernel_version_tpm;
break;
+ case VDAT_INT_TRIED_FIRMWARE_B:
+ value = (sh->flags & VBSD_FWB_TRIED ? 1 : 0);
+ break;
+ case VDAT_INT_KERNEL_KEY_VERIFIED:
+ value = (sh->flags & VBSD_KERNEL_KEY_VERIFIED ? 1 : 0);
+ break;
}
Free(ab);
@@ -719,9 +728,7 @@ int VbGetSystemPropertyInt(const char* name) {
return (-1 == ReadFileInt(ACPI_CHSW_PATH) ? -1 : 0x00100000);
}
/* NV storage values with no defaults for older BIOS. */
- else if (!strcasecmp(name,"tried_fwb")) {
- value = VbGetNvStorage(VBNV_TRIED_FIRMWARE_B);
- } else if (!strcasecmp(name,"kern_nv")) {
+ else if (!strcasecmp(name,"kern_nv")) {
value = VbGetNvStorage(VBNV_KERNEL_FIELD);
} else if (!strcasecmp(name,"nvram_cleared")) {
value = VbGetNvStorage(VBNV_KERNEL_SETTINGS_RESET);
@@ -758,6 +765,8 @@ int VbGetSystemPropertyInt(const char* name) {
value = GetVdatInt(VDAT_INT_FW_VERSION_TPM);
} else if (!strcasecmp(name,"tpm_kernver")) {
value = GetVdatInt(VDAT_INT_KERNEL_VERSION_TPM);
+ } else if (!strcasecmp(name,"tried_fwb")) {
+ value = GetVdatInt(VDAT_INT_TRIED_FIRMWARE_B);
}
return value;
@@ -798,7 +807,7 @@ const char* VbGetSystemPropertyString(const char* name, char* dest, int size) {
return NULL;
}
} else if (!strcasecmp(name,"kernkey_vfy")) {
- switch(VbGetNvStorage(VBNV_FW_VERIFIED_KERNEL_KEY)) {
+ switch(GetVdatInt(VDAT_INT_KERNEL_KEY_VERIFIED)) {
case 0:
return "hash";
case 1:
« no previous file with comments | « firmware/lib/vboot_nvstorage.c ('k') | tests/vboot_nvstorage_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698