veracrypt / VeraCrypt

Disk encryption with strong security based on TrueCrypt
https://www.veracrypt.fr
Other
6.95k stars 951 forks source link

Password field does not accept accented caracter made of a dead key + a letter #1427

Open p4tpr0 opened 1 month ago

p4tpr0 commented 1 month ago

On macOS (not tested on other OSes) Using either BÉPO layout and keymap file, or ERGOL layout and keymap file.

The password field at creation-time and during use does not accept accented caracter made of à dead key + a letter. If you are using a direct "é" letter, it works as expected. If you are using a combo of dead-key and "e", the dead-key has no effect IF you choose not to display password while typing. If you choose te display the password while typing, the dead key works.

Expected behavior

The dead-key should work every time, whether or not you choose to display the password.

Observed behavior

The dead-key is ignored if password field is in conceal mode. The dead-key works if password field is in reveal mode.

Steps to reproduce

  1. On macOS with BÉPO or ERGOL keyboard layout installed, start Veracrypt and create a new encrypted file
  2. create a password containing an accented character obtained by a dead-key and a simple letter
  3. reveal the password and see that the dead key was ignored
  4. with password revealed, type an accented character obtained by a dead-key and a simple letter and see that it work as intended

Your Environment

tested on macOS 14.6 + ERGOL and macOS 13.7 + BÉPO

Please tell us more about your environment

VeraCrypt version: 1.26.14

bugtracker2019 commented 1 month ago

Cannot confirm that behaviour on Linux with german keyboard layout. For example tété works no matter if password is displayed or not.

p4tpr0 commented 1 month ago

It’s very likely to be OS-dependent. See the behavior on macOS: https://www.patpro.net/~patpro/dead-keys2.gif (behavior is different depending on the dead key you use…)

iovantsaous commented 1 month ago

This also affects Veracrypt CLI.

On macOS 14.6, with Azerty layout (or Ergol by the way), if I create an encrypted volume and enter (not by copy-pasting but at the keyboard) a password such as âë (dead key letters for Azerty or Ergol), I can decrypt the volume with the same keystrokes. So this seem to work.

But actually, the password than can decrypt the volume is not âë but ^ae (a ^, then a a and at last a e without diaeresis (or trema)).

If I write âë in a text file, and then copy and paste it in Veracrypt CLI when trying to decrypt the volume, it doesn’t work. I have to copy and paste ^ae to decrypt the volume.

On Debian, everything works fine.

Jertzukka commented 1 month ago

wxWidgets uses the macOS native NSSecureTextField, which is the cause of the problem. If you google NSSecureTextField umlaut / deadchar, you can find topics on StackOverflow (like this and this). It seems to an really old issue, and some comments suggested that fixing it would break compatibility with older behaviour, which I kind of agree. If it was to be fixed, anyone on macOS who has created a volume with password hidden, after a "fix" would be unable to open their volumes as they would've input their old password in the old format. Obviously current behaviour is problematic also as password created on macOS behave differently than Linux or Windows.