]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: remove unneeded calls to bytes.NewReader
authorTim Cooper <tim.cooper@layeh.com>
Mon, 29 Oct 2018 23:11:12 +0000 (18:11 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 30 Oct 2018 01:43:09 +0000 (01:43 +0000)
Updates #28269

Change-Id: Iae765f85e6ae49f4b581161ed489b2f5ee27cdba
Reviewed-on: https://go-review.googlesource.com/c/145737
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/crypto/tls/tls.go

index 51932882c013853c6ee62852bb30cfdab0fcfa3c..8fd429431595ead9b87834a400d0bfb71ff2340b 100644 (file)
@@ -11,7 +11,6 @@ package tls
 // https://www.imperialviolet.org/2013/02/04/luckythirteen.html.
 
 import (
-       "bytes"
        "crypto"
        "crypto/ecdsa"
        "crypto/rsa"
@@ -30,10 +29,7 @@ import (
 // The configuration config must be non-nil and must include
 // at least one certificate or else set GetCertificate.
 func Server(conn net.Conn, config *Config) *Conn {
-       return &Conn{
-               conn: conn, config: config,
-               input: *bytes.NewReader(nil), // Issue 28269
-       }
+       return &Conn{conn: conn, config: config}
 }
 
 // Client returns a new TLS client side connection
@@ -41,10 +37,7 @@ func Server(conn net.Conn, config *Config) *Conn {
 // The config cannot be nil: users must set either ServerName or
 // InsecureSkipVerify in the config.
 func Client(conn net.Conn, config *Config) *Conn {
-       return &Conn{
-               conn: conn, config: config, isClient: true,
-               input: *bytes.NewReader(nil), // Issue 28269
-       }
+       return &Conn{conn: conn, config: config, isClient: true}
 }
 
 // A listener implements a network listener (net.Listener) for TLS connections.