From b05b18928f4291b7c24cbe0046e4d5b3f44705d0 Mon Sep 17 00:00:00 2001 From: Bogdan Drozdowski <93281795+bogdro@users.noreply.github.com> Date: Sun, 21 May 2023 17:21:21 +0200 Subject: Keep PIM secret and re-ask when user entered a wrong value (#1026) Co-authored-by: Bogdan Drozdowski <> --- src/Main/TextUserInterface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp index 7233b8b6..e972163b 100644 --- a/src/Main/TextUserInterface.cpp +++ b/src/Main/TextUserInterface.cpp @@ -175,9 +175,13 @@ namespace VeraCrypt wxString msg = _("Enter new PIM: "); if (!message.empty()) msg = message + L": "; + SetTerminalEcho (false); + finally_do ({ TextUserInterface::SetTerminalEcho (true); }); while (pim < 0) { wstring pimStr = AskString (msg); + ShowString (L"\n"); + if (pimStr.empty()) pim = 0; else @@ -1290,7 +1294,7 @@ namespace VeraCrypt options.Password = AskPassword (StringFormatter (_("Enter password for {0}"), wstring (*options.Path))); } - if (!options.TrueCryptMode && (options.Pim < 0)) + if (!options.TrueCryptMode /*&& (options.Pim < 0) re-ask in case of wrong value entered*/) { options.Pim = AskPim (StringFormatter (_("Enter PIM for {0}"), wstring (*options.Path))); } -- cgit v1.2.3