VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume
diff options
context:
space:
mode:
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: