diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-01-28 14:58:41 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2019-01-28 17:16:33 +0100 |
commit | cdd1179c63bb892696adfad1818d65e3026916ca (patch) | |
tree | e2d7265440b8cc51ca544d2c2412041b0d18439d /src/Driver | |
parent | 54e46c260cf04861c99d8b2590999c1eb33f0cb1 (diff) | |
download | VeraCrypt-cdd1179c63bb892696adfad1818d65e3026916ca.tar.gz VeraCrypt-cdd1179c63bb892696adfad1818d65e3026916ca.zip |
Increase password maximum length to 128 bytes from 64 bytes
Diffstat (limited to 'src/Driver')
-rw-r--r-- | src/Driver/DriveFilter.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c index 7105838a..c17410df 100644 --- a/src/Driver/DriveFilter.c +++ b/src/Driver/DriveFilter.c @@ -114,7 +114,7 @@ NTSTATUS LoadBootArguments () } // Sanity check: for valid boot argument, the password is less than 64 bytes long - if (bootArguments->BootPassword.Length <= MAX_PASSWORD) + if (bootArguments->BootPassword.Length <= MAX_LEGACY_PASSWORD) { BootLoaderArgsPtr = BootArgsRegions[bootLoaderArgsIndex]; @@ -594,7 +594,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password, for(i = 0; i<pwdCache->Count; ++i){ if (CacheBootPassword && pwdCache->Pwd[i].Length > 0) { int cachedPim = CacheBootPim? (int) (pwdCache->Pim[i]) : 0; - AddPasswordToCache (&pwdCache->Pwd[i], cachedPim); + AddLegacyPasswordToCache (&pwdCache->Pwd[i], cachedPim); } } burn(pwdCache, sizeof(*pwdCache)); @@ -606,7 +606,7 @@ static NTSTATUS MountDrive (DriveFilterExtension *Extension, Password *password, if (CacheBootPassword && BootArgs.BootPassword.Length > 0) { int cachedPim = CacheBootPim? pim : 0; - AddPasswordToCache (&BootArgs.BootPassword, cachedPim); + AddLegacyPasswordToCache (&BootArgs.BootPassword, cachedPim); } burn (&BootArgs.BootPassword, sizeof (BootArgs.BootPassword)); @@ -808,7 +808,13 @@ static void CheckDeviceTypeAndMount (DriveFilterExtension *filterExtension) TC_BUG_CHECK (status); if (!BootDriveFound) - MountDrive (filterExtension, &BootArgs.BootPassword, &BootArgs.HeaderSaltCrc32); + { + Password bootPass = {0}; + bootPass.Length = BootArgs.BootPassword.Length; + memcpy (bootPass.Text, BootArgs.BootPassword.Text, BootArgs.BootPassword.Length); + MountDrive (filterExtension, &bootPass, &BootArgs.HeaderSaltCrc32); + burn (&bootPass, sizeof (bootPass)); + } KeReleaseMutex (&MountMutex, FALSE); } @@ -1101,7 +1107,7 @@ void ReopenBootVolumeHeader (PIRP irp, PIO_STACK_LOCATION irpSp) return; if (!BootDriveFound || !BootDriveFilterExtension || !BootDriveFilterExtension->DriveMounted || !BootDriveFilterExtension->HeaderCryptoInfo - || request->VolumePassword.Length > MAX_PASSWORD + || request->VolumePassword.Length > MAX_LEGACY_PASSWORD || request->pkcs5_prf < 0 || request->pkcs5_prf > LAST_PRF_ID || request->pim < 0 |