]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Move authenticated variable definition from SecurityPkg
authorStar Zeng <star.zeng@intel.com>
Wed, 1 Jul 2015 03:02:08 +0000 (03:02 +0000)
committerlzeng14 <lzeng14@Edk2>
Wed, 1 Jul 2015 03:02:08 +0000 (03:02 +0000)
What to do:
1. Move authenticated variable definition from AuthenticatedVariableFormat.h
to VariableFormat.h with gEfiAuthenticatedVariableGuid and
AUTHENTICATED_VARIABLE_HEADER.

Why to do:
1. Share code.
We are moving forward to 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.
2. Remove code duplication and reduce maintenance effort.
After auth variable service separated from Auth Variable driver in SecurityPkg
to AuthVariableLib. The remaining code logic of Auth Variable driver in SecurityPkg
will be almost same with Variable driver in MdeModulePkg. We are going to
merge them.
3. gEfiAuthenticatedVariableGuid will be used by both merged Variable driver
and AuthVariableLib, AUTHENTICATED_VARIABLE_HEADER will be used by
merged Variable driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17754 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Guid/VariableFormat.h
MdeModulePkg/MdeModulePkg.dec

index a7902f16828eb796c2ddcd3ee51403ff00a20f10..c52eaf3f12ec39c0cab8ee4e2079341211aae0b8 100644 (file)
@@ -2,7 +2,7 @@
   The variable data structures are related to EDK II-specific implementation of UEFI variables.\r
   VariableFormat.h defines variable data headers and variable storage region headers.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -19,7 +19,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define EFI_VARIABLE_GUID \\r
   { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d } }\r
 \r
+#define EFI_AUTHENTICATED_VARIABLE_GUID \\r
+  { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 } }\r
+\r
 extern EFI_GUID gEfiVariableGuid;\r
+extern EFI_GUID gEfiAuthenticatedVariableGuid;\r
 \r
 ///\r
 /// Alignment of variable name and data, according to the architecture:\r
@@ -60,6 +64,7 @@ typedef enum {
 #pragma pack(1)\r
 \r
 #define VARIABLE_STORE_SIGNATURE  EFI_VARIABLE_GUID\r
+#define AUTHENTICATED_VARIABLE_STORE_SIGNATURE  EFI_AUTHENTICATED_VARIABLE_GUID\r
 \r
 ///\r
 /// Variable Store Header Format and State.\r
@@ -136,6 +141,49 @@ typedef struct {
   EFI_GUID    VendorGuid;\r
 } VARIABLE_HEADER;\r
 \r
+///\r
+/// Single Authenticated Variable Data Header Structure.\r
+///\r
+typedef struct {\r
+  ///\r
+  /// Variable Data Start Flag.\r
+  ///\r
+  UINT16      StartId;\r
+  ///\r
+  /// Variable State defined above.\r
+  ///\r
+  UINT8       State;\r
+  UINT8       Reserved;\r
+  ///\r
+  /// Attributes of variable defined in UEFI specification.\r
+  ///\r
+  UINT32      Attributes;\r
+  ///\r
+  /// Associated monotonic count value against replay attack.\r
+  ///\r
+  UINT64      MonotonicCount;\r
+  ///\r
+  /// Associated TimeStamp value against replay attack.\r
+  ///\r
+  EFI_TIME    TimeStamp;\r
+  ///\r
+  /// Index of associated public key in database.\r
+  ///\r
+  UINT32      PubKeyIndex;\r
+  ///\r
+  /// Size of variable null-terminated Unicode string name.\r
+  ///\r
+  UINT32      NameSize;\r
+  ///\r
+  /// Size of the variable data without this header.\r
+  ///\r
+  UINT32      DataSize;\r
+  ///\r
+  /// A unique identifier for the vendor that produces and consumes this varaible.\r
+  ///\r
+  EFI_GUID    VendorGuid;\r
+} AUTHENTICATED_VARIABLE_HEADER;\r
+\r
 #pragma pack()\r
 \r
 typedef struct _VARIABLE_INFO_ENTRY  VARIABLE_INFO_ENTRY;\r
index e87e89aa905471685e0be68f6db6fd75c3fd7793..12b77a6ca44963a02816ff0a10ce19a99099996c 100644 (file)
   #  Include/Guid/VariableFormat.h\r
   gEfiVariableGuid           = { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}\r
 \r
+  ## Guid acted as the authenticated variable store header's signature, and to specify the variable list entries put in the EFI system table.\r
+  #  Include/Guid/AuthenticatedVariableFormat.h\r
+  gEfiAuthenticatedVariableGuid = { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 } }\r
+\r
   #  Include/Guid/VariableIndexTable.h\r
   gEfiVariableIndexTableGuid  = { 0x8cfdb8c8, 0xd6b2, 0x40f3, { 0x8e, 0x97, 0x02, 0x30, 0x7c, 0xc9, 0x8b, 0x7c }}\r
 \r