]>
Commit | Line | Data |
---|---|---|
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 |
7 | Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r |
8 | This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
0c18794e | 11 | http://opensource.org/licenses/bsd-license.php\r |
12 | \r | |
b3548d32 | 13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
0c18794e | 14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
15 | \r | |
16 | **/\r | |
17 | \r | |
c99bcf3d LG |
18 | BOOLEAN mUserPhysicalPresence = FALSE;\r |
19 | \r | |
0c18794e | 20 | /**\r |
21 | \r | |
ecc722ad | 22 | This function provides a platform-specific method to detect whether the platform\r |
b3548d32 | 23 | is operating by a physically present user.\r |
ecc722ad | 24 | \r |
25 | Programmatic changing of platform security policy (such as disable Secure Boot,\r | |
26 | or switch between Standard/Custom Secure Boot mode) MUST NOT be possible during\r | |
27 | Boot Services or after exiting EFI Boot Services. Only a physically present user\r | |
28 | is allowed to perform these operations.\r | |
29 | \r | |
0c18794e | 30 | NOTE THAT: This function cannot depend on any EFI Variable Service since they are\r |
31 | not available when this function is called in AuthenticateVariable driver.\r | |
b3548d32 | 32 | \r |
ecc722ad | 33 | @retval TRUE The platform is operated by a physically present user.\r |
34 | @retval FALSE The platform is NOT operated by a physically present user.\r | |
0c18794e | 35 | \r |
36 | **/\r | |
37 | BOOLEAN\r | |
38 | EFIAPI\r | |
ecc722ad | 39 | UserPhysicalPresent (\r |
0c18794e | 40 | VOID\r |
41 | )\r | |
42 | {\r | |
b3548d32 | 43 | return mUserPhysicalPresence;\r |
c99bcf3d LG |
44 | }\r |
45 | \r | |
46 | \r | |
47 | /**\r | |
48 | Save user physical presence state from a PCD to mUserPhysicalPresence.\r | |
49 | \r | |
50 | @param ImageHandle ImageHandle of the loaded driver.\r | |
51 | @param SystemTable Pointer to the EFI System Table.\r | |
52 | \r | |
53 | @retval EFI_SUCCESS PcdUserPhysicalPresence is got successfully.\r | |
54 | \r | |
55 | **/\r | |
56 | EFI_STATUS\r | |
57 | EFIAPI\r | |
58 | PlatformSecureLibNullConstructor (\r | |
59 | IN EFI_HANDLE ImageHandle,\r | |
60 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
61 | )\r | |
62 | {\r | |
63 | \r | |
64 | mUserPhysicalPresence = PcdGetBool(PcdUserPhysicalPresence);\r | |
65 | \r | |
66 | return EFI_SUCCESS;\r | |
0c18794e | 67 | }\r |