#856038 cryptsetup: clear error message before each password re-try

Package:
cryptsetup
Source:
cryptsetup
Description:
disk encryption support - startup scripts
Submitter:
lewis dorrel
Date:
2022-08-08 10:36:02 UTC
Severity:
wishlist
#856038#5
Date:
2017-02-24 20:19:48 UTC
From:
To:
Dear Maintainer,

whenever a debian/ubuntu user fails to log in the first time to his full disk encrypted hard disk (or solid state disk) he continues to see the error message "cryptsetup: cryptsetup failed, bad password or options?" even if this is a new login try.

This problem might not be that noticeable whenever the user has a very fast hardware and configured very low crypt settings. Furthermore, it may not be easily noticeable when you have a text-based login prompt only. In all other cases, it is quite disturbing to see the old error message e.g. "cryptsetup: cryptsetup failed, bad password or options?" for seconds or minutes (depending on your hardware, algorithm settings etc) on a new/independent password login try.

I've located the problem within the file /usr/share/initramfs-tools/scripts/local-top/cryptroot . Especially the line: $cryptkeyscript "$cryptkey" | $cryptopen  (see https://anonscm.debian.org/cgit/pkg-cryptsetup/cryptsetup.git/tree/debian/initramfs/cryptroot-script#n309 ).

This line suggests that the script waits until the user enters the password (could take a while) and hits enter and the disk was tried to be opened (this could even take longer).

During all of this time the user will still be presented with the old error messages (if he failed to log in with the previous login tries). The error message was presented by the message() function and in case plymouth is working, the /bin/plymouth binary was used.

I therefore suggest that whenever the user tries to log in (again), the previous error messages should be hidden/cleared after the user hit enter (makes a new password login).

The main problem is that it might be very confusing for the user that he is presented with old error messages which are unrelated to the current try. The error message might suggest that the login failed (again) even if it did not.

Thanks