diff options
-rw-r--r-- | src/Common/Volumes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c index 902c1699..9590715e 100644 --- a/src/Common/Volumes.c +++ b/src/Common/Volumes.c @@ -253,71 +253,71 @@ int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int TCfree(noOutstandingWorkItemEvent); return ERR_OUTOFMEMORY; } keyDerivationWorkItemsSize = sizeof (KeyDerivationWorkItem) * pkcs5PrfCount; keyDerivationWorkItems = TCalloc (keyDerivationWorkItemsSize); if (!keyDerivationWorkItems) { TCfree(keyDerivationCompletedEvent); TCfree(noOutstandingWorkItemEvent); TCfree(outstandingWorkItemCount); return ERR_OUTOFMEMORY; } for (i = 0; i < pkcs5PrfCount; ++i) keyDerivationWorkItems[i].Free = TRUE; *outstandingWorkItemCount = 0; #ifdef DEVICE_DRIVER KeInitializeEvent (keyDerivationCompletedEvent, SynchronizationEvent, FALSE); KeInitializeEvent (noOutstandingWorkItemEvent, SynchronizationEvent, TRUE); #else *keyDerivationCompletedEvent = CreateEvent (NULL, FALSE, FALSE, NULL); if (!*keyDerivationCompletedEvent) { TCfree (keyDerivationWorkItems); TCfree(keyDerivationCompletedEvent); TCfree(noOutstandingWorkItemEvent); TCfree(outstandingWorkItemCount); return ERR_OUTOFMEMORY; } *noOutstandingWorkItemEvent = CreateEvent (NULL, FALSE, TRUE, NULL); if (!*noOutstandingWorkItemEvent) { - CloseHandle (keyDerivationCompletedEvent); + CloseHandle (*keyDerivationCompletedEvent); TCfree (keyDerivationWorkItems); TCfree(keyDerivationCompletedEvent); TCfree(noOutstandingWorkItemEvent); TCfree(outstandingWorkItemCount); return ERR_OUTOFMEMORY; } VirtualLock (keyDerivationWorkItems, keyDerivationWorkItemsSize); #endif } #if !defined(DEVICE_DRIVER) VirtualLock (&dk, sizeof (dk)); VirtualLock (&header, sizeof (header)); #endif #endif // !defined(_UEFI) crypto_loadkey (keyInfo, password->Text, (int) password->Length); // PKCS5 is used to derive the primary header key(s) and secondary header key(s) (XTS mode) from the password memcpy (keyInfo->salt, encryptedHeader + HEADER_SALT_OFFSET, PKCS5_SALT_SIZE); // Test all available PKCS5 PRFs for (enqPkcs5Prf = FIRST_PRF_ID; enqPkcs5Prf <= LAST_PRF_ID || queuedWorkItems > 0; ++enqPkcs5Prf) { // if a PRF is specified, we skip all other PRFs if (selected_pkcs5_prf != 0 && enqPkcs5Prf != selected_pkcs5_prf) continue; // skip SHA-256 in case of TrueCrypt mode if (truecryptMode && (enqPkcs5Prf == SHA256)) continue; #if !defined(_UEFI) if ((selected_pkcs5_prf == 0) && (encryptionThreadCount > 1)) { |