From 9c2ada8a7a699f6acbe28cde74c4dc1bb7b8b1c3 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 6 May 2025 16:41:34 -0700 Subject: [PATCH] Fixes for spelling and debug. --- examples/wrap/caps.c | 2 +- examples/wrap/wrap_test.c | 2 +- src/tpm2_linux.c | 2 +- src/tpm2_wrap.c | 2 +- wolftpm/tpm2_wrap.h | 8 +++++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/wrap/caps.c b/examples/wrap/caps.c index cb8c4d3..7c0965a 100644 --- a/examples/wrap/caps.c +++ b/examples/wrap/caps.c @@ -130,7 +130,7 @@ int TPM2_Wrapper_CapsArgs(void* userCtx, int argc, char *argv[]) TPM2_PCRs_Print(); exit: - /* Only doShutdown=1: Just shut down the TPM */ + /* Only doShutdown=1: Just shutdown the TPM */ wolfTPM2_Reset(&dev, 1, 0); wolfTPM2_Cleanup(&dev); diff --git a/examples/wrap/wrap_test.c b/examples/wrap/wrap_test.c index b0a694f..1d8dc29 100644 --- a/examples/wrap/wrap_test.c +++ b/examples/wrap/wrap_test.c @@ -1010,7 +1010,7 @@ exit: wolfTPM2_UnloadHandle(&dev, &ekKey.handle); wolfTPM2_UnloadHandle(&dev, &tpmSession.handle); - /* Only doShutdown=1: Just shut down the TPM */ + /* Only doShutdown=1: Just shutdown the TPM */ wolfTPM2_Reset(&dev, 1, 0); wolfTPM2_Cleanup(&dev); diff --git a/src/tpm2_linux.c b/src/tpm2_linux.c index 668101d..fefca7d 100644 --- a/src/tpm2_linux.c +++ b/src/tpm2_linux.c @@ -34,7 +34,7 @@ #include #include -/* supresses waring for now */ +/* import u-boot function helper to get device */ extern int tcg2_platform_get_tpm2(struct udevice **dev); /* Use the U-Boot TPM device and TIS layer */ diff --git a/src/tpm2_wrap.c b/src/tpm2_wrap.c index 4f51697..598ed7d 100644 --- a/src/tpm2_wrap.c +++ b/src/tpm2_wrap.c @@ -5792,7 +5792,7 @@ int wolfTPM2_ChangeHierarchyAuth(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* session, #endif } else { printf("Error %d setting %s auth! %s\n", - rc, wolfTPM2_GetRCString(rc), desc); + rc, desc, wolfTPM2_GetRCString(rc)); } #endif /* ensure the random secret is not left in stack */ diff --git a/wolftpm/tpm2_wrap.h b/wolftpm/tpm2_wrap.h index 9d0641a..e303bde 100644 --- a/wolftpm/tpm2_wrap.h +++ b/wolftpm/tpm2_wrap.h @@ -2607,6 +2607,7 @@ WOLFTPM_API int wolfTPM2_SetCommand(WOLFTPM2_DEV* dev, TPM_CC commandCode, \param doShutdown integer value, non-zero values represent "perform Shutdown" \sa wolfTPM2_Init + \sa wolfTPM2_Reset */ WOLFTPM_API int wolfTPM2_Reset(WOLFTPM2_DEV* dev, int doShutdown, int doStartup); @@ -2623,6 +2624,7 @@ WOLFTPM_API int wolfTPM2_Reset(WOLFTPM2_DEV* dev, int doShutdown, int doStartup) \param doStartup integer value, non-zero values represent "perform Startup after Shutdown" \sa wolfTPM2_Init + \sa wolfTPM2_Shutdown */ WOLFTPM_API int wolfTPM2_Shutdown(WOLFTPM2_DEV* dev, int doStartup); @@ -3282,7 +3284,7 @@ WOLFTPM_API int wolfTPM2_CSR_Generate(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* key, /*! \ingroup wolfTPM2_Wrappers - \brief Helper to set the platform heirarchy authentication value to random. + \brief Helper to set the platform hierarchy authentication value to random. Setting the platform auth to random value is used to prevent application from being able to use platform hierarchy. This is defined in section 10 of the TCG PC Client Platform specification. @@ -3301,7 +3303,7 @@ WOLFTPM_API int wolfTPM2_ChangePlatformAuth(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* /*! \ingroup wolfTPM2_Wrappers - \brief Helper to set the heirarchy authentication value to random. + \brief Helper to set the hierarchy authentication value to random. Setting the platform auth to random value is used to prevent application from being able to use platform hierarchy. This is defined in section 10 of the TCG PC Client Platform specification. @@ -3312,7 +3314,7 @@ WOLFTPM_API int wolfTPM2_ChangePlatformAuth(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* \param dev pointer to a TPM2_DEV struct \param session the current session, a session is required to protect the new platform auth - \param authHandle the auth heirarchy (example: TPM_RH_PLATFORM or TPM_RH_LOCKOUT) + \param authHandle the auth hierarchy (example: TPM_RH_PLATFORM or TPM_RH_LOCKOUT) \sa TPM2_HierarchyChangeAuth \sa wolfTPM2_ChangePlatformAuth