From cdd1179c63bb892696adfad1818d65e3026916ca Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 28 Jan 2019 14:58:41 +0100 Subject: Increase password maximum length to 128 bytes from 64 bytes --- src/Volume/Keyfile.cpp | 2 +- src/Volume/VolumePassword.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Volume') diff --git a/src/Volume/Keyfile.cpp b/src/Volume/Keyfile.cpp index e52d58f7..d15dc0d7 100644 --- a/src/Volume/Keyfile.cpp +++ b/src/Volume/Keyfile.cpp @@ -134,7 +134,7 @@ done: } else { - SecureBuffer keyfilePool (VolumePassword::MaxSize); + SecureBuffer keyfilePool (password->Size() <= VolumePassword::MaxLegacySize? VolumePassword::MaxLegacySize: VolumePassword::MaxSize); // Pad password with zeros if shorter than max length keyfilePool.Zero(); diff --git a/src/Volume/VolumePassword.h b/src/Volume/VolumePassword.h index 6154bc0b..5e319774 100644 --- a/src/Volume/VolumePassword.h +++ b/src/Volume/VolumePassword.h @@ -41,7 +41,8 @@ namespace VeraCrypt TC_SERIALIZABLE (VolumePassword); - static const size_t MaxSize = 64; + static const size_t MaxLegacySize = 64; + static const size_t MaxSize = 128; static const size_t WarningSizeThreshold = 12; protected: -- cgit v1.2.3