-
Notifications
You must be signed in to change notification settings - Fork 61
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
TPM command authentication refactor #305
Conversation
src/tpm2.c
Outdated
@@ -2754,14 +2697,15 @@ TPM_RC TPM2_GetCommandAuditDigest(GetCommandAuditDigest_In* in, | |||
TPM2_Packet packet; | |||
CmdInfo_t info = {0,0,0,0}; | |||
info.inHandleCnt = 2; | |||
info.flags = (CMD_FLAG_ENC2 | CMD_FLAG_DEC2); | |||
info.flags = (CMD_FLAG_ENC2 | CMD_FLAG_DEC2 | | |||
CMD_FLAG_AUTH_USER1 | CMD_FLAG_AUTH_USER1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate or here
for (i=0; i<info->authCnt; i++) { | ||
/* Note: Casting a TPM2_AUTH_SESSION to TPMS_AUTH_COMMAND here, | ||
* this is allowed because top of structure matches */ | ||
TPM2_Packet_AppendAuthCmd(packet, (TPMS_AUTH_COMMAND*)&ctx->session[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for the indices to be mismatched here? For example suppose TPM2_GetCmdAuthCount incremented authSessCount for indices 0 and 2 with a count of 2. Wouldn't this use indices 0 and 1 instead of 0 and 2?
…uth do not supply it. ZD 16689
493e448
to
cdcdf38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Refactor of the command authentication. If command does not require auth do not supply it. ZD 16689