/**\r
Initializes for authenticated varibale service.\r
\r
+ @param[in] MaxAuthVariableSize Reflect the overhead associated with the saving\r
+ of a single EFI authenticated variable with the exception\r
+ of the overhead associated with the length\r
+ of the string name of the EFI variable.\r
+\r
@retval EFI_SUCCESS Function successfully executed.\r
@retval EFI_OUT_OF_RESOURCES Fail to allocate enough memory resources.\r
\r
**/\r
EFI_STATUS\r
AutenticatedVariableServiceInitialize (\r
- VOID\r
+ IN UINTN MaxAuthVariableSize\r
)\r
{\r
EFI_STATUS Status;\r
//\r
// Reserve runtime buffer for public key database. The size excludes variable header and name size.\r
//\r
- mMaxKeyDbSize = PcdGet32 (PcdMaxVariableSize) - sizeof (VARIABLE_HEADER) - sizeof (AUTHVAR_KEYDB_NAME);\r
+ mMaxKeyDbSize = (UINT32) (MaxAuthVariableSize - sizeof (AUTHVAR_KEYDB_NAME));\r
mMaxKeyNumber = mMaxKeyDbSize / EFI_CERT_TYPE_RSA2048_SIZE;\r
mPubKeyStore = AllocateRuntimePool (mMaxKeyDbSize);\r
if (mPubKeyStore == NULL) {\r
//\r
// Reserve runtime buffer for certificate database. The size excludes variable header and name size.\r
//\r
- mMaxCertDbSize = PcdGet32 (PcdMaxVariableSize) - sizeof (VARIABLE_HEADER) - sizeof (EFI_CERT_DB_NAME);\r
+ mMaxCertDbSize = (UINT32) (MaxAuthVariableSize - sizeof (EFI_CERT_DB_NAME));\r
mCertDbStore = AllocateRuntimePool (mMaxCertDbSize);\r
if (mCertDbStore == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r