What to do:
1. Add AuthVariableLib LibraryClass definitions.
2. Implement a NULL AuthVariableLib library instance.
3. Add VARIABLE_ENTRY_PROPERTY definition to VarCheck.h.
4. Add VARIABLE_ENTRY_CONSISTENCY and variable attribute
combinations definitions to VariableFormat.h.

Why to do:
1. Share code.
1.1. Separate auth variable service from Auth Variable driver in
SecurityPkg to AuthVariableLib. Then the AuthVariableLib could benefit
and be used by different implementation of Auth Variable drivers.

1.2 The VARIABLE_ENTRY_PROPERTY definition to VarCheck.h,
VARIABLE_ENTRY_CONSISTENCY and variable attribute
combinations definitions to VariableFormat.h will be shared
by merged Variable driver and AuthVariableLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.z...@intel.com>
Reviewed-by: Jiewen Yao <jiewen....@intel.com>
Reviewed-by: Liming Gao <liming....@intel.com>
---
 MdeModulePkg/Include/Guid/VariableFormat.h         |  18 ++
 MdeModulePkg/Include/Library/AuthVariableLib.h     | 261 +++++++++++++++++++++
 MdeModulePkg/Include/Protocol/VarCheck.h           |   6 +
 .../AuthVariableLibNull/AuthVariableLibNull.c      |  78 ++++++
 .../AuthVariableLibNull/AuthVariableLibNull.inf    |  40 ++++
 .../AuthVariableLibNull/AuthVariableLibNull.uni    | Bin 0 -> 1710 bytes
 MdeModulePkg/MdeModulePkg.dec                      |   4 +
 MdeModulePkg/MdeModulePkg.dsc                      |   2 +
 .../Universal/Variable/RuntimeDxe/Variable.h       |  10 -
 9 files changed, 409 insertions(+), 10 deletions(-)
 create mode 100644 MdeModulePkg/Include/Library/AuthVariableLib.h
 create mode 100644 
MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.c
 create mode 100644 
MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 create mode 100644 
MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.uni

diff --git a/MdeModulePkg/Include/Guid/VariableFormat.h 
b/MdeModulePkg/Include/Guid/VariableFormat.h
index c52eaf3..3b60fac 100644
--- a/MdeModulePkg/Include/Guid/VariableFormat.h
+++ b/MdeModulePkg/Include/Guid/VariableFormat.h
@@ -111,6 +111,18 @@ typedef struct {
 #define VAR_ADDED                     0x3f  ///< Variable has been completely 
added.
 
 ///
+/// Variable Attribute combinations.
+///
+#define VARIABLE_ATTRIBUTE_NV_BS        (EFI_VARIABLE_NON_VOLATILE | 
EFI_VARIABLE_BOOTSERVICE_ACCESS)
+#define VARIABLE_ATTRIBUTE_BS_RT        (EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS)
+#define VARIABLE_ATTRIBUTE_AT_AW        
(EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | 
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
+#define VARIABLE_ATTRIBUTE_NV_BS_RT     (VARIABLE_ATTRIBUTE_BS_RT | 
EFI_VARIABLE_NON_VOLATILE)
+#define VARIABLE_ATTRIBUTE_NV_BS_RT_HR  (VARIABLE_ATTRIBUTE_NV_BS_RT | 
EFI_VARIABLE_HARDWARE_ERROR_RECORD)
+#define VARIABLE_ATTRIBUTE_NV_BS_RT_AT  (VARIABLE_ATTRIBUTE_NV_BS_RT | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
+#define VARIABLE_ATTRIBUTE_NV_BS_RT_AW  (VARIABLE_ATTRIBUTE_NV_BS_RT | 
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
+#define VARIABLE_ATTRIBUTE_NV_BS_RT_HR_AT_AW    
(VARIABLE_ATTRIBUTE_NV_BS_RT_HR | VARIABLE_ATTRIBUTE_AT_AW)
+
+///
 /// Single Variable Data Header Structure.
 ///
 typedef struct {
@@ -184,6 +196,12 @@ typedef struct {
   EFI_GUID    VendorGuid;
 } AUTHENTICATED_VARIABLE_HEADER;
 
+typedef struct {
+  EFI_GUID    *Guid;
+  CHAR16      *Name;
+  UINTN       VariableSize;
+} VARIABLE_ENTRY_CONSISTENCY;
+
 #pragma pack()
 
 typedef struct _VARIABLE_INFO_ENTRY  VARIABLE_INFO_ENTRY;
diff --git a/MdeModulePkg/Include/Library/AuthVariableLib.h 
b/MdeModulePkg/Include/Library/AuthVariableLib.h
new file mode 100644
index 0000000..66bc424
--- /dev/null
+++ b/MdeModulePkg/Include/Library/AuthVariableLib.h
@@ -0,0 +1,261 @@
+/** @file
+  Provides services to initialize and process authenticated variables.
+
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available 
under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _AUTH_VARIABLE_LIB_H_
+#define _AUTH_VARIABLE_LIB_H_
+
+#include <Protocol/VarCheck.h>
+
+///
+/// Size of AuthInfo prior to the data payload.
+///
+#define AUTHINFO_SIZE ((OFFSET_OF (EFI_VARIABLE_AUTHENTICATION, AuthInfo)) + \
+                       (OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, CertData)) + \
+                       sizeof (EFI_CERT_BLOCK_RSA_2048_SHA256))
+
+#define AUTHINFO2_SIZE(VarAuth2) ((OFFSET_OF (EFI_VARIABLE_AUTHENTICATION_2, 
AuthInfo)) + \
+                                  (UINTN) ((EFI_VARIABLE_AUTHENTICATION_2 *) 
(VarAuth2))->AuthInfo.Hdr.dwLength)
+
+#define OFFSET_OF_AUTHINFO2_CERT_DATA ((OFFSET_OF 
(EFI_VARIABLE_AUTHENTICATION_2, AuthInfo)) + \
+                                       (OFFSET_OF (WIN_CERTIFICATE_UEFI_GUID, 
CertData)))
+
+typedef struct {
+  CHAR16        *VariableName;
+  EFI_GUID      *VendorGuid;
+  UINT32        Attributes;
+  UINTN         DataSize;
+  VOID          *Data;
+  UINT32        PubKeyIndex;
+  UINT64        MonotonicCount;
+  EFI_TIME      *TimeStamp;
+} AUTH_VARIABLE_INFO;
+
+/**
+  Finds variable in storage blocks of volatile and non-volatile storage areas.
+
+  This code finds variable in storage blocks of volatile and non-volatile 
storage areas.
+  If VariableName is an empty string, then we just return the first
+  qualified variable without comparing VariableName and VendorGuid.
+
+  @param[in]  VariableName          Name of the variable to be found.
+  @param[in]  VendorGuid            Variable vendor GUID to be found.
+  @param[out] AuthVariableInfo      Pointer to AUTH_VARIABLE_INFO structure for
+                                    output of the variable found.
+
+  @retval EFI_INVALID_PARAMETER     If VariableName is not an empty string,
+                                    while VendorGuid is NULL.
+  @retval EFI_SUCCESS               Variable successfully found.
+  @retval EFI_NOT_FOUND             Variable not found
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *AUTH_VAR_LIB_FIND_VARIABLE) (
+  IN  CHAR16                *VariableName,
+  IN  EFI_GUID              *VendorGuid,
+  OUT AUTH_VARIABLE_INFO    *AuthVariableInfo
+  );
+
+/**
+  Finds next variable in storage blocks of volatile and non-volatile storage 
areas.
+
+  This code finds next variable in storage blocks of volatile and non-volatile 
storage areas.
+  If VariableName is an empty string, then we just return the first
+  qualified variable without comparing VariableName and VendorGuid.
+
+  @param[in]  VariableName          Name of the variable to be found.
+  @param[in]  VendorGuid            Variable vendor GUID to be found.
+  @param[out] AuthVariableInfo      Pointer to AUTH_VARIABLE_INFO structure for
+                                    output of the next variable.
+
+  @retval EFI_INVALID_PARAMETER     If VariableName is not an empty string,
+                                    while VendorGuid is NULL.
+  @retval EFI_SUCCESS               Variable successfully found.
+  @retval EFI_NOT_FOUND             Variable not found
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *AUTH_VAR_LIB_FIND_NEXT_VARIABLE) (
+  IN  CHAR16                *VariableName,
+  IN  EFI_GUID              *VendorGuid,
+  OUT AUTH_VARIABLE_INFO    *AuthVariableInfo
+  );
+
+/**
+  Update the variable region with Variable information.
+
+  @param[in] AuthVariableInfo       Pointer AUTH_VARIABLE_INFO structure for
+                                    input of the variable.
+
+  @retval EFI_SUCCESS               The update operation is success.
+  @retval EFI_INVALID_PARAMETER     Invalid parameter.
+  @retval EFI_WRITE_PROTECTED       Variable is write-protected.
+  @retval EFI_OUT_OF_RESOURCES      There is not enough resource.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *AUTH_VAR_LIB_UPDATE_VARIABLE) (
+  IN AUTH_VARIABLE_INFO     *AuthVariableInfo
+  );
+
+/**
+  Get scratch buffer.
+
+  @param[in, out] ScratchBufferSize Scratch buffer size. If input size is 
greater than
+                                    the maximum supported buffer size, this 
value contains
+                                    the maximum supported buffer size as 
output.
+  @param[out]     ScratchBuffer     Pointer to scratch buffer address.
+
+  @retval EFI_SUCCESS       Get scratch buffer successfully.
+  @retval EFI_UNSUPPORTED   If input size is greater than the maximum 
supported buffer size.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *AUTH_VAR_LIB_GET_SCRATCH_BUFFER) (
+  IN OUT UINTN      *ScratchBufferSize,
+  OUT    VOID       **ScratchBuffer
+  );
+
+/**
+  This function is to check if the remaining variable space is enough to set
+  all Variables from argument list successfully. The purpose of the check
+  is to keep the consistency of the Variables to be in variable storage.
+
+  Note: Variables are assumed to be in same storage.
+  The set sequence of Variables will be same with the sequence of 
VariableEntry from argument list,
+  so follow the argument sequence to check the Variables.
+
+  @param[in] Attributes         Variable attributes for Variable entries.
+  @param ...                    The variable argument list with type 
VARIABLE_ENTRY_CONSISTENCY *.
+                                A NULL terminates the list. The VariableSize of
+                                VARIABLE_ENTRY_CONSISTENCY is the variable 
data size as input.
+                                It will be changed to variable total size as 
output.
+
+  @retval TRUE                  Have enough variable space to set the 
Variables successfully.
+  @retval FALSE                 No enough variable space to set the Variables 
successfully.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *AUTH_VAR_LIB_CHECK_REMAINING_SPACE) (
+  IN UINT32                     Attributes,
+  ...
+  );
+
+/**
+  Return TRUE if at OS runtime.
+
+  @retval TRUE If at OS runtime.
+  @retval FALSE If at boot time.
+
+**/
+typedef
+BOOLEAN
+(EFIAPI *AUTH_VAR_LIB_AT_RUNTIME) (
+  VOID
+  );
+
+#define AUTH_VAR_LIB_CONTEXT_IN_STRUCT_VERSION  0x01
+
+typedef struct {
+  UINTN                                 StructVersion;
+  UINTN                                 StructSize;
+  //
+  // Reflect the overhead associated with the saving
+  // of a single EFI authenticated variable with the exception
+  // of the overhead associated with the length
+  // of the string name of the EFI variable.
+  //
+  UINTN                                 MaxAuthVariableSize;
+  AUTH_VAR_LIB_FIND_VARIABLE            FindVariable;
+  AUTH_VAR_LIB_FIND_NEXT_VARIABLE       FindNextVariable;
+  AUTH_VAR_LIB_UPDATE_VARIABLE          UpdateVariable;
+  AUTH_VAR_LIB_GET_SCRATCH_BUFFER       GetScratchBuffer;
+  AUTH_VAR_LIB_CHECK_REMAINING_SPACE    CheckRemainingSpaceForConsistency;
+  AUTH_VAR_LIB_AT_RUNTIME               AtRuntime;
+} AUTH_VAR_LIB_CONTEXT_IN;
+
+#define AUTH_VAR_LIB_CONTEXT_OUT_STRUCT_VERSION 0x01
+
+typedef struct {
+  UINTN                                 StructVersion;
+  UINTN                                 StructSize;
+  //
+  // Caller needs to set variable property for the variables.
+  //
+  VARIABLE_ENTRY_PROPERTY               *AuthVarEntry;
+  UINTN                                 AuthVarEntryCount;
+  //
+  // Caller needs to ConvertPointer() for the pointers.
+  //
+  VOID                                  **AddressPointer;
+  UINTN                                 AddressPointerCount;
+} AUTH_VAR_LIB_CONTEXT_OUT;
+
+/**
+  Initialization for authenticated varibale services.
+  If this initialization returns error status, other APIs will not work
+  and expect to be not called then.
+
+  @param[in]  AuthVarLibContextIn   Pointer to input auth variable lib context.
+  @param[out] AuthVarLibContextOut  Pointer to output auth variable lib 
context.
+
+  @retval EFI_SUCCESS               Function successfully executed.
+  @retval EFI_INVALID_PARAMETER     If AuthVarLibContextIn == NULL or 
AuthVarLibContextOut == NULL.
+  @retval EFI_OUT_OF_RESOURCES      Fail to allocate enough resource.
+  @retval EFI_UNSUPPORTED           Unsupported to process authenticated 
variable.
+
+**/
+EFI_STATUS
+EFIAPI
+AuthVariableLibInitialize (
+  IN  AUTH_VAR_LIB_CONTEXT_IN   *AuthVarLibContextIn,
+  OUT AUTH_VAR_LIB_CONTEXT_OUT  *AuthVarLibContextOut
+  );
+
+/**
+  Process variable with 
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS/EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
 set.
+
+  @param[in] VariableName           Name of the variable.
+  @param[in] VendorGuid             Variable vendor GUID.
+  @param[in] Data                   Data pointer.
+  @param[in] DataSize               Size of Data.
+  @param[in] Attributes             Attribute value of the variable.
+
+  @retval EFI_SUCCESS               The firmware has successfully stored the 
variable and its data as
+                                    defined by the Attributes.
+  @retval EFI_INVALID_PARAMETER     Invalid parameter.
+  @retval EFI_WRITE_PROTECTED       Variable is write-protected.
+  @retval EFI_OUT_OF_RESOURCES      There is not enough resource.
+  @retval EFI_SECURITY_VIOLATION    The variable is with 
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
+                                    or 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS
+                                    set, but the AuthInfo does NOT pass the 
validation
+                                    check carried out by the firmware.
+  @retval EFI_UNSUPPORTED           Unsupported to process authenticated 
variable.
+
+**/
+EFI_STATUS
+EFIAPI
+AuthVariableLibProcessVariable (
+  IN CHAR16         *VariableName,
+  IN EFI_GUID       *VendorGuid,
+  IN VOID           *Data,
+  IN UINTN          DataSize,
+  IN UINT32         Attributes
+  );
+
+#endif
diff --git a/MdeModulePkg/Include/Protocol/VarCheck.h 
b/MdeModulePkg/Include/Protocol/VarCheck.h
index 1a79216..3525989 100644
--- a/MdeModulePkg/Include/Protocol/VarCheck.h
+++ b/MdeModulePkg/Include/Protocol/VarCheck.h
@@ -63,6 +63,12 @@ typedef struct {
   UINTN                             MaxSize;
 } VAR_CHECK_VARIABLE_PROPERTY;
 
+typedef struct {
+  EFI_GUID                      *Guid;
+  CHAR16                        *Name;
+  VAR_CHECK_VARIABLE_PROPERTY   VariableProperty;
+} VARIABLE_ENTRY_PROPERTY;
+
 /**
   Variable property set.
   Variable driver will do check according to the VariableProperty before
diff --git a/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.c 
b/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.c
new file mode 100644
index 0000000..054131f
--- /dev/null
+++ b/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.c
@@ -0,0 +1,78 @@
+/** @file
+  Implements NULL authenticated variable services.
+
+Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/AuthVariableLib.h>
+#include <Library/DebugLib.h>
+
+/**
+  Initialization for authenticated varibale services.
+  If this initialization returns error status, other APIs will not work
+  and expect to be not called then.
+
+  @param[in]  AuthVarLibContextIn   Pointer to input auth variable lib context.
+  @param[out] AuthVarLibContextOut  Pointer to output auth variable lib 
context.
+
+  @retval EFI_SUCCESS               Function successfully executed.
+  @retval EFI_INVALID_PARAMETER     If AuthVarLibContextIn == NULL or 
AuthVarLibContextOut == NULL.
+  @retval EFI_OUT_OF_RESOURCES      Fail to allocate enough resource.
+  @retval EFI_UNSUPPORTED           Unsupported to process authenticated 
variable.
+
+**/
+EFI_STATUS
+EFIAPI
+AuthVariableLibInitialize (
+  IN  AUTH_VAR_LIB_CONTEXT_IN   *AuthVarLibContextIn,
+  OUT AUTH_VAR_LIB_CONTEXT_OUT  *AuthVarLibContextOut
+  )
+{
+  //
+  // Do nothing, just return EFI_UNSUPPORTED.
+  //
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  Process variable with 
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS/EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS
 set.
+
+  @param[in] VariableName           Name of the variable.
+  @param[in] VendorGuid             Variable vendor GUID.
+  @param[in] Data                   Data pointer.
+  @param[in] DataSize               Size of Data.
+  @param[in] Attributes             Attribute value of the variable.
+
+  @retval EFI_SUCCESS               The firmware has successfully stored the 
variable and its data as
+                                    defined by the Attributes.
+  @retval EFI_INVALID_PARAMETER     Invalid parameter.
+  @retval EFI_WRITE_PROTECTED       Variable is write-protected.
+  @retval EFI_OUT_OF_RESOURCES      There is not enough resource.
+  @retval EFI_SECURITY_VIOLATION    The variable is with 
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
+                                    or 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS
+                                    set, but the AuthInfo does NOT pass the 
validation
+                                    check carried out by the firmware.
+  @retval EFI_UNSUPPORTED           Unsupported to process authenticated 
variable.
+
+**/
+EFI_STATUS
+EFIAPI
+AuthVariableLibProcessVariable (
+  IN CHAR16         *VariableName,
+  IN EFI_GUID       *VendorGuid,
+  IN VOID           *Data,
+  IN UINTN          DataSize,
+  IN UINT32         Attributes
+  )
+{
+  ASSERT (FALSE);
+  return EFI_UNSUPPORTED;
+}
diff --git a/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf 
b/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
new file mode 100644
index 0000000..e153f63
--- /dev/null
+++ b/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
@@ -0,0 +1,40 @@
+## @file
+#  Provides NULL authenticated variable services.
+#
+#  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions
+#  of the BSD License which accompanies this distribution.  The
+#  full text of the license may be found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = AuthVariableLibNull
+  MODULE_UNI_FILE                = AuthVariableLibNull.uni
+  FILE_GUID                      = 435CB0E4-7C9A-4BB7-9907-8FD4643E978A
+  MODULE_TYPE                    = DXE_RUNTIME_DRIVER
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = AuthVariableLib|DXE_RUNTIME_DRIVER 
DXE_SMM_DRIVER
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES           = IA32 X64 
+#
+
+[Sources]
+  AuthVariableLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  DebugLib
diff --git a/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.uni 
b/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.uni
new file mode 100644
index 
0000000000000000000000000000000000000000..02237fffe27cc038184ece447a04ff4e0a0ac421
GIT binary patch
literal 1710
zcmc(fTW`}q5QXO%iT_}wFMwJHD)E94A|VDWN)zRx!c&!7TT3C1oTQLHPx;PlZPQRB
zUQlJ(yE{93=FFK{-~4P^(<0tyJdwS%3(IU_b9-!$uxhVoh2?gQeTIFF<<v%Y!V}rp
zwzjb=>`TVXrdT$tX6#)vFR+bm;)oGv=U9X^b)>k8@=(#<k=e?2&hwHyHt>D|yQhrD
z_S|0BOFLwqdVX{Ah)ib+PU)*`GiFPR*=eya4`m(Dq*md%hRmf*Y_F|teS33H_Cq*i
zuJMX<IVg(p4U{o4q-s!G>nTsp-pcoOoLk}_VF@(|+Alz>)m262_$=^N4VGRL;g<M1
ztvbu13aT6G3T~Z+a;cf9-UU&WYl$Le;+s|aXg8<3>T_)yScmn=9WFK3@2<s^@1NOb
z#1x{`2zn{jnzgc?cvseSk*dn*0(+>CIRC(VpVM7kf|fhHCb#Ev5JDZKam`hov!N2N
z{LZMSg0}K6T<MtX3+mI{(|(O*0`r+2?d`;%T=CXXhW61C*!1Y0u6^L!vd^qjl#I|)
z;}B~~e~p+WuJ4HZ+F{<ur$nf=PwD3bkAWk1nW>NUZ7>Q~s13%pueCb-jnf(XLhX9Q
z$j<QUJF`>lDX7Bedh|XkahFXohxp1zQG?fed=>pG<0p2+T=y@zjS{j*>`R4Hqo-)m
zqni}7!!0XyE62$HaZR_&ruU%gnQ(W4e&--{!O&kWv2z$nFDctXts#8=_8j<a5!RNw
saOqv6PB;QfOdBx#Uw_j^mD#^#rJfj&kNTxo)#1L(9x|&K&B|*10?{@M8vp<R

literal 0
HcmV?d00001

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 12b77a6..a067384 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -115,6 +115,10 @@ [LibraryClasses]
   #
   TpmMeasurementLib|Include/Library/TpmMeasurementLib.h
 
+  ## @libraryclass  Provides authenticated variable services.
+  #
+  AuthVaribleLib|Include/Library/AuthVaribleLib.h
+
 [Guids]
   ## MdeModule package token space guid
   # Include/Guid/MdeModulePkgTokenSpace.h
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 3b1ace9..fc518d0 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -96,6 +96,7 @@ [LibraryClasses]
   
CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf
   
PlatformBootManagerLib|MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManagerLibNull.inf
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 
 [LibraryClasses.EBC.PEIM]
   IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
@@ -275,6 +276,7 @@ [Components]
   MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
   
MdeModulePkg/Library/PlatformBootManagerLibNull/PlatformBootManagerLibNull.inf
   MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
index 8ea7378..f5ba486 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
@@ -44,10 +44,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include <Guid/HardwareErrorVariable.h>
 #include <Guid/VarErrorFlag.h>
 
-#define VARIABLE_ATTRIBUTE_BS_RT        (EFI_VARIABLE_BOOTSERVICE_ACCESS | 
EFI_VARIABLE_RUNTIME_ACCESS)
-#define VARIABLE_ATTRIBUTE_NV_BS_RT     (VARIABLE_ATTRIBUTE_BS_RT | 
EFI_VARIABLE_NON_VOLATILE)
-#define VARIABLE_ATTRIBUTE_NV_BS_RT_AT  (VARIABLE_ATTRIBUTE_NV_BS_RT | 
EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
-
 ///
 /// The size of a 3 character ISO639 language code.
 ///
@@ -100,12 +96,6 @@ typedef struct {
 } VARIABLE_MODULE_GLOBAL;
 
 typedef struct {
-  EFI_GUID    *Guid;
-  CHAR16      *Name;
-  UINTN       VariableSize;
-} VARIABLE_ENTRY_CONSISTENCY;
-
-typedef struct {
   LIST_ENTRY  Link;
   EFI_GUID    Guid;
   //CHAR16      *Name;
-- 
1.9.5.msysgit.0


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to