TianoCore EDK2
master
Loading...
Searching...
No Matches
Tpm2Test.c
Go to the documentation of this file.
1
9
#include <
IndustryStandard/UefiTcgPlatform.h
>
10
#include <
Library/Tpm2CommandLib.h
>
11
#include <
Library/Tpm2DeviceLib.h
>
12
#include <
Library/BaseMemoryLib.h
>
13
#include <
Library/BaseLib.h
>
14
#include <
Library/DebugLib.h
>
15
16
#pragma pack(1)
17
18
typedef
struct
{
19
TPM2_COMMAND_HEADER
Header;
20
TPMI_YES_NO FullTest;
21
}
TPM2_SELF_TEST_COMMAND
;
22
23
typedef
struct
{
24
TPM2_RESPONSE_HEADER
Header;
25
}
TPM2_SELF_TEST_RESPONSE
;
26
27
#pragma pack()
28
40
EFI_STATUS
41
EFIAPI
42
Tpm2SelfTest
(
43
IN
TPMI_YES_NO FullTest
44
)
45
{
46
EFI_STATUS
Status;
47
TPM2_SELF_TEST_COMMAND
Cmd;
48
TPM2_SELF_TEST_RESPONSE
Res;
49
UINT32 ResultBufSize;
50
51
Cmd.Header.tag =
SwapBytes16
(TPM_ST_NO_SESSIONS);
52
Cmd.Header.paramSize =
SwapBytes32
(
sizeof
(Cmd));
53
Cmd.Header.commandCode =
SwapBytes32
(TPM_CC_SelfTest);
54
Cmd.FullTest = FullTest;
55
56
ResultBufSize =
sizeof
(Res);
57
Status =
Tpm2SubmitCommand
(
sizeof
(Cmd), (UINT8 *)&Cmd, &ResultBufSize, (UINT8 *)&Res);
58
59
return
Status;
60
}
BaseLib.h
SwapBytes16
UINT16 EFIAPI SwapBytes16(IN UINT16 Value)
Definition:
SwapBytes16.c:25
SwapBytes32
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
Definition:
SwapBytes32.c:25
BaseMemoryLib.h
IN
#define IN
Definition:
Base.h:279
DebugLib.h
Tpm2CommandLib.h
Tpm2DeviceLib.h
Tpm2SubmitCommand
EFI_STATUS EFIAPI Tpm2SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition:
Tpm2DeviceLibDTpm.c:66
Tpm2SelfTest
EFI_STATUS EFIAPI Tpm2SelfTest(IN TPMI_YES_NO FullTest)
Definition:
Tpm2Test.c:42
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
UefiTcgPlatform.h
TPM2_COMMAND_HEADER
Definition:
Tpm20.h:1790
TPM2_RESPONSE_HEADER
Definition:
Tpm20.h:1796
TPM2_SELF_TEST_COMMAND
Definition:
Tpm2Test.c:18
TPM2_SELF_TEST_RESPONSE
Definition:
Tpm2Test.c:23
SecurityPkg
Library
Tpm2CommandLib
Tpm2Test.c
Generated on Fri Nov 15 2024 18:01:23 for TianoCore EDK2 by
1.9.6