bug 1320510 - clamp the default enabled TLS version range to what NSS supports r=keeler

In particular, this fixes the case where Firefox is compiled with TLS 1.3
enabled by default with the option --with-system-nss against NSS 3.28, which has
TLS 1.3 compile-time disabled by default.
This commit is contained in:
EKR 2016-11-28 13:15:34 -08:00
parent df53257c80
commit 1987bbf1a9

View File

@ -1411,6 +1411,11 @@ nsNSSComponent::FillTLSVersionRange(SSLVersionRange& rangeOut,
return;
}
// Clip the defaults by what NSS actually supports to enable
// working with a system NSS with different ranges.
rangeOut.min = std::max(rangeOut.min, supported.min);
rangeOut.max = std::min(rangeOut.max, supported.max);
// convert min/maxFromPrefs to the internal representation
minFromPrefs += SSL_LIBRARY_VERSION_3_0;
maxFromPrefs += SSL_LIBRARY_VERSION_3_0;