]> git.proxmox.com Git - mirror_edk2.git/blame - SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c
SecurityPkg: Apply uncrustify changes
[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 7Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
289b714b 8SPDX-License-Identifier: BSD-2-Clause-Patent\r
0c18794e 9\r
10**/\r
11\r
c5386c78
AB
12#include <Uefi/UefiBaseType.h>\r
13\r
c411b485 14BOOLEAN mUserPhysicalPresence = FALSE;\r
c99bcf3d 15\r
0c18794e 16/**\r
17\r
ecc722ad 18 This function provides a platform-specific method to detect whether the platform\r
b3548d32 19 is operating by a physically present user.\r
ecc722ad 20\r
21 Programmatic changing of platform security policy (such as disable Secure Boot,\r
22 or switch between Standard/Custom Secure Boot mode) MUST NOT be possible during\r
23 Boot Services or after exiting EFI Boot Services. Only a physically present user\r
24 is allowed to perform these operations.\r
25\r
0c18794e 26 NOTE THAT: This function cannot depend on any EFI Variable Service since they are\r
27 not available when this function is called in AuthenticateVariable driver.\r
b3548d32 28\r
ecc722ad 29 @retval TRUE The platform is operated by a physically present user.\r
30 @retval FALSE The platform is NOT operated by a physically present user.\r
0c18794e 31\r
32**/\r
33BOOLEAN\r
34EFIAPI\r
ecc722ad 35UserPhysicalPresent (\r
0c18794e 36 VOID\r
37 )\r
38{\r
b3548d32 39 return mUserPhysicalPresence;\r
c99bcf3d
LG
40}\r
41\r
c99bcf3d
LG
42/**\r
43 Save user physical presence state from a PCD to mUserPhysicalPresence.\r
44\r
c99bcf3d
LG
45 @retval EFI_SUCCESS PcdUserPhysicalPresence is got successfully.\r
46\r
47**/\r
c5386c78 48RETURN_STATUS\r
c99bcf3d
LG
49EFIAPI\r
50PlatformSecureLibNullConstructor (\r
c5386c78 51 VOID\r
c99bcf3d
LG
52 )\r
53{\r
c411b485 54 mUserPhysicalPresence = PcdGetBool (PcdUserPhysicalPresence);\r
c99bcf3d 55\r
c5386c78 56 return RETURN_SUCCESS;\r
0c18794e 57}\r