Windows driver: call VcProtectKeys only when RAM encryption enabled although this function does nothing when RAM encryption is disabled.

This commit is contained in:
Mounir IDRASSI 2019-02-28 20:23:01 +01:00
parent 0391b8e550
commit ae5eb73f93
No known key found for this signature in database
GPG Key ID: 02C30AE90FAE4A6F
1 changed files with 5 additions and 2 deletions

View File

@ -645,8 +645,11 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password,
/* encrypt keys */
#ifdef _WIN64
VcProtectKeys (Extension->HeaderCryptoInfo, VcGetEncryptionID (Extension->HeaderCryptoInfo));
VcProtectKeys (Extension->Queue.CryptoInfo, VcGetEncryptionID (Extension->Queue.CryptoInfo));
if (IsRamEncryptionEnabled())
{
VcProtectKeys (Extension->HeaderCryptoInfo, VcGetEncryptionID (Extension->HeaderCryptoInfo));
VcProtectKeys (Extension->Queue.CryptoInfo, VcGetEncryptionID (Extension->Queue.CryptoInfo));
}
#endif
status = EncryptedIoQueueStart (&Extension->Queue);