Browse Source

Merge branch 'master' into dev

# Conflicts:
#	source/WinSCP.cbproj

Source commit: 4d93b11600a8053c2ef684fb1013044e50b4ab43
Martin Prikryl 5 years ago
parent
commit
fc722bdc90

+ 1 - 1
deployment/readme.txt

@@ -1,7 +1,7 @@
 To create 'WinSCP-x.x.x-Setup.exe' install package, follow these steps:
 - Build 'WinSCP.exe', 'Console.com', 'DragExt.dll' and 'DragExt64.dll' (see ..\readme)
 - Install 'Inno Setup'
-  http://www.jrsoftware.org/isinfo.php
+  https://jrsoftware.org/isinfo.php
 - Install 'PuTTY' package
   https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
 - Create 'translations' subfolder

+ 7 - 1
source/core/PuttyIntf.cpp

@@ -937,6 +937,11 @@ UnicodeString __fastcall ParseOpenSshPubLine(const UnicodeString & Line, const s
   return Result;
 }
 //---------------------------------------------------------------------------
+UnicodeString __fastcall GetSsh1KeyType()
+{
+  return UnicodeString(ssh_rsa.cache_id);
+}
+//---------------------------------------------------------------------------
 UnicodeString __fastcall GetKeyTypeHuman(const UnicodeString & KeyType)
 {
   UnicodeString Result;
@@ -944,7 +949,8 @@ UnicodeString __fastcall GetKeyTypeHuman(const UnicodeString & KeyType)
   {
     Result = L"DSA";
   }
-  else if (KeyType == ssh_rsa.cache_id)
+  else if ((KeyType == ssh_rsa.cache_id) ||
+           (KeyType == L"rsa")) // SSH1
   {
     Result = L"RSA";
   }

+ 1 - 0
source/core/PuttyTools.h

@@ -37,6 +37,7 @@ void __fastcall DllHijackingProtection();
 UnicodeString __fastcall ParseOpenSshPubLine(const UnicodeString & Line, const struct ssh_keyalg *& Algorithm);
 //---------------------------------------------------------------------------
 UnicodeString __fastcall GetKeyTypeHuman(const UnicodeString & KeyType);
+UnicodeString __fastcall GetSsh1KeyType();
 //---------------------------------------------------------------------------
 bool IsOpenSSH(const UnicodeString & SshImplementation);
 //---------------------------------------------------------------------------

+ 20 - 4
source/core/SecureShell.cpp

@@ -2374,12 +2374,28 @@ void __fastcall TSecureShell::VerifyHostKey(
   GetRealHost(Host, Port);
 
   UnicodeString Buf = Fingerprint;
-  UnicodeString SignKeyAlg = CutToChar(Buf, L' ', false);
-  UnicodeString SignKeySize = CutToChar(Buf, L' ', false);
+  UnicodeString SignKeyAlg, SignKeySize, MD5, SHA256;
+  if (get_ssh_version(FBackendHandle) == 1)
+  {
+    SignKeyAlg = GetSsh1KeyType();
+  }
+  else
+  {
+    SignKeyAlg = CutToChar(Buf, L' ', false);
+  }
+  SignKeySize = CutToChar(Buf, L' ', false);
+  MD5 = CutToChar(Buf, L' ', false);
+  if (get_ssh_version(FBackendHandle) == 1)
+  {
+    SHA256 = L"-";
+    DebugAssert(Buf.IsEmpty());
+  }
+  else
+  {
+    SHA256 = Buf;
+  }
   UnicodeString SignKeyType = SignKeyAlg + L' ' + SignKeySize;
-  UnicodeString MD5 = CutToChar(Buf, L' ', false);
   UnicodeString FingerprintMD5 = SignKeyType + L' ' + MD5;
-  UnicodeString SHA256 = Buf;
   UnicodeString FingerprintSHA256 = SignKeyType + L' ' + SHA256;
 
   FSessionInfo.HostKeyFingerprintSHA256 = FingerprintSHA256;

+ 1 - 1
source/core/SessionData.cpp

@@ -265,7 +265,7 @@ void __fastcall TSessionData::DefaultSettings()
   FtpTransferActiveImmediately = asAuto;
   Ftps = ftpsNone;
   MinTlsVersion = tls10;
-  MaxTlsVersion = tls13;
+  MaxTlsVersion = tls12;
   FtpListAll = asAuto;
   FtpHost = asAuto;
   FtpDeleteFromCwd = asAuto;

+ 5 - 1
source/core/Terminal.cpp

@@ -7790,7 +7790,11 @@ void __fastcall TTerminal::CacheCertificate(const UnicodeString & CertificateSto
 void __fastcall TTerminal::CollectTlsUsage(const UnicodeString & TlsVersionStr)
 {
   // see SSL_get_version() in OpenSSL ssl_lib.c
-  if (TlsVersionStr == L"TLSv1.2")
+  if (TlsVersionStr == L"TLSv1.3")
+  {
+    Configuration->Usage->Inc(L"OpenedSessionsTLS13");
+  }
+  else if (TlsVersionStr == L"TLSv1.2")
   {
     Configuration->Usage->Inc(L"OpenedSessionsTLS12");
   }

+ 65 - 29
source/filezilla/AsyncSslSocketLayer.cpp

@@ -54,6 +54,7 @@ CAsyncSslSocketLayer::CAsyncSslSocketLayer()
   m_Main = NULL;
   m_sessionid = NULL;
   m_sessionreuse = true;
+  m_sessionreuse_failed = false;
 
   FCertificate = NULL;
   FPrivateKey = NULL;
@@ -636,6 +637,56 @@ BOOL CAsyncSslSocketLayer::Connect(LPCTSTR lpszHostAddress, UINT nHostPort)
   return res;
 }
 
+bool CAsyncSslSocketLayer::HandleSession(SSL_SESSION * Session)
+{
+  bool Result = false;
+  if (m_sessionreuse)
+  {
+    if (m_sessionid != Session)
+    {
+      if (m_sessionid == NULL)
+      {
+        if (SSL_session_reused(m_ssl))
+        {
+          LogSocketMessageRaw(FZ_LOG_PROGRESS, L"Session ID reused");
+        }
+        else
+        {
+          if ((m_Main != NULL) && !m_Main->m_sessionreuse_failed)
+          {
+            LogSocketMessageRaw(FZ_LOG_INFO, L"Main TLS session ID not reused, will not try again");
+            m_Main->m_sessionreuse_failed = true;
+          }
+        }
+        LogSocketMessageRaw(FZ_LOG_DEBUG, L"Saving session ID");
+      }
+      else
+      {
+        SSL_SESSION_free(m_sessionid);
+        LogSocketMessageRaw(FZ_LOG_INFO, L"Session ID changed");
+      }
+      m_sessionid = Session;
+      Result = true;
+    }
+  }
+  return Result;
+}
+
+int CAsyncSslSocketLayer::NewSessionCallback(struct ssl_st * Ssl, SSL_SESSION * Session)
+{
+  CAsyncSslSocketLayer * Layer = LookupLayer(Ssl);
+
+  int Result = 0;
+  // This is not called for TLS 1.2 and older when session is reused (so "Session ID reused" won't be logged).
+  // So for 1.2 and older, we call HandleSession from apps_ssl_info_callback as we always did.
+  if ((SSL_version(Ssl) >= TLS1_3_VERSION) && Layer->HandleSession(Session))
+  {
+    Result = 1;
+  }
+
+  return Result;
+}
+
 int CAsyncSslSocketLayer::InitSSLConnection(bool clientMode,
   CAsyncSslSocketLayer* main, bool sessionreuse,
   CFileZillaTools * tools,
@@ -683,6 +734,9 @@ int CAsyncSslSocketLayer::InitSSLConnection(bool clientMode,
       USES_CONVERSION;
       SSL_CTX_set_verify(m_ssl_ctx, SSL_VERIFY_PEER, verify_callback);
       SSL_CTX_set_client_cert_cb(m_ssl_ctx, ProvideClientCert);
+      // https://www.mail-archive.com/[email protected]/msg86186.html
+      SSL_CTX_set_session_cache_mode(m_ssl_ctx, SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_NO_INTERNAL_STORE | SSL_SESS_CACHE_NO_AUTO_CLEAR);
+      SSL_CTX_sess_set_new_cb(m_ssl_ctx, NewSessionCallback);
       CFileStatus Dummy;
       if (CFile::GetStatus((LPCTSTR)m_CertStorage, Dummy))
       {
@@ -740,7 +794,12 @@ int CAsyncSslSocketLayer::InitSSLConnection(bool clientMode,
   m_sessionreuse = sessionreuse;
   if ((m_Main != NULL) && m_sessionreuse)
   {
-    if (m_Main->m_sessionid != NULL)
+    if (m_Main->m_sessionid == NULL)
+    {
+      DebugFail();
+      SSL_set_session(m_ssl, NULL);
+    }
+    else if (!m_Main->m_sessionreuse_failed)
     {
       if (!SSL_set_session(m_ssl, m_Main->m_sessionid))
       {
@@ -882,6 +941,7 @@ void CAsyncSslSocketLayer::ResetSslSession()
     m_sessionid = NULL;
   }
   m_sessionreuse = true;
+  m_sessionreuse_failed = false;
 
   m_sCriticalSection.Unlock();
 }
@@ -1119,36 +1179,12 @@ void CAsyncSslSocketLayer::apps_ssl_info_callback(const SSL *s, int where, int r
   }
   if (where & SSL_CB_HANDSHAKE_DONE)
   {
-    if (pLayer->m_sessionreuse)
+    // For 1.2 and older, session is always established at this point.
+    // For 1.3, session can be restarted later, so this is handled in NewSessionCallback.
+    if (SSL_version(pLayer->m_ssl) < TLS1_3_VERSION)
     {
       SSL_SESSION * sessionid = SSL_get1_session(pLayer->m_ssl);
-      if (pLayer->m_sessionid != sessionid)
-      {
-        if (pLayer->m_sessionid == NULL)
-        {
-          if (SSL_session_reused(pLayer->m_ssl))
-          {
-            pLayer->LogSocketMessageRaw(FZ_LOG_PROGRESS, L"Session ID reused");
-          }
-          else
-          {
-            if ((pLayer->m_Main != NULL) && (pLayer->m_Main->m_sessionid != NULL))
-            {
-              pLayer->LogSocketMessageRaw(FZ_LOG_INFO, L"Main TLS session ID not reused, will not try again");
-              SSL_SESSION_free(pLayer->m_Main->m_sessionid);
-              pLayer->m_Main->m_sessionid = NULL;
-            }
-          }
-          pLayer->LogSocketMessageRaw(FZ_LOG_DEBUG, L"Saving session ID");
-        }
-        else
-        {
-          SSL_SESSION_free(pLayer->m_sessionid);
-          pLayer->LogSocketMessageRaw(FZ_LOG_INFO, L"Session ID changed");
-        }
-        pLayer->m_sessionid = sessionid;
-      }
-      else
+      if (!pLayer->HandleSession(sessionid))
       {
         SSL_SESSION_free(sessionid);
       }

+ 3 - 0
source/filezilla/AsyncSslSocketLayer.h

@@ -161,6 +161,7 @@ private:
   int InitSSL();
   void UnloadSSL();
   void PrintLastErrorMsg();
+  bool HandleSession(SSL_SESSION * Session);
 
   void TriggerEvents();
 
@@ -169,6 +170,7 @@ private:
   static int verify_callback(int preverify_ok, X509_STORE_CTX * ctx);
   static int ProvideClientCert(
     SSL * Ssl, X509 ** Certificate, EVP_PKEY ** PrivateKey);
+  static int NewSessionCallback(struct ssl_st * Ssl, SSL_SESSION * Session);
   static CAsyncSslSocketLayer * LookupLayer(SSL * Ssl);
 
   bool m_bUseSSL;
@@ -201,6 +203,7 @@ private:
   SSL* m_ssl;      // current session handle
   SSL_SESSION * m_sessionid;
   bool m_sessionreuse;
+  bool m_sessionreuse_failed;
   CAsyncSslSocketLayer * m_Main;
 
   // Data channels for encrypted/unencrypted data

+ 2 - 2
source/packages/tb2k/LICENSE.txt

@@ -4,12 +4,12 @@ Jordan Russell.
 Use and/or distribution of the files requires compliance with the
 "Toolbar2000 License", found in TB2k-LICENSE.txt or at:
 
-  http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+  https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
 Alternatively, at your option, the files may be used and/or distributed under
 the terms of the "GNU General Public License", found in GPL-LICENSE.txt or at:
 
-  http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+  https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
 
 NOTE: If you choose the GPL license option, your application as a whole must
 also be licensed under the GPL. (Refer to section 2b of the GPL license.)

+ 2 - 2
source/packages/tb2k/TB2Acc.pas

@@ -9,13 +9,13 @@ unit TB2Acc;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2Anim.pas

@@ -9,13 +9,13 @@ unit TB2Anim;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2Common.pas

@@ -9,13 +9,13 @@ unit TB2Common;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2Dock.pas

@@ -9,13 +9,13 @@ unit TB2Dock;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2DsgnConvertOptions.pas

@@ -9,13 +9,13 @@ unit TB2DsgnConvertOptions;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2DsgnConverter.pas

@@ -9,13 +9,13 @@ unit TB2DsgnConverter;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 3 - 3
source/packages/tb2k/TB2DsgnItemEditor.pas

@@ -9,13 +9,13 @@ unit TB2DsgnItemEditor;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions
@@ -327,7 +327,7 @@ const
     'For conditions of distribution and use, see LICENSE.TXT.'#13#10 +
     #13#10 +
     'Visit my web site for the latest versions of Toolbar2000:'#13#10 +
-    'http://www.jrsoftware.org/';
+    'https://jrsoftware.org/';
 begin
   MessageDlg(Format(AboutText, [Toolbar2000VersionPropText]), mtInformation,
     [mbOK], 0);

+ 2 - 2
source/packages/tb2k/TB2ExtItems.pas

@@ -9,13 +9,13 @@ unit TB2ExtItems;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2Hook.pas

@@ -13,13 +13,13 @@ unit TB2Hook;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2Item.pas

@@ -10,13 +10,13 @@ unit TB2Item;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2Reg.pas

@@ -9,13 +9,13 @@ unit TB2Reg;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2Toolbar.pas

@@ -9,13 +9,13 @@ unit TB2Toolbar;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 2 - 2
source/packages/tb2k/TB2Version.pas

@@ -9,13 +9,13 @@ unit TB2Version;
   not use or distribute this file except in compliance with the
   "Toolbar2000 License". A copy of the "Toolbar2000 License" may be found in
   TB2k-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/TB2k-LICENSE.txt
 
   Alternatively, the contents of this file may be used under the terms of the
   GNU General Public License (the "GPL"), in which case the provisions of the
   GPL are applicable instead of those in the "Toolbar2000 License". A copy of
   the GPL may be found in GPL-LICENSE.txt or at:
-    http://www.jrsoftware.org/files/tb2k/GPL-LICENSE.txt
+    https://jrsoftware.org/files/tb2k/GPL-LICENSE.txt
   If you wish to allow use of your version of this file only under the terms of
   the GPL and not to allow others to use your version of this file under the
   "Toolbar2000 License", indicate your decision by deleting the provisions

+ 1 - 1
source/packages/tb2k/readme.txt

@@ -2,4 +2,4 @@ TBX package is copyright (c) 1998-2004 Jordan Russell.
 
 The package distributed with WinSCP is not complete.
 To download complete package go to:
-http://www.jrsoftware.org/tb2k.php
+https://jrsoftware.org/tb2k.php

+ 1 - 1
source/packages/tbx/TBXReg.pas

@@ -282,7 +282,7 @@ const
     '©1998-2004 by Jordan Russell'#13#10 +
     'For conditions of distribution and use, see Toolbar2000 documentation.'#13#10 +
     #13#10 +
-    'Visit http://www.jrsoftware.org/ for the latest versions of Toolbar2000'#13#10 +
+    'Visit https://jrsoftware.org/ for the latest versions of Toolbar2000'#13#10 +
     '';
 begin
   case Index of

+ 29 - 1
source/putty/ssh1connection.c

@@ -37,6 +37,7 @@ static void ssh1_connection_special_cmd(PacketProtocolLayer *ppl,
 static bool ssh1_connection_want_user_input(PacketProtocolLayer *ppl);
 static void ssh1_connection_got_user_input(PacketProtocolLayer *ppl);
 static void ssh1_connection_reconfigure(PacketProtocolLayer *ppl, Conf *conf);
+static unsigned int ssh1_connection_winscp_query(PacketProtocolLayer *ppl, int query);
 
 static const struct PacketProtocolLayerVtable ssh1_connection_vtable = {
     ssh1_connection_free,
@@ -47,6 +48,7 @@ static const struct PacketProtocolLayerVtable ssh1_connection_vtable = {
     ssh1_connection_got_user_input,
     ssh1_connection_reconfigure,
     NULL /* no layer names in SSH-1 */,
+    ssh1_connection_winscp_query,
 };
 
 static void ssh1_rportfwd_remove(
@@ -217,7 +219,7 @@ static void ssh1_connection_free(PacketProtocolLayer *ppl)
     if (s->antispoof_prompt)
         free_prompts(s->antispoof_prompt);
 
-    delete_callbacks_for_context(ppl->seat, s);
+    delete_callbacks_for_context(get_seat_callback_set(ppl->seat), s);
 
     sfree(s);
 }
@@ -843,3 +845,29 @@ static void ssh1_connection_reconfigure(PacketProtocolLayer *ppl, Conf *conf)
     if (s->portfwdmgr_configured)
         portfwdmgr_config(s->portfwdmgr, s->conf);
 }
+
+#include <puttyexp.h>
+
+static unsigned int ssh1_connection_winscp_query(PacketProtocolLayer *ppl, int query)
+{
+    struct ssh1_connection_state *s =
+        container_of(ppl, struct ssh1_connection_state, ppl);
+
+    if (query == WINSCP_QUERY_TIMER)
+    {
+        return 0; // dummy
+    }
+    else if (query == WINSCP_QUERY_REMMAXPKT)
+    {
+        return 0; // dummy
+    }
+    else if (query == WINSCP_QUERY_MAIN_CHANNEL)
+    {
+        return s->finished_setup;
+    }
+    else
+    {
+        assert(0);
+        return 0;
+    }
+}

+ 22 - 0
source/putty/ssh1login.c

@@ -71,6 +71,7 @@ static void ssh1_login_special_cmd(PacketProtocolLayer *ppl,
 static bool ssh1_login_want_user_input(PacketProtocolLayer *ppl);
 static void ssh1_login_got_user_input(PacketProtocolLayer *ppl);
 static void ssh1_login_reconfigure(PacketProtocolLayer *ppl, Conf *conf);
+static unsigned int ssh1_login_winscp_query(PacketProtocolLayer *ppl, int query);
 
 static const struct PacketProtocolLayerVtable ssh1_login_vtable = {
     ssh1_login_free,
@@ -81,6 +82,7 @@ static const struct PacketProtocolLayerVtable ssh1_login_vtable = {
     ssh1_login_got_user_input,
     ssh1_login_reconfigure,
     NULL /* no layer names in SSH-1 */,
+    ssh1_login_winscp_query,
 };
 
 static void ssh1_login_agent_query(struct ssh1_login_state *s, strbuf *req);
@@ -1187,3 +1189,23 @@ static void ssh1_login_reconfigure(PacketProtocolLayer *ppl, Conf *conf)
         container_of(ppl, struct ssh1_login_state, ppl);
     ssh_ppl_reconfigure(s->successor_layer, conf);
 }
+
+#include <puttyexp.h>
+
+static unsigned int ssh1_login_winscp_query(PacketProtocolLayer *ppl, int query)
+{
+    struct ssh1_login_state *s =
+        container_of(ppl, struct ssh1_login_state, ppl);
+    if (query == WINSCP_QUERY_TIMER)
+    {
+        return 0;
+    }
+    else if (s->successor_layer->vt->winscp_query != NULL)
+    {
+        return ssh_ppl_winscp_query(s->successor_layer, query);
+    }
+    else
+    {
+        return 0;
+    }
+}

+ 1 - 1
source/resource/TextsWin1.rc

@@ -545,7 +545,7 @@ BEGIN
         ABOUT_THIRDPARTY_LICENSE, "Display license"
         ABOUT_TOOLBAR2000, "Toolbar2000 library %s"
         ABOUT_TOOLBAR2000_COPYRIGHT, "Copyright © Jordan Russell"
-        ABOUT_TOOLBAR2000_URL, "http://www.jrsoftware.org/tb2kdl.php"
+        ABOUT_TOOLBAR2000_URL, "https://jrsoftware.org/tb2kdl.php"
         ABOUT_TBX, "TBX library %s"
         ABOUT_TBX_COPYRIGHT, "Copyright © Alex A. Denisov and contributors"
         ABOUT_TBX_URL, "https://github.com/plashenkov/TBX"

+ 12 - 9
translations/DA.ini

@@ -12,7 +12,7 @@ PasswordPanel.ButtonsPanel.PasswordOKButton.Caption="OK"
 PasswordPanel.ButtonsPanel.PasswordCancelButton.Caption="Annuller"
 PasswordPanel.ButtonsPanel.PasswordHelpButton.Caption="&Hjælp"
 PasswordPanel.SessionRememberPasswordPanel.SessionRememberPasswordCheck.Caption="Husk koden for denne &session"
-BannerPanel.NeverShowAgainCheck.Caption="vis ikke dette banner igen"
+BannerPanel.NeverShowAgainCheck.Caption="Vis ikke dette banner igen"
 BannerPanel.BannerCloseButton.Caption="Fortsæt"
 BannerPanel.BannerHelpButton.Caption="Hjælp"
 BannerActionList.EditCopy.Caption="&Kopiér"
@@ -20,13 +20,13 @@ BannerActionList.EditSelectAll.Caption="Markér &alt"
 
 [Cleanup.dfm]
 Caption="Ryd op i programmets data"
-Label1.Caption="Den følgende liste indeholder alle programmets data, der kan være gemt på denne computer. Vælg dem, du til fjerne.\r\n\r\nHvis en anden instans af programmet kører, da luk det venligst før oprydning i data.\r\n\r\nBemærk: Hvis du senere åbner en session eller kører programmet igen, vil noget af dataen blive genskabt."
+Label1.Caption="Den følgende liste indeholder alle programmets data, der kan være gemt på denne computer. Vælg dem, du til fjerne.\r\n\r\nHvis en anden instans af programmet kører, da luk det venligst før oprydning i data.\r\n\r\nBemærk: Hvis du senere åbner en session eller kører programmet igen, vil noget af dataene blive genskabt."
 OKButton.Caption="OK"
 CancelButton.Caption="Luk"
 DataListView.item0.Caption="Data"
 DataListView.item1.Caption="Placering"
-CheckAllButton.Caption="Vælg/afvælg &alle"
-HelpButton.Caption="Hjælp"
+CheckAllButton.Caption="Vælg/fravælg &alle"
+HelpButton.Caption="&Hjælp"
 
 [Console.dfm]
 Caption="Konsol"
@@ -51,7 +51,7 @@ CopyParamGroup.Caption="Overfør indstillinger"
 
 [CopyParamCustom.dfm]
 Caption="Overfør indstillinger"
-OkButton.Caption="Ok"
+OkButton.Caption="OK"
 CancelButton.Caption="Fortryd"
 HelpButton.Caption="Hjælp"
 
@@ -60,8 +60,8 @@ Label1.Caption="Beskrivelse"
 OkButton.Caption="Ok"
 CancelButton.Caption="Fortryd"
 RuleGroup.Caption="Regler for automatisk valg"
-RuleGroup.Label2.Caption="Host Navn"
-RuleGroup.Label3.Caption="Brugernavn"
+RuleGroup.Label2.Caption="Host Na&vn"
+RuleGroup.Label3.Caption="Bruger&navn"
 RuleGroup.Label4.Caption="&Fjernmappe filter"
 RuleGroup.Label5.Caption="&Lokal mappe filter"
 RuleGroup.CurrentRuleButton.Caption="Nuværende"
@@ -616,7 +616,7 @@ ExplorerActions.ShowHideRemoteNameColumnAction.Hint="Vis/skjul navn|Vis/skjul na
 ExplorerActions.ShowHideRemoteExtColumnAction.Caption="&Endelse"
 ExplorerActions.ShowHideRemoteExtColumnAction.Hint="Vis/skjul endelse|Vis/skjul endelseskolonne på serverpanel"
 ExplorerActions.ShowHideRemoteSizeColumnAction.Caption="&Størrelse"
-ExplorerActions.ShowHideRemoteSizeColumnAction.Hint="Vis/skjul størrelseskolonne på serverpanel"
+ExplorerActions.ShowHideRemoteSizeColumnAction.Hint="Vis/skjul størrelse|Vis/skjul størrelseskolonne på serverpanel"
 ExplorerActions.ShowHideRemoteChangedColumnAction.Caption="&Modificering"
 ExplorerActions.ShowHideRemoteChangedColumnAction.Hint="Vis/skjul modificering|Vis/skjul modificeringskolonne på serverpanel"
 ExplorerActions.ShowHideRemoteRightsColumnAction.Caption="&Tilladelser"
@@ -1009,7 +1009,7 @@ EXPLORE_LOCAL_DIR_ERROR="Kan ikke gennemse mappe '%s'."
 NO_UPLOAD_LIST_ERROR="Der er ingen filer til upload."
 DELETE_TEMP_EXECUTE_FILE_ERROR="Kan ikke fjerne midlertidige mappe '%s'."
 EXECUTE_FILE_ERROR="Kan ikke åbne eller afvikle '%s'"
-EDITOR_ERROR="Kunne ikke starte editoren: '%s'."
+EDITOR_ERROR="Kan ikke starte editoren: '%s'."
 SYNC_DIR_BROWSE_ERROR="Kunne ikke åbne den tilsvarende mappe i det modsatte panel. Synkroniseret gennemgang fejlede og er blevet deaktiveret."
 RESOLVE_SHORTCUT_ERROR="Kunne ikke finde genvejen '%s'"
 BOOKMARK_INVALID_NAME="'%s' er ikke et gyldigt navn til Lokations Profil."
@@ -1126,6 +1126,7 @@ WizardSelectDir="Vælg installationsmappe"
 SelectDirDesc="Hvor skal [name] installeres?"
 SelectDirLabel3="Installationsprogrammet installerer [name] i følgende mappe."
 SelectDirBrowseLabel="Klik på Næste for at fortsætte. Klik på Gennemse, hvis du vil vælge en anden mappe."
+; <override>
 DiskSpaceGBLabel="Der skal være mindst [gb] GB fri diskplads."
 DiskSpaceMBLabel="Der skal være mindst [mb] MB fri diskplads."
 CannotInstallToNetworkDrive="Guiden kan ikke installere programmet på et netværksdrev."
@@ -1151,6 +1152,7 @@ NoUninstallWarningTitle="Komponenterne er installeret"
 NoUninstallWarning="Installationsprogrammet har registreret at følgende komponenter allerede er installeret på computeren:\n\n%1\n\nKomponenterne bliver ikke afinstalleret hvis de fravælges.\n\nFortsæt alligevel?"
 ComponentSize1="%1 KB"
 ComponentSize2="%1 MB"
+; <override>
 ComponentsDiskSpaceGBLabel="De nuværende valg kræver mindst [gb] GB ledig diskplads."
 ComponentsDiskSpaceMBLabel="De nuværende valg kræver mindst [mb] MB ledig diskplads."
 WizardSelectTasks="Vælg supplerende opgaver"
@@ -1184,6 +1186,7 @@ ApplicationsFound2="Følgende programmer bruger filer som skal opdateres. Det an
 CloseApplications="&Luk programmerne automatisk"
 DontCloseApplications="Luk &ikke programmerne"
 ErrorCloseApplications="Installationsprogrammet kunne ikke lukke alle programmerne automatisk. Det anbefales at du lukker alle programmer som bruger filer der skal opdateres, inden installationsprogrammet fortsætter."
+; <override>
 PrepareToInstallNeedsRestart="Installationsprogrammet er nødt til at genstarte computeren. Efter genstarten skal du køre installationsprogrammet igen for at færdiggøre installation af [name].\n\nVil du at genstarte nu?"
 WizardInstalling="Installerer"
 InstallingLabel="Vent venligst mens installationsprogrammet installerer [name] på computeren."

+ 2 - 2
translations/version.ini

@@ -27,7 +27,7 @@ VI=18
 CA=34
 KO=48
 AR=43
-DA=19
+DA=20
 ET=23
 SK=58
 CH=130
@@ -82,7 +82,7 @@ VI=2004,2019,Trần Ngọc Quân
 CA=2003,2019,Joan Monguillot,Oriol Capsada,Víctor Mitjans
 KO=2004,2019,Jinsup Park,Keunsik Hong
 AR=2005,2019,Ramzi alsllami,Suhaila
-DA=2004,2019,Torben Stallknecht,Thomas Pryds Lauritsen,Thomas Poulsen
+DA=2004,2020,Kristoff Carsten,Torben Stallknecht,Thomas Pryds Lauritsen,Thomas Poulsen
 CHS=2005,2019,Digital Sonic
 ET=2005,2019,Kristjan Randma
 SK=2005,2019,Marián Hikaník,Patrik Lenart