Skip to content

Commit 664db13

Browse files
authored
Merge pull request #469 from padelsbach/padelsbach/finding-tpm2-wrap
Address findings in tpm2_wrap.c
2 parents 343c195 + 383bdb4 commit 664db13

5 files changed

Lines changed: 260 additions & 134 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ pkcs7tpmsignedex.p7s
6060
examples/tls/tls_server
6161
examples/tls/tls_client_notpm
6262
tests/unit.test
63+
tests/unit.log
64+
unit.trs
6365
examples/keygen/create_primary
6466
examples/keygen/keyload
6567
examples/keygen/keygen

examples/wrap/wrap_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
989989
/* PCR TESTS */
990990
/*------------------------------------------------------------------------*/
991991
/* Read PCR Index 0 */
992-
hashSz = 0;
992+
hashSz = sizeof(hashBuf);
993993
rc = wolfTPM2_ReadPCR(&dev, 0, TEST_WRAP_DIGEST, hashBuf, &hashSz);
994994
if (rc != 0) goto exit;
995995

@@ -1001,6 +1001,7 @@ int TPM2_Wrapper_TestArgs(void* userCtx, int argc, char *argv[])
10011001
if (rc != 0 && !WOLFTPM_IS_COMMAND_UNAVAILABLE(rc)) goto exit;
10021002

10031003
/* Read PCR Index 0 */
1004+
hashSz = sizeof(hashBuf);
10041005
rc = wolfTPM2_ReadPCR(&dev, 0, TEST_WRAP_DIGEST, hashBuf, &hashSz);
10051006
if (rc != 0) goto exit;
10061007
printf("PCR Test pass\n");

0 commit comments

Comments
 (0)