summaryrefslogtreecommitdiff
path: root/src/security/tpm/tspi
diff options
context:
space:
mode:
authorJon Murphy <jpmurphy@google.com>2023-09-05 10:44:09 -0600
committerFelix Held <felix-coreboot@felixheld.de>2023-09-25 14:05:36 +0000
commit056952ef14bdc542e0ebfef48aa09f126754d3aa (patch)
treea744ea3c2400ed7b65c35e7d3a5fbe02512d3933 /src/security/tpm/tspi
parent3e4f586ec07b6e5e908c66088b5765f762aa86fe (diff)
treewide: Adopt TCG standard naming
Adopt TCG standard naming and definitions for TPM Return codes. BUG=b:296439237 TEST=Build and boot to OS on skyrim BRANCH=None Change-Id: I60755723262ec205a4c134948b0250aac4974d35 Signed-off-by: Jon Murphy <jpmurphy@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77665 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/security/tpm/tspi')
-rw-r--r--src/security/tpm/tspi/tspi.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c
index 22383d4027..aee1cf4709 100644
--- a/src/security/tpm/tspi/tspi.c
+++ b/src/security/tpm/tspi/tspi.c
@@ -45,7 +45,7 @@ static uint32_t tpm1_invoke_state_machine(void)
}
deactivated = !deactivated;
- rc = TPM_E_MUST_REBOOT;
+ rc = TPM_CB_MUST_REBOOT;
}
return rc;
@@ -61,7 +61,7 @@ static uint32_t tpm_setup_s3_helper(void)
case TPM_SUCCESS:
break;
- case TPM_E_INVALID_POSTINIT:
+ case TPM_INVALID_POSTINIT:
/*
* We're on a platform where the TPM maintains power
* in S3, so it's already initialized.
@@ -151,7 +151,7 @@ uint32_t tpm_setup(int s3flag)
rc = tlcl_startup();
if (CONFIG(TPM_STARTUP_IGNORE_POSTINIT)
- && rc == TPM_E_INVALID_POSTINIT) {
+ && rc == TPM_INVALID_POSTINIT) {
printk(BIOS_DEBUG, "TPM: ignoring invalid POSTINIT\n");
rc = TPM_SUCCESS;
}
@@ -224,7 +224,7 @@ uint32_t tpm_extend_pcr(int pcr, enum vb2_hash_algorithm digest_algo,
uint32_t rc;
if (!digest)
- return TPM_E_IOERROR;
+ return TPM_IOERROR;
if (tspi_tpm_is_setup()) {
rc = tlcl_lib_init();
@@ -262,14 +262,14 @@ uint32_t tpm_measure_region(const struct region_device *rdev, uint8_t pcr,
struct vb2_digest_context ctx;
if (!rdev || !rname)
- return TPM_E_INVALID_ARG;
+ return TPM_CB_INVALID_ARG;
digest_len = vb2_digest_size(TPM_MEASURE_ALGO);
assert(digest_len <= sizeof(digest));
if (vb2_digest_init(&ctx, vboot_hwcrypto_allowed(), TPM_MEASURE_ALGO,
region_device_sz(rdev))) {
printk(BIOS_ERR, "TPM: Error initializing hash.\n");
- return TPM_E_HASH_ERROR;
+ return TPM_CB_HASH_ERROR;
}
/*
* Though one can mmap the full needed region on x86 this is not the
@@ -281,16 +281,16 @@ uint32_t tpm_measure_region(const struct region_device *rdev, uint8_t pcr,
if (rdev_readat(rdev, buf, offset, len) < 0) {
printk(BIOS_ERR, "TPM: Not able to read region %s.\n",
rname);
- return TPM_E_READ_FAILURE;
+ return TPM_CB_READ_FAILURE;
}
if (vb2_digest_extend(&ctx, buf, len)) {
printk(BIOS_ERR, "TPM: Error extending hash.\n");
- return TPM_E_HASH_ERROR;
+ return TPM_CB_HASH_ERROR;
}
}
if (vb2_digest_finalize(&ctx, digest, digest_len)) {
printk(BIOS_ERR, "TPM: Error finalizing hash.\n");
- return TPM_E_HASH_ERROR;
+ return TPM_CB_HASH_ERROR;
}
return tpm_extend_pcr(pcr, TPM_MEASURE_ALGO, digest, digest_len, rname);
}