Skip to content

Commit c11853c

Browse files
committed
[release-branch.go1.13] crypto/tls: make SSLv3 again disabled by default
It was mistakenly re-enabled in CL 146217. Updates #33837 Change-Id: I8c0e1787114c6232df5888e51e355906622295bc Reviewed-on: https://go-review.googlesource.com/c/go/+/191877 Run-TryBot: Filippo Valsorda <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> (cherry picked from commit 2ebc3d8) Reviewed-on: https://go-review.googlesource.com/c/go/+/191998
1 parent 44a66ac commit c11853c

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

doc/go1.13.html

+9-4
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,15 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
593593
<dd>
594594
<p>
595595
Support for SSL version 3.0 (SSLv3) <a href="https://golang.org/issue/32716">
596-
is now deprecated and will be removed in Go 1.14</a>. Note that SSLv3
597-
<a href="https://tools.ietf.org/html/rfc7568">is cryptographically
598-
broken</a>, is already disabled by default in <code>crypto/tls</code>,
599-
and was never supported by Go clients.
596+
is now deprecated and will be removed in Go 1.14</a>. Note that SSLv3 is the
597+
<a href="https://tools.ietf.org/html/rfc7568">cryptographically broken</a>
598+
protocol predating TLS.
599+
</p>
600+
601+
<p>
602+
SSLv3 was always disabled by default, other than in Go 1.12, when it was
603+
mistakenly enabled by default server-side. It is now again disabled by
604+
default. (SSLv3 was never supported client-side.)
600605
</p>
601606

602607
<p><!-- CL 177698 -->

src/crypto/tls/common.go

+4
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,10 @@ var supportedVersions = []uint16{
794794
func (c *Config) supportedVersions(isClient bool) []uint16 {
795795
versions := make([]uint16, 0, len(supportedVersions))
796796
for _, v := range supportedVersions {
797+
// TLS 1.0 is the default minimum version.
798+
if (c == nil || c.MinVersion == 0) && v < VersionTLS10 {
799+
continue
800+
}
797801
if c != nil && c.MinVersion != 0 && v < c.MinVersion {
798802
continue
799803
}

src/crypto/tls/handshake_server_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@ func TestRejectBadProtocolVersion(t *testing.T) {
7777
}, "unsupported versions")
7878
}
7979

80+
func TestSSLv3OptIn(t *testing.T) {
81+
config := testConfig.Clone()
82+
config.MinVersion = 0
83+
testClientHelloFailure(t, config, &clientHelloMsg{
84+
vers: VersionSSL30,
85+
random: make([]byte, 32),
86+
}, "unsupported versions")
87+
testClientHelloFailure(t, config, &clientHelloMsg{
88+
vers: VersionTLS12,
89+
supportedVersions: []uint16{VersionSSL30},
90+
random: make([]byte, 32),
91+
}, "unsupported versions")
92+
}
93+
8094
func TestNoSuiteOverlap(t *testing.T) {
8195
clientHello := &clientHelloMsg{
8296
vers: VersionTLS10,

0 commit comments

Comments
 (0)