From 0337d45f15098f0ee2c8d692e091156b78cdafd5 Mon Sep 17 00:00:00 2001 From: Juergen Repp Date: Tue, 30 Jan 2024 18:06:02 +0100 Subject: [PATCH] ESYS: Remove dead code from change auth functions. The check whether the esys object exists was not needed in the sys prepare call. Signed-off-by: Juergen Repp --- src/tss2-esys/api/Esys_NV_ChangeAuth.c | 3 +-- src/tss2-esys/api/Esys_ObjectChangeAuth.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/tss2-esys/api/Esys_NV_ChangeAuth.c b/src/tss2-esys/api/Esys_NV_ChangeAuth.c index 6cde980d1..9ffae2472 100644 --- a/src/tss2-esys/api/Esys_NV_ChangeAuth.c +++ b/src/tss2-esys/api/Esys_NV_ChangeAuth.c @@ -194,8 +194,7 @@ Esys_NV_ChangeAuth_Async( /* Initial invocation of SAPI to prepare the command buffer with parameters */ r = Tss2_Sys_NV_ChangeAuth_Prepare(esysContext->sys, - (nvIndexNode == NULL) ? TPM2_RH_NULL - : nvIndexNode->rsrc.handle, newAuth); + nvIndexNode->rsrc.handle, newAuth); return_state_if_error(r, _ESYS_STATE_INIT, "SAPI Prepare returned error."); /* Calculate the cpHash Values */ diff --git a/src/tss2-esys/api/Esys_ObjectChangeAuth.c b/src/tss2-esys/api/Esys_ObjectChangeAuth.c index 8408a06b2..c75ea8f14 100644 --- a/src/tss2-esys/api/Esys_ObjectChangeAuth.c +++ b/src/tss2-esys/api/Esys_ObjectChangeAuth.c @@ -194,9 +194,7 @@ Esys_ObjectChangeAuth_Async( /* Initial invocation of SAPI to prepare the command buffer with parameters */ r = Tss2_Sys_ObjectChangeAuth_Prepare(esysContext->sys, - (objectHandleNode == NULL) - ? TPM2_RH_NULL - : objectHandleNode->rsrc.handle, + objectHandleNode->rsrc.handle, (parentHandleNode == NULL) ? TPM2_RH_NULL : parentHandleNode->rsrc.handle,