Skip to content

Commit

Permalink
Log a reference to Bug 1952 when an OpenSSH 8.8 (or newer) server ref…
Browse files Browse the repository at this point in the history
…uses the key

Source commit: dff6f47367c65c8cc658d5a27a9790391cd2fb4a
  • Loading branch information
martinprikryl committed Nov 24, 2021
1 parent bc1a1eb commit 37bd7e6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions source/core/SecureShell.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 37bd7e6

Please sign in to comment.