A Policy DLL's PolFreeKey callback function is called to enable the Policy DLL to return the storage that it previously allocated for key storage.
POL_FREE_KEY PolFreeKey;
VOID
PolFreeKey(
_In_ PVOID PolKey,
_In_ DWORD PolKeySize
)
PolKey [in]
A pointer to a key data storage area to be returned that was previously allocated by the Policy DLL.
PolKeySize [in]
The size, in bytes, of the key storage area.
(none)
A Policy DLL's PolFreeKey callback function is called by FESF to allow the Policy DLL to deallocate space that it previously allocated for storage of key data information. This key buffer was provided to FESF by the Policy DLL on return from the PolGetKeyNewFile or PolGetKeyFromHeader callback function.
This callback function is separate from the PolFreeHeader callback function to allow for different allocation and return methods for Header Data (which is presumably not security sensitive) and key information (which is presumably sensitive from a security standpoint). In most Policy DLL implementations PolFreeKey would overwrite the key storage area with random data before freeing it.
Policy DLLs must implement this callback function.
The FESF Sample Solution contains an example implementation of this callback function. This example is part of the provided UM_Sample Visual Studio Solution, the SampPolicy project, and is located in the file SampPolicy.cpp.
Software version |
FESF V1 (or later) |
Library |
FESFPolicy.lib |
Header |
PolDllApi.h |