• Filippo Valsorda's avatar
    crypto/tls: replace net.Pipe in tests with real TCP connections · be0f3c28
    Filippo Valsorda authored
    crypto/tls is meant to work over network connections with buffering, not
    synchronous connections, as explained in #24198. Tests based on net.Pipe
    are unrealistic as reads and writes are matched one to one. Such tests
    worked just thanks to the implementation details of the tls.Conn
    internal buffering, and would break if for example the flush of the
    first flight of the server was not entirely assimilated by the client
    rawInput buffer before the client attempted to reply to the ServerHello.
    
    Note that this might run into the Darwin network issues at #25696.
    
    Fixed a few test races that were either hidden or synchronized by the
    use of the in-memory net.Pipe.
    
    Also, this gets us slightly more realistic benchmarks, reflecting some
    syscall cost of Read and Write operations.
    
    Change-Id: I5a597b3d7a81b8ccc776030cc837133412bf50f8
    Reviewed-on: https://go-review.googlesource.com/c/142817
    Run-TryBot: Filippo Valsorda <filippo@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    be0f3c28
Name
Last commit
Last update
..
testdata Loading commit data...
alert.go Loading commit data...
auth.go Loading commit data...
auth_test.go Loading commit data...
cipher_suites.go Loading commit data...
common.go Loading commit data...
conn.go Loading commit data...
conn_test.go Loading commit data...
example_test.go Loading commit data...
generate_cert.go Loading commit data...
handshake_client.go Loading commit data...
handshake_client_test.go Loading commit data...
handshake_messages.go Loading commit data...
handshake_messages_test.go Loading commit data...
handshake_server.go Loading commit data...
handshake_server_test.go Loading commit data...
handshake_test.go Loading commit data...
key_agreement.go Loading commit data...
prf.go Loading commit data...
prf_test.go Loading commit data...
ticket.go Loading commit data...
tls.go Loading commit data...
tls_test.go Loading commit data...