Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct spelling mistakes #94

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

2 changes: 1 addition & 1 deletion TPMCmd/Makefile.am
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion TPMCmd/Platform/src/Clock.c
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions TPMCmd/Platform/src/RunCommand.c
Original file line number Diff line number Diff line change
@@ -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);
}
}
2 changes: 1 addition & 1 deletion TPMCmd/flags.m4
Original file line number Diff line number Diff line change
@@ -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],[
2 changes: 1 addition & 1 deletion TPMCmd/tpm/include/CryptRsa.h
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion TPMCmd/tpm/include/GpMacros.h
Original file line number Diff line number Diff line change
@@ -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})

4 changes: 2 additions & 2 deletions TPMCmd/tpm/src/command/Hierarchy/SetPrimaryPolicy.c
Original file line number Diff line number Diff line change
@@ -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
#endif // CC_SetPrimaryPolicy
4 changes: 2 additions & 2 deletions TPMCmd/tpm/src/crypt/CryptEccMain.c
Original file line number Diff line number Diff line change
@@ -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
#endif // ALG_ECC
4 changes: 2 additions & 2 deletions TPMCmd/tpm/src/crypt/CryptPrime.c
Original file line number Diff line number Diff line change
@@ -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
#endif // ALG_RSA
4 changes: 2 additions & 2 deletions TPMCmd/tpm/src/crypt/CryptPrimeSieve.c
Original file line number Diff line number Diff line change
@@ -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
#endif
2 changes: 1 addition & 1 deletion TPMCmd/tpm/src/crypt/CryptUtil.c
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions TPMCmd/tpm/src/support/Entity.c
Original file line number Diff line number Diff line change
@@ -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;
}
}