summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/cr50/tpm_nvmem_ops.c9
-rw-r--r--fuzz/nvmem_tpm2_mock.c2
-rw-r--r--test/nvmem_tpm2_mock.c2
3 files changed, 8 insertions, 5 deletions
diff --git a/board/cr50/tpm_nvmem_ops.c b/board/cr50/tpm_nvmem_ops.c
index 90bddfb313..9c29834756 100644
--- a/board/cr50/tpm_nvmem_ops.c
+++ b/board/cr50/tpm_nvmem_ops.c
@@ -21,16 +21,18 @@ enum tpm_read_rv read_tpm_nvmem(uint16_t obj_index,
{
TPM_HANDLE object_handle;
NV_INDEX nvIndex;
+ uint32_t handle_addr;
object_handle = HR_NV_INDEX + obj_index;
- if (!NvEarlyStageFindHandle(object_handle)) {
+ handle_addr = NvEarlyStageFindHandle(object_handle);
+ if (!handle_addr) {
CPRINTF("%s: object at 0x%x not found\n", __func__, obj_index);
return tpm_read_not_found;
}
/* Get properties of this index as stored in nvmem. */
- NvGetIndexInfo(object_handle, &nvIndex);
+ NvReadIndexInfo(object_handle, handle_addr, &nvIndex);
/*
* We presume it is readable and are not checking the access
@@ -49,7 +51,8 @@ enum tpm_read_rv read_tpm_nvmem(uint16_t obj_index,
}
/* Perform the read. */
- NvGetIndexData(object_handle, &nvIndex, 0, obj_size, obj_value);
+ NvReadIndexData(object_handle, &nvIndex, handle_addr, 0, obj_size,
+ obj_value);
return tpm_read_success;
}
diff --git a/fuzz/nvmem_tpm2_mock.c b/fuzz/nvmem_tpm2_mock.c
index b864953b5d..931b7dc610 100644
--- a/fuzz/nvmem_tpm2_mock.c
+++ b/fuzz/nvmem_tpm2_mock.c
@@ -40,7 +40,7 @@ const uint16_t res_sizes[] = {4, 2, 2, 2, 66, 66, 66, 66, 66, 66,
static uint16_t res_addrs[ARRAY_SIZE(res_sizes)];
-BOOL NvEarlyStageFindHandle(TPM_HANDLE handle)
+UINT32 NvEarlyStageFindHandle(TPM_HANDLE handle)
{
size_t i;
diff --git a/test/nvmem_tpm2_mock.c b/test/nvmem_tpm2_mock.c
index a6d32bcb34..00c87df3b9 100644
--- a/test/nvmem_tpm2_mock.c
+++ b/test/nvmem_tpm2_mock.c
@@ -35,7 +35,7 @@ const uint16_t res_sizes[] = {4, 2, 2, 2, 66, 66, 66, 66, 66, 66,
static uint16_t res_addrs[ARRAY_SIZE(res_sizes)];
-BOOL NvEarlyStageFindHandle(TPM_HANDLE handle)
+UINT32 NvEarlyStageFindHandle(TPM_HANDLE handle)
{
size_t i;