Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Javagedes committed Dec 4, 2023
1 parent cc2567a commit a95dbfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
## @file - SecureBootKeyStoreLib.inf
## @file - BaseSecureBootKeyStoreLib.inf
# Copyright (C) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

[Defines]
INF_VERSION = 0x00010005
BASE_NAME = SecureBootKeyStoreLib
BASE_NAME = BaseSecureBootKeyStoreLib
FILE_GUID = 02EEF9DA-5557-4090-BFF5-E07EF0344805
VERSION_STRING = 1.0
MODULE_TYPE = BASE
LIBRARY_CLASS = SecureBootKeyStoreLib
CONSTRUCTOR = SecureBootKeyStoreLibConstructor

#
# The following information is for reference only and not required by the build tools.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@

#include <Uefi.h>
#include <UefiSecureBoot.h>

#include <Guid/ImageAuthentication.h>
#include <Library/SecureBootVariableLib.h>

#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/SecureBootVariableLib.h>
#include <Library/PcdLib.h>

#define PLATFORM_SECURE_BOOT_KEY_COUNT 2

SECURE_BOOT_PAYLOAD_INFO *gSecureBootPayload = NULL;
UINT8 gSecureBootPayloadCount = 0;

UINT8 mSecureBootPayloadCount = PLATFORM_SECURE_BOOT_KEY_COUNT;
SECURE_BOOT_PAYLOAD_INFO mSecureBootPayload[PLATFORM_SECURE_BOOT_KEY_COUNT] = {
SECURE_BOOT_PAYLOAD_INFO mSecureBootPayload[] = {
{
.SecureBootKeyName = L"Microsoft Only",
.KekPtr = (CONST UINT8 *)FixedPcdGetPtr (PcdDefaultKek),
Expand Down Expand Up @@ -62,7 +55,6 @@ SECURE_BOOT_PAYLOAD_INFO mSecureBootPayload[PLATFORM_SECURE_BOOT_KEY_COUNT] = {
@retval EFI_SUCCESS The Keys are properly fetched.
@retval EFI_INVALID_PARAMETER Inputs have NULL pointers.
@retval Others Something went wrong. Investigate further.
**/
EFI_STATUS
EFIAPI
Expand All @@ -75,26 +67,8 @@ GetPlatformKeyStore (
return EFI_INVALID_PARAMETER;
}

*Keys = gSecureBootPayload;
*KeyCount = gSecureBootPayloadCount;

return EFI_SUCCESS;
}

/**
The constructor gets the secure boot platform keys populated.
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
**/
EFI_STATUS
EFIAPI
SecureBootKeyStoreLibConstructor (
VOID
)
{
gSecureBootPayload = mSecureBootPayload;
gSecureBootPayloadCount = mSecureBootPayloadCount;
*Keys = mSecureBootPayload;
*KeyCount = ARRAY_SIZE (mSecureBootPayload);

return EFI_SUCCESS;
}

0 comments on commit a95dbfd

Please sign in to comment.