diff options
author | Jon Murphy <jpmurphy@google.com> | 2023-09-05 11:36:43 -0600 |
---|---|---|
committer | Raul Rangel <rrangel@chromium.org> | 2023-09-28 16:54:37 +0000 |
commit | d7b8dc9cf5978809912dcffefce2eda5937c9653 (patch) | |
tree | 56befbc9563ce2baca6f31ccbfb041e99fb858d6 /src/security/vboot/antirollback.h | |
parent | 53fc667943052bd592b8406bdf4bf652c6c9cd3a (diff) |
treewide: convert to tpm_result_t
Convert TPM functions to return TPM error codes(referred to as
tpm_result_t) values to match the TCG standard.
BUG=b:296439237
TEST=build and boot to Skyrim
BRANCH=None
Change-Id: Ifdf9ff6c2a1f9b938dbb04d245799391115eb6b1
Signed-off-by: Jon Murphy <jpmurphy@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77666
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/security/vboot/antirollback.h')
-rw-r--r-- | src/security/vboot/antirollback.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/security/vboot/antirollback.h b/src/security/vboot/antirollback.h index ab7c43aac9..c0f77c9fa7 100644 --- a/src/security/vboot/antirollback.h +++ b/src/security/vboot/antirollback.h @@ -10,6 +10,7 @@ #include <types.h> #include <security/tpm/tspi.h> +#include <security/tpm/tss_errors.h> #include <vb2_sha.h> struct vb2_context; @@ -52,23 +53,23 @@ enum vb2_pcr_digest; /* All functions return TPM_SUCCESS (zero) if successful, non-zero if error */ -uint32_t antirollback_read_space_firmware(struct vb2_context *ctx); +tpm_result_t antirollback_read_space_firmware(struct vb2_context *ctx); /** * Write may be called if the versions change. */ -uint32_t antirollback_write_space_firmware(struct vb2_context *ctx); +tpm_result_t antirollback_write_space_firmware(struct vb2_context *ctx); /** * Read and write kernel space in TPM. */ -uint32_t antirollback_read_space_kernel(struct vb2_context *ctx); -uint32_t antirollback_write_space_kernel(struct vb2_context *ctx); +tpm_result_t antirollback_read_space_kernel(struct vb2_context *ctx); +tpm_result_t antirollback_write_space_kernel(struct vb2_context *ctx); /** * Lock must be called. */ -uint32_t antirollback_lock_space_firmware(void); +tpm_result_t antirollback_lock_space_firmware(void); /* * Read MRC hash data from TPM. @@ -79,7 +80,7 @@ uint32_t antirollback_lock_space_firmware(void); * @param data pointer to buffer where hash from TPM read into * @param size size of buffer */ -uint32_t antirollback_read_space_mrc_hash(uint32_t index, uint8_t *data, uint32_t size); +tpm_result_t antirollback_read_space_mrc_hash(uint32_t index, uint8_t *data, uint32_t size); /* * Write new hash data to MRC space in TPM.\ * @param index index into TPM NVRAM where hash is stored The index @@ -89,7 +90,7 @@ uint32_t antirollback_read_space_mrc_hash(uint32_t index, uint8_t *data, uint32_ * @param data pointer to buffer of hash value to be written * @param size size of buffer */ -uint32_t antirollback_write_space_mrc_hash(uint32_t index, const uint8_t *data, +tpm_result_t antirollback_write_space_mrc_hash(uint32_t index, const uint8_t *data, uint32_t size); /* * Lock down MRC hash space in TPM. @@ -98,19 +99,19 @@ uint32_t antirollback_write_space_mrc_hash(uint32_t index, const uint8_t *data, * MRC_RW_HASH_NV_INDEX depending upon whether we are * booting in recovery or normal mode. */ -uint32_t antirollback_lock_space_mrc_hash(uint32_t index); +tpm_result_t antirollback_lock_space_mrc_hash(uint32_t index); /* * Read VBIOS hash data from TPM. * @param data pointer to buffer where hash from TPM read into * @param size size of buffer */ -uint32_t antirollback_read_space_vbios_hash(uint8_t *data, uint32_t size); +tpm_result_t antirollback_read_space_vbios_hash(uint8_t *data, uint32_t size); /* * Write new hash data to VBIOS space in TPM. * @param data pointer to buffer of hash value to be written * @param size size of buffer */ -uint32_t antirollback_write_space_vbios_hash(const uint8_t *data, uint32_t size); +tpm_result_t antirollback_write_space_vbios_hash(const uint8_t *data, uint32_t size); #endif /* ANTIROLLBACK_H_ */ |