]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | NULL PlatformSecureLib instance does NOT really detect whether a physical present\r | |
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 | |
6 | \r | |
7 | Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
9 | \r | |
10 | **/\r | |
11 | \r | |
12 | #include <Uefi/UefiBaseType.h>\r | |
13 | \r | |
14 | BOOLEAN mUserPhysicalPresence = FALSE;\r | |
15 | \r | |
16 | /**\r | |
17 | \r | |
18 | This function provides a platform-specific method to detect whether the platform\r | |
19 | is operating by a physically present user.\r | |
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 | |
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 | |
28 | \r | |
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 | |
31 | \r | |
32 | **/\r | |
33 | BOOLEAN\r | |
34 | EFIAPI\r | |
35 | UserPhysicalPresent (\r | |
36 | VOID\r | |
37 | )\r | |
38 | {\r | |
39 | return mUserPhysicalPresence;\r | |
40 | }\r | |
41 | \r | |
42 | /**\r | |
43 | Save user physical presence state from a PCD to mUserPhysicalPresence.\r | |
44 | \r | |
45 | @retval EFI_SUCCESS PcdUserPhysicalPresence is got successfully.\r | |
46 | \r | |
47 | **/\r | |
48 | RETURN_STATUS\r | |
49 | EFIAPI\r | |
50 | PlatformSecureLibNullConstructor (\r | |
51 | VOID\r | |
52 | )\r | |
53 | {\r | |
54 | mUserPhysicalPresence = PcdGetBool (PcdUserPhysicalPresence);\r | |
55 | \r | |
56 | return RETURN_SUCCESS;\r | |
57 | }\r |