mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/tls: switch to OpenSSL 1.1.0 for test data.
We will need OpenSSL 1.1.0 in order to test some of the features expected for Go 1.8. However, 1.1.0 also disables (by default) some things that we still want to test, such as RC4, 3DES and SSLv3. Thus developers wanting to update the crypto/tls test data will need to build OpenSSL from source. This change updates the test data with transcripts generated by 1.1.0 (in order to reduce future diffs) and also causes a banner to be printed if 1.1.0 is not used when updating. (The test for an ALPN mismatch is removed because OpenSSL now terminates the connection with a fatal alert if no known ALPN protocols are offered. There's no point testing against this because it's an OpenSSL behaviour.) Change-Id: I957516975e0b8c7def84184f65c81d0b68f1c551 Reviewed-on: https://go-review.googlesource.com/30821 Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
0e36456bf9
commit
9d88292c83
64 changed files with 2840 additions and 2725 deletions
|
|
@ -77,7 +77,7 @@ func newOpensslOutputSink() *opensslOutputSink {
|
|||
|
||||
// opensslEndOfHandshake is a message that the “openssl s_server” tool will
|
||||
// print when a handshake completes if run with “-state”.
|
||||
const opensslEndOfHandshake = "SSL_accept:SSLv3 write finished A"
|
||||
const opensslEndOfHandshake = "SSL_accept:SSLv3/TLS write finished"
|
||||
|
||||
func (o *opensslOutputSink) Write(data []byte) (n int, err error) {
|
||||
o.line = append(o.line, data...)
|
||||
|
|
@ -276,6 +276,8 @@ func (test *clientTest) loadData() (flows [][]byte, err error) {
|
|||
}
|
||||
|
||||
func (test *clientTest) run(t *testing.T, write bool) {
|
||||
checkOpenSSLVersion(t)
|
||||
|
||||
var clientConn, serverConn net.Conn
|
||||
var recordingConn *recordingConn
|
||||
var childProcess *exec.Cmd
|
||||
|
|
@ -542,7 +544,7 @@ func TestHandshakeClientCertRSA(t *testing.T) {
|
|||
|
||||
test := &clientTest{
|
||||
name: "ClientCert-RSA-RSA",
|
||||
command: []string{"openssl", "s_server", "-cipher", "RC4-SHA", "-verify", "1"},
|
||||
command: []string{"openssl", "s_server", "-cipher", "AES128", "-verify", "1"},
|
||||
config: config,
|
||||
}
|
||||
|
||||
|
|
@ -578,7 +580,7 @@ func TestHandshakeClientCertECDSA(t *testing.T) {
|
|||
|
||||
test := &clientTest{
|
||||
name: "ClientCert-ECDSA-RSA",
|
||||
command: []string{"openssl", "s_server", "-cipher", "RC4-SHA", "-verify", "1"},
|
||||
command: []string{"openssl", "s_server", "-cipher", "AES128", "-verify", "1"},
|
||||
config: config,
|
||||
}
|
||||
|
||||
|
|
@ -800,27 +802,6 @@ func TestHandshakeClientALPNMatch(t *testing.T) {
|
|||
runClientTestTLS12(t, test)
|
||||
}
|
||||
|
||||
func TestHandshakeClientALPNNoMatch(t *testing.T) {
|
||||
config := testConfig.Clone()
|
||||
config.NextProtos = []string{"proto3"}
|
||||
|
||||
test := &clientTest{
|
||||
name: "ALPN-NoMatch",
|
||||
// Note that this needs OpenSSL 1.0.2 because that is the first
|
||||
// version that supports the -alpn flag.
|
||||
command: []string{"openssl", "s_server", "-alpn", "proto1,proto2"},
|
||||
config: config,
|
||||
validate: func(state ConnectionState) error {
|
||||
// There's no overlap so OpenSSL will not select a protocol.
|
||||
if state.NegotiatedProtocol != "" {
|
||||
return fmt.Errorf("Got protocol %q, wanted ''", state.NegotiatedProtocol)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
runClientTestTLS12(t, test)
|
||||
}
|
||||
|
||||
// sctsBase64 contains data from `openssl s_client -serverinfo 18 -connect ritter.vg:443`
|
||||
const sctsBase64 = "ABIBaQFnAHUApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFHl5nuFgAABAMARjBEAiAcS4JdlW5nW9sElUv2zvQyPoZ6ejKrGGB03gjaBZFMLwIgc1Qbbn+hsH0RvObzhS+XZhr3iuQQJY8S9G85D9KeGPAAdgBo9pj4H2SCvjqM7rkoHUz8cVFdZ5PURNEKZ6y7T0/7xAAAAUeX4bVwAAAEAwBHMEUCIDIhFDgG2HIuADBkGuLobU5a4dlCHoJLliWJ1SYT05z6AiEAjxIoZFFPRNWMGGIjskOTMwXzQ1Wh2e7NxXE1kd1J0QsAdgDuS723dc5guuFCaR+r4Z5mow9+X7By2IMAxHuJeqj9ywAAAUhcZIqHAAAEAwBHMEUCICmJ1rBT09LpkbzxtUC+Hi7nXLR0J+2PmwLp+sJMuqK+AiEAr0NkUnEVKVhAkccIFpYDqHOlZaBsuEhWWrYpg2RtKp0="
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue