--- /dev/null
+/** @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
--- /dev/null
+## @file\r
+# FmpAuthentication Library\r
+#\r
+# NULL Instance of FmpAuthentication Library.\r
+#\r
+# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+#\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
+# 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
+[Defines]\r
+ INF_VERSION = 0x00010005\r
+ BASE_NAME = FmpAuthenticationLibNull\r
+ MODULE_UNI_FILE = FmpAuthenticationLibNull.uni\r
+ FILE_GUID = 5011522C-7B0E-4ACB-8E30-9B1D133CF2E0\r
+ MODULE_TYPE = BASE\r
+ VERSION_STRING = 1.0\r
+ LIBRARY_CLASS = FmpAuthenticationLib\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC\r
+#\r
+\r
+[Sources]\r
+ FmpAuthenticationLibNull.c\r
+\r
+[Packages]\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
+\r
+[LibraryClasses]\r
+ DebugLib\r
--- /dev/null
+// /** @file\r
+// FmpAuthentication Library\r
+//\r
+// NULL Instance of FmpAuthentication Library.\r
+//\r
+// Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+//\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
+\r
+#string STR_MODULE_ABSTRACT #language en-US "FmpAuthentication Library"\r
+\r
+#string STR_MODULE_DESCRIPTION #language en-US "NULL Instance of FmpAuthentication Library."\r
+\r