Skip to content

Commit 409ec70

Browse files
dgarskedanielinux
authored andcommitted
Improve TPM NV write debug logging (show before).
1 parent 6de582c commit 409ec70

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/tpm2_wrap.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4564,13 +4564,6 @@ static int wolfTPM2_NVWriteData(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* tpmSession,
45644564
XMEMCPY(in.write.data.buffer, &dataBuf[pos], towrite);
45654565
if (!extend) {
45664566
in.write.offset = offset+pos;
4567-
rc = TPM2_NV_Write(&in.write);
4568-
}
4569-
else {
4570-
rc = TPM2_NV_Extend(&in.extend);
4571-
}
4572-
if (rc != TPM_RC_SUCCESS) {
4573-
break;
45744567
}
45754568

45764569
#ifdef DEBUG_WOLFTPM
@@ -4580,6 +4573,16 @@ static int wolfTPM2_NVWriteData(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* tpmSession,
45804573
in.write.offset, in.write.data.size, extend);
45814574
#endif
45824575

4576+
if (!extend) {
4577+
rc = TPM2_NV_Write(&in.write);
4578+
}
4579+
else {
4580+
rc = TPM2_NV_Extend(&in.extend);
4581+
}
4582+
if (rc != TPM_RC_SUCCESS) {
4583+
break;
4584+
}
4585+
45834586
pos += towrite;
45844587
dataSz -= towrite;
45854588
}

0 commit comments

Comments
 (0)