diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-11-30 11:35:41 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-11-30 13:58:19 +0100 |
commit | efa436974d8203485eec6faa1bf0116bb32f6fcd (patch) | |
tree | 97a5ef2eea0310a12db399151de7ca97dbd47ece /src/Volume/VolumePassword.h | |
parent | cfadb231d24bd292a6ea3708b776bde8f06e50ab (diff) | |
download | VeraCrypt-efa436974d8203485eec6faa1bf0116bb32f6fcd.tar.gz VeraCrypt-efa436974d8203485eec6faa1bf0116bb32f6fcd.zip |
Linux/MacOSX: Implement Unicode passwords suppport. Make validation of parameters in GUI more robust.
Diffstat (limited to 'src/Volume/VolumePassword.h')
-rw-r--r-- | src/Volume/VolumePassword.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/Volume/VolumePassword.h b/src/Volume/VolumePassword.h index bf10eb98..ff7479a5 100644 --- a/src/Volume/VolumePassword.h +++ b/src/Volume/VolumePassword.h @@ -22,10 +22,8 @@ namespace VeraCrypt { public: VolumePassword (); - VolumePassword (const byte *password, size_t size); - VolumePassword (const char *password, size_t size); - VolumePassword (const wchar_t *password, size_t charCount); - VolumePassword (const wstring &password); + VolumePassword (const byte *password, size_t size) { Set (password, size); } + VolumePassword (const SecureBuffer &password) { Set (password.Ptr (), password.Size ()); } VolumePassword (const VolumePassword &password) { Set (password); } virtual ~VolumePassword (); @@ -35,13 +33,10 @@ namespace VeraCrypt operator BufferPtr () const { return BufferPtr (PasswordBuffer); } - void CheckPortability () const; byte *DataPtr () const { return PasswordBuffer; } bool IsEmpty () const { return PasswordSize == 0; } size_t Size () const { return PasswordSize; } void Set (const byte *password, size_t size); - void Set (const wchar_t *password, size_t charCount); - void Set (const ConstBufferPtr &password); void Set (const VolumePassword &password); TC_SERIALIZABLE (VolumePassword); @@ -51,12 +46,10 @@ namespace VeraCrypt protected: void AllocateBuffer (); - bool IsPortable () const; SecureBuffer PasswordBuffer; size_t PasswordSize; - bool Unportable; }; struct PasswordException : public Exception @@ -86,6 +79,8 @@ namespace VeraCrypt TC_EXCEPTION_NODECL (ProtectionPasswordKeyfilesIncorrect); \ TC_EXCEPTION (PasswordEmpty); \ TC_EXCEPTION (PasswordTooLong); \ + TC_EXCEPTION (PasswordUTF8TooLong); \ + TC_EXCEPTION (PasswordUTF8Invalid); \ TC_EXCEPTION (UnportablePassword); TC_EXCEPTION_SET; |