4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/** @file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If a GUID-defined section is encountered when doing section
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync extraction, the section extraction driver calls the appropriate
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync instance of the GUIDed Section Extraction Protocol to extract
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the section stream contained therein.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are licensed and made available under the terms and conditions of the BSD License
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync which accompanies this distribution. The full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync http://opensource.org/licenses/bsd-license.php
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @par Revision Reference: PI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Version 1.00.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#ifndef __GUID_SECTION_EXTRACTION_PROTOCOL_H__
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define __GUID_SECTION_EXTRACTION_PROTOCOL_H__
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync//
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// The protocol interface structures are identified by associating
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// them with a GUID. Each instance of a protocol with a given
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// GUID must have the same interface structure. While all instances
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// of the GUIDed Section Extraction Protocol must have the same
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// interface structure, they do not all have the same GUID. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// GUID that is associated with an instance of the GUIDed Section
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Extraction Protocol is used to correlate it with the GUIDed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// section type that it is intended to process.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync//
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The ExtractSection() function processes the input section and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync allocates a buffer from the pool in which it returns the section
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync contents. If the section being extracted contains
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync authentication information (the section's
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync GuidedSectionHeader.Attributes field has the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned in AuthenticationStatus must reflect the results of
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the authentication operation. Depending on the algorithm and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync size of the encapsulated data, the time that is required to do
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync a full authentication may be prohibitively long for some
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync classes of systems. To indicate this, use
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the security policy driver (see the Platform Initialization
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Driver Execution Environment Core Interface Specification for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync more details and the GUID definition). If the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync database, then, if possible, full authentication should be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync skipped and the section contents simply returned in the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OutputBuffer. In this case, the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync must be set on return. ExtractSection() is callable only from
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync TPL_NOTIFY and below. Behavior of ExtractSection() at any
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync defined in RaiseTPL() in the UEFI 2.0 specification.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Indicates the EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param InputSection Buffer containing the input GUIDed section
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to be processed. OutputBuffer OutputBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is allocated from boot services pool
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync memory and contains the new section
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync stream. The caller is responsible for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync freeing this buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param OutputSize A pointer to a caller-allocated UINTN in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync which the size of OutputBuffer allocation
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is stored. If the function returns
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync anything other than EFI_SUCCESS, the value
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of OutputSize is undefined.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param AuthenticationStatus A pointer to a caller-allocated
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT32 that indicates the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync authentication status of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync output buffer. If the input
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync section's
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync GuidedSectionHeader.Attributes
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync field has the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_GUIDED_SECTION_AUTH_STATUS_VAL
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync bit as clear, AuthenticationStatus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync must return zero. Both local bits
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync (19:16) and aggregate bits (3:0)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync in AuthenticationStatus are
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned by ExtractSection().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync These bits reflect the status of
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the extraction operation. The bit
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync pattern in both regions must be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the same, as the local and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync aggregate authentication statuses
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync have equivalent meaning at this
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync level. If the function returns
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync anything other than EFI_SUCCESS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the value of AuthenticationStatus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is undefined.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The InputSection was successfully
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync processed and the section contents were
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_OUT_OF_RESOURCES The system has insufficient
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync resources to process the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync request.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER The GUID in InputSection does
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync not match this instance of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync GUIDed Section Extraction
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Protocol.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST VOID *InputSection,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT VOID **OutputBuffer,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINTN *OutputSize,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT32 *AuthenticationStatus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync);
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync///
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Typically, protocol interface structures are identified by associating them with a GUID. Each
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// instance of a protocol with a given GUID must have the same interface structure. While all instances
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// of the GUIDed Section Extraction Protocol must have the same interface structure, they do not all
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// have the same GUID. The GUID that is associated with an instance of the GUIDed Section
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/// Extraction Protocol is used to correlate it with the GUIDed section type that it is intended to process.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync///
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncstruct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_EXTRACT_GUIDED_SECTION ExtractSection;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync};
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#endif