20 TPMI_RH_LOCKOUT LockHandle;
21 UINT32 AuthSessionSize;
27 UINT32 AuthSessionSize;
33 TPMI_RH_LOCKOUT LockHandle;
34 UINT32 AuthSessionSize;
37 UINT32 NewRecoveryTime;
38 UINT32 LockoutRecovery;
43 UINT32 AuthSessionSize;
62 IN TPMI_RH_LOCKOUT LockHandle,
69 UINT32 SendBufferSize;
70 UINT32 RecvBufferSize;
72 UINT32 SessionInfoSize;
77 SendBuffer.Header.tag =
SwapBytes16 (TPM_ST_SESSIONS);
78 SendBuffer.Header.commandCode =
SwapBytes32 (TPM_CC_DictionaryAttackLockReset);
85 Buffer = (UINT8 *)&SendBuffer.AuthSession;
89 Buffer += SessionInfoSize;
90 SendBuffer.AuthSessionSize =
SwapBytes32 (SessionInfoSize);
92 SendBufferSize = (UINT32)((
UINTN)Buffer - (
UINTN)&SendBuffer);
93 SendBuffer.Header.paramSize =
SwapBytes32 (SendBufferSize);
98 RecvBufferSize =
sizeof (RecvBuffer);
99 Status =
Tpm2SubmitCommand (SendBufferSize, (UINT8 *)&SendBuffer, &RecvBufferSize, (UINT8 *)&RecvBuffer);
100 if (EFI_ERROR (Status)) {
105 DEBUG ((DEBUG_ERROR,
"Tpm2DictionaryAttackLockReset - RecvBufferSize Error - %x\n", RecvBufferSize));
106 Status = EFI_DEVICE_ERROR;
110 if (
SwapBytes32 (RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
111 DEBUG ((DEBUG_ERROR,
"Tpm2DictionaryAttackLockReset - responseCode - %x\n",
SwapBytes32 (RecvBuffer.Header.responseCode)));
112 Status = EFI_DEVICE_ERROR;
120 ZeroMem (&SendBuffer,
sizeof (SendBuffer));
121 ZeroMem (&RecvBuffer,
sizeof (RecvBuffer));
141 IN TPMI_RH_LOCKOUT LockHandle,
143 IN UINT32 NewMaxTries,
144 IN UINT32 NewRecoveryTime,
145 IN UINT32 LockoutRecovery
151 UINT32 SendBufferSize;
152 UINT32 RecvBufferSize;
154 UINT32 SessionInfoSize;
159 SendBuffer.Header.tag =
SwapBytes16 (TPM_ST_SESSIONS);
160 SendBuffer.Header.commandCode =
SwapBytes32 (TPM_CC_DictionaryAttackParameters);
167 Buffer = (UINT8 *)&SendBuffer.AuthSession;
171 Buffer += SessionInfoSize;
172 SendBuffer.AuthSessionSize =
SwapBytes32 (SessionInfoSize);
178 Buffer +=
sizeof (UINT32);
180 Buffer +=
sizeof (UINT32);
182 Buffer +=
sizeof (UINT32);
184 SendBufferSize = (UINT32)((
UINTN)Buffer - (
UINTN)&SendBuffer);
185 SendBuffer.Header.paramSize =
SwapBytes32 (SendBufferSize);
190 RecvBufferSize =
sizeof (RecvBuffer);
191 Status =
Tpm2SubmitCommand (SendBufferSize, (UINT8 *)&SendBuffer, &RecvBufferSize, (UINT8 *)&RecvBuffer);
192 if (EFI_ERROR (Status)) {
197 DEBUG ((DEBUG_ERROR,
"Tpm2DictionaryAttackParameters - RecvBufferSize Error - %x\n", RecvBufferSize));
198 Status = EFI_DEVICE_ERROR;
202 if (
SwapBytes32 (RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
203 DEBUG ((DEBUG_ERROR,
"Tpm2DictionaryAttackParameters - responseCode - %x\n",
SwapBytes32 (RecvBuffer.Header.responseCode)));
204 Status = EFI_DEVICE_ERROR;
212 ZeroMem (&SendBufferSize,
sizeof (SendBufferSize));
213 ZeroMem (&RecvBuffer,
sizeof (RecvBuffer));
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
UINT32 EFIAPI WriteUnaligned32(OUT UINT32 *Buffer, IN UINT32 Value)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define DEBUG(Expression)
UINT32 EFIAPI CopyAuthSessionCommand(IN TPMS_AUTH_COMMAND *AuthSessionIn OPTIONAL, OUT UINT8 *AuthSessionOut)
EFI_STATUS EFIAPI Tpm2SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
EFI_STATUS EFIAPI Tpm2DictionaryAttackParameters(IN TPMI_RH_LOCKOUT LockHandle, IN TPMS_AUTH_COMMAND *AuthSession, IN UINT32 NewMaxTries, IN UINT32 NewRecoveryTime, IN UINT32 LockoutRecovery)
EFI_STATUS EFIAPI Tpm2DictionaryAttackLockReset(IN TPMI_RH_LOCKOUT LockHandle, IN TPMS_AUTH_COMMAND *AuthSession)