mirror of
https://github.com/golang/go
synced 2024-11-23 09:20:05 -07:00
crypto/tls: remove unneeded calls to bytes.NewReader
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>
This commit is contained in:
parent
7b0fa529f3
commit
d1836e629f
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user