-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TpmTestingPkg: Add InputChannelLib (#352)
## Description Adds a new library class (InputChannelLib) that allows the TPM replay event log to be passed through a platform-specific mechanism. - [x] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested - Passed FW CFG TPM event log through QemuQ35Pkg - Verified library integrated without a custom log being passed uses lower priority input channels as expected - Verified BaseInputChannelLibNull is functionally usable for skipping custom log input. ## Integration Instructions Add `InputChannelLib|TpmTestingPkg/Library/BaseInputChannelLibNull/BaseInputChannelLibNull.inf` to a platform that uses the TPM Replay feature but does not provide a custom input channel instance. Signed-off-by: Michael Kubacki <[email protected]>
- Loading branch information
Showing
13 changed files
with
115 additions
and
8 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** @file | ||
TPM Event Log Input Channel Library | ||
Allows a TPM replay log to be passed through a custom interface. | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef INPUT_CHANNEL_LIB_H | ||
#define INPUT_CHANNEL_LIB_H | ||
|
||
#include <Guid/TpmReplayEventLog.h> | ||
|
||
/** | ||
Retrieves a TPM Replay Event Log through a custom interface. | ||
@param[out] ReplayEventLog A pointer to a pointer to the buffer to hold the event log data. | ||
@param[out] ReplayEventLogSize The size of the data placed in the buffer. | ||
@retval EFI_SUCCESS The TPM Replay event log was returned successfully. | ||
@retval EFI_INVALID_PARAMETER A pointer argument given is NULL. | ||
@retval EFI_UNSUPPORTED The function is not implemented yet. The arguments are not used. | ||
@retval EFI_COMPROMISED_DATA The event log data found is not valid. | ||
@retval EFI_NOT_FOUND The event log data was not found. The input channel is ignored in this case. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
GetReplayEventLogFromCustomInterface ( | ||
OUT VOID **ReplayEventLog, | ||
OUT UINTN *ReplayEventLogSize | ||
); | ||
|
||
#endif |
33 changes: 33 additions & 0 deletions
33
TpmTestingPkg/Library/BaseInputChannelLibNull/BaseInputChannelLibNull.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** @file | ||
A null instance of the Input Channel Library. | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <Uefi.h> | ||
#include <Library/InputChannelLib.h> | ||
|
||
/** | ||
Retrieves a TPM Replay Event Log through a custom interface. | ||
@param[out] ReplayEventLog A pointer to a pointer to the buffer to hold the event log data. | ||
@param[out] ReplayEventLogSize The size of the data placed in the buffer. | ||
@retval EFI_SUCCESS The TPM Replay event log was returned successfully. | ||
@retval EFI_INVALID_PARAMETER A pointer argument given is NULL. | ||
@retval EFI_UNSUPPORTED The function is not implemented yet. The arguments are not used. | ||
@retval EFI_COMPROMISED_DATA The event log data found is not valid. | ||
@retval EFI_NOT_FOUND The event log data was not found. The input channel is ignored in this case. | ||
**/ | ||
EFI_STATUS | ||
EFIAPI | ||
GetReplayEventLogFromCustomInterface ( | ||
OUT VOID **ReplayEventLog, | ||
OUT UINTN *ReplayEventLogSize | ||
) | ||
{ | ||
return EFI_UNSUPPORTED; | ||
} |
24 changes: 24 additions & 0 deletions
24
TpmTestingPkg/Library/BaseInputChannelLibNull/BaseInputChannelLibNull.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## @file | ||
# A null instance of the Input Channel Library. | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
# | ||
## | ||
|
||
[Defines] | ||
INF_VERSION = 0x00010005 | ||
BASE_NAME = BaseInputChannelLibNull | ||
FILE_GUID = F35B1671-08BC-4231-9CEB-A08E809E32FF | ||
MODULE_TYPE = BASE | ||
VERSION_STRING = 1.0 | ||
LIBRARY_CLASS = InputChannelLib | ||
|
||
[Packages] | ||
MdePkg/MdePkg.dec | ||
SecurityPkg/SecurityPkg.dec | ||
TpmTestingPkg/TpmTestingPkg.dec | ||
|
||
[Sources] | ||
BaseInputChannelLibNull.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters