Browse Source

Correcting error message when credential is missing with SSH protocol which retry the prompt (after acd12ea3)

Source commit: 9b7449274a60c0260767d0b8e80b20a9a6dd2b7f
Martin Prikryl 2 years ago
parent
commit
4ed18b85ef
1 changed files with 10 additions and 1 deletions
  1. 10 1
      source/core/SecureShell.cpp

+ 10 - 1
source/core/SecureShell.cpp

@@ -1798,7 +1798,16 @@ void inline __fastcall TSecureShell::CheckConnection(int Message)
     {
       if ((ExitCode == 0) && FAuthenticationCancelled)
       {
-        Str = LoadStr(CREDENTIALS_NOT_SPECIFIED);
+        // This should be improved to check if the prompt for specific credential
+        // was cancelled after it was unsuccessfully answered before
+        if (GetStoredCredentialsTried())
+        {
+          Str = LoadStr(AUTHENTICATION_FAILED);
+        }
+        else
+        {
+          Str = LoadStr(CREDENTIALS_NOT_SPECIFIED);
+        }
         // The 0 code is not coming from the server
         ExitCode = -1;
       }