From 035b116d53c3c9c40fa49a01752212ddf1729ebe Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Fri, 25 Sep 2026 13:18:47 +0200 Subject: [PATCH] CLI: retry hidden-protection credentials after keyfile failures Handle protection-keyfile failures before general password failures. Reset the hidden password, PIM, and keyfiles for correction while retaining outer credentials and avoiding backup-header retries. --- src/Main/TextUserInterface.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp index cd46b112..70a1405a 100644 --- a/src/Main/TextUserInterface.cpp +++ b/src/Main/TextUserInterface.cpp @@ -1566,6 +1566,13 @@ namespace VeraCrypt options.ProtectionPassword.reset(); options.ProtectionPim = -1; } + catch (ProtectionPasswordKeyfilesIncorrect &e) + { + ShowInfo (e); + options.ProtectionPassword.reset(); + options.ProtectionPim = -1; + options.ProtectionKeyfiles.reset(); + } catch (PasswordIncorrect &e) { if (++incorrectPasswordCount > 2 && !options.UseBackupHeaders)