Merge mozilla-inbound to mozilla-central. a=merge
authorAndreea Pavel <apavel@mozilla.com>
Sat, 13 Jan 2018 23:49:24 +0200
changeset 451021 04c0a07b8de21300856ec89b7d118d4be9b86250
parent 451020 93340ac5ecd8d2791176d3e9656f6d1aff3f3092 (current diff)
parent 451019 fafb731dae7c13cf972b8fa94ea584bcc9b9bbfd (diff)
child 451022 4259ed6ea40f6e9af6d5d4dc210685f7ea313768
child 451028 47aae85fb8cdb69121abe6b7a7ce24eaaa047b7f
push id8543
push userryanvm@gmail.com
push dateTue, 16 Jan 2018 14:33:22 +0000
treeherdermozilla-beta@a6525ed16a32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone59.0a1
first release with
nightly linux32
04c0a07b8de2 / 59.0a1 / 20180113220355 / files
nightly linux64
04c0a07b8de2 / 59.0a1 / 20180113220355 / files
nightly mac
04c0a07b8de2 / 59.0a1 / 20180113220355 / files
nightly win32
04c0a07b8de2 / 59.0a1 / 20180113220355 / files
nightly win64
04c0a07b8de2 / 59.0a1 / 20180113220355 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-inbound to mozilla-central. a=merge
--- a/security/manager/ssl/nsNSSIOLayer.cpp
+++ b/security/manager/ssl/nsNSSIOLayer.cpp
@@ -70,17 +70,17 @@ namespace {
 // does not impact other normal sockets not using the flags.)
 //
 // Their current definitions are:
 //
 // bits 0-2 (mask 0x07) specify the max tls version
 //          0 means no override 1->4 are 1.0, 1.1, 1.2, 1.3, 4->7 unused
 // bits 3-5 (mask 0x38) specify the tls fallback limit
 //          0 means no override, values 1->4 match prefs
-// bit    6 (mask 0x40) specifies use of TLS 1.3 compatibility mode (draft-22)
+// bit    6 (mask 0x40) was used to specify compat mode. Temporarily reserved.
 
 enum {
   kTLSProviderFlagMaxVersion10   = 0x01,
   kTLSProviderFlagMaxVersion11   = 0x02,
   kTLSProviderFlagMaxVersion12   = 0x03,
   kTLSProviderFlagMaxVersion13   = 0x04,
 };
 
@@ -89,21 +89,16 @@ static uint32_t getTLSProviderFlagMaxVer
   return (flags & 0x07);
 }
 
 static uint32_t getTLSProviderFlagFallbackLimit(uint32_t flags)
 {
   return (flags & 0x38) >> 3;
 }
 
-static bool getTLSProviderFlagCompatMode(uint32_t flags)
-{
-  return (flags & 0x40);
-}
-
 #define MAX_ALPN_LENGTH 255
 
 void
 getSiteKey(const nsACString& hostName, uint16_t port,
            /*out*/ nsACString& key)
 {
   key = hostName;
   key.AppendASCII(":");
@@ -2575,16 +2570,22 @@ nsSSLIOLayerSetOptions(PRFileDesc* fd, b
     }
   }
 
   SSLVersionRange range;
   if (SSL_VersionRangeGet(fd, &range) != SECSuccess) {
     return NS_ERROR_FAILURE;
   }
 
+  // Set TLS 1.3 compat mode.
+  if (SECSuccess != SSL_OptionSet(fd, SSL_ENABLE_TLS13_COMPAT_MODE, PR_TRUE)) {
+    MOZ_LOG(gPIPNSSLog, LogLevel::Error,
+            ("[%p] nsSSLIOLayerSetOptions: Setting compat mode failed\n", fd));
+  }
+
   // setting TLS max version
   uint32_t versionFlags =
     getTLSProviderFlagMaxVersion(infoObject->GetProviderTlsFlags());
   if (versionFlags) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
             ("[%p] nsSSLIOLayerSetOptions: version flags %d\n", fd, versionFlags));
     if (versionFlags == kTLSProviderFlagMaxVersion10) {
       range.max = SSL_LIBRARY_VERSION_TLS_1_0;
@@ -2596,27 +2597,16 @@ nsSSLIOLayerSetOptions(PRFileDesc* fd, b
       range.max = SSL_LIBRARY_VERSION_TLS_1_3;
     } else {
       MOZ_LOG(gPIPNSSLog, LogLevel::Error,
               ("[%p] nsSSLIOLayerSetOptions: unknown version flags %d\n",
                fd, versionFlags));
     }
   }
 
-  // enabling alternative handshake
-  if (getTLSProviderFlagCompatMode(infoObject->GetProviderTlsFlags())) {
-    MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
-            ("[%p] nsSSLIOLayerSetOptions: Use Compatible Handshake\n", fd));
-    if (SECSuccess != SSL_OptionSet(fd, SSL_ENABLE_TLS13_COMPAT_MODE, PR_TRUE)) {
-          MOZ_LOG(gPIPNSSLog, LogLevel::Error,
-                  ("[%p] nsSSLIOLayerSetOptions: Setting compat mode failed\n", fd));
-          // continue on default path
-    }
-  }
-
   if ((infoObject->GetProviderFlags() & nsISocketProvider::BE_CONSERVATIVE) &&
       (range.max > SSL_LIBRARY_VERSION_TLS_1_2)) {
     MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
             ("[%p] nsSSLIOLayerSetOptions: range.max limited to 1.2 due to BE_CONSERVATIVE flag\n",
              fd));
     range.max = SSL_LIBRARY_VERSION_TLS_1_2;
   }
 
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -523,17 +523,19 @@ var dataProviders = {
         data[keyPrefix + "Version"] = ext.getParameter(gl.VERSION);
         data[keyPrefix + "DriverExtensions"] = ext.getParameter(ext.EXTENSIONS);
         data[keyPrefix + "WSIInfo"] = ext.getParameter(ext.WSI_INFO);
 
         // //
 
         // Eagerly free resources.
         let loseExt = gl.getExtension("WEBGL_lose_context");
-        loseExt.loseContext();
+        if (loseExt) {
+             loseExt.loseContext();
+        }
     }
 
     GetWebGLInfo(data, "webgl1", "webgl");
     GetWebGLInfo(data, "webgl2", "webgl2");
 
 
     let infoInfo = gfxInfo.getInfo();
     if (infoInfo)