Skip to content

Commit

Permalink
Improve TPM NV write debug logging (show before).
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Dec 20, 2024
1 parent 5332caf commit 3c5c512
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/tpm2_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4564,13 +4564,6 @@ static int wolfTPM2_NVWriteData(WOLFTPM2_DEV* dev, WOLFTPM2_SESSION* tpmSession,
XMEMCPY(in.write.data.buffer, &dataBuf[pos], towrite);
if (!extend) {
in.write.offset = offset+pos;
rc = TPM2_NV_Write(&in.write);
}
else {
rc = TPM2_NV_Extend(&in.extend);
}
if (rc != TPM_RC_SUCCESS) {
break;
}

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

if (!extend) {
rc = TPM2_NV_Write(&in.write);
}
else {
rc = TPM2_NV_Extend(&in.extend);
}
if (rc != TPM_RC_SUCCESS) {
break;
}

pos += towrite;
dataSz -= towrite;
}
Expand Down

0 comments on commit 3c5c512

Please sign in to comment.