+/** @file\r
+ NULL FMP authentication library.\r
+\r
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php.\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <Uefi.h>\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/FmpAuthenticationLib.h>\r
+\r
+/**\r
+ The function is used to do the authentication for FMP capsule based upon\r
+ EFI_FIRMWARE_IMAGE_AUTHENTICATION.\r
+\r
+ The FMP capsule image should start with EFI_FIRMWARE_IMAGE_AUTHENTICATION,\r
+ followed by the payload.\r
+\r
+ If the return status is RETURN_SUCCESS, the caller may continue the rest\r
+ FMP update process.\r
+ If the return status is NOT RETURN_SUCCESS, the caller should stop the FMP\r
+ update process and convert the return status to LastAttemptStatus\r
+ to indicate that FMP update fails.\r
+ The LastAttemptStatus can be got from ESRT table or via\r
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImageInfo().\r
+\r
+ Caution: This function may receive untrusted input.\r
+\r
+ @param[in] Image Points to an FMP authentication image, started from EFI_FIRMWARE_IMAGE_AUTHENTICATION.\r
+ @param[in] ImageSize Size of the authentication image in bytes.\r
+ @param[in] PublicKeyData The public key data used to validate the signature.\r
+ @param[in] PublicKeyDataLength The length of the public key data.\r
+\r
+ @retval RETURN_SUCCESS Authentication pass.\r
+ The LastAttemptStatus should be LAST_ATTEMPT_STATUS_SUCCESS.\r
+ @retval RETURN_SECURITY_VIOLATION Authentication fail.\r
+ The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR.\r
+ @retval RETURN_INVALID_PARAMETER The image is in an invalid format.\r
+ The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.\r
+ @retval RETURN_UNSUPPORTED No Authentication handler associated with CertType.\r
+ The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.\r
+ @retval RETURN_UNSUPPORTED Image or ImageSize is invalid.\r
+ The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT.\r
+ @retval RETURN_OUT_OF_RESOURCES No Authentication handler associated with CertType.\r
+ The LastAttemptStatus should be LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES.\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+AuthenticateFmpImage (\r
+ IN EFI_FIRMWARE_IMAGE_AUTHENTICATION *Image,\r
+ IN UINTN ImageSize,\r
+ IN CONST UINT8 *PublicKeyData,\r
+ IN UINTN PublicKeyDataLength\r
+ )\r
+{\r
+ ASSERT(FALSE);\r
+ return RETURN_UNSUPPORTED;\r
+}\r