mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-01-04 20:58:12 -06:00
Keep PIM secret and re-ask when user entered a wrong value (#1026)
Co-authored-by: Bogdan Drozdowski <>
This commit is contained in:
committed by
GitHub
parent
76df737ae5
commit
b05b18928f
@@ -175,9 +175,13 @@ namespace VeraCrypt
|
|||||||
wxString msg = _("Enter new PIM: ");
|
wxString msg = _("Enter new PIM: ");
|
||||||
if (!message.empty())
|
if (!message.empty())
|
||||||
msg = message + L": ";
|
msg = message + L": ";
|
||||||
|
SetTerminalEcho (false);
|
||||||
|
finally_do ({ TextUserInterface::SetTerminalEcho (true); });
|
||||||
while (pim < 0)
|
while (pim < 0)
|
||||||
{
|
{
|
||||||
wstring pimStr = AskString (msg);
|
wstring pimStr = AskString (msg);
|
||||||
|
ShowString (L"\n");
|
||||||
|
|
||||||
if (pimStr.empty())
|
if (pimStr.empty())
|
||||||
pim = 0;
|
pim = 0;
|
||||||
else
|
else
|
||||||
@@ -1290,7 +1294,7 @@ namespace VeraCrypt
|
|||||||
options.Password = AskPassword (StringFormatter (_("Enter password for {0}"), wstring (*options.Path)));
|
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)));
|
options.Pim = AskPim (StringFormatter (_("Enter PIM for {0}"), wstring (*options.Path)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user