VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-28 14:58:41 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-28 17:16:33 +0100
commitcdd1179c63bb892696adfad1818d65e3026916ca (patch)
treee2d7265440b8cc51ca544d2c2412041b0d18439d /src/Volume
parent54e46c260cf04861c99d8b2590999c1eb33f0cb1 (diff)
downloadVeraCrypt-cdd1179c63bb892696adfad1818d65e3026916ca.tar.gz
VeraCrypt-cdd1179c63bb892696adfad1818d65e3026916ca.zip
Increase password maximum length to 128 bytes from 64 bytes
Diffstat (limited to 'src/Volume')
-rw-r--r--src/Volume/Keyfile.cpp2
-rw-r--r--src/Volume/VolumePassword.h3
2 files changed, 3 insertions, 2 deletions
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: