Changeset 58459 in vbox for trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/SecurityStubDxe
- Timestamp:
- Oct 28, 2015 8:17:18 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
-
Property svn:mergeinfo
set to (toggle deleted branches)
/vendor/edk2/current 103735-103757
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c
r48674 r58459 1 1 /** @file 2 This driver produces security architectural protocol based on SecurityManagementLib.2 This driver produces Security2 and Security architectural protocol based on SecurityManagementLib. 3 3 4 Copyright (c) 2006 - 20 09, Intel Corporation. All rights reserved.<BR>4 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials 6 6 are licensed and made available under the terms and conditions of the BSD License … … 16 16 #include <Uefi.h> 17 17 #include <Protocol/Security.h> 18 #include <Protocol/Security2.h> 18 19 #include <Library/DebugLib.h> 19 20 #include <Library/UefiBootServicesTableLib.h> … … 69 70 ) 70 71 { 71 return ExecuteSecurityHandlers (AuthenticationStatus, File); 72 EFI_STATUS Status; 73 74 Status = ExecuteSecurity2Handlers (EFI_AUTH_OPERATION_AUTHENTICATION_STATE, 75 AuthenticationStatus, 76 File, 77 NULL, 78 0, 79 FALSE 80 ); 81 if (Status == EFI_SUCCESS) { 82 Status = ExecuteSecurityHandlers (AuthenticationStatus, File); 83 } 84 85 return Status; 72 86 } 73 87 74 // 75 // Security Architectural Protocol instance produced by this driver 88 /** 89 The DXE Foundation uses this service to measure and/or verify a UEFI image. 90 91 This service abstracts the invocation of Trusted Computing Group (TCG) measured boot, UEFI 92 Secure boot, and UEFI User Identity infrastructure. For the former two, the DXE Foundation 93 invokes the FileAuthentication() with a DevicePath and corresponding image in 94 FileBuffer memory. The TCG measurement code will record the FileBuffer contents into the 95 appropriate PCR. The image verification logic will confirm the integrity and provenance of the 96 image in FileBuffer of length FileSize . The origin of the image will be DevicePath in 97 these cases. 98 If the FileBuffer is NULL, the interface will determine if the DevicePath can be connected 99 in order to support the User Identification policy. 100 101 @param This The EFI_SECURITY2_ARCH_PROTOCOL instance. 102 @param File A pointer to the device path of the file that is 103 being dispatched. This will optionally be used for logging. 104 @param FileBuffer A pointer to the buffer with the UEFI file image. 105 @param FileSize The size of the file. 106 @param BootPolicy A boot policy that was used to call LoadImage() UEFI service. If 107 FileAuthentication() is invoked not from the LoadImage(), 108 BootPolicy must be set to FALSE. 109 110 @retval EFI_SUCCESS The file specified by DevicePath and non-NULL 111 FileBuffer did authenticate, and the platform policy dictates 112 that the DXE Foundation may use the file. 113 @retval EFI_SUCCESS The device path specified by NULL device path DevicePath 114 and non-NULL FileBuffer did authenticate, and the platform 115 policy dictates that the DXE Foundation may execute the image in 116 FileBuffer. 117 @retval EFI_SUCCESS FileBuffer is NULL and current user has permission to start 118 UEFI device drivers on the device path specified by DevicePath. 119 @retval EFI_SECURITY_VIOLATION The file specified by DevicePath and FileBuffer did not 120 authenticate, and the platform policy dictates that the file should be 121 placed in the untrusted state. The image has been added to the file 122 execution table. 123 @retval EFI_ACCESS_DENIED The file specified by File and FileBuffer did not 124 authenticate, and the platform policy dictates that the DXE 125 Foundation many not use File. 126 @retval EFI_SECURITY_VIOLATION FileBuffer is NULL and the user has no 127 permission to start UEFI device drivers on the device path specified 128 by DevicePath. 129 @retval EFI_SECURITY_VIOLATION FileBuffer is not NULL and the user has no permission to load 130 drivers from the device path specified by DevicePath. The 131 image has been added into the list of the deferred images. 132 **/ 133 EFI_STATUS 134 EFIAPI 135 Security2StubAuthenticate ( 136 IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This, 137 IN CONST EFI_DEVICE_PATH_PROTOCOL *File, 138 IN VOID *FileBuffer, 139 IN UINTN FileSize, 140 IN BOOLEAN BootPolicy 141 ) 142 { 143 return ExecuteSecurity2Handlers (EFI_AUTH_OPERATION_VERIFY_IMAGE | 144 EFI_AUTH_OPERATION_DEFER_IMAGE_LOAD | 145 EFI_AUTH_OPERATION_MEASURE_IMAGE | 146 EFI_AUTH_OPERATION_CONNECT_POLICY, 147 0, 148 File, 149 FileBuffer, 150 FileSize, 151 BootPolicy 152 ); 153 } 154 155 // 156 // Security2 and Security Architectural Protocol instance produced by this driver 76 157 // 77 158 EFI_SECURITY_ARCH_PROTOCOL mSecurityStub = { … … 79 160 }; 80 161 162 EFI_SECURITY2_ARCH_PROTOCOL mSecurity2Stub = { 163 Security2StubAuthenticate 164 }; 165 81 166 /** 82 Installs Security Architectural Protocol.167 Installs Security2 and Security Architectural Protocol. 83 168 84 169 @param ImageHandle The image handle of this driver. … … 100 185 // Make sure the Security Architectural Protocol is not already installed in the system 101 186 // 187 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiSecurity2ArchProtocolGuid); 102 188 ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiSecurityArchProtocolGuid); 103 189 … … 107 193 Status = gBS->InstallMultipleProtocolInterfaces ( 108 194 &mSecurityArchProtocolHandle, 195 &gEfiSecurity2ArchProtocolGuid, 196 &mSecurity2Stub, 109 197 &gEfiSecurityArchProtocolGuid, 110 198 &mSecurityStub, -
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
r48674 r58459 1 1 ## @file 2 # This driver produces security architectural protocol based on SecurityManagementLib.2 # This driver produces security2 and security architectural protocol based on SecurityManagementLib. 3 3 # 4 # Copyright (c) 2006 - 201 0, Intel Corporation. All rights reserved.<BR>4 # Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> 5 5 # This program and the accompanying materials 6 6 # are licensed and made available under the terms and conditions of the BSD License … … 17 17 INF_VERSION = 0x00010005 18 18 BASE_NAME = SecurityStubDxe 19 MODULE_UNI_FILE = SecurityStubDxe.uni 19 20 FILE_GUID = F80697E9-7FD6-4665-8646-88E33EF71DFC 20 21 MODULE_TYPE = DXE_DRIVER … … 41 42 42 43 [Protocols] 43 gEfiSecurityArchProtocolGuid ## PRODUCED 44 gEfiSecurityArchProtocolGuid ## PRODUCES 45 gEfiSecurity2ArchProtocolGuid ## PRODUCES 44 46 45 47 [Depex] 46 48 TRUE 47 49 50 [UserExtensions.TianoCore."ExtraFiles"] 51 SecurityStubDxeExtra.uni
Note:
See TracChangeset
for help on using the changeset viewer.