Linux/MacOSX: Add switch to force the use of legacy maximum password length (64 UTF8 bytes)

The switch is --legacy-password-maxlength
This commit is contained in:
Mounir IDRASSI
2019-11-03 22:54:23 +01:00
parent 8fb7742dad
commit a7d5b6a477
47 changed files with 92 additions and 36 deletions

View File

@@ -125,7 +125,7 @@ namespace VeraCrypt
if (verify && verPhase)
{
shared_ptr <VolumePassword> verPassword = ToUTF8Password (passwordBuf, length);
shared_ptr <VolumePassword> verPassword = ToUTF8Password (passwordBuf, length, CmdLine->ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
if (*password != *verPassword)
{
@@ -136,7 +136,7 @@ namespace VeraCrypt
}
}
password = ToUTF8Password (passwordBuf, length);
password = ToUTF8Password (passwordBuf, length, CmdLine->ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
if (!verPhase)
{