2 This driver implements one sample platform security service, which does
3 nothing and always return EFI_SUCCESS.
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include "SecurityStub.h"
20 // Handle for the Security Architectural Protocol instance produced by this driver
22 EFI_HANDLE mSecurityArchProtocolHandle
= NULL
;
25 // Security Architectural Protocol instance produced by this driver
27 EFI_SECURITY_ARCH_PROTOCOL mSecurityStub
= {
28 SecurityStubAuthenticateState
33 The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
34 policy from the DXE core response to an attempt to use a file that returns a
35 given status for the authentication check from the section extraction protocol.
37 The possible responses in a given SAP implementation may include locking
38 flash upon failure to authenticate, attestation logging for all signed drivers,
39 and other exception operations. The File parameter allows for possible logging
40 within the SAP of the driver.
42 If File is NULL, then EFI_INVALID_PARAMETER is returned.
44 If the file specified by File with an authentication status specified by
45 AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.
47 If the file specified by File with an authentication status specified by
48 AuthenticationStatus is not safe for the DXE Core to use under any circumstances,
49 then EFI_ACCESS_DENIED is returned.
51 If the file specified by File with an authentication status specified by
52 AuthenticationStatus is not safe for the DXE Core to use right now, but it
53 might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is
56 @param This The EFI_SECURITY_ARCH_PROTOCOL instance.
57 @param AuthenticationStatus
58 This is the authentication type returned from the Section
59 Extraction protocol. See the Section Extraction Protocol
60 Specification for details on this type.
61 @param File This is a pointer to the device path of the file that is
62 being dispatched. This will optionally be used for logging.
64 @retval EFI_SUCCESS Do nothing and return.
65 @retval EFI_INVALID_PARAMETER File is NULL.
69 SecurityStubAuthenticateState (
70 IN CONST EFI_SECURITY_ARCH_PROTOCOL
*This
,
71 IN UINT32 AuthenticationStatus
,
72 IN CONST EFI_DEVICE_PATH_PROTOCOL
*File
76 return EFI_INVALID_PARAMETER
;
84 The user Entry Point installs SAP. The user code starts with this function
85 as the real entry point for the image goes into a library that calls this
88 @param ImageHandle The firmware allocated handle for the EFI image.
89 @param SystemTable A pointer to the EFI System Table.
91 @retval EFI_SUCCESS Install the sample Security Architectural Protocol successfully.
96 SecurityStubInitialize (
97 IN EFI_HANDLE ImageHandle
,
98 IN EFI_SYSTEM_TABLE
*SystemTable
104 // Make sure the Security Architectural Protocol is not already installed in the system
106 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiSecurityArchProtocolGuid
);
109 // Install the Security Architectural Protocol onto a new handle
111 Status
= gBS
->InstallMultipleProtocolInterfaces (
112 &mSecurityArchProtocolHandle
,
113 &gEfiSecurityArchProtocolGuid
,
117 ASSERT_EFI_ERROR (Status
);