]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/AuthVariableLib/AuthServiceInternal.h
SecurityPkg Tpm2DeviceLibDTpm: Update enum type name to match the one in lib
[mirror_edk2.git] / SecurityPkg / Library / AuthVariableLib / AuthServiceInternal.h
index ac7ea89a803866cb53cb620fe2772d100bfd31f2..28862609258f7fc6cb4a5961bfb8b6acf06e67f5 100644 (file)
@@ -12,7 +12,7 @@
   may not be modified without authorization. If platform fails to protect these resources,\r
   the authentication service provided in this driver will be broken, and the behavior is undefined.\r
 \r
-Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2017, 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
@@ -37,6 +37,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/AuthenticatedVariableFormat.h>\r
 #include <Guid/ImageAuthentication.h>\r
 \r
+#define TWO_BYTE_ENCODE       0x82\r
+\r
 ///\r
 /// Struct to record signature requirement defined by UEFI spec.\r
 /// For SigHeaderSize and SigDataSize, ((UINT32) ~0) means NO exact length requirement for this field.\r
@@ -56,35 +58,6 @@ typedef enum {
   AuthVarTypePayload\r
 } AUTHVAR_TYPE;\r
 \r
-///\r
-/// "AuthVarKeyDatabase" variable for the Public Key store\r
-/// of variables with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS set.\r
-///\r
-/// GUID: gEfiAuthenticatedVariableGuid\r
-///\r
-/// We need maintain atomicity.\r
-///\r
-/// Format:\r
-/// +----------------------------+\r
-/// | AUTHVAR_KEY_DB_DATA        | <-- First AuthVarKey\r
-/// +----------------------------+\r
-/// | ......                     |\r
-/// +----------------------------+\r
-/// | AUTHVAR_KEY_DB_DATA        | <-- Last AuthKey\r
-/// +----------------------------+\r
-///\r
-#define AUTHVAR_KEYDB_NAME      L"AuthVarKeyDatabase"\r
-\r
-#define EFI_CERT_TYPE_RSA2048_SHA256_SIZE 256\r
-#define EFI_CERT_TYPE_RSA2048_SIZE        256\r
-\r
-#pragma pack(1)\r
-typedef struct {\r
-  UINT32    KeyIndex;\r
-  UINT8     KeyData[EFI_CERT_TYPE_RSA2048_SIZE];\r
-} AUTHVAR_KEY_DB_DATA;\r
-#pragma pack()\r
-\r
 ///\r
 ///  "certdb" variable stores the signer's certificates for non PK/KEK/DB/DBX\r
 /// variables with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS|EFI_VARIABLE_NON_VOLATILE set.\r
@@ -120,15 +93,10 @@ typedef struct {
 } AUTH_CERT_DB_DATA;\r
 #pragma pack()\r
 \r
-extern UINT8    *mPubKeyStore;\r
-extern UINT32   mPubKeyNumber;\r
-extern UINT32   mMaxKeyNumber;\r
-extern UINT32   mMaxKeyDbSize;\r
 extern UINT8    *mCertDbStore;\r
 extern UINT32   mMaxCertDbSize;\r
 extern UINT32   mPlatformMode;\r
 extern UINT8    mVendorKeyState;\r
-extern BOOLEAN  mUserPhysicalPresent;\r
 \r
 extern VOID     *mHashCtx;\r
 \r
@@ -294,7 +262,7 @@ ProcessVarWithKek (
   );\r
 \r
 /**\r
-  Process variable with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS/EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set\r
+  Process variable with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set\r
 \r
   Caution: This function may receive untrusted input.\r
   This function may be invoked in SMM mode, and datasize and data are external input.\r
@@ -311,9 +279,9 @@ ProcessVarWithKek (
 \r
   @return EFI_INVALID_PARAMETER           Invalid parameter.\r
   @return EFI_WRITE_PROTECTED             Variable is write-protected and needs authentication with\r
-                                          EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS set.\r
+                                          EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS set.\r
   @return EFI_OUT_OF_RESOURCES            The Database to save the public key is full.\r
-  @return EFI_SECURITY_VIOLATION          The variable is with EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\r
+  @return EFI_SECURITY_VIOLATION          The variable is with EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\r
                                           set, but the AuthInfo does NOT pass the validation\r
                                           check carried out by the firmware.\r
   @return EFI_SUCCESS                     Variable is not write-protected or pass validation successfully.\r
@@ -378,34 +346,6 @@ AuthServiceInternalUpdateVariable (
   IN UINT32         Attributes\r
   );\r
 \r
-/**\r
-  Update the variable region with Variable information.\r
-\r
-  @param[in] VariableName           Name of variable.\r
-  @param[in] VendorGuid             Guid of variable.\r
-  @param[in] Data                   Data pointer.\r
-  @param[in] DataSize               Size of Data.\r
-  @param[in] Attributes             Attribute value of the variable.\r
-  @param[in] KeyIndex               Index of associated public key.\r
-  @param[in] MonotonicCount         Value of associated monotonic count.\r
-\r
-  @retval EFI_SUCCESS               The update operation is success.\r
-  @retval EFI_INVALID_PARAMETER     Invalid parameter.\r
-  @retval EFI_WRITE_PROTECTED       Variable is write-protected.\r
-  @retval EFI_OUT_OF_RESOURCES      There is not enough resource.\r
-\r
-**/\r
-EFI_STATUS\r
-AuthServiceInternalUpdateVariableWithMonotonicCount (\r
-  IN CHAR16         *VariableName,\r
-  IN EFI_GUID       *VendorGuid,\r
-  IN VOID           *Data,\r
-  IN UINTN          DataSize,\r
-  IN UINT32         Attributes,\r
-  IN UINT32         KeyIndex,\r
-  IN UINT64         MonotonicCount\r
-  );\r
-\r
 /**\r
   Update the variable region with Variable information.\r
 \r