If ReclaimPubKeyStore is TRUE, reclaim invalid key in public key database and update the PubKeyIndex\r
for all the count-based authenticate variable in NV storage.\r
\r
- @param[in] VariableBase Base address of variable store.\r
- @param[out] LastVariableOffset Offset of last variable.\r
- @param[in] IsVolatile The variable store is volatile or not;\r
- if it is non-volatile, need FTW.\r
- @param[in, out] UpdatingPtrTrack Pointer to updating variable pointer track structure.\r
- @param[in] ReclaimPubKeyStore Reclaim for public key database or not.\r
- @param[in] ReclaimAnyway If TRUE, do reclaim anyway.\r
+ @param[in] VariableBase Base address of variable store.\r
+ @param[out] LastVariableOffset Offset of last variable.\r
+ @param[in] IsVolatile The variable store is volatile or not;\r
+ if it is non-volatile, need FTW.\r
+ @param[in, out] UpdatingPtrTrack Pointer to updating variable pointer track structure.\r
+ @param[in] ReclaimPubKeyStore Reclaim for public key database or not.\r
+ @param[in] ReclaimAnyway If TRUE, do reclaim anyway.\r
\r
- @return EFI_OUT_OF_RESOURCES No enough memory resources.\r
@return EFI_SUCCESS Reclaim operation has finished successfully.\r
+ @return EFI_OUT_OF_RESOURCES No enough memory resources.\r
+ @return EFI_DEVICE_ERROR The public key database doesn't exist.\r
@return Others Unexpect error happened during reclaim operation.\r
\r
**/\r
EFI_STATUS\r
Reclaim (\r
- IN EFI_PHYSICAL_ADDRESS VariableBase,\r
- OUT UINTN *LastVariableOffset,\r
- IN BOOLEAN IsVolatile,\r
- IN OUT VARIABLE_POINTER_TRACK *UpdatingPtrTrack,\r
- IN BOOLEAN ReclaimPubKeyStore,\r
- IN BOOLEAN ReclaimAnyway\r
+ IN EFI_PHYSICAL_ADDRESS VariableBase,\r
+ OUT UINTN *LastVariableOffset,\r
+ IN BOOLEAN IsVolatile,\r
+ IN OUT VARIABLE_POINTER_TRACK *UpdatingPtrTrack,\r
+ IN BOOLEAN ReclaimPubKeyStore,\r
+ IN BOOLEAN ReclaimAnyway\r
)\r
{\r
VARIABLE_HEADER *Variable;\r
// Reinstall the new public key database.\r
//\r
ASSERT (PubKeyHeader != NULL);\r
+ if (PubKeyHeader == NULL) {\r
+ FreePool (ValidBuffer);\r
+ FreePool (NewPubKeyIndex);\r
+ FreePool (NewPubKeyStore);\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
CopyMem (CurrPtr, (UINT8*) PubKeyHeader, sizeof (VARIABLE_HEADER));\r
Variable = (VARIABLE_HEADER*) CurrPtr;\r
Variable->DataSize = NewPubKeySize;\r
If ReclaimPubKeyStore is TRUE, reclaim invalid key in public key database and update the PubKeyIndex\r
for all the count-based authenticate variable in NV storage.\r
\r
- @param[in] VariableBase Base address of variable store.\r
- @param[out] LastVariableOffset Offset of last variable.\r
- @param[in] IsVolatile The variable store is volatile or not;\r
- if it is non-volatile, need FTW.\r
- @param[in, out] UpdatingPtrTrack Pointer to updating variable pointer track structure.\r
- @param[in] ReclaimPubKeyStore Reclaim for public key database or not.\r
- @param[in] ReclaimAnyway If TRUE, do reclaim anyway.\r
+ @param[in] VariableBase Base address of variable store.\r
+ @param[out] LastVariableOffset Offset of last variable.\r
+ @param[in] IsVolatile The variable store is volatile or not;\r
+ if it is non-volatile, need FTW.\r
+ @param[in, out] UpdatingPtrTrack Pointer to updating variable pointer track structure.\r
+ @param[in] ReclaimPubKeyStore Reclaim for public key database or not.\r
+ @param[in] ReclaimAnyway If TRUE, do reclaim anyway.\r
\r
- @return EFI_OUT_OF_RESOURCES No enough memory resources.\r
@return EFI_SUCCESS Reclaim operation has finished successfully.\r
+ @return EFI_OUT_OF_RESOURCES No enough memory resources.\r
+ @return EFI_DEVICE_ERROR The public key database doesn't exist.\r
@return Others Unexpect error happened during reclaim operation.\r
\r
**/\r
EFI_STATUS\r
Reclaim (\r
- IN EFI_PHYSICAL_ADDRESS VariableBase,\r
- OUT UINTN *LastVariableOffset,\r
- IN BOOLEAN IsVolatile,\r
- IN OUT VARIABLE_POINTER_TRACK *UpdatingPtrTrack,\r
- IN BOOLEAN ReclaimPubKeyStore,\r
- IN BOOLEAN ReclaimAnyway\r
+ IN EFI_PHYSICAL_ADDRESS VariableBase,\r
+ OUT UINTN *LastVariableOffset,\r
+ IN BOOLEAN IsVolatile,\r
+ IN OUT VARIABLE_POINTER_TRACK *UpdatingPtrTrack,\r
+ IN BOOLEAN ReclaimPubKeyStore,\r
+ IN BOOLEAN ReclaimAnyway\r
);\r
\r
/**\r