3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This driver supports platform security service
22 #include "SecurityStub.h"
25 // Handle for the Security Architectural Protocol instance produced by this driver
27 EFI_HANDLE mSecurityArchProtocolHandle
= NULL
;
30 // Security Architectural Protocol instance produced by this driver
32 EFI_SECURITY_ARCH_PROTOCOL mSecurityStub
= {
33 SecurityStubAuthenticateState
41 SecurityStubAuthenticateState (
42 IN EFI_SECURITY_ARCH_PROTOCOL
*This
,
43 IN UINT32 AuthenticationStatus
,
44 IN EFI_DEVICE_PATH_PROTOCOL
*File
50 The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
51 policy from the DXE core response to an attempt to use a file that returns a
52 given status for the authentication check from the section extraction protocol.
54 The possible responses in a given SAP implementation may include locking
55 flash upon failure to authenticate, attestation logging for all signed drivers,
56 and other exception operations. The File parameter allows for possible logging
57 within the SAP of the driver.
59 If File is NULL, then EFI_INVALID_PARAMETER is returned.
61 If the file specified by File with an authentication status specified by
62 AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.
64 If the file specified by File with an authentication status specified by
65 AuthenticationStatus is not safe for the DXE Core to use under any circumstances,
66 then EFI_ACCESS_DENIED is returned.
68 If the file specified by File with an authentication status specified by
69 AuthenticationStatus is not safe for the DXE Core to use right now, but it
70 might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is
75 This - The EFI_SECURITY_ARCH_PROTOCOL instance.
77 AuthenticationStatus - This is the authentication type returned from the Section
78 Extraction protocol. See the Section Extraction Protocol
79 Specification for details on this type.
81 File - This is a pointer to the device path of the file that is
82 being dispatched. This will optionally be used for logging.
86 EFI_SUCCESS - The file specified by File did authenticate, and the
87 platform policy dictates that the DXE Core may use File.
89 EFI_INVALID_PARAMETER - File is NULL.
91 EFI_SECURITY_VIOLATION - The file specified by File did not authenticate, and
92 the platform policy dictates that File should be placed
93 in the untrusted state. A file may be promoted from
94 the untrusted to the trusted state at a future time
95 with a call to the Trust() DXE Service.
97 EFI_ACCESS_DENIED - The file specified by File did not authenticate, and
98 the platform policy dictates that File should not be
104 return EFI_INVALID_PARAMETER
;
112 SecurityStubInitialize (
113 IN EFI_HANDLE ImageHandle
,
114 IN EFI_SYSTEM_TABLE
*SystemTable
120 Initialize the state information for the Security Architectural Protocol
124 ImageHandle of the loaded driver
125 Pointer to the System Table
131 EFI_SUCCESS - successful installation of the service
132 EFI_OUT_OF_RESOURCES - cannot allocate protocol data structure
133 EFI_DEVICE_ERROR - cannot create the timer service
140 // Make sure the Security Architectural Protocol is not already installed in the system
142 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL
, &gEfiSecurityArchProtocolGuid
);
145 // Install the Security Architectural Protocol onto a new handle
147 Status
= gBS
->InstallMultipleProtocolInterfaces (
148 &mSecurityArchProtocolHandle
,
149 &gEfiSecurityArchProtocolGuid
,
153 ASSERT_EFI_ERROR (Status
);