MdeModulePkg/FmpAuthenticationLibNull: Add NULL instance FMP.
authorJiewen Yao <>
Wed, 21 Sep 2016 01:46:32 +0000 (09:46 +0800)
committerJiewen Yao <>
Tue, 8 Nov 2016 14:36:55 +0000 (22:36 +0800)
Add NULL instance to pass build.

Cc: Feng Tian <>
Cc: Star Zeng <>
Cc: Michael D Kinney <>
Cc: Liming Gao <>
Cc: Chao Zhang <>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <>
Reviewed-by: Liming Gao <>
Reviewed-by: Michael Kinney <>
Tested-by: Michael Kinney <>
MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.c [new file with mode: 0644]
MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.inf [new file with mode: 0644]
MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.uni [new file with mode: 0644]

diff --git a/MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.c b/MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.c
new file mode 100644 (file)
index 0000000..02ff504
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  NULL FMP authentication library.\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
+#include <Uefi.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/FmpAuthenticationLib.h>\r
+  The function is used to do the authentication for FMP capsule based upon\r
+  The FMP capsule image should start with EFI_FIRMWARE_IMAGE_AUTHENTICATION,\r
+  followed by the payload.\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
+  Caution: This function may receive untrusted input.\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
+  @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
+AuthenticateFmpImage (\r
+  IN UINTN                              ImageSize,\r
+  IN CONST UINT8                        *PublicKeyData,\r
+  IN UINTN                              PublicKeyDataLength\r
+  )\r
diff --git a/MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.inf b/MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.inf
new file mode 100644 (file)
index 0000000..f9b87ca
--- /dev/null
@@ -0,0 +1,40 @@
+## @file\r
+# FmpAuthentication Library\r
+# NULL Instance of FmpAuthentication Library.\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
+  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
+# The following information is for reference only and not required by the build tools.\r
+#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
+  FmpAuthenticationLibNull.c\r
+  MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
+  DebugLib\r
diff --git a/MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.uni b/MdeModulePkg/Library/FmpAuthenticationLibNull/FmpAuthenticationLibNull.uni
new file mode 100644 (file)
index 0000000..69fd6e1
--- /dev/null
@@ -0,0 +1,22 @@
+// /** @file\r
+// FmpAuthentication Library\r
+// NULL Instance of FmpAuthentication Library.\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
+// **/\r
+#string STR_MODULE_ABSTRACT             #language en-US "FmpAuthentication Library"\r
+#string STR_MODULE_DESCRIPTION          #language en-US "NULL Instance of FmpAuthentication Library."\r