TianoCore EDK2 master
Loading...
Searching...
No Matches
FmpAuthenticationLib.h File Reference

Go to the source code of this file.

Functions

RETURN_STATUS EFIAPI AuthenticateFmpImage (IN EFI_FIRMWARE_IMAGE_AUTHENTICATION *Image, IN UINTN ImageSize, IN CONST UINT8 *PublicKeyData, IN UINTN PublicKeyDataLength)
 

Detailed Description

FMP capsule authenitcation Library.

Copyright (c) 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file FmpAuthenticationLib.h.

Function Documentation

◆ AuthenticateFmpImage()

RETURN_STATUS EFIAPI AuthenticateFmpImage ( IN EFI_FIRMWARE_IMAGE_AUTHENTICATION Image,
IN UINTN  ImageSize,
IN CONST UINT8 *  PublicKeyData,
IN UINTN  PublicKeyDataLength 
)

The function is used to do the authentication for FMP capsule based upon EFI_FIRMWARE_IMAGE_AUTHENTICATION.

The FMP capsule image should start with EFI_FIRMWARE_IMAGE_AUTHENTICATION, followed by the payload.

If the return status is RETURN_SUCCESS, the caller may continue the rest FMP update process. If the return status is NOT RETURN_SUCCESS, the caller should stop the FMP update process and convert the return status to LastAttemptStatus to indicate that FMP update fails. The LastAttemptStatus can be got from ESRT table or via EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImageInfo().

Caution: This function may receive untrusted input.

Parameters
[in]ImagePoints to an FMP authentication image, started from EFI_FIRMWARE_IMAGE_AUTHENTICATION.
[in]ImageSizeSize of the authentication image in bytes.
[in]PublicKeyDataThe public key data used to validate the signature.
[in]PublicKeyDataLengthThe length of the public key data.
Return values
RETURN_SUCCESSAuthentication pass. The LastAttemptStatus should be LAST_ATTEMPT_STATUS_SUCCESS.
RETURN_SECURITY_VIOLATIONAuthentication fail. The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR.
RETURN_INVALID_PARAMETERThe image is in an invalid format. The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.
RETURN_UNSUPPORTEDNo Authentication handler associated with CertType. The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.
RETURN_UNSUPPORTEDImage or ImageSize is invalid. The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.
RETURN_OUT_OF_RESOURCESNo Authentication handler associated with CertType. The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES.

Definition at line 51 of file FmpAuthenticationLibNull.c.