summaryrefslogtreecommitdiff
path: root/src/security/vboot
diff options
context:
space:
mode:
authorJon Murphy <jpmurphy@google.com>2023-09-26 21:05:37 -0600
committerRaul Rangel <rrangel@chromium.org>2023-09-28 16:54:31 +0000
commit53fc667943052bd592b8406bdf4bf652c6c9cd3a (patch)
treeb5729589da0f5b77fd3898a03648bef60ab5a11a /src/security/vboot
parent901f0400b701791524301ce4ab2ba5bd028e7e2b (diff)
treewide: convert to %#x hex prints
Convert hex print values to use the %#x qualifier to print 0x{value}. BUG=b:296439237 TEST=build and boot to Skyrim BRANCH=None Change-Id: I0d1ac4b920530635fb758c5165a6a99c11b414c8 Signed-off-by: Jon Murphy <jpmurphy@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78183 Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/security/vboot')
-rw-r--r--src/security/vboot/mrc_cache_hash_tpm.c4
-rw-r--r--src/security/vboot/secdata_tpm.c16
-rw-r--r--src/security/vboot/vbios_cache_hash_tpm.c4
-rw-r--r--src/security/vboot/vboot_logic.c6
4 files changed, 15 insertions, 15 deletions
diff --git a/src/security/vboot/mrc_cache_hash_tpm.c b/src/security/vboot/mrc_cache_hash_tpm.c
index f67eae48cb..07baed7eba 100644
--- a/src/security/vboot/mrc_cache_hash_tpm.c
+++ b/src/security/vboot/mrc_cache_hash_tpm.c
@@ -41,7 +41,7 @@ void mrc_cache_update_hash(uint32_t index, const uint8_t *data, size_t size)
return;
}
- printk(BIOS_INFO, "MRC: TPM MRC hash idx 0x%x updated successfully.\n", index);
+ printk(BIOS_INFO, "MRC: TPM MRC hash idx %#x updated successfully.\n", index);
}
int mrc_cache_verify_hash(uint32_t index, const uint8_t *data, size_t size)
@@ -67,7 +67,7 @@ int mrc_cache_verify_hash(uint32_t index, const uint8_t *data, size_t size)
return 0;
}
- printk(BIOS_INFO, "MRC: Hash idx 0x%x comparison successful.\n", index);
+ printk(BIOS_INFO, "MRC: Hash idx %#x comparison successful.\n", index);
return 1;
}
diff --git a/src/security/vboot/secdata_tpm.c b/src/security/vboot/secdata_tpm.c
index fdf98cc41c..d19b47e609 100644
--- a/src/security/vboot/secdata_tpm.c
+++ b/src/security/vboot/secdata_tpm.c
@@ -436,8 +436,8 @@ uint32_t antirollback_lock_space_firmware(void)
uint32_t antirollback_read_space_mrc_hash(uint32_t index, uint8_t *data, uint32_t size)
{
if (size != HASH_NV_SIZE) {
- VBDEBUG("TPM: Incorrect buffer size for hash idx 0x%x. "
- "(Expected=0x%x Actual=0x%x).\n", index, HASH_NV_SIZE,
+ VBDEBUG("TPM: Incorrect buffer size for hash idx %#x. "
+ "(Expected=%#x Actual=%#x).\n", index, HASH_NV_SIZE,
size);
return TPM_CB_READ_FAILURE;
}
@@ -450,8 +450,8 @@ uint32_t antirollback_write_space_mrc_hash(uint32_t index, const uint8_t *data,
uint32_t rc;
if (size != HASH_NV_SIZE) {
- VBDEBUG("TPM: Incorrect buffer size for hash idx 0x%x. "
- "(Expected=0x%x Actual=0x%x).\n", index, HASH_NV_SIZE,
+ VBDEBUG("TPM: Incorrect buffer size for hash idx %#x. "
+ "(Expected=%#x Actual=%#x).\n", index, HASH_NV_SIZE,
size);
return TPM_CB_WRITE_FAILURE;
}
@@ -486,8 +486,8 @@ static uint32_t read_space_vbios_hash(uint8_t *data)
uint32_t antirollback_read_space_vbios_hash(uint8_t *data, uint32_t size)
{
if (size != HASH_NV_SIZE) {
- VBDEBUG("TPM: Incorrect buffer size for hash idx 0x%x. "
- "(Expected=0x%x Actual=0x%x).\n", VBIOS_CACHE_NV_INDEX, HASH_NV_SIZE,
+ VBDEBUG("TPM: Incorrect buffer size for hash idx %#x. "
+ "(Expected=%#x Actual=%#x).\n", VBIOS_CACHE_NV_INDEX, HASH_NV_SIZE,
size);
return TPM_CB_READ_FAILURE;
}
@@ -500,8 +500,8 @@ uint32_t antirollback_write_space_vbios_hash(const uint8_t *data, uint32_t size)
uint32_t rc;
if (size != HASH_NV_SIZE) {
- VBDEBUG("TPM: Incorrect buffer size for hash idx 0x%x. "
- "(Expected=0x%x Actual=0x%x).\n", VBIOS_CACHE_NV_INDEX, HASH_NV_SIZE,
+ VBDEBUG("TPM: Incorrect buffer size for hash idx %#x. "
+ "(Expected=%#x Actual=%#x).\n", VBIOS_CACHE_NV_INDEX, HASH_NV_SIZE,
size);
return TPM_CB_WRITE_FAILURE;
}
diff --git a/src/security/vboot/vbios_cache_hash_tpm.c b/src/security/vboot/vbios_cache_hash_tpm.c
index aa54f19e4c..6ad09ace8e 100644
--- a/src/security/vboot/vbios_cache_hash_tpm.c
+++ b/src/security/vboot/vbios_cache_hash_tpm.c
@@ -41,7 +41,7 @@ void vbios_cache_update_hash(const uint8_t *data, size_t size)
return;
}
- printk(BIOS_INFO, "VBIOS_CACHE: TPM NV idx 0x%x updated successfully.\n",
+ printk(BIOS_INFO, "VBIOS_CACHE: TPM NV idx %#x updated successfully.\n",
VBIOS_CACHE_NV_INDEX);
}
@@ -68,7 +68,7 @@ enum cb_err vbios_cache_verify_hash(const uint8_t *data, size_t size)
return CB_ERR;
}
- printk(BIOS_INFO, "VBIOS_CACHE: Hash idx 0x%x comparison successful.\n",
+ printk(BIOS_INFO, "VBIOS_CACHE: Hash idx %#x comparison successful.\n",
VBIOS_CACHE_NV_INDEX);
return CB_SUCCESS;
diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c
index 69cfaf8047..f6d8bad2e3 100644
--- a/src/security/vboot/vboot_logic.c
+++ b/src/security/vboot/vboot_logic.c
@@ -318,7 +318,7 @@ void verstage_main(void)
* For any other error code, save context if needed and reboot.
*/
if (rv == VB2_ERROR_API_PHASE1_RECOVERY) {
- printk(BIOS_INFO, "Recovery requested (%x)\n", rv);
+ printk(BIOS_INFO, "Recovery requested (%#x)\n", rv);
vboot_save_data(ctx);
extend_pcrs(ctx); /* ignore failures */
goto verstage_main_exit;
@@ -376,7 +376,7 @@ void verstage_main(void)
timestamp_add_now(TS_TPMLOCK_START);
rv = antirollback_lock_space_firmware();
if (rv) {
- printk(BIOS_INFO, "Failed to lock TPM (%x)\n", rv);
+ printk(BIOS_INFO, "Failed to lock TPM (%#x)\n", rv);
vboot_fail_and_reboot(ctx, VB2_RECOVERY_RO_TPM_L_ERROR, 0);
}
timestamp_add_now(TS_TPMLOCK_END);
@@ -385,7 +385,7 @@ void verstage_main(void)
if (CONFIG(VBOOT_HAS_REC_HASH_SPACE)) {
rv = antirollback_lock_space_mrc_hash(MRC_REC_HASH_NV_INDEX);
if (rv) {
- printk(BIOS_INFO, "Failed to lock rec hash space(%x)\n", rv);
+ printk(BIOS_INFO, "Failed to lock rec hash space(%#x)\n", rv);
vboot_fail_and_reboot(ctx, VB2_RECOVERY_RO_TPM_REC_HASH_L_ERROR, rv);
}
}