[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/14] tpm2: adjust the input parameters of TPM2_EvictControl
From: |
Gary Lin |
Subject: |
[PATCH 08/14] tpm2: adjust the input parameters of TPM2_EvictControl |
Date: |
Wed, 22 Feb 2023 15:00:48 +0800 |
Per "TCG TPM2 Part3 Commands", 'persistentHandle' of TPM2_EvictControl
is in the parameter area, i.e. after the authorization command. Adjust
the order of the arguments to match the spec definition.
Signed-off-by: Gary Lin <glin@suse.com>
---
grub-core/tpm2/tpm2.c | 2 +-
include/grub/tpm2/internal/functions.h | 2 +-
util/grub-protect.c | 8 ++++----
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/grub-core/tpm2/tpm2.c b/grub-core/tpm2/tpm2.c
index 7baa4c6e5..85bd4ef23 100644
--- a/grub-core/tpm2/tpm2.c
+++ b/grub-core/tpm2/tpm2.c
@@ -662,8 +662,8 @@ TPM2_Create (TPMI_DH_OBJECT parentHandle,
TPM_RC
TPM2_EvictControl (TPMI_RH_PROVISION auth,
TPMI_DH_OBJECT objectHandle,
- TPMI_DH_PERSISTENT persistentHandle,
const TPMS_AUTH_COMMAND *authCommand,
+ TPMI_DH_PERSISTENT persistentHandle,
TPMS_AUTH_RESPONSE *authResponse)
{
struct grub_tpm2_buffer in;
diff --git a/include/grub/tpm2/internal/functions.h
b/include/grub/tpm2/internal/functions.h
index 9d5823975..f88ea2dfe 100644
--- a/include/grub/tpm2/internal/functions.h
+++ b/include/grub/tpm2/internal/functions.h
@@ -110,8 +110,8 @@ TPM2_Create (TPMI_DH_OBJECT parentHandle,
TPM_RC
TPM2_EvictControl (TPMI_RH_PROVISION auth,
TPMI_DH_OBJECT objectHandle,
- TPMI_DH_PERSISTENT persistentHandle,
const TPMS_AUTH_COMMAND *authCommand,
+ TPMI_DH_PERSISTENT persistentHandle,
TPMS_AUTH_RESPONSE *authResponse);
#endif /* ! GRUB_TPM2_INTERNAL_FUNCTIONS_HEADER */
diff --git a/util/grub-protect.c b/util/grub-protect.c
index acd30642f..f0f27af0a 100644
--- a/util/grub-protect.c
+++ b/util/grub-protect.c
@@ -695,8 +695,8 @@ grub_protect_tpm2_get_srk (struct grub_protect_args *args,
TPM_HANDLE *srk)
/* Persist SRK */
if (args->tpm2_persist)
{
- rc = TPM2_EvictControl (TPM_RH_OWNER, srkHandle, args->tpm2_srk,
- &authCommand, NULL);
+ rc = TPM2_EvictControl (TPM_RH_OWNER, srkHandle, &authCommand,
+ args->tpm2_srk, NULL);
if (rc == TPM_RC_SUCCESS)
{
TPM2_FlushContext (srkHandle);
@@ -877,8 +877,8 @@ grub_protect_tpm2_remove (struct grub_protect_args *args)
/* Evict SRK */
authCommand.sessionHandle = TPM_RS_PW;
- rc = TPM2_EvictControl (TPM_RH_OWNER, args->tpm2_srk, args->tpm2_srk,
- &authCommand, NULL);
+ rc = TPM2_EvictControl (TPM_RH_OWNER, args->tpm2_srk, &authCommand,
+ args->tpm2_srk, NULL);
if (rc != TPM_RC_SUCCESS)
{
fprintf (stderr,
--
2.35.3
- Re: [PATCH 03/14] protectors: Add TPM2 Key Protector, (continued)
- [PATCH 05/14] util/grub-protect: Add new tool, Gary Lin, 2023/02/22
- [PATCH 07/14] tpm2: Don't measure the sealed key, Gary Lin, 2023/02/22
- [PATCH 09/14] tpm2: declare the input arguments of TPM2 functions as const, Gary Lin, 2023/02/22
- [PATCH 13/14] tpm2: allow some command parameters to be NULL, Gary Lin, 2023/02/22
- [PATCH 14/14] tpm2: remove the unnecessary variables, Gary Lin, 2023/02/22
- [PATCH 04/14] cryptodisk: Support key protectors, Gary Lin, 2023/02/22
- [PATCH 06/14] crytodisk: fix cryptodisk module looking up, Gary Lin, 2023/02/22
- [PATCH 08/14] tpm2: adjust the input parameters of TPM2_EvictControl,
Gary Lin <=
- [PATCH 11/14] tpm2: check the command parameters of TPM2 commands, Gary Lin, 2023/02/22
- [PATCH 10/14] tpm2: resend the command on TPM_RC_RETRY, Gary Lin, 2023/02/22
- [PATCH 12/14] tpm2: pack the missing authorization command for TPM2_PCR_Read, Gary Lin, 2023/02/22
- Re: [PATCH 00/14] Automatic Disk Unlock with TPM2, Daniel Kiper, 2023/02/28