OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AppleSecureBoot.h File Reference

Go to the source code of this file.

Data Structures

struct  APPLE_SECURE_BOOT_PROTOCOL_
 

Macros

#define APPLE_SECURE_BOOT_PROTOCOL_REVISION   4U
 
#define APPLE_SECURE_BOOT_PROTOCOL_GUID
 
#define APPLE_SB_OBJ_TYPE(A, B, C, D)
 
#define APPLE_SB_OBJ_EFIBOOT   APPLE_SB_OBJ_TYPE ('e', 'f', 'i', 'b')
 
#define APPLE_SB_OBJ_EFIBOOT_DEBUG   APPLE_SB_OBJ_TYPE ('e', 'f', 'b', 'd')
 
#define APPLE_SB_OBJ_EFIBOOT_BASE   APPLE_SB_OBJ_TYPE ('e', 'f', 'b', 'b')
 
#define APPLE_SB_OBJ_MUPD   APPLE_SB_OBJ_TYPE ('m', 'u', 'p', 'd')
 
#define APPLE_SB_OBJ_HPMU   APPLE_SB_OBJ_TYPE ('h', 'p', 'm', 'u')
 
#define APPLE_SB_OBJ_THOU   APPLE_SB_OBJ_TYPE ('t', 'h', 'o', 'u')
 
#define APPLE_SB_OBJ_GPUU   APPLE_SB_OBJ_TYPE ('g', 'p', 'u', 'u')
 
#define APPLE_SB_OBJ_ETHU   APPLE_SB_OBJ_TYPE ('e', 't', 'h', 'u')
 
#define APPLE_SB_OBJ_SDFU   APPLE_SB_OBJ_TYPE ('s', 'd', 'f', 'u')
 
#define APPLE_SB_OBJ_DTHU   APPLE_SB_OBJ_TYPE ('d', 't', 'h', 'u')
 
#define APPLE_SB_OBJ_KERNEL   APPLE_SB_OBJ_TYPE ('m', 'k', 'r', 'n')
 
#define APPLE_SB_OBJ_KERNEL_DEBUG   APPLE_SB_OBJ_TYPE ('m', 'k', 'r', 'd')
 

Typedefs

typedef struct APPLE_SECURE_BOOT_PROTOCOL_ APPLE_SECURE_BOOT_PROTOCOL
 
typedef VOID(EFIAPI * APPLE_SB_SET_AVAILABILITY) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN BOOLEAN Available)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_VERIFY_IMG4_BY_PATH) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN UINT32 ObjType, IN BOOLEAN SetFailureReason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_VERIFY_IMG4) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN CONST VOID *ImageBuffer, IN UINTN ImageSize, IN CONST VOID *ManifestBuffer, IN UINTN ManifestSize, IN UINT32 ObjType, IN BOOLEAN SetFailureReason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_POLICY) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Policy)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Reason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_SET_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN UINT8 Reason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_KERNEL_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Reason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_SET_KERNEL_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN UINT8 Reason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_VERIFY_WINDOWS_BY_PATH) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN SetFailureReason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_VERIFY_WINDOWS) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN CONST VOID *ImageBuffer, IN UINTN ImageSize, IN BOOLEAN SetFailureReason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_WINDOWS_POLICY) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Policy)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_WINDOWS_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Reason)
 
typedef EFI_STATUS(EFIAPI * APPLE_SB_SET_WINDOWS_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN UINT8 Reason)
 

Variables

EFI_GUID gAppleSecureBootProtocolGuid
 

Detailed Description

The Apple Secure Boot protocol provides services to verify a trusted image's integrity.

Copyright (C) 2019, Download-Fritz. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file AppleSecureBoot.h.

Macro Definition Documentation

◆ APPLE_SB_OBJ_DTHU

#define APPLE_SB_OBJ_DTHU   APPLE_SB_OBJ_TYPE ('d', 't', 'h', 'u')

Definition at line 49 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_EFIBOOT

#define APPLE_SB_OBJ_EFIBOOT   APPLE_SB_OBJ_TYPE ('e', 'f', 'i', 'b')

Definition at line 39 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_EFIBOOT_BASE

#define APPLE_SB_OBJ_EFIBOOT_BASE   APPLE_SB_OBJ_TYPE ('e', 'f', 'b', 'b')

Definition at line 41 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_EFIBOOT_DEBUG

#define APPLE_SB_OBJ_EFIBOOT_DEBUG   APPLE_SB_OBJ_TYPE ('e', 'f', 'b', 'd')

Definition at line 40 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_ETHU

#define APPLE_SB_OBJ_ETHU   APPLE_SB_OBJ_TYPE ('e', 't', 'h', 'u')

Definition at line 47 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_GPUU

#define APPLE_SB_OBJ_GPUU   APPLE_SB_OBJ_TYPE ('g', 'p', 'u', 'u')

Definition at line 46 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_HPMU

#define APPLE_SB_OBJ_HPMU   APPLE_SB_OBJ_TYPE ('h', 'p', 'm', 'u')

Definition at line 44 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_KERNEL

#define APPLE_SB_OBJ_KERNEL   APPLE_SB_OBJ_TYPE ('m', 'k', 'r', 'n')

Definition at line 55 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_KERNEL_DEBUG

#define APPLE_SB_OBJ_KERNEL_DEBUG   APPLE_SB_OBJ_TYPE ('m', 'k', 'r', 'd')

Definition at line 56 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_MUPD

#define APPLE_SB_OBJ_MUPD   APPLE_SB_OBJ_TYPE ('m', 'u', 'p', 'd')

Definition at line 43 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_SDFU

#define APPLE_SB_OBJ_SDFU   APPLE_SB_OBJ_TYPE ('s', 'd', 'f', 'u')

Definition at line 48 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_THOU

#define APPLE_SB_OBJ_THOU   APPLE_SB_OBJ_TYPE ('t', 'h', 'o', 'u')

Definition at line 45 of file AppleSecureBoot.h.

◆ APPLE_SB_OBJ_TYPE

#define APPLE_SB_OBJ_TYPE ( A,
B,
C,
D )
Value:
(UINT32)( \
((A) << 24UL) \
| ((B) << 16UL) \
| ((C) << 8UL) \
| ((D) << 0UL) \
)

Definition at line 27 of file AppleSecureBoot.h.

◆ APPLE_SECURE_BOOT_PROTOCOL_GUID

#define APPLE_SECURE_BOOT_PROTOCOL_GUID
Value:
{ 0x24B73556, 0x2197, 0x4702, \
{ 0x82, 0xA8, 0x3E, 0x13, 0x37, 0xDA, 0xFB, 0xF2 } }

Definition at line 21 of file AppleSecureBoot.h.

◆ APPLE_SECURE_BOOT_PROTOCOL_REVISION

#define APPLE_SECURE_BOOT_PROTOCOL_REVISION   4U

Definition at line 19 of file AppleSecureBoot.h.

Typedef Documentation

◆ APPLE_SB_GET_FAILURE_REASON

typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Reason)

Retrieves the current Secure Boot failure reason.

Parameters
[in]ThisA pointer to the current protocol instance.
[out]ReasonOn output, the current failure reason.
Return values
EFI_SUCCESSThe current failure reason has been returned.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.

Definition at line 162 of file AppleSecureBoot.h.

◆ APPLE_SB_GET_KERNEL_FAILURE_REASON

typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_KERNEL_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Reason)

Retrieves the current Secure Boot Kernel failure reason.

Parameters
[in]ThisA pointer to the current protocol instance.
[out]ReasonOn output, the current Kernel failure reason.
Return values
EFI_SUCCESSThe current failure reason has been returned.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.

Definition at line 196 of file AppleSecureBoot.h.

◆ APPLE_SB_GET_POLICY

typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_POLICY) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Policy)

Retrieves the current Secure Boot policy.

Parameters
[in]ThisA pointer to the current protocol instance.
[out]PolicyOn output, the current Secure Boot policy.
Return values
EFI_SUCCESSThe current policy has been returned.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.
EFI_NOT_FOUNDThe current policy could not be retrieved.

Definition at line 145 of file AppleSecureBoot.h.

◆ APPLE_SB_GET_WINDOWS_FAILURE_REASON

typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_WINDOWS_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Reason)

Retrieves the current Secure Boot Windows failure reason.

Parameters
[in]ThisA pointer to the current protocol instance.
[out]ReasonOn output, the current Windows failure reason.
Return values
EFI_SUCCESSThe current failure reason has been returned.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.

Definition at line 301 of file AppleSecureBoot.h.

◆ APPLE_SB_GET_WINDOWS_POLICY

typedef EFI_STATUS(EFIAPI * APPLE_SB_GET_WINDOWS_POLICY) (IN APPLE_SECURE_BOOT_PROTOCOL *This, OUT UINT8 *Policy)

Retrieves the current Secure Boot Windows policy.

Parameters
[in]ThisA pointer to the current protocol instance.
[out]PolicyOn output, the current Secure Boot Windows policy.
Return values
EFI_SUCCESSThe current policy has been returned.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.
EFI_NOT_FOUNDThe current policy could not be retrieved.

Definition at line 284 of file AppleSecureBoot.h.

◆ APPLE_SB_SET_AVAILABILITY

typedef VOID(EFIAPI * APPLE_SB_SET_AVAILABILITY) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN BOOLEAN Available)

Sets the Secure Boot availability state.

Parameters
[in]ThisA pointer to the current protocol instance.
[in]AvailableThe new availability status for Secure Boot.

Definition at line 66 of file AppleSecureBoot.h.

◆ APPLE_SB_SET_FAILURE_REASON

typedef EFI_STATUS(EFIAPI * APPLE_SB_SET_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN UINT8 Reason)

Sets the Secure Boot failure reason.

Parameters
[in]ThisA pointer to the current protocol instance.
[in]ReasonThe failure reason to set.
Return values
EFI_SUCCESSThe failure reason has been set successfully.
EFI_UNSUPPORTEDSecure Boot is currently unavailable.

Definition at line 179 of file AppleSecureBoot.h.

◆ APPLE_SB_SET_KERNEL_FAILURE_REASON

typedef EFI_STATUS(EFIAPI * APPLE_SB_SET_KERNEL_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN UINT8 Reason)

Sets the Secure Boot Kernel failure reason.

Parameters
[in]ThisA pointer to the current protocol instance.
[in]ReasonThe Kernel failure reason to set.
Return values
EFI_SUCCESSThe failure reason has been set successfully.
EFI_UNSUPPORTEDSecure Boot is currently unavailable.

Definition at line 213 of file AppleSecureBoot.h.

◆ APPLE_SB_SET_WINDOWS_FAILURE_REASON

typedef EFI_STATUS(EFIAPI * APPLE_SB_SET_WINDOWS_FAILURE_REASON) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN UINT8 Reason)

Sets the Secure Boot Windows failure reason.

Parameters
[in]ThisA pointer to the current protocol instance.
[in]ReasonThe Windows failure reason to set.
Return values
EFI_SUCCESSThe failure reason has been set successfully.
EFI_UNSUPPORTEDSecure Boot is currently unavailable.

Definition at line 318 of file AppleSecureBoot.h.

◆ APPLE_SB_VERIFY_IMG4

typedef EFI_STATUS(EFIAPI * APPLE_SB_VERIFY_IMG4) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN CONST VOID *ImageBuffer, IN UINTN ImageSize, IN CONST VOID *ManifestBuffer, IN UINTN ManifestSize, IN UINT32 ObjType, IN BOOLEAN SetFailureReason)

Verify the signature of ImageBuffer against Type within a IMG4 Manifest.

Parameters
[in]ThisThe pointer to the current protocol instance.
[in]ImageBufferThe buffer to validate.
[in]ImageSizeThe size, in bytes, of ImageBuffer.
[in]ManifestBufferThe buffer of the IMG4 Manifest.
[in]ManifestSizeThe size, in bytes, of ManifestBuffer.
[in]ObjTypeThe IMG4 object type to validate against.
[in]SetFailureReasonWhether to set the failure reason.
Return values
EFI_SUCCESSImageBuffer is correctly signed.
EFI_LOAD_ERRORThe current policy is invalid.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.
EFI_UNSUPPORTEDSecure Boot is currently unavailable or disabled.
EFI_OUT_OF_RESOURCESNot enough resources are available.
EFI_SECURITY_VIOLATIONImageBuffer's signature is invalid.

Definition at line 122 of file AppleSecureBoot.h.

◆ APPLE_SB_VERIFY_IMG4_BY_PATH

typedef EFI_STATUS(EFIAPI * APPLE_SB_VERIFY_IMG4_BY_PATH) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN UINT32 ObjType, IN BOOLEAN SetFailureReason)

Verify the signature of the file at DevicePath via the matching IMG4 Manifest.

Parameters
[in]ThisA pointer to the current protocol instance.
[in]DevicePathThe device path to the image to validate.
[in]ObjTypeThe IMG4 object type to validate against.
[in]SetFailureReasonWhether to set the failure reason.
Return values
EFI_SUCCESSThe file at DevicePath is correctly signed.
EFI_LOAD_ERRORThe current policy is invalid.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.
EFI_UNSUPPORTEDSecure Boot is currently unavailable or disabled.
EFI_OUT_OF_RESOURCESNot enough resources are available.
EFI_NO_MEDIAThe file at DevicePath could not be read.
EFI_NOT_FOUNDThe file's IMG4 Manifest could not be found.
EFI_SECURITY_VIOLATIONThe file's signature is invalid.

Definition at line 93 of file AppleSecureBoot.h.

◆ APPLE_SB_VERIFY_WINDOWS

typedef EFI_STATUS(EFIAPI * APPLE_SB_VERIFY_WINDOWS) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN CONST VOID *ImageBuffer, IN UINTN ImageSize, IN BOOLEAN SetFailureReason)

Verify the signature of ImageBuffer against a Microsoft certificate chain.

Parameters
[in]ThisThe pointer to the current protocol instance.
[in]ImageBufferThe buffer to validate.
[in]ImageSizeThe size, in bytes, of ImageBuffer.
[in]SetFailureReasonWhether to set the failure reason.
Return values
EFI_SUCCESSImageBuffer is correctly signed.
EFI_LOAD_ERRORThe current policy is invalid.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.
EFI_UNSUPPORTEDSecure Boot is currently unavailable or disabled.
EFI_ACCESSDENIED A suiting certificate could not be found.
EFI_SECURITY_VIOLATIONImageBuffer's signature is invalid.

Definition at line 264 of file AppleSecureBoot.h.

◆ APPLE_SB_VERIFY_WINDOWS_BY_PATH

typedef EFI_STATUS(EFIAPI * APPLE_SB_VERIFY_WINDOWS_BY_PATH) (IN APPLE_SECURE_BOOT_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN SetFailureReason)

Verify the signature of the image at DebicePath against a Microsoft certificate chain.

Parameters
[in]ThisThe pointer to the current protocol instance.
[in]DevicePathThe device path to the image to validate.
[in]SetFailureReasonWhether to set the failure reason.
Return values
EFI_SUCCESSThe file at DevicePath is correctly signed.
EFI_LOAD_ERRORThe current policy is invalid.
EFI_INVALID_PARAMETEROne or more required parameters are NULL.
EFI_UNSUPPORTEDSecure Boot is currently unavailable or disabled.
EFI_OUT_OF_RESOURCESNot enough resources are available.
EFI_NO_MEDIAThe file at DevicePath could not be read.
EFI_ACCESSDENIED A suiting certificate could not be found.
EFI_SECURITY_VIOLATIONthe file's signature is invalid.

Definition at line 239 of file AppleSecureBoot.h.

◆ APPLE_SECURE_BOOT_PROTOCOL

Definition at line 25 of file AppleSecureBoot.h.

Variable Documentation

◆ gAppleSecureBootProtocolGuid

EFI_GUID gAppleSecureBootProtocolGuid
extern