Windows: clear DeriveKeyWork work item only if they have correct type

This commit is contained in:
Mounir IDRASSI 2021-08-02 00:27:07 +02:00
parent 2e32adf625
commit 6986dce63e
No known key found for this signature in database
GPG Key ID: 02C30AE90FAE4A6F
1 changed files with 6 additions and 3 deletions

View File

@ -517,9 +517,12 @@ void EncryptionThreadPoolStop ()
for (i = 0; i < sizeof (WorkItemQueue) / sizeof (WorkItemQueue[0]); ++i)
{
#if !defined(DEVICE_DRIVER)
burn (WorkItemQueue[i].KeyDerivation.Password, sizeof(WorkItemQueue[i].KeyDerivation.Password));
burn (WorkItemQueue[i].KeyDerivation.Salt, sizeof(WorkItemQueue[i].KeyDerivation.Salt));
VirtualUnlock (&WorkItemQueue[i].KeyDerivation, sizeof (WorkItemQueue[i].KeyDerivation));
if (WorkItemQueue[i].Type == DeriveKeyWork)
{
burn (WorkItemQueue[i].KeyDerivation.Password, sizeof(WorkItemQueue[i].KeyDerivation.Password));
burn (WorkItemQueue[i].KeyDerivation.Salt, sizeof(WorkItemQueue[i].KeyDerivation.Salt));
VirtualUnlock (&WorkItemQueue[i].KeyDerivation, sizeof (WorkItemQueue[i].KeyDerivation));
}
#endif
if (WorkItemQueue[i].ItemCompletedEvent)
CloseHandle (WorkItemQueue[i].ItemCompletedEvent);