From 77940073a55215be1ab4e98dc50c2c2b232bcbf3 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 3 Jul 2023 14:38:13 +0200 Subject: [PATCH] Correct spelling mistakes --- README.md | 2 +- TPMCmd/Makefile.am | 2 +- TPMCmd/Platform/src/Clock.c | 2 +- TPMCmd/Platform/src/RunCommand.c | 4 ++-- TPMCmd/flags.m4 | 2 +- TPMCmd/tpm/include/CryptRsa.h | 2 +- TPMCmd/tpm/include/GpMacros.h | 2 +- TPMCmd/tpm/src/command/Hierarchy/SetPrimaryPolicy.c | 4 ++-- TPMCmd/tpm/src/crypt/CryptEccMain.c | 4 ++-- TPMCmd/tpm/src/crypt/CryptPrime.c | 4 ++-- TPMCmd/tpm/src/crypt/CryptPrimeSieve.c | 4 ++-- TPMCmd/tpm/src/crypt/CryptUtil.c | 2 +- TPMCmd/tpm/src/support/Entity.c | 4 ++-- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 04a3689b..76263ea4 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Windows build is implemented as a Visual Studio 2017 solution. Before building i 1. Create `TPMCmd/lib` folder and place a static OpenSSL library (`libcrypto.lib`) built for the `x86` architecture there. For the `x64` architecture use the `TPMCmd/lib/x64` folder. - The static libs can be either static libraries proper, or import libraries accompanying the corresponding DLLs. In the latter case you'll need to ensure that ther is a matching copy of the OpenSSL DLL in the standard Windows search path, so that it is available when you run the simulator executable (e.g. copy it into the same folder where `simulator.exe` is located). + The static libs can be either static libraries proper, or import libraries accompanying the corresponding DLLs. In the latter case you'll need to ensure that there is a matching copy of the OpenSSL DLL in the standard Windows search path, so that it is available when you run the simulator executable (e.g. copy it into the same folder where `simulator.exe` is located). Recommended version of OpenSSL is `1.1.1d` or higher. diff --git a/TPMCmd/Makefile.am b/TPMCmd/Makefile.am index 1df7a5e2..daa19374 100644 --- a/TPMCmd/Makefile.am +++ b/TPMCmd/Makefile.am @@ -52,7 +52,7 @@ Platform_src_libplatform_a_SOURCES = $(PLATFORM_C) $(PLATFORM_H) Simulator_src_tpm2_simulator_CFLAGS = $(EXTRA_CFLAGS) $(PLATFORM_INC) \ $(TPM_INC) $(SIMULATOR_INC) $(LIBCRYPTO_CFLAGS) $(PTHREAD_CFLAGS) # the weird / duplicate static library is necessary for dealing with the -# circular dependency beetween libplatform and libtpm +# circular dependency between libplatform and libtpm Simulator_src_tpm2_simulator_LDADD = $(libplatform) $(libtpm) \ $(libplatform) $(LIBCRYPTO_LIBS) $(PTHREAD_LIBS) @ADDITIONAL_LIBS@ Simulator_src_tpm2_simulator_SOURCES = $(SIMULATOR_C) $(SIMULATOR_H) diff --git a/TPMCmd/Platform/src/Clock.c b/TPMCmd/Platform/src/Clock.c index 89260f10..e1a11d11 100644 --- a/TPMCmd/Platform/src/Clock.c +++ b/TPMCmd/Platform/src/Clock.c @@ -121,7 +121,7 @@ LIB_EXPORT uint64_t _plat__RealTime(void) LIB_EXPORT uint64_t _plat__TimerRead(void) { #ifdef HARDWARE_CLOCK -# error "need a defintion for reading the hardware clock" +# error "need a definition for reading the hardware clock" return HARDWARE_CLOCK #else clock64_t timeDiff; diff --git a/TPMCmd/Platform/src/RunCommand.c b/TPMCmd/Platform/src/RunCommand.c index 114421e1..5d68646e 100644 --- a/TPMCmd/Platform/src/RunCommand.c +++ b/TPMCmd/Platform/src/RunCommand.c @@ -42,7 +42,7 @@ // code will have set the flag to indicate that the TPM is in failure mode. // This call will then recursively call ExecuteCommand in order to build the // failure mode response. When ExecuteCommand() returns to _plat__Fail(), the -// platform will do some platform specif operation to return to the environment in +// platform will do some platform specific operation to return to the environment in // which the TPM is executing. For a simulator, setjmp/longjmp is used. For an OS, // a system exit to the OS would be appropriate. @@ -78,4 +78,4 @@ LIB_EXPORT void _plat__RunCommand( LIB_EXPORT NORETURN void _plat__Fail(void) { longjmp(&s_jumpBuffer[0], 1); -} \ No newline at end of file +} diff --git a/TPMCmd/flags.m4 b/TPMCmd/flags.m4 index 286c10bf..7fcaf3fa 100644 --- a/TPMCmd/flags.m4 +++ b/TPMCmd/flags.m4 @@ -53,7 +53,7 @@ dnl macro will check to be sure the preprocessor supports the flag. dnl The flag can be made mandatory by provideing the string 'required' as dnl the second parameter. dnl $1: Preprocessor flag to add to EXTRA_CFLAGS. -dnl $2: Set to "required" t ocause configure failure if preprocesor flag +dnl $2: Set to "required" to cause configure failure if preprocessor flag dnl is not supported. AC_DEFUN([ADD_PREPROC_FLAG],[ AX_CHECK_PREPROC_FLAG([$1],[ diff --git a/TPMCmd/tpm/include/CryptRsa.h b/TPMCmd/tpm/include/CryptRsa.h index 3cdb5fd2..a21b1676 100644 --- a/TPMCmd/tpm/include/CryptRsa.h +++ b/TPMCmd/tpm/include/CryptRsa.h @@ -49,7 +49,7 @@ BN_TYPE(prime, (MAX_RSA_KEY_BITS / 2)); BN_INITIALIZED(name, MAX_RSA_KEY_BITS / 2, initializer) #if !CRT_FORMAT_RSA -# error This verson only works with CRT formatted data +# error This version only works with CRT formatted data #endif // !CRT_FORMAT_RSA typedef struct privateExponent diff --git a/TPMCmd/tpm/include/GpMacros.h b/TPMCmd/tpm/include/GpMacros.h index 72ccac1e..e1ba9238 100644 --- a/TPMCmd/tpm/include/GpMacros.h +++ b/TPMCmd/tpm/include/GpMacros.h @@ -386,7 +386,7 @@ #endif // This macro will create an OID. All OIDs are in DER form with a first octet of -// 0x06 indicating an OID fallowed by an octet indicating the number of octets in the +// 0x06 indicating an OID followed by an octet indicating the number of octets in the // rest of the OID. This allows a user of this OID to know how much/little to copy. #define MAKE_OID(NAME) EXTERN const BYTE OID##NAME[] INITIALIZER({OID##NAME##_VALUE}) diff --git a/TPMCmd/tpm/src/command/Hierarchy/SetPrimaryPolicy.c b/TPMCmd/tpm/src/command/Hierarchy/SetPrimaryPolicy.c index e75275dc..a7c80ab3 100644 --- a/TPMCmd/tpm/src/command/Hierarchy/SetPrimaryPolicy.c +++ b/TPMCmd/tpm/src/command/Hierarchy/SetPrimaryPolicy.c @@ -55,7 +55,7 @@ TPM2_SetPrimaryPolicy(SetPrimaryPolicy_In* in // IN: input parameter list return TPM_RCS_SIZE + RC_SetPrimaryPolicy_authPolicy; // The command need NV update for OWNER and ENDORSEMENT hierarchy, and - // might need orderlyState update for PLATFROM hierarchy. + // might need orderlyState update for PLATFORM hierarchy. // Check if NV is available. A TPM_RC_NV_UNAVAILABLE or TPM_RC_NV_RATE // error may be returned at this point RETURN_IF_NV_IS_NOT_AVAILABLE; @@ -107,4 +107,4 @@ TPM2_SetPrimaryPolicy(SetPrimaryPolicy_In* in // IN: input parameter list return TPM_RC_SUCCESS; } -#endif // CC_SetPrimaryPolicy \ No newline at end of file +#endif // CC_SetPrimaryPolicy diff --git a/TPMCmd/tpm/src/crypt/CryptEccMain.c b/TPMCmd/tpm/src/crypt/CryptEccMain.c index 57bd783b..24cb0688 100644 --- a/TPMCmd/tpm/src/crypt/CryptEccMain.c +++ b/TPMCmd/tpm/src/crypt/CryptEccMain.c @@ -39,7 +39,7 @@ // This version requires that the new format for ECC data be used # if !USE_BN_ECC_DATA -# error "Need to SET USE_BN_ECC_DATA to YES in Implementaion.h" +# error "Need to SET USE_BN_ECC_DATA to YES in Implementation.h" # endif //** Functions @@ -768,4 +768,4 @@ LIB_EXPORT TPM_RC CryptEccGenerateKey( return retVal; } -#endif // ALG_ECC \ No newline at end of file +#endif // ALG_ECC diff --git a/TPMCmd/tpm/src/crypt/CryptPrime.c b/TPMCmd/tpm/src/crypt/CryptPrime.c index 46f994a2..6ad6fae4 100644 --- a/TPMCmd/tpm/src/crypt/CryptPrime.c +++ b/TPMCmd/tpm/src/crypt/CryptPrime.c @@ -353,7 +353,7 @@ BnGeneratePrimeForRSA(bigNum prime, // IN/OUT: points to the BN that will g while(!found) { // The change below is to make sure that all keys that are generated from the same - // seed value will be the same regardless of the endianess or word size of the CPU. + // seed value will be the same regardless of the endianness or word size of the CPU. // DRBG_Generate(rand, (BYTE *)prime->d, (UINT16)BITS_TO_BYTES(bits));// old // if(g_inFailureMode) // old if(!BnGetRandomBits(prime, bits, rand)) // new @@ -364,4 +364,4 @@ BnGeneratePrimeForRSA(bigNum prime, // IN/OUT: points to the BN that will g return TPM_RC_SUCCESS; } -#endif // ALG_RSA \ No newline at end of file +#endif // ALG_RSA diff --git a/TPMCmd/tpm/src/crypt/CryptPrimeSieve.c b/TPMCmd/tpm/src/crypt/CryptPrimeSieve.c index a7d71df5..d8d65b50 100644 --- a/TPMCmd/tpm/src/crypt/CryptPrimeSieve.c +++ b/TPMCmd/tpm/src/crypt/CryptPrimeSieve.c @@ -326,7 +326,7 @@ LIB_EXPORT UINT32 PrimeSieve(bigNum bnN, // IN/OUT: number to sieve // only contains odd numbers and our stride is actually 2 * stride. If the // quoitent is even, then that means that when we add 2 * stride, we are going // to hit another even number. So, we have to know if we need to back off - // by 1 stride before we start couting by 2 * stride. + // by 1 stride before we start counting by 2 * stride. // We can tell from the remainder whether we are on an even or odd // stride when we hit the beginning of the table. If we are on an odd stride // (r & 1), we would start half a stride in (next - r)/2. If we are on an @@ -534,4 +534,4 @@ void RsaSimulationEnd(void) { return; } -#endif \ No newline at end of file +#endif diff --git a/TPMCmd/tpm/src/crypt/CryptUtil.c b/TPMCmd/tpm/src/crypt/CryptUtil.c index 52fcd0b7..9f054cbf 100644 --- a/TPMCmd/tpm/src/crypt/CryptUtil.c +++ b/TPMCmd/tpm/src/crypt/CryptUtil.c @@ -1191,7 +1191,7 @@ CryptGetSignHashAlg(TPMT_SIGNATURE* auth // IN: signature #if ALG_ECC // If ECC is defined, ECDSA is mandatory # if !ALG_ECDSA -# error "ECDSA is requried for ECC" +# error "ECDSA is required for ECC" # endif case TPM_ALG_ECDSA: // SM2 and ECSCHNORR are optional diff --git a/TPMCmd/tpm/src/support/Entity.c b/TPMCmd/tpm/src/support/Entity.c index 53144755..c24f2d7f 100644 --- a/TPMCmd/tpm/src/support/Entity.c +++ b/TPMCmd/tpm/src/support/Entity.c @@ -485,6 +485,6 @@ EntityGetHierarchy(TPMI_DH_ENTITY handle // IN :handle of entity break; } // this is unreachable but it provides a return value for the default - // case which makes the complier happy + // case which makes the compiler happy return hierarchy; -} \ No newline at end of file +}