VirtualBox

Ignore:
Timestamp:
Oct 28, 2015 8:17:18 PM (9 years ago)
Author:
vboxsync
Message:

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c

    r48674 r58459  
    11/** @file
    2   This driver produces security architectural protocol based on SecurityManagementLib.
     2  This driver produces Security2 and Security architectural protocol based on SecurityManagementLib.
    33 
    4   Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
    55  This program and the accompanying materials                         
    66  are licensed and made available under the terms and conditions of the BSD License         
     
    1616#include <Uefi.h>
    1717#include <Protocol/Security.h>
     18#include <Protocol/Security2.h>
    1819#include <Library/DebugLib.h>
    1920#include <Library/UefiBootServicesTableLib.h>
     
    6970  )
    7071{
    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;
    7286}
    7387
    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**/
     133EFI_STATUS
     134EFIAPI
     135Security2StubAuthenticate (
     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
    76157//
    77158EFI_SECURITY_ARCH_PROTOCOL  mSecurityStub = {
     
    79160};
    80161
     162EFI_SECURITY2_ARCH_PROTOCOL mSecurity2Stub = {
     163  Security2StubAuthenticate
     164};
     165
    81166/**
    82   Installs Security Architectural Protocol.
     167  Installs Security2 and Security Architectural Protocol.
    83168
    84169  @param  ImageHandle  The image handle of this driver.
     
    100185  // Make sure the Security Architectural Protocol is not already installed in the system
    101186  //
     187  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiSecurity2ArchProtocolGuid);
    102188  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiSecurityArchProtocolGuid);
    103189
     
    107193  Status = gBS->InstallMultipleProtocolInterfaces (
    108194                  &mSecurityArchProtocolHandle,
     195                  &gEfiSecurity2ArchProtocolGuid,
     196                  &mSecurity2Stub,
    109197                  &gEfiSecurityArchProtocolGuid,
    110198                  &mSecurityStub,
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf

    r48674 r58459  
    11## @file
    2 #  This driver produces security architectural protocol based on SecurityManagementLib.
     2#  This driver produces security2 and security architectural protocol based on SecurityManagementLib.
    33#
    4 #  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
     4#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    55#  This program and the accompanying materials
    66#  are licensed and made available under the terms and conditions of the BSD License
     
    1717  INF_VERSION                    = 0x00010005
    1818  BASE_NAME                      = SecurityStubDxe
     19  MODULE_UNI_FILE                = SecurityStubDxe.uni
    1920  FILE_GUID                      = F80697E9-7FD6-4665-8646-88E33EF71DFC
    2021  MODULE_TYPE                    = DXE_DRIVER
     
    4142
    4243[Protocols]
    43   gEfiSecurityArchProtocolGuid                  ## PRODUCED
     44  gEfiSecurityArchProtocolGuid                  ## PRODUCES
     45  gEfiSecurity2ArchProtocolGuid                 ## PRODUCES
    4446
    4547[Depex]
    4648  TRUE
    47  
     49
     50[UserExtensions.TianoCore."ExtraFiles"]
     51  SecurityStubDxeExtra.uni
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette