Jelajahi Sumber

Log a reference to Bug 1952 when an OpenSSH 8.8 (or newer) server refuses the key

Source commit: dff6f47367c65c8cc658d5a27a9790391cd2fb4a
Martin Prikryl 3 tahun lalu
induk
melakukan
37bd7e6269
1 mengubah file dengan 21 tambahan dan 0 penghapusan
  1. 21 0
      source/core/SecureShell.cpp

+ 21 - 0
source/core/SecureShell.cpp

@@ -703,6 +703,27 @@ void __fastcall TSecureShell::PuttyLogEvent(const char * AStr)
     FLastTunnelError = Str;
   }
   LogEvent(Str);
+  if (SameText(Str, L"Server refused our key") &&
+      // This occurs before FSshImplementation is initialized
+      IsOpenSSH(GetSessionInfo().SshImplementation))
+  {
+    UnicodeString SshImplementation = GetSessionInfo().SshImplementation;
+    int P = SshImplementation.LastDelimiter(L"_");
+    if (P > 0)
+    {
+      UnicodeString Version = SshImplementation.SubString(P + 1, SshImplementation.Length() - P);
+      int P = Version.Pos(L".");
+      if (P > 0)
+      {
+        int Major = StrToIntDef(Version.SubString(1, P - 1), 0);
+        int Minor = StrToIntDef(Version.SubString(P + 1, Version.Length() - P), 0);
+        if ((Major > 8) || ((Major == 8) && (Minor >= 6)))
+        {
+          LogEvent(L"See https://winscp.net/tracker/1952");
+        }
+      }
+    }
+  }
 }
 //---------------------------------------------------------------------------
 TPromptKind __fastcall TSecureShell::IdentifyPromptKind(UnicodeString & Name)