aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Marochko <Andrey.Marochko@microsoft.com>2020-10-16 16:02:27 -0700
committerAndrey Marochko <Andrey.Marochko@microsoft.com>2020-10-16 16:02:27 -0700
commit411239d6a4b3649fc63d4b14f3ce2c95c27e19d8 (patch)
tree2b30af25d1c618a358287a53bdc29993ec481640
parentbcad02cd78039e81778d4844b109048caa944331 (diff)
parentb94f9f92c579b723a16be72a69efbbf9c35ce44e (diff)
downloadms-tpm-20-ref-411239d6a4b3649fc63d4b14f3ce2c95c27e19d8.tar.gz
Merge branch 'master' of https://github.com/Microsoft/ms-tpm-20-ref
-rw-r--r--TPMCmd/tpm/src/command/Attestation/CertifyX509.c6
-rw-r--r--TPMCmd/tpm/src/crypt/AlgorithmTests.c2
-rw-r--r--TPMCmd/tpm/src/crypt/CryptRsa.c2
-rw-r--r--TPMCmd/tpm/src/main/ExecCommand.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/TPMCmd/tpm/src/command/Attestation/CertifyX509.c b/TPMCmd/tpm/src/command/Attestation/CertifyX509.c
index 0f19289..8ed5602 100644
--- a/TPMCmd/tpm/src/command/Attestation/CertifyX509.c
+++ b/TPMCmd/tpm/src/command/Attestation/CertifyX509.c
@@ -77,9 +77,9 @@ TPM2_CertifyX509(
// certTBS holds an array of pointers and lengths. Each entry references the
// corresponding value in a TBSCertificate structure. For example, the 1th
// element references the version number
- stringRef certTBS[REF_COUNT] = {{0}};
+ stringRef certTBS[REF_COUNT] = {0};
#define ALLOWED_SEQUENCES (SUBJECT_PUBLIC_KEY_REF - SIGNATURE_REF)
- stringRef partial[ALLOWED_SEQUENCES] = {{0}};
+ stringRef partial[ALLOWED_SEQUENCES] = {0};
INT16 countOfSequences = 0;
INT16 i;
//
@@ -149,7 +149,7 @@ TPM2_CertifyX509(
// number of elements.
if((ctx.offset != ctx.size) || (countOfSequences < 3)
|| (countOfSequences > 4)
- || (certTBS[EXTENSIONS_REF].buf == NULL))
+ || (certTBS[EXTENSIONS_REF].buf == 0))
return TPM_RCS_VALUE + RC_CertifyX509_partialCertificate;
// Now that we know how many sequences there were, we can put them where they
// belong
diff --git a/TPMCmd/tpm/src/crypt/AlgorithmTests.c b/TPMCmd/tpm/src/crypt/AlgorithmTests.c
index 652cbb6..7120f0e 100644
--- a/TPMCmd/tpm/src/crypt/AlgorithmTests.c
+++ b/TPMCmd/tpm/src/crypt/AlgorithmTests.c
@@ -104,7 +104,7 @@ TestHash(
FOR_EACH_HASH(HASH_CASE_FOR_TEST)
default:
- FAIL(FATAL_ERROR_INTERNAL);
+ FAIL(FATAL_ERROR_INTERNAL);
}
// Clear the to-test bits
CLEAR_BOTH(hashAlg);
diff --git a/TPMCmd/tpm/src/crypt/CryptRsa.c b/TPMCmd/tpm/src/crypt/CryptRsa.c
index b42322f..1d8b1e9 100644
--- a/TPMCmd/tpm/src/crypt/CryptRsa.c
+++ b/TPMCmd/tpm/src/crypt/CryptRsa.c
@@ -563,7 +563,7 @@ RSAES_Decode(
// Make sure that pSize has not gone over the end and that there are at least 8
// bytes of pad data.
fail = (pSize > coded->size) | fail;
- fail = ((pSize - 2) < 8) | fail;
+ fail = ((pSize - 2) <= 8) | fail;
if((message->size < (UINT16)(coded->size - pSize)) || fail)
return TPM_RC_VALUE;
message->size = coded->size - pSize;
diff --git a/TPMCmd/tpm/src/main/ExecCommand.c b/TPMCmd/tpm/src/main/ExecCommand.c
index d7673c5..7e70632 100644
--- a/TPMCmd/tpm/src/main/ExecCommand.c
+++ b/TPMCmd/tpm/src/main/ExecCommand.c
@@ -62,7 +62,7 @@
// 3) marshal the responses into the response buffer.
// f) If any error occurs in any of the steps above create the error response
// and return.
-// g) Calls BuildResponseSessions() to:
+// g) Calls BuildResponseSession() to:
// 1) when necessary, encrypt a parameter
// 2) build the response authorization sessions
// 3) update the audit sessions and nonces