From 6986dce63ecf60e26203dab42a1c5bb383cbf203 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 2 Aug 2021 00:27:07 +0200 Subject: Windows: clear DeriveKeyWork work item only if they have correct type --- src/Common/EncryptionThreadPool.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Common/EncryptionThreadPool.c b/src/Common/EncryptionThreadPool.c index dce01733..f62f8772 100644 --- a/src/Common/EncryptionThreadPool.c +++ b/src/Common/EncryptionThreadPool.c @@ -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); -- cgit v1.2.3