Browse Source

Logging SSH authentication prompts responding

(cherry picked from commit 7ec3560bb8d95dc09f60a87913fac3185c2da967)

Source commit: 7fd555c45c64cad7f3a6a5c557d09ee35a61b904
Martin Prikryl 4 years ago
parent
commit
79f7c90fef
1 changed files with 10 additions and 1 deletions
  1. 10 1
      source/core/SecureShell.cpp

+ 10 - 1
source/core/SecureShell.cpp

@@ -952,16 +952,25 @@ bool __fastcall TSecureShell::PromptUser(bool /*ToServer*/,
 
   if (!Result)
   {
+    LogEvent(L"Prompting user for the credentials.");
     Result = FUI->PromptUser(FSessionData,
       PromptKind, Name, Instructions, Prompts, Results);
 
-    if (Result)
+    if (!Result)
+    {
+      LogEvent(L"Prompt cancelled.");
+    }
+    else
     {
       if ((Prompts->Count >= 1) &&
           (FLAGSET(int(Prompts->Objects[0]), pupEcho) || Configuration->LogSensitive))
       {
         LogEvent(FORMAT(L"Response: \"%s\"", (Results->Strings[0])));
       }
+      else
+      {
+        LogEvent("Prompt responded.");
+      }
 
       if ((PromptKind == pkUserName) && (Prompts->Count == 1))
       {