diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2025-08-18 18:52:58 +0300 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-08-23 03:48:06 +0300 |
commit | 8682d3ea0a5df1152c62f87326649f3d0082d9b6 (patch) | |
tree | 6d72662dff4471426522c7ac968f7114c775b0e8 | |
parent | 42ba637432221cb6da9b4053204095e3cbd306f2 (diff) | |
download | edk2-master.tar.xz |
Currently a EFI_DEVICE_ERROR is returned if `TPM_RC_HANDLE` is the
return code from a TPM2_NV_ReadPublic command. However, in the TCG
TPM Library Part 3: Commands specification, `TPM_RC_HANDLE` is a
return code if:
1. An Index does not exist that corresponds to the handle
(TPM_RC_HANDLE)
2. The hierarchy associated with the existing NV Index is not
enabled (TPM_RC_HANDLE)
Therefore, return EFI_NOT_FOUND in this case, since that more
precisely allows a caller to identify this condition and act on
it as opposed to a more generic device error.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
-rw-r--r-- | SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c index f11f7696b1..7ca892735b 100644 --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2NVStorage.c @@ -229,6 +229,7 @@ Tpm2NvReadPublic ( case TPM_RC_SUCCESS:
// return data
break;
+ case TPM_RC_HANDLE:
case TPM_RC_HANDLE + RC_NV_ReadPublic_nvIndex: // TPM_RC_NV_DEFINED:
return EFI_NOT_FOUND;
case TPM_RC_VALUE + RC_NV_ReadPublic_nvIndex:
|