]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c
SecurityPkg/PlatformSecureLibNull: permit use by MM_STANDALONE modules
[mirror_edk2.git] / SecurityPkg / Library / PlatformSecureLibNull / PlatformSecureLibNull.c
CommitLineData
0c18794e 1/** @file\r
b3548d32 2 NULL PlatformSecureLib instance does NOT really detect whether a physical present\r
a7450323 3 user exists but return TRUE directly. This instance can be used to verify security\r
4 related features during platform enabling and development. It should be replaced\r
5 by a platform-specific method(e.g. Button pressed) in a real platform for product.\r
0c18794e 6\r
b3548d32
LG
7Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
8This program and the accompanying materials\r
9are licensed and made available under the terms and conditions of the BSD License\r
10which accompanies this distribution. The full text of the license may be found at\r
0c18794e 11http://opensource.org/licenses/bsd-license.php\r
12\r
b3548d32 13THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
0c18794e 14WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16**/\r
17\r
c5386c78
AB
18#include <Uefi/UefiBaseType.h>\r
19\r
c99bcf3d
LG
20BOOLEAN mUserPhysicalPresence = FALSE;\r
21\r
0c18794e 22/**\r
23\r
ecc722ad 24 This function provides a platform-specific method to detect whether the platform\r
b3548d32 25 is operating by a physically present user.\r
ecc722ad 26\r
27 Programmatic changing of platform security policy (such as disable Secure Boot,\r
28 or switch between Standard/Custom Secure Boot mode) MUST NOT be possible during\r
29 Boot Services or after exiting EFI Boot Services. Only a physically present user\r
30 is allowed to perform these operations.\r
31\r
0c18794e 32 NOTE THAT: This function cannot depend on any EFI Variable Service since they are\r
33 not available when this function is called in AuthenticateVariable driver.\r
b3548d32 34\r
ecc722ad 35 @retval TRUE The platform is operated by a physically present user.\r
36 @retval FALSE The platform is NOT operated by a physically present user.\r
0c18794e 37\r
38**/\r
39BOOLEAN\r
40EFIAPI\r
ecc722ad 41UserPhysicalPresent (\r
0c18794e 42 VOID\r
43 )\r
44{\r
b3548d32 45 return mUserPhysicalPresence;\r
c99bcf3d
LG
46}\r
47\r
48\r
49/**\r
50 Save user physical presence state from a PCD to mUserPhysicalPresence.\r
51\r
c99bcf3d
LG
52 @retval EFI_SUCCESS PcdUserPhysicalPresence is got successfully.\r
53\r
54**/\r
c5386c78 55RETURN_STATUS\r
c99bcf3d
LG
56EFIAPI\r
57PlatformSecureLibNullConstructor (\r
c5386c78 58 VOID\r
c99bcf3d
LG
59 )\r
60{\r
61\r
62 mUserPhysicalPresence = PcdGetBool(PcdUserPhysicalPresence);\r
63\r
c5386c78 64 return RETURN_SUCCESS;\r
0c18794e 65}\r