Browse Source

Bug fix: Check for application updates was limited to TLS 1.2

Source commit: 947be1b917051e314e5e52e637297cb50cd57030
Martin Prikryl 2 years ago
parent
commit
699bf5fd2c
4 changed files with 5 additions and 5 deletions
  1. 1 1
      source/core/Http.cpp
  2. 1 1
      source/core/NeonIntf.cpp
  3. 2 2
      source/core/SessionData.cpp
  4. 1 1
      source/core/SessionData.h

+ 1 - 1
source/core/Http.cpp

@@ -219,7 +219,7 @@ __int64 THttp::GetResponseLength()
 //------------------------------------------------------------------------------
 void THttp::InitSslSession(ssl_st * Ssl, ne_session * /*Session*/)
 {
-  SetupSsl(Ssl, tls12, tls12);
+  SetupSsl(Ssl, tlsDefaultMin, tlsMax);
 }
 //---------------------------------------------------------------------------
 int THttp::NeonServerSSLCallback(void * UserData, int Failures, const ne_ssl_certificate * Certificate)

+ 1 - 1
source/core/NeonIntf.cpp

@@ -546,7 +546,7 @@ UnicodeString __fastcall NeonTlsSessionInfo(
 //---------------------------------------------------------------------------
 void SetupSsl(ssl_st * Ssl, TTlsVersion MinTlsVersion, TTlsVersion MaxTlsVersion)
 {
-  MaxTlsVersion = (TTlsVersion)std::max(MaxTlsVersion, tls10); // the lowest currently supported version
+  MaxTlsVersion = (TTlsVersion)std::max(MaxTlsVersion, tlsMin); // the lowest currently supported version
   #define MASK_TLS_VERSION(VERSION, FLAG) ((MinTlsVersion > VERSION) || (MaxTlsVersion < VERSION) ? FLAG : 0)
   int Options =
     MASK_TLS_VERSION(tls10, SSL_OP_NO_TLSv1) |

+ 2 - 2
source/core/SessionData.cpp

@@ -330,8 +330,8 @@ void __fastcall TSessionData::DefaultSettings()
   FtpPingType = ptDummyCommand;
   FtpTransferActiveImmediately = asAuto;
   Ftps = ftpsNone;
-  MinTlsVersion = tls12;
-  MaxTlsVersion = tls13;
+  MinTlsVersion = tlsDefaultMin;
+  MaxTlsVersion = tlsMax;
   FtpListAll = asAuto;
   FtpHost = asAuto;
   FtpWorkFromCwd = asAuto;

+ 1 - 1
source/core/SessionData.h

@@ -34,7 +34,7 @@ enum TPingType { ptOff, ptNullPacket, ptDummyCommand };
 enum TAddressFamily { afAuto, afIPv4, afIPv6 };
 enum TFtps { ftpsNone, ftpsImplicit, ftpsExplicitSsl, ftpsExplicitTls };
 // ssl2 and ssh3 are equivalent of tls10 now
-enum TTlsVersion { ssl2 = 2, ssl3 = 3, tls10 = 10, tls11 = 11, tls12 = 12, tls13 = 13 };
+enum TTlsVersion { ssl2 = 2, ssl3 = 3, tls10 = 10, tls11 = 11, tls12 = 12, tls13 = 13, tlsMin = tls10, tlsDefaultMin = tls12, tlsMax = tls13 };
 // has to match libs3 S3UriStyle
 enum TS3UrlStyle { s3usVirtualHost, s3usPath };
 enum TSessionSource { ssNone, ssStored, ssStoredModified };