From 47d1c42aff6bb84a654cc69b1dbc42f855b03415 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Mon, 7 Nov 2016 15:40:48 -0500 Subject: [PATCH] crypto/tls: use default cipher suites in BenchmarkThroughput CL 32871 updated the default cipher suites to use AES-GCM in preference to ChaCha20-Poly1305 on platforms which have hardware implementations of AES-GCM. This change makes BenchmarkThroughput use the default cipher suites instead of the test cipher suites to ensure that the recommended (fastest) algorithms are used. Updates #17779. Change-Id: Ib551223e4a00b5ea197d4d73748e1fdd8a47c32d Reviewed-on: https://go-review.googlesource.com/32838 Run-TryBot: Michael Munday TryBot-Result: Gobot Gobot Reviewed-by: Adam Langley --- src/crypto/tls/tls_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go index 83b1f4ca9d..1a5286c383 100644 --- a/src/crypto/tls/tls_test.go +++ b/src/crypto/tls/tls_test.go @@ -668,6 +668,7 @@ func throughput(b *testing.B, totalBytes int64, dynamicRecordSizingDisabled bool panic(fmt.Errorf("accept: %v", err)) } serverConfig := testConfig.Clone() + serverConfig.CipherSuites = nil // the defaults may prefer faster ciphers serverConfig.DynamicRecordSizingDisabled = dynamicRecordSizingDisabled srv := Server(sconn, serverConfig) if err := srv.Handshake(); err != nil { @@ -681,6 +682,7 @@ func throughput(b *testing.B, totalBytes int64, dynamicRecordSizingDisabled bool b.SetBytes(totalBytes) clientConfig := testConfig.Clone() + clientConfig.CipherSuites = nil // the defaults may prefer faster ciphers clientConfig.DynamicRecordSizingDisabled = dynamicRecordSizingDisabled buf := make([]byte, bufsize) -- 2.48.1