From 8e8bfb697fbc948494d67428c4953605cc89b6f4 Mon Sep 17 00:00:00 2001
From: Ainar Garipov
Date: Wed, 23 Sep 2020 21:15:01 +0300
Subject: crypto/tls: replace errClosed with net.ErrClosed
CL 250357 exported net.ErrClosed to allow more reliable detection
of closed network connection errors. Use that error in crypto/tls
as well.
The error message is changed from "tls: use of closed connection"
to "use of closed network connection", so the code that detected such
errors by looking for that text in the error message will need to be
updated to use errors.Is(err, net.ErrClosed) instead.
Fixes #41066
Change-Id: Ic05c0ed6a4f57af2a0302d53b00851a59200be2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/256897
Reviewed-by: Katie Hockman
Trust: Katie Hockman
Trust: Ian Lance Taylor
Run-TryBot: Katie Hockman
TryBot-Result: Go Bot
---
src/crypto/tls/conn.go | 5 ++---
src/crypto/tls/tls_test.go | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go
index edcfecf81d..5dff76c988 100644
--- a/src/crypto/tls/conn.go
+++ b/src/crypto/tls/conn.go
@@ -1070,7 +1070,6 @@ func (c *Conn) readHandshake() (interface{}, error) {
}
var (
- errClosed = errors.New("tls: use of closed connection")
errShutdown = errors.New("tls: protocol is shutdown")
)
@@ -1080,7 +1079,7 @@ func (c *Conn) Write(b []byte) (int, error) {
for {
x := atomic.LoadInt32(&c.activeCall)
if x&1 != 0 {
- return 0, errClosed
+ return 0, net.ErrClosed
}
if atomic.CompareAndSwapInt32(&c.activeCall, x, x+2) {
break
@@ -1285,7 +1284,7 @@ func (c *Conn) Close() error {
for {
x = atomic.LoadInt32(&c.activeCall)
if x&1 != 0 {
- return errClosed
+ return net.ErrClosed
}
if atomic.CompareAndSwapInt32(&c.activeCall, x, x|1) {
break
diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go
index 198423414b..334bfc411a 100644
--- a/src/crypto/tls/tls_test.go
+++ b/src/crypto/tls/tls_test.go
@@ -569,8 +569,8 @@ func TestConnCloseBreakingWrite(t *testing.T) {
}
<-closeReturned
- if err := tconn.Close(); err != errClosed {
- t.Errorf("Close error = %v; want errClosed", err)
+ if err := tconn.Close(); err != net.ErrClosed {
+ t.Errorf("Close error = %v; want net.ErrClosed", err)
}
}
--
cgit v1.3
From 79e681d2a291142aa0ac8297229e182b2d1a78ac Mon Sep 17 00:00:00 2001
From: "Chen.Zhidong"
Date: Tue, 29 Sep 2020 09:05:41 +0000
Subject: crypto/tls: make config.Clone return nil if the source is nil
Fixes #40565
Change-Id: I13a67be193f8cd68df02b8729529e627a73d364b
GitHub-Last-Rev: b03d2c04fd88db909b40dfd7bd08fe13d8994ab9
GitHub-Pull-Request: golang/go#40566
Reviewed-on: https://go-review.googlesource.com/c/go/+/246637
Run-TryBot: Emmanuel Odeke
TryBot-Result: Go Bot
Reviewed-by: Filippo Valsorda
Reviewed-by: Emmanuel Odeke
Trust: Emmanuel Odeke
---
src/crypto/tls/common.go | 5 ++++-
src/crypto/tls/tls_test.go | 7 +++++++
2 files changed, 11 insertions(+), 1 deletion(-)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go
index e8d009137a..e4f18bf5eb 100644
--- a/src/crypto/tls/common.go
+++ b/src/crypto/tls/common.go
@@ -727,9 +727,12 @@ func (c *Config) ticketKeyFromBytes(b [32]byte) (key ticketKey) {
// ticket, and the lifetime we set for tickets we send.
const maxSessionTicketLifetime = 7 * 24 * time.Hour
-// Clone returns a shallow clone of c. It is safe to clone a Config that is
+// Clone returns a shallow clone of c or nil if c is nil. It is safe to clone a Config that is
// being used concurrently by a TLS client or server.
func (c *Config) Clone() *Config {
+ if c == nil {
+ return nil
+ }
c.mutex.RLock()
defer c.mutex.RUnlock()
return &Config{
diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go
index 334bfc411a..4ab8a430ba 100644
--- a/src/crypto/tls/tls_test.go
+++ b/src/crypto/tls/tls_test.go
@@ -841,6 +841,13 @@ func TestCloneNonFuncFields(t *testing.T) {
}
}
+func TestCloneNilConfig(t *testing.T) {
+ var config *Config
+ if cc := config.Clone(); cc != nil {
+ t.Fatalf("Clone with nil should return nil, got: %+v", cc)
+ }
+}
+
// changeImplConn is a net.Conn which can change its Write and Close
// methods.
type changeImplConn struct {
--
cgit v1.3
From 0163bdae685c1b060f8108ac5af13ea6374555b1 Mon Sep 17 00:00:00 2001
From: Cherry Zhang
Date: Mon, 28 Sep 2020 17:43:44 -0400
Subject: crypto/tls: fix TestLinkerGC test
A test that checks if "tls.(*Conn)" appears in any symbol's name.
tls.Conn is a type, so the string "tls.(*Conn)" can only appear
in the name of a method of Conn. But the test code doesn't use
any of the methods. Not sure why this needs to be live. In
particular, the linker is now able to prune all methods of Conn.
Remove this requirement. In fact, just drop the only_conn test
case, as simply allocating a type doesn't necessarily bring
anything live.
Change-Id: I754291b75d38e1465b5291b4dea20806615d21b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/257973
Trust: Cherry Zhang
Trust: Tobias Klauser
Run-TryBot: Cherry Zhang
TryBot-Result: Go Bot
Reviewed-by: Filippo Valsorda
Reviewed-by: Than McIntosh
Reviewed-by: Jeremy Faller
---
src/crypto/tls/link_test.go | 13 -------------
1 file changed, 13 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/link_test.go b/src/crypto/tls/link_test.go
index c1fb57e70e..8224216b5c 100644
--- a/src/crypto/tls/link_test.go
+++ b/src/crypto/tls/link_test.go
@@ -41,19 +41,6 @@ func main() {}
"type.crypto/tls.serverHandshakeState",
},
},
- {
- name: "only_conn",
- program: `package main
-import "crypto/tls"
-var c = new(tls.Conn)
-func main() {}
-`,
- want: []string{"tls.(*Conn)"},
- bad: []string{
- "type.crypto/tls.clientHandshakeState",
- "type.crypto/tls.serverHandshakeState",
- },
- },
{
name: "client_and_server",
program: `package main
--
cgit v1.3
From d2a80f3fb5b44450e0b304ac5a718f99c053d82a Mon Sep 17 00:00:00 2001
From: Luca Spiller
Date: Tue, 6 Oct 2020 08:12:45 +0000
Subject: crypto/tls: fix typo in spelling of permanentError
Change-Id: I819c121ff388460ec348af773ef94b44416a2ea9
GitHub-Last-Rev: 98dd8fb25cecb73e88d107e0a35e3e63a53dfd09
GitHub-Pull-Request: golang/go#41785
Reviewed-on: https://go-review.googlesource.com/c/go/+/259517
Run-TryBot: Emmanuel Odeke
TryBot-Result: Go Bot
Reviewed-by: Emmanuel Odeke
Reviewed-by: Filippo Valsorda
Trust: Emmanuel Odeke
---
src/crypto/tls/conn.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go
index 5dff76c988..f1d4cb926c 100644
--- a/src/crypto/tls/conn.go
+++ b/src/crypto/tls/conn.go
@@ -168,18 +168,18 @@ type halfConn struct {
trafficSecret []byte // current TLS 1.3 traffic secret
}
-type permamentError struct {
+type permanentError struct {
err net.Error
}
-func (e *permamentError) Error() string { return e.err.Error() }
-func (e *permamentError) Unwrap() error { return e.err }
-func (e *permamentError) Timeout() bool { return e.err.Timeout() }
-func (e *permamentError) Temporary() bool { return false }
+func (e *permanentError) Error() string { return e.err.Error() }
+func (e *permanentError) Unwrap() error { return e.err }
+func (e *permanentError) Timeout() bool { return e.err.Timeout() }
+func (e *permanentError) Temporary() bool { return false }
func (hc *halfConn) setErrorLocked(err error) error {
if e, ok := err.(net.Error); ok {
- hc.err = &permamentError{err: e}
+ hc.err = &permanentError{err: e}
} else {
hc.err = err
}
--
cgit v1.3
From 1b09d430678d4a6f73b2443463d11f75851aba8a Mon Sep 17 00:00:00 2001
From: Russ Cox
Date: Fri, 16 Oct 2020 00:49:02 -0400
Subject: all: update references to symbols moved from io/ioutil to io
The old ioutil references are still valid, but update our code
to reflect best practices and get used to the new locations.
Code compiled with the bootstrap toolchain
(cmd/asm, cmd/dist, cmd/compile, debug/elf)
must remain Go 1.4-compatible and is excluded.
Also excluded vendored code.
For #41190.
Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/263142
Trust: Russ Cox
Run-TryBot: Russ Cox
TryBot-Result: Go Bot
Reviewed-by: Emmanuel Odeke
---
src/archive/tar/reader.go | 7 +-
src/archive/tar/reader_test.go | 2 +-
src/archive/tar/tar_test.go | 8 +-
src/archive/zip/reader_test.go | 6 +-
src/archive/zip/register.go | 3 +-
src/archive/zip/writer_test.go | 4 +-
src/archive/zip/zip_test.go | 3 +-
src/bufio/bufio_test.go | 19 ++--
src/bytes/reader_test.go | 9 +-
src/cmd/fix/main.go | 3 +-
src/cmd/go/internal/clean/clean.go | 3 +-
src/cmd/go/internal/fsys/fsys_test.go | 3 +-
src/cmd/go/internal/imports/read.go | 4 +-
src/cmd/go/internal/lockedfile/lockedfile.go | 5 +-
src/cmd/go/internal/modfetch/codehost/git.go | 5 +-
src/cmd/go/internal/modfetch/codehost/git_test.go | 3 +-
src/cmd/go/internal/modfetch/codehost/shell.go | 3 +-
src/cmd/go/internal/modfetch/coderepo.go | 2 +-
src/cmd/go/internal/modfetch/fetch.go | 2 +-
src/cmd/go/internal/modfetch/proxy.go | 3 +-
src/cmd/go/internal/modfetch/sumdb.go | 4 +-
src/cmd/go/internal/web/api.go | 5 +-
src/cmd/go/proxy_test.go | 4 +-
src/cmd/go/testdata/script/test_cache_inputs.txt | 2 +-
src/cmd/gofmt/gofmt.go | 2 +-
src/cmd/pprof/pprof.go | 4 +-
src/cmd/trace/trace_test.go | 10 +-
src/cmd/trace/trace_unix_test.go | 4 +-
src/compress/bzip2/bzip2_test.go | 6 +-
src/compress/flate/deflate_test.go | 24 ++---
src/compress/flate/flate_test.go | 5 +-
src/compress/flate/inflate_test.go | 3 +-
src/compress/flate/reader_test.go | 4 +-
src/compress/flate/writer_test.go | 9 +-
src/compress/gzip/gunzip_test.go | 9 +-
src/compress/gzip/gzip_test.go | 9 +-
src/compress/lzw/reader_test.go | 4 +-
src/compress/lzw/writer_test.go | 10 +-
src/compress/zlib/writer_test.go | 4 +-
src/crypto/tls/handshake_test.go | 2 +-
src/crypto/tls/tls_test.go | 7 +-
src/crypto/x509/root_ios_gen.go | 2 +-
src/debug/gosym/pclntab_test.go | 3 +-
src/encoding/ascii85/ascii85_test.go | 7 +-
src/encoding/base32/base32_test.go | 13 ++-
src/encoding/base64/base64_test.go | 15 ++-
src/encoding/binary/binary_test.go | 3 +-
src/encoding/gob/encoder_test.go | 4 +-
src/encoding/hex/hex_test.go | 3 +-
src/encoding/json/bench_test.go | 8 +-
src/encoding/json/stream_test.go | 5 +-
src/encoding/pem/pem_test.go | 4 +-
src/flag/flag_test.go | 5 +-
src/go/internal/gccgoimporter/importer.go | 2 +-
src/go/internal/gcimporter/gcimporter.go | 3 +-
src/go/parser/interface.go | 2 +-
src/go/printer/performance_test.go | 2 +-
src/go/types/gotype.go | 4 +-
src/html/template/clone_test.go | 14 +--
src/html/template/exec_test.go | 8 +-
src/image/gif/writer_test.go | 22 ++--
src/image/jpeg/writer_test.go | 6 +-
src/image/png/writer_test.go | 17 ++--
src/internal/obscuretestdata/obscuretestdata.go | 2 +-
src/internal/profile/profile.go | 5 +-
src/io/example_test.go | 5 +-
src/io/io.go | 2 +-
src/io/multi_test.go | 11 +-
src/mime/encodedword_test.go | 3 +-
src/mime/example_test.go | 5 +-
src/mime/multipart/example_test.go | 3 +-
src/mime/multipart/multipart.go | 3 +-
src/mime/multipart/multipart_test.go | 13 ++-
src/mime/multipart/writer_test.go | 8 +-
src/mime/quotedprintable/example_test.go | 4 +-
src/mime/quotedprintable/writer_test.go | 6 +-
src/net/http/alpn_test.go | 5 +-
src/net/http/cgi/child.go | 3 +-
src/net/http/client.go | 5 +-
src/net/http/client_test.go | 25 +++--
src/net/http/clientserver_test.go | 39 ++++---
src/net/http/doc.go | 2 +-
src/net/http/example_test.go | 3 +-
src/net/http/fcgi/child.go | 5 +-
src/net/http/fcgi/fcgi_test.go | 5 +-
src/net/http/filetransport_test.go | 3 +-
src/net/http/fs_test.go | 20 ++--
src/net/http/httptest/example_test.go | 9 +-
src/net/http/httptest/httptest.go | 3 +-
src/net/http/httptest/httptest_test.go | 3 +-
src/net/http/httptest/recorder.go | 4 +-
src/net/http/httptest/recorder_test.go | 3 +-
src/net/http/httptest/server_test.go | 10 +-
src/net/http/httputil/dump.go | 9 +-
src/net/http/httputil/dump_test.go | 9 +-
src/net/http/httputil/example_test.go | 6 +-
src/net/http/httputil/reverseproxy_test.go | 49 +++++----
src/net/http/internal/chunked_test.go | 5 +-
src/net/http/main_test.go | 4 +-
src/net/http/pprof/pprof_test.go | 6 +-
src/net/http/readrequest_test.go | 3 +-
src/net/http/request.go | 11 +-
src/net/http/request_test.go | 22 ++--
src/net/http/requestwrite_test.go | 27 +++--
src/net/http/response_test.go | 5 +-
src/net/http/responsewrite_test.go | 20 ++--
src/net/http/roundtrip_js.go | 3 +-
src/net/http/serve_test.go | 119 +++++++++++-----------
src/net/http/server.go | 5 +-
src/net/http/sniff_test.go | 7 +-
src/net/http/transfer.go | 11 +-
src/net/http/transfer_test.go | 16 +--
src/net/http/transport_internal_test.go | 3 +-
src/net/http/transport_test.go | 100 +++++++++---------
src/net/mail/example_test.go | 4 +-
src/net/mail/message_test.go | 5 +-
src/net/rpc/jsonrpc/all_test.go | 5 +-
src/net/sendfile_test.go | 3 +-
src/net/splice_test.go | 3 +-
src/net/textproto/reader.go | 3 +-
src/net/timeout_test.go | 3 +-
src/net/writev_test.go | 5 +-
src/os/exec/example_test.go | 3 +-
src/os/exec/exec_test.go | 4 +-
src/os/exec/read3.go | 4 +-
src/os/timeout_test.go | 4 +-
src/runtime/crash_unix_test.go | 2 +-
src/runtime/testdata/testprogcgo/eintr.go | 3 +-
src/strings/reader_test.go | 7 +-
src/syscall/mkpost.go | 4 +-
src/syscall/syscall_unix_test.go | 2 +-
src/testing/iotest/reader.go | 9 +-
src/text/tabwriter/tabwriter_test.go | 11 +-
src/text/template/exec_test.go | 8 +-
src/time/genzabbrs.go | 3 +-
135 files changed, 535 insertions(+), 597 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/src/archive/tar/reader.go b/src/archive/tar/reader.go
index 4f9135b791..1b1d5b4689 100644
--- a/src/archive/tar/reader.go
+++ b/src/archive/tar/reader.go
@@ -7,7 +7,6 @@ package tar
import (
"bytes"
"io"
- "io/ioutil"
"strconv"
"strings"
"time"
@@ -104,7 +103,7 @@ func (tr *Reader) next() (*Header, error) {
continue // This is a meta header affecting the next header
case TypeGNULongName, TypeGNULongLink:
format.mayOnlyBe(FormatGNU)
- realname, err := ioutil.ReadAll(tr)
+ realname, err := io.ReadAll(tr)
if err != nil {
return nil, err
}
@@ -294,7 +293,7 @@ func mergePAX(hdr *Header, paxHdrs map[string]string) (err error) {
// parsePAX parses PAX headers.
// If an extended header (type 'x') is invalid, ErrHeader is returned
func parsePAX(r io.Reader) (map[string]string, error) {
- buf, err := ioutil.ReadAll(r)
+ buf, err := io.ReadAll(r)
if err != nil {
return nil, err
}
@@ -850,7 +849,7 @@ func discard(r io.Reader, n int64) error {
}
}
- copySkipped, err := io.CopyN(ioutil.Discard, r, n-seekSkipped)
+ copySkipped, err := io.CopyN(io.Discard, r, n-seekSkipped)
if err == io.EOF && seekSkipped+copySkipped < n {
err = io.ErrUnexpectedEOF
}
diff --git a/src/archive/tar/reader_test.go b/src/archive/tar/reader_test.go
index f153b668de..411d1e0b99 100644
--- a/src/archive/tar/reader_test.go
+++ b/src/archive/tar/reader_test.go
@@ -865,7 +865,7 @@ func TestReadTruncation(t *testing.T) {
}
cnt++
if s2 == "manual" {
- if _, err = tr.writeTo(ioutil.Discard); err != nil {
+ if _, err = tr.writeTo(io.Discard); err != nil {
break
}
}
diff --git a/src/archive/tar/tar_test.go b/src/archive/tar/tar_test.go
index f605dae904..d4a3d42312 100644
--- a/src/archive/tar/tar_test.go
+++ b/src/archive/tar/tar_test.go
@@ -328,7 +328,7 @@ func TestRoundTrip(t *testing.T) {
if !reflect.DeepEqual(rHdr, hdr) {
t.Errorf("Header mismatch.\n got %+v\nwant %+v", rHdr, hdr)
}
- rData, err := ioutil.ReadAll(tr)
+ rData, err := io.ReadAll(tr)
if err != nil {
t.Fatalf("Read: %v", err)
}
@@ -805,9 +805,9 @@ func Benchmark(b *testing.B) {
b.Run(v.label, func(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
- // Writing to ioutil.Discard because we want to
+ // Writing to io.Discard because we want to
// test purely the writer code and not bring in disk performance into this.
- tw := NewWriter(ioutil.Discard)
+ tw := NewWriter(io.Discard)
for _, file := range v.files {
if err := tw.WriteHeader(file.hdr); err != nil {
b.Errorf("unexpected WriteHeader error: %v", err)
@@ -845,7 +845,7 @@ func Benchmark(b *testing.B) {
if _, err := tr.Next(); err != nil {
b.Errorf("unexpected Next error: %v", err)
}
- if _, err := io.Copy(ioutil.Discard, tr); err != nil {
+ if _, err := io.Copy(io.Discard, tr); err != nil {
b.Errorf("unexpected Copy error : %v", err)
}
}
diff --git a/src/archive/zip/reader_test.go b/src/archive/zip/reader_test.go
index 38ff7badd0..b7a7d7a757 100644
--- a/src/archive/zip/reader_test.go
+++ b/src/archive/zip/reader_test.go
@@ -930,7 +930,7 @@ func returnBigZipBytes() (r io.ReaderAt, size int64) {
if err != nil {
panic(err)
}
- b, err = ioutil.ReadAll(f)
+ b, err = io.ReadAll(f)
if err != nil {
panic(err)
}
@@ -987,7 +987,7 @@ func TestIssue10957(t *testing.T) {
continue
}
if f.UncompressedSize64 < 1e6 {
- n, err := io.Copy(ioutil.Discard, r)
+ n, err := io.Copy(io.Discard, r)
if i == 3 && err != io.ErrUnexpectedEOF {
t.Errorf("File[3] error = %v; want io.ErrUnexpectedEOF", err)
}
@@ -1029,7 +1029,7 @@ func TestIssue11146(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- _, err = ioutil.ReadAll(r)
+ _, err = io.ReadAll(r)
if err != io.ErrUnexpectedEOF {
t.Errorf("File[0] error = %v; want io.ErrUnexpectedEOF", err)
}
diff --git a/src/archive/zip/register.go b/src/archive/zip/register.go
index 51e9c3e4d4..4389246286 100644
--- a/src/archive/zip/register.go
+++ b/src/archive/zip/register.go
@@ -8,7 +8,6 @@ import (
"compress/flate"
"errors"
"io"
- "io/ioutil"
"sync"
)
@@ -111,7 +110,7 @@ func init() {
compressors.Store(Store, Compressor(func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil }))
compressors.Store(Deflate, Compressor(func(w io.Writer) (io.WriteCloser, error) { return newFlateWriter(w), nil }))
- decompressors.Store(Store, Decompressor(ioutil.NopCloser))
+ decompressors.Store(Store, Decompressor(io.NopCloser))
decompressors.Store(Deflate, Decompressor(newFlateReader))
}
diff --git a/src/archive/zip/writer_test.go b/src/archive/zip/writer_test.go
index 282f9ec216..2c32eaf4a5 100644
--- a/src/archive/zip/writer_test.go
+++ b/src/archive/zip/writer_test.go
@@ -301,7 +301,7 @@ func TestWriterFlush(t *testing.T) {
}
func TestWriterDir(t *testing.T) {
- w := NewWriter(ioutil.Discard)
+ w := NewWriter(io.Discard)
dw, err := w.Create("dir/")
if err != nil {
t.Fatal(err)
@@ -380,7 +380,7 @@ func testReadFile(t *testing.T, f *File, wt *WriteTest) {
if err != nil {
t.Fatal("opening:", err)
}
- b, err := ioutil.ReadAll(rc)
+ b, err := io.ReadAll(rc)
if err != nil {
t.Fatal("reading:", err)
}
diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go
index b3a7caac7f..ead9cd3aab 100644
--- a/src/archive/zip/zip_test.go
+++ b/src/archive/zip/zip_test.go
@@ -13,7 +13,6 @@ import (
"hash"
"internal/testenv"
"io"
- "io/ioutil"
"runtime"
"sort"
"strings"
@@ -620,7 +619,7 @@ func testZip64(t testing.TB, size int64) *rleBuffer {
t.Fatal("read:", err)
}
}
- gotEnd, err := ioutil.ReadAll(rc)
+ gotEnd, err := io.ReadAll(rc)
if err != nil {
t.Fatal("read end:", err)
}
diff --git a/src/bufio/bufio_test.go b/src/bufio/bufio_test.go
index cb68f3ba23..75086f1f24 100644
--- a/src/bufio/bufio_test.go
+++ b/src/bufio/bufio_test.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"strings"
"testing"
"testing/iotest"
@@ -886,7 +885,7 @@ func TestReadEmptyBuffer(t *testing.T) {
func TestLinesAfterRead(t *testing.T) {
l := NewReaderSize(bytes.NewReader([]byte("foo")), minReadBufferSize)
- _, err := ioutil.ReadAll(l)
+ _, err := io.ReadAll(l)
if err != nil {
t.Error(err)
return
@@ -1130,7 +1129,7 @@ func TestWriterReadFromCounts(t *testing.T) {
}
}
-// A writeCountingDiscard is like ioutil.Discard and counts the number of times
+// A writeCountingDiscard is like io.Discard and counts the number of times
// Write is called on it.
type writeCountingDiscard int
@@ -1300,7 +1299,7 @@ func TestReaderReset(t *testing.T) {
t.Errorf("buf = %q; want foo", buf)
}
r.Reset(strings.NewReader("bar bar"))
- all, err := ioutil.ReadAll(r)
+ all, err := io.ReadAll(r)
if err != nil {
t.Fatal(err)
}
@@ -1645,13 +1644,13 @@ func BenchmarkReaderWriteToOptimal(b *testing.B) {
buf := make([]byte, bufSize)
r := bytes.NewReader(buf)
srcReader := NewReaderSize(onlyReader{r}, 1<<10)
- if _, ok := ioutil.Discard.(io.ReaderFrom); !ok {
- b.Fatal("ioutil.Discard doesn't support ReaderFrom")
+ if _, ok := io.Discard.(io.ReaderFrom); !ok {
+ b.Fatal("io.Discard doesn't support ReaderFrom")
}
for i := 0; i < b.N; i++ {
r.Seek(0, io.SeekStart)
srcReader.Reset(onlyReader{r})
- n, err := srcReader.WriteTo(ioutil.Discard)
+ n, err := srcReader.WriteTo(io.Discard)
if err != nil {
b.Fatal(err)
}
@@ -1722,7 +1721,7 @@ func BenchmarkReaderEmpty(b *testing.B) {
str := strings.Repeat("x", 16<<10)
for i := 0; i < b.N; i++ {
br := NewReader(strings.NewReader(str))
- n, err := io.Copy(ioutil.Discard, br)
+ n, err := io.Copy(io.Discard, br)
if err != nil {
b.Fatal(err)
}
@@ -1737,7 +1736,7 @@ func BenchmarkWriterEmpty(b *testing.B) {
str := strings.Repeat("x", 1<<10)
bs := []byte(str)
for i := 0; i < b.N; i++ {
- bw := NewWriter(ioutil.Discard)
+ bw := NewWriter(io.Discard)
bw.Flush()
bw.WriteByte('a')
bw.Flush()
@@ -1752,7 +1751,7 @@ func BenchmarkWriterEmpty(b *testing.B) {
func BenchmarkWriterFlush(b *testing.B) {
b.ReportAllocs()
- bw := NewWriter(ioutil.Discard)
+ bw := NewWriter(io.Discard)
str := strings.Repeat("x", 50)
for i := 0; i < b.N; i++ {
bw.WriteString(str)
diff --git a/src/bytes/reader_test.go b/src/bytes/reader_test.go
index d799e036f0..8baac5046c 100644
--- a/src/bytes/reader_test.go
+++ b/src/bytes/reader_test.go
@@ -8,7 +8,6 @@ import (
. "bytes"
"fmt"
"io"
- "io/ioutil"
"sync"
"testing"
)
@@ -235,7 +234,7 @@ func TestReaderCopyNothing(t *testing.T) {
type justWriter struct {
io.Writer
}
- discard := justWriter{ioutil.Discard} // hide ReadFrom
+ discard := justWriter{io.Discard} // hide ReadFrom
var with, withOut nErr
with.n, with.err = io.Copy(discard, NewReader(nil))
@@ -248,7 +247,7 @@ func TestReaderCopyNothing(t *testing.T) {
// tests that Len is affected by reads, but Size is not.
func TestReaderLenSize(t *testing.T) {
r := NewReader([]byte("abc"))
- io.CopyN(ioutil.Discard, r, 1)
+ io.CopyN(io.Discard, r, 1)
if r.Len() != 2 {
t.Errorf("Len = %d; want 2", r.Len())
}
@@ -268,7 +267,7 @@ func TestReaderReset(t *testing.T) {
if err := r.UnreadRune(); err == nil {
t.Errorf("UnreadRune: expected error, got nil")
}
- buf, err := ioutil.ReadAll(r)
+ buf, err := io.ReadAll(r)
if err != nil {
t.Errorf("ReadAll: unexpected error: %v", err)
}
@@ -314,7 +313,7 @@ func TestReaderZero(t *testing.T) {
t.Errorf("UnreadRune: got nil, want error")
}
- if n, err := (&Reader{}).WriteTo(ioutil.Discard); n != 0 || err != nil {
+ if n, err := (&Reader{}).WriteTo(io.Discard); n != 0 || err != nil {
t.Errorf("WriteTo: got %d, %v; want 0, nil", n, err)
}
}
diff --git a/src/cmd/fix/main.go b/src/cmd/fix/main.go
index dfba902f48..1cea9a876a 100644
--- a/src/cmd/fix/main.go
+++ b/src/cmd/fix/main.go
@@ -13,6 +13,7 @@ import (
"go/parser"
"go/scanner"
"go/token"
+ "io"
"io/fs"
"io/ioutil"
"os"
@@ -128,7 +129,7 @@ func processFile(filename string, useStdin bool) error {
defer f.Close()
}
- src, err := ioutil.ReadAll(f)
+ src, err := io.ReadAll(f)
if err != nil {
return err
}
diff --git a/src/cmd/go/internal/clean/clean.go b/src/cmd/go/internal/clean/clean.go
index 6bfd7ae21e..095c3cc713 100644
--- a/src/cmd/go/internal/clean/clean.go
+++ b/src/cmd/go/internal/clean/clean.go
@@ -8,6 +8,7 @@ package clean
import (
"context"
"fmt"
+ "io"
"io/ioutil"
"os"
"path/filepath"
@@ -172,7 +173,7 @@ func runClean(ctx context.Context, cmd *base.Command, args []string) {
f, err := lockedfile.Edit(filepath.Join(dir, "testexpire.txt"))
if err == nil {
now := time.Now().UnixNano()
- buf, _ := ioutil.ReadAll(f)
+ buf, _ := io.ReadAll(f)
prev, _ := strconv.ParseInt(strings.TrimSpace(string(buf)), 10, 64)
if now > prev {
if err = f.Truncate(0); err == nil {
diff --git a/src/cmd/go/internal/fsys/fsys_test.go b/src/cmd/go/internal/fsys/fsys_test.go
index ba9f05d00b..28c3f08cb9 100644
--- a/src/cmd/go/internal/fsys/fsys_test.go
+++ b/src/cmd/go/internal/fsys/fsys_test.go
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"internal/testenv"
+ "io"
"io/fs"
"io/ioutil"
"os"
@@ -418,7 +419,7 @@ this can exist because the parent directory is deleted
t.Errorf("Open(%q): got error %v, want nil", tc.path, err)
continue
}
- contents, err := ioutil.ReadAll(f)
+ contents, err := io.ReadAll(f)
if err != nil {
t.Errorf("unexpected error reading contents of file: %v", err)
}
diff --git a/src/cmd/go/internal/imports/read.go b/src/cmd/go/internal/imports/read.go
index 58c2abdc29..5e270781d7 100644
--- a/src/cmd/go/internal/imports/read.go
+++ b/src/cmd/go/internal/imports/read.go
@@ -198,7 +198,7 @@ func (r *importReader) readImport(imports *[]string) {
r.readString(imports)
}
-// ReadComments is like ioutil.ReadAll, except that it only reads the leading
+// ReadComments is like io.ReadAll, except that it only reads the leading
// block of comments in the file.
func ReadComments(f io.Reader) ([]byte, error) {
r := &importReader{b: bufio.NewReader(f)}
@@ -210,7 +210,7 @@ func ReadComments(f io.Reader) ([]byte, error) {
return r.buf, r.err
}
-// ReadImports is like ioutil.ReadAll, except that it expects a Go file as input
+// ReadImports is like io.ReadAll, except that it expects a Go file as input
// and stops reading the input once the imports have completed.
func ReadImports(f io.Reader, reportSyntaxError bool, imports *[]string) ([]byte, error) {
r := &importReader{b: bufio.NewReader(f)}
diff --git a/src/cmd/go/internal/lockedfile/lockedfile.go b/src/cmd/go/internal/lockedfile/lockedfile.go
index 503024da4b..82e1a89675 100644
--- a/src/cmd/go/internal/lockedfile/lockedfile.go
+++ b/src/cmd/go/internal/lockedfile/lockedfile.go
@@ -10,7 +10,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"os"
"runtime"
)
@@ -104,7 +103,7 @@ func Read(name string) ([]byte, error) {
}
defer f.Close()
- return ioutil.ReadAll(f)
+ return io.ReadAll(f)
}
// Write opens the named file (creating it with the given permissions if needed),
@@ -136,7 +135,7 @@ func Transform(name string, t func([]byte) ([]byte, error)) (err error) {
}
defer f.Close()
- old, err := ioutil.ReadAll(f)
+ old, err := io.ReadAll(f)
if err != nil {
return err
}
diff --git a/src/cmd/go/internal/modfetch/codehost/git.go b/src/cmd/go/internal/modfetch/codehost/git.go
index 58b4b2f2d3..8abc039e7f 100644
--- a/src/cmd/go/internal/modfetch/codehost/git.go
+++ b/src/cmd/go/internal/modfetch/codehost/git.go
@@ -10,7 +10,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"net/url"
"os"
"os/exec"
@@ -832,7 +831,7 @@ func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser,
return nil, err
}
- return ioutil.NopCloser(bytes.NewReader(archive)), nil
+ return io.NopCloser(bytes.NewReader(archive)), nil
}
// ensureGitAttributes makes sure export-subst and export-ignore features are
@@ -863,7 +862,7 @@ func ensureGitAttributes(repoDir string) (err error) {
}
}()
- b, err := ioutil.ReadAll(f)
+ b, err := io.ReadAll(f)
if err != nil {
return err
}
diff --git a/src/cmd/go/internal/modfetch/codehost/git_test.go b/src/cmd/go/internal/modfetch/codehost/git_test.go
index 16908b3e84..981e3fe91f 100644
--- a/src/cmd/go/internal/modfetch/codehost/git_test.go
+++ b/src/cmd/go/internal/modfetch/codehost/git_test.go
@@ -10,6 +10,7 @@ import (
"flag"
"fmt"
"internal/testenv"
+ "io"
"io/fs"
"io/ioutil"
"log"
@@ -433,7 +434,7 @@ func TestReadZip(t *testing.T) {
if tt.err != "" {
t.Fatalf("ReadZip: no error, wanted %v", tt.err)
}
- zipdata, err := ioutil.ReadAll(rc)
+ zipdata, err := io.ReadAll(rc)
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/modfetch/codehost/shell.go b/src/cmd/go/internal/modfetch/codehost/shell.go
index 2762c55720..b9525adf5e 100644
--- a/src/cmd/go/internal/modfetch/codehost/shell.go
+++ b/src/cmd/go/internal/modfetch/codehost/shell.go
@@ -14,6 +14,7 @@ import (
"bytes"
"flag"
"fmt"
+ "io"
"io/ioutil"
"log"
"os"
@@ -115,7 +116,7 @@ func main() {
fmt.Fprintf(os.Stderr, "?%s\n", err)
continue
}
- data, err := ioutil.ReadAll(rc)
+ data, err := io.ReadAll(rc)
rc.Close()
if err != nil {
fmt.Fprintf(os.Stderr, "?%s\n", err)
diff --git a/src/cmd/go/internal/modfetch/coderepo.go b/src/cmd/go/internal/modfetch/coderepo.go
index 7f44e18a70..b6bcf83f1a 100644
--- a/src/cmd/go/internal/modfetch/coderepo.go
+++ b/src/cmd/go/internal/modfetch/coderepo.go
@@ -1052,7 +1052,7 @@ type dataFile struct {
func (f dataFile) Path() string { return f.name }
func (f dataFile) Lstat() (fs.FileInfo, error) { return dataFileInfo{f}, nil }
func (f dataFile) Open() (io.ReadCloser, error) {
- return ioutil.NopCloser(bytes.NewReader(f.data)), nil
+ return io.NopCloser(bytes.NewReader(f.data)), nil
}
type dataFileInfo struct {
diff --git a/src/cmd/go/internal/modfetch/fetch.go b/src/cmd/go/internal/modfetch/fetch.go
index 6ff455e89c..40196c4e9a 100644
--- a/src/cmd/go/internal/modfetch/fetch.go
+++ b/src/cmd/go/internal/modfetch/fetch.go
@@ -461,7 +461,7 @@ func checkMod(mod module.Version) {
// goModSum returns the checksum for the go.mod contents.
func goModSum(data []byte) (string, error) {
return dirhash.Hash1([]string{"go.mod"}, func(string) (io.ReadCloser, error) {
- return ioutil.NopCloser(bytes.NewReader(data)), nil
+ return io.NopCloser(bytes.NewReader(data)), nil
})
}
diff --git a/src/cmd/go/internal/modfetch/proxy.go b/src/cmd/go/internal/modfetch/proxy.go
index 819990b403..d75b4da521 100644
--- a/src/cmd/go/internal/modfetch/proxy.go
+++ b/src/cmd/go/internal/modfetch/proxy.go
@@ -10,7 +10,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"net/url"
"path"
pathpkg "path"
@@ -305,7 +304,7 @@ func (p *proxyRepo) getBytes(path string) ([]byte, error) {
return nil, err
}
defer body.Close()
- return ioutil.ReadAll(body)
+ return io.ReadAll(body)
}
func (p *proxyRepo) getBody(path string) (io.ReadCloser, error) {
diff --git a/src/cmd/go/internal/modfetch/sumdb.go b/src/cmd/go/internal/modfetch/sumdb.go
index 5108961a33..4fbc54d15c 100644
--- a/src/cmd/go/internal/modfetch/sumdb.go
+++ b/src/cmd/go/internal/modfetch/sumdb.go
@@ -12,8 +12,8 @@ import (
"bytes"
"errors"
"fmt"
+ "io"
"io/fs"
- "io/ioutil"
"net/url"
"os"
"path/filepath"
@@ -228,7 +228,7 @@ func (*dbClient) WriteConfig(file string, old, new []byte) error {
return err
}
defer f.Close()
- data, err := ioutil.ReadAll(f)
+ data, err := io.ReadAll(f)
if err != nil {
return err
}
diff --git a/src/cmd/go/internal/web/api.go b/src/cmd/go/internal/web/api.go
index f7d3ed60f6..9053b16b62 100644
--- a/src/cmd/go/internal/web/api.go
+++ b/src/cmd/go/internal/web/api.go
@@ -14,7 +14,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"net/url"
"strings"
"unicode"
@@ -87,7 +86,7 @@ func GetBytes(u *url.URL) ([]byte, error) {
if err := resp.Err(); err != nil {
return nil, err
}
- b, err := ioutil.ReadAll(resp.Body)
+ b, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("reading %s: %v", u.Redacted(), err)
}
@@ -130,7 +129,7 @@ func (r *Response) formatErrorDetail() string {
}
// Ensure that r.errorDetail has been populated.
- _, _ = io.Copy(ioutil.Discard, r.Body)
+ _, _ = io.Copy(io.Discard, r.Body)
s := r.errorDetail.buf.String()
if !utf8.ValidString(s) {
diff --git a/src/cmd/go/proxy_test.go b/src/cmd/go/proxy_test.go
index 8b0dbb74b2..3ed42face2 100644
--- a/src/cmd/go/proxy_test.go
+++ b/src/cmd/go/proxy_test.go
@@ -471,13 +471,13 @@ func proxyGoSum(path, vers string) ([]byte, error) {
}
h1, err := dirhash.Hash1(names, func(name string) (io.ReadCloser, error) {
data := files[name]
- return ioutil.NopCloser(bytes.NewReader(data)), nil
+ return io.NopCloser(bytes.NewReader(data)), nil
})
if err != nil {
return nil, err
}
h1mod, err := dirhash.Hash1([]string{"go.mod"}, func(string) (io.ReadCloser, error) {
- return ioutil.NopCloser(bytes.NewReader(gomod)), nil
+ return io.NopCloser(bytes.NewReader(gomod)), nil
})
if err != nil {
return nil, err
diff --git a/src/cmd/go/testdata/script/test_cache_inputs.txt b/src/cmd/go/testdata/script/test_cache_inputs.txt
index 57602e91dc..97ae4af51f 100644
--- a/src/cmd/go/testdata/script/test_cache_inputs.txt
+++ b/src/cmd/go/testdata/script/test_cache_inputs.txt
@@ -159,7 +159,7 @@ func TestOddFileContent(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- data, err := ioutil.ReadAll(f)
+ data, err := io.ReadAll(f)
f.Close()
if err != nil {
t.Fatal(err)
diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go
index 48b6ad6f53..dba2411eed 100644
--- a/src/cmd/gofmt/gofmt.go
+++ b/src/cmd/gofmt/gofmt.go
@@ -97,7 +97,7 @@ func processFile(filename string, in io.Reader, out io.Writer, stdin bool) error
perm = fi.Mode().Perm()
}
- src, err := ioutil.ReadAll(in)
+ src, err := io.ReadAll(in)
if err != nil {
return err
}
diff --git a/src/cmd/pprof/pprof.go b/src/cmd/pprof/pprof.go
index c1ddbe372f..11f91cbedb 100644
--- a/src/cmd/pprof/pprof.go
+++ b/src/cmd/pprof/pprof.go
@@ -13,7 +13,7 @@ import (
"crypto/tls"
"debug/dwarf"
"fmt"
- "io/ioutil"
+ "io"
"net/http"
"net/url"
"os"
@@ -94,7 +94,7 @@ func getProfile(source string, timeout time.Duration) (*profile.Profile, error)
func statusCodeError(resp *http.Response) error {
if resp.Header.Get("X-Go-Pprof") != "" && strings.Contains(resp.Header.Get("Content-Type"), "text/plain") {
// error is from pprof endpoint
- if body, err := ioutil.ReadAll(resp.Body); err == nil {
+ if body, err := io.ReadAll(resp.Body); err == nil {
return fmt.Errorf("server response: %s - %s", resp.Status, body)
}
}
diff --git a/src/cmd/trace/trace_test.go b/src/cmd/trace/trace_test.go
index dd12e8cd20..ea0cc6f880 100644
--- a/src/cmd/trace/trace_test.go
+++ b/src/cmd/trace/trace_test.go
@@ -10,7 +10,7 @@ import (
"cmd/internal/traceviewer"
"context"
"internal/trace"
- "io/ioutil"
+ "io"
rtrace "runtime/trace"
"strings"
"sync"
@@ -78,7 +78,7 @@ func TestGoroutineCount(t *testing.T) {
// Use the default viewerDataTraceConsumer but replace
// consumeViewerEvent to intercept the ViewerEvents for testing.
- c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1)
+ c := viewerDataTraceConsumer(io.Discard, 0, 1<<63-1)
c.consumeViewerEvent = func(ev *traceviewer.Event, _ bool) {
if ev.Name == "Goroutines" {
cnt := ev.Arg.(*goroutineCountersArg)
@@ -131,7 +131,7 @@ func TestGoroutineFilter(t *testing.T) {
gs: map[uint64]bool{10: true},
}
- c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1)
+ c := viewerDataTraceConsumer(io.Discard, 0, 1<<63-1)
if err := generateTrace(params, c); err != nil {
t.Fatalf("generateTrace failed: %v", err)
}
@@ -163,7 +163,7 @@ func TestPreemptedMarkAssist(t *testing.T) {
endTime: int64(1<<63 - 1),
}
- c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1)
+ c := viewerDataTraceConsumer(io.Discard, 0, 1<<63-1)
marks := 0
c.consumeViewerEvent = func(ev *traceviewer.Event, _ bool) {
@@ -214,7 +214,7 @@ func TestFoo(t *testing.T) {
tasks: []*taskDesc{task},
}
- c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1)
+ c := viewerDataTraceConsumer(io.Discard, 0, 1<<63-1)
var logBeforeTaskEnd, logAfterTaskEnd bool
c.consumeViewerEvent = func(ev *traceviewer.Event, _ bool) {
diff --git a/src/cmd/trace/trace_unix_test.go b/src/cmd/trace/trace_unix_test.go
index 645978e0f8..c569b40bb2 100644
--- a/src/cmd/trace/trace_unix_test.go
+++ b/src/cmd/trace/trace_unix_test.go
@@ -10,7 +10,7 @@ import (
"bytes"
"cmd/internal/traceviewer"
traceparser "internal/trace"
- "io/ioutil"
+ "io"
"runtime"
"runtime/trace"
"sync"
@@ -83,7 +83,7 @@ func TestGoroutineInSyscall(t *testing.T) {
// Check only one thread for the pipe read goroutine is
// considered in-syscall.
- c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1)
+ c := viewerDataTraceConsumer(io.Discard, 0, 1<<63-1)
c.consumeViewerEvent = func(ev *traceviewer.Event, _ bool) {
if ev.Name == "Threads" {
arg := ev.Arg.(*threadCountersArg)
diff --git a/src/compress/bzip2/bzip2_test.go b/src/compress/bzip2/bzip2_test.go
index c432bb5226..98477791b3 100644
--- a/src/compress/bzip2/bzip2_test.go
+++ b/src/compress/bzip2/bzip2_test.go
@@ -133,7 +133,7 @@ func TestReader(t *testing.T) {
for i, v := range vectors {
rd := NewReader(bytes.NewReader(v.input))
- buf, err := ioutil.ReadAll(rd)
+ buf, err := io.ReadAll(rd)
if fail := bool(err != nil); fail != v.fail {
if fail {
@@ -220,7 +220,7 @@ var (
func benchmarkDecode(b *testing.B, compressed []byte) {
// Determine the uncompressed size of testfile.
- uncompressedSize, err := io.Copy(ioutil.Discard, NewReader(bytes.NewReader(compressed)))
+ uncompressedSize, err := io.Copy(io.Discard, NewReader(bytes.NewReader(compressed)))
if err != nil {
b.Fatal(err)
}
@@ -231,7 +231,7 @@ func benchmarkDecode(b *testing.B, compressed []byte) {
for i := 0; i < b.N; i++ {
r := bytes.NewReader(compressed)
- io.Copy(ioutil.Discard, NewReader(r))
+ io.Copy(io.Discard, NewReader(r))
}
}
diff --git a/src/compress/flate/deflate_test.go b/src/compress/flate/deflate_test.go
index b19cbec5a9..6fc5abf4d5 100644
--- a/src/compress/flate/deflate_test.go
+++ b/src/compress/flate/deflate_test.go
@@ -157,7 +157,7 @@ func TestVeryLongSparseChunk(t *testing.T) {
if testing.Short() {
t.Skip("skipping sparse chunk during short test")
}
- w, err := NewWriter(ioutil.Discard, 1)
+ w, err := NewWriter(io.Discard, 1)
if err != nil {
t.Errorf("NewWriter: %v", err)
return
@@ -294,7 +294,7 @@ func testSync(t *testing.T, level int, input []byte, name string) {
// stream should work for ordinary reader too
r = NewReader(buf1)
- out, err = ioutil.ReadAll(r)
+ out, err = io.ReadAll(r)
if err != nil {
t.Errorf("testSync: read: %s", err)
return
@@ -322,7 +322,7 @@ func testToFromWithLevelAndLimit(t *testing.T, level int, input []byte, name str
t.Logf("level: %d, size:%.2f%%, %d b\n", level, float64(buffer.Len()*100)/float64(limit), buffer.Len())
}
r := NewReader(&buffer)
- out, err := ioutil.ReadAll(r)
+ out, err := io.ReadAll(r)
if err != nil {
t.Errorf("read: %s", err)
return
@@ -415,7 +415,7 @@ func TestReaderDict(t *testing.T) {
w.Close()
r := NewReaderDict(&b, []byte(dict))
- data, err := ioutil.ReadAll(r)
+ data, err := io.ReadAll(r)
if err != nil {
t.Fatal(err)
}
@@ -456,7 +456,7 @@ func TestRegression2508(t *testing.T) {
t.Logf("test disabled with -short")
return
}
- w, err := NewWriter(ioutil.Discard, 1)
+ w, err := NewWriter(io.Discard, 1)
if err != nil {
t.Fatalf("NewWriter: %v", err)
}
@@ -475,7 +475,7 @@ func TestWriterReset(t *testing.T) {
if testing.Short() && level > 1 {
break
}
- w, err := NewWriter(ioutil.Discard, level)
+ w, err := NewWriter(io.Discard, level)
if err != nil {
t.Fatalf("NewWriter: %v", err)
}
@@ -487,9 +487,9 @@ func TestWriterReset(t *testing.T) {
for i := 0; i < n; i++ {
w.Write(buf)
}
- w.Reset(ioutil.Discard)
+ w.Reset(io.Discard)
- wref, err := NewWriter(ioutil.Discard, level)
+ wref, err := NewWriter(io.Discard, level)
if err != nil {
t.Fatalf("NewWriter: %v", err)
}
@@ -654,7 +654,7 @@ func TestBestSpeed(t *testing.T) {
}
r := NewReader(buf)
- got, err := ioutil.ReadAll(r)
+ got, err := io.ReadAll(r)
if err != nil {
t.Errorf("i=%d, firstN=%d, flush=%t: ReadAll: %v", i, firstN, flush, err)
continue
@@ -881,7 +881,7 @@ func TestBestSpeedMaxMatchOffset(t *testing.T) {
}
r := NewReader(buf)
- dst, err := ioutil.ReadAll(r)
+ dst, err := io.ReadAll(r)
r.Close()
if err != nil {
report("ReadAll: ", err)
@@ -968,7 +968,7 @@ func TestMaxStackSize(t *testing.T) {
wg.Add(1)
go func(level int) {
defer wg.Done()
- zw, err := NewWriter(ioutil.Discard, level)
+ zw, err := NewWriter(io.Discard, level)
if err != nil {
t.Errorf("level %d, NewWriter() = %v, want nil", level, err)
}
@@ -978,7 +978,7 @@ func TestMaxStackSize(t *testing.T) {
if err := zw.Close(); err != nil {
t.Errorf("level %d, Close() = %v, want nil", level, err)
}
- zw.Reset(ioutil.Discard)
+ zw.Reset(io.Discard)
}(level)
}
}
diff --git a/src/compress/flate/flate_test.go b/src/compress/flate/flate_test.go
index 1e45077bd5..23f4c47b03 100644
--- a/src/compress/flate/flate_test.go
+++ b/src/compress/flate/flate_test.go
@@ -12,7 +12,6 @@ import (
"bytes"
"encoding/hex"
"io"
- "io/ioutil"
"strings"
"testing"
)
@@ -243,7 +242,7 @@ func TestStreams(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- data, err = ioutil.ReadAll(NewReader(bytes.NewReader(data)))
+ data, err = io.ReadAll(NewReader(bytes.NewReader(data)))
if tc.want == "fail" {
if err == nil {
t.Errorf("#%d (%s): got nil error, want non-nil", i, tc.desc)
@@ -266,7 +265,7 @@ func TestTruncatedStreams(t *testing.T) {
for i := 0; i < len(data)-1; i++ {
r := NewReader(strings.NewReader(data[:i]))
- _, err := io.Copy(ioutil.Discard, r)
+ _, err := io.Copy(io.Discard, r)
if err != io.ErrUnexpectedEOF {
t.Errorf("io.Copy(%d) on truncated stream: got %v, want %v", i, err, io.ErrUnexpectedEOF)
}
diff --git a/src/compress/flate/inflate_test.go b/src/compress/flate/inflate_test.go
index 951decd775..9575be1cf2 100644
--- a/src/compress/flate/inflate_test.go
+++ b/src/compress/flate/inflate_test.go
@@ -7,7 +7,6 @@ package flate
import (
"bytes"
"io"
- "io/ioutil"
"strings"
"testing"
)
@@ -57,7 +56,7 @@ func TestReaderTruncated(t *testing.T) {
for i, v := range vectors {
r := strings.NewReader(v.input)
zr := NewReader(r)
- b, err := ioutil.ReadAll(zr)
+ b, err := io.ReadAll(zr)
if err != io.ErrUnexpectedEOF {
t.Errorf("test %d, error mismatch: got %v, want io.ErrUnexpectedEOF", i, err)
}
diff --git a/src/compress/flate/reader_test.go b/src/compress/flate/reader_test.go
index 9d2943a540..eb32c89184 100644
--- a/src/compress/flate/reader_test.go
+++ b/src/compress/flate/reader_test.go
@@ -16,7 +16,7 @@ import (
func TestNlitOutOfRange(t *testing.T) {
// Trying to decode this bogus flate data, which has a Huffman table
// with nlit=288, should not panic.
- io.Copy(ioutil.Discard, NewReader(strings.NewReader(
+ io.Copy(io.Discard, NewReader(strings.NewReader(
"\xfc\xfe\x36\xe7\x5e\x1c\xef\xb3\x55\x58\x77\xb6\x56\xb5\x43\xf4"+
"\x6f\xf2\xd2\xe6\x3d\x99\xa0\x85\x8c\x48\xeb\xf8\xda\x83\x04\x2a"+
"\x75\xc4\xf8\x0f\x12\x11\xb9\xb4\x4b\x09\xa0\xbe\x8b\x91\x4c")))
@@ -54,7 +54,7 @@ func BenchmarkDecode(b *testing.B) {
runtime.GC()
b.StartTimer()
for i := 0; i < b.N; i++ {
- io.Copy(ioutil.Discard, NewReader(bytes.NewReader(buf1)))
+ io.Copy(io.Discard, NewReader(bytes.NewReader(buf1)))
}
})
}
diff --git a/src/compress/flate/writer_test.go b/src/compress/flate/writer_test.go
index 881cb71cc3..c413735cd2 100644
--- a/src/compress/flate/writer_test.go
+++ b/src/compress/flate/writer_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"math/rand"
"runtime"
"testing"
@@ -27,14 +26,14 @@ func BenchmarkEncode(b *testing.B) {
copy(buf1[i:], buf0)
}
buf0 = nil
- w, err := NewWriter(ioutil.Discard, level)
+ w, err := NewWriter(io.Discard, level)
if err != nil {
b.Fatal(err)
}
runtime.GC()
b.StartTimer()
for i := 0; i < b.N; i++ {
- w.Reset(ioutil.Discard)
+ w.Reset(io.Discard)
w.Write(buf1)
w.Close()
}
@@ -96,7 +95,7 @@ func TestWriteError(t *testing.T) {
t.Fatal("Level", l, "Expected an error on close")
}
- w.Reset(ioutil.Discard)
+ w.Reset(io.Discard)
n2, err = w.Write([]byte{1, 2, 3, 4, 5, 6})
if err != nil {
t.Fatal("Level", l, "Got unexpected error after reset:", err)
@@ -206,7 +205,7 @@ func TestDeflateFast_Reset(t *testing.T) {
w.Close()
for ; offset <= 256; offset *= 2 {
- w, err := NewWriter(ioutil.Discard, level)
+ w, err := NewWriter(io.Discard, level)
if err != nil {
t.Fatalf("NewWriter: level %d: %v", level, err)
}
diff --git a/src/compress/gzip/gunzip_test.go b/src/compress/gzip/gunzip_test.go
index 1b01404169..17c23e8a9b 100644
--- a/src/compress/gzip/gunzip_test.go
+++ b/src/compress/gzip/gunzip_test.go
@@ -9,7 +9,6 @@ import (
"compress/flate"
"encoding/base64"
"io"
- "io/ioutil"
"os"
"strings"
"testing"
@@ -430,7 +429,7 @@ func TestIssue6550(t *testing.T) {
defer gzip.Close()
done := make(chan bool, 1)
go func() {
- _, err := io.Copy(ioutil.Discard, gzip)
+ _, err := io.Copy(io.Discard, gzip)
if err == nil {
t.Errorf("Copy succeeded")
} else {
@@ -467,7 +466,7 @@ Found:
const hello = "hello world\n"
r.Multistream(false)
- data, err := ioutil.ReadAll(&r)
+ data, err := io.ReadAll(&r)
if string(data) != hello || err != nil {
t.Fatalf("first stream = %q, %v, want %q, %v", string(data), err, hello, nil)
}
@@ -476,7 +475,7 @@ Found:
t.Fatalf("second reset: %v", err)
}
r.Multistream(false)
- data, err = ioutil.ReadAll(&r)
+ data, err = io.ReadAll(&r)
if string(data) != hello || err != nil {
t.Fatalf("second stream = %q, %v, want %q, %v", string(data), err, hello, nil)
}
@@ -507,7 +506,7 @@ func TestTruncatedStreams(t *testing.T) {
}
continue
}
- _, err = io.Copy(ioutil.Discard, r)
+ _, err = io.Copy(io.Discard, r)
if ferr, ok := err.(*flate.ReadError); ok {
err = ferr.Err
}
diff --git a/src/compress/gzip/gzip_test.go b/src/compress/gzip/gzip_test.go
index f18c5cb454..12c8e18207 100644
--- a/src/compress/gzip/gzip_test.go
+++ b/src/compress/gzip/gzip_test.go
@@ -8,7 +8,6 @@ import (
"bufio"
"bytes"
"io"
- "io/ioutil"
"reflect"
"testing"
"time"
@@ -29,7 +28,7 @@ func TestEmpty(t *testing.T) {
if want := (Header{OS: 255}); !reflect.DeepEqual(r.Header, want) {
t.Errorf("Header mismatch:\ngot %#v\nwant %#v", r.Header, want)
}
- b, err := ioutil.ReadAll(r)
+ b, err := io.ReadAll(r)
if err != nil {
t.Fatalf("ReadAll: %v", err)
}
@@ -62,7 +61,7 @@ func TestRoundTrip(t *testing.T) {
if err != nil {
t.Fatalf("NewReader: %v", err)
}
- b, err := ioutil.ReadAll(r)
+ b, err := io.ReadAll(r)
if err != nil {
t.Fatalf("ReadAll: %v", err)
}
@@ -147,7 +146,7 @@ func TestLatin1RoundTrip(t *testing.T) {
t.Errorf("NewReader: %v", err)
continue
}
- _, err = ioutil.ReadAll(r)
+ _, err = io.ReadAll(r)
if err != nil {
t.Errorf("ReadAll: %v", err)
continue
@@ -217,7 +216,7 @@ func TestConcat(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- data, err := ioutil.ReadAll(r)
+ data, err := io.ReadAll(r)
if string(data) != "hello world\n" || err != nil {
t.Fatalf("ReadAll = %q, %v, want %q, nil", data, err, "hello world")
}
diff --git a/src/compress/lzw/reader_test.go b/src/compress/lzw/reader_test.go
index 98bbfbb763..6d91dd806f 100644
--- a/src/compress/lzw/reader_test.go
+++ b/src/compress/lzw/reader_test.go
@@ -206,7 +206,7 @@ func TestNoLongerSavingPriorExpansions(t *testing.T) {
in = append(in, 0x80, 0xff, 0x0f, 0x08)
r := NewReader(bytes.NewReader(in), LSB, 8)
- nDecoded, err := io.Copy(ioutil.Discard, r)
+ nDecoded, err := io.Copy(io.Discard, r)
if err != nil {
t.Fatalf("Copy: %v", err)
}
@@ -246,7 +246,7 @@ func BenchmarkDecoder(b *testing.B) {
runtime.GC()
b.StartTimer()
for i := 0; i < b.N; i++ {
- io.Copy(ioutil.Discard, NewReader(bytes.NewReader(buf1), LSB, 8))
+ io.Copy(io.Discard, NewReader(bytes.NewReader(buf1), LSB, 8))
}
})
}
diff --git a/src/compress/lzw/writer_test.go b/src/compress/lzw/writer_test.go
index 4979f8b352..33a28bdd3a 100644
--- a/src/compress/lzw/writer_test.go
+++ b/src/compress/lzw/writer_test.go
@@ -67,8 +67,8 @@ func testFile(t *testing.T, fn string, order Order, litWidth int) {
defer lzwr.Close()
// Compare the two.
- b0, err0 := ioutil.ReadAll(golden)
- b1, err1 := ioutil.ReadAll(lzwr)
+ b0, err0 := io.ReadAll(golden)
+ b1, err1 := io.ReadAll(lzwr)
if err0 != nil {
t.Errorf("%s (order=%d litWidth=%d): %v", fn, order, litWidth, err0)
return
@@ -107,7 +107,7 @@ func TestWriter(t *testing.T) {
}
func TestWriterReturnValues(t *testing.T) {
- w := NewWriter(ioutil.Discard, LSB, 8)
+ w := NewWriter(io.Discard, LSB, 8)
n, err := w.Write([]byte("asdf"))
if n != 4 || err != nil {
t.Errorf("got %d, %v, want 4, nil", n, err)
@@ -115,7 +115,7 @@ func TestWriterReturnValues(t *testing.T) {
}
func TestSmallLitWidth(t *testing.T) {
- w := NewWriter(ioutil.Discard, LSB, 2)
+ w := NewWriter(io.Discard, LSB, 2)
if _, err := w.Write([]byte{0x03}); err != nil {
t.Fatalf("write a byte < 1<<2: %v", err)
}
@@ -148,7 +148,7 @@ func BenchmarkEncoder(b *testing.B) {
b.Run(fmt.Sprint("1e", e), func(b *testing.B) {
b.SetBytes(int64(n))
for i := 0; i < b.N; i++ {
- w := NewWriter(ioutil.Discard, LSB, 8)
+ w := NewWriter(io.Discard, LSB, 8)
w.Write(buf1)
w.Close()
}
diff --git a/src/compress/zlib/writer_test.go b/src/compress/zlib/writer_test.go
index d501974078..c518729146 100644
--- a/src/compress/zlib/writer_test.go
+++ b/src/compress/zlib/writer_test.go
@@ -34,7 +34,7 @@ func testFileLevelDict(t *testing.T, fn string, level int, d string) {
return
}
defer golden.Close()
- b0, err0 := ioutil.ReadAll(golden)
+ b0, err0 := io.ReadAll(golden)
if err0 != nil {
t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err0)
return
@@ -74,7 +74,7 @@ func testLevelDict(t *testing.T, fn string, b0 []byte, level int, d string) {
defer zlibr.Close()
// Compare the decompressed data.
- b1, err1 := ioutil.ReadAll(zlibr)
+ b1, err1 := io.ReadAll(zlibr)
if err1 != nil {
t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err1)
return
diff --git a/src/crypto/tls/handshake_test.go b/src/crypto/tls/handshake_test.go
index f55cd16ca8..224edcd5c7 100644
--- a/src/crypto/tls/handshake_test.go
+++ b/src/crypto/tls/handshake_test.go
@@ -403,7 +403,7 @@ func testHandshake(t *testing.T, clientConfig, serverConfig *Config) (serverStat
}
defer cli.Close()
clientState = cli.ConnectionState()
- buf, err := ioutil.ReadAll(cli)
+ buf, err := io.ReadAll(cli)
if err != nil {
t.Errorf("failed to call cli.Read: %v", err)
}
diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go
index 4ab8a430ba..9995538871 100644
--- a/src/crypto/tls/tls_test.go
+++ b/src/crypto/tls/tls_test.go
@@ -14,7 +14,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"math"
"net"
"os"
@@ -594,7 +593,7 @@ func TestConnCloseWrite(t *testing.T) {
}
defer srv.Close()
- data, err := ioutil.ReadAll(srv)
+ data, err := io.ReadAll(srv)
if err != nil {
return err
}
@@ -635,7 +634,7 @@ func TestConnCloseWrite(t *testing.T) {
return fmt.Errorf("CloseWrite error = %v; want errShutdown", err)
}
- data, err := ioutil.ReadAll(conn)
+ data, err := io.ReadAll(conn)
if err != nil {
return err
}
@@ -698,7 +697,7 @@ func TestWarningAlertFlood(t *testing.T) {
}
defer srv.Close()
- _, err = ioutil.ReadAll(srv)
+ _, err = io.ReadAll(srv)
if err == nil {
return errors.New("unexpected lack of error from server")
}
diff --git a/src/crypto/x509/root_ios_gen.go b/src/crypto/x509/root_ios_gen.go
index 34dd5d5b22..0641c073ea 100644
--- a/src/crypto/x509/root_ios_gen.go
+++ b/src/crypto/x509/root_ios_gen.go
@@ -81,7 +81,7 @@ func main() {
continue
}
- der, err := ioutil.ReadAll(tr)
+ der, err := io.ReadAll(tr)
if err != nil {
log.Fatal(err)
}
diff --git a/src/debug/gosym/pclntab_test.go b/src/debug/gosym/pclntab_test.go
index 33772c7813..f93a5bf5e5 100644
--- a/src/debug/gosym/pclntab_test.go
+++ b/src/debug/gosym/pclntab_test.go
@@ -9,6 +9,7 @@ import (
"compress/gzip"
"debug/elf"
"internal/testenv"
+ "io"
"io/ioutil"
"os"
"os/exec"
@@ -287,7 +288,7 @@ func Test115PclnParsing(t *testing.T) {
t.Fatal(err)
}
var dat []byte
- dat, err = ioutil.ReadAll(gzReader)
+ dat, err = io.ReadAll(gzReader)
if err != nil {
t.Fatal(err)
}
diff --git a/src/encoding/ascii85/ascii85_test.go b/src/encoding/ascii85/ascii85_test.go
index 1a3a87a596..c637103942 100644
--- a/src/encoding/ascii85/ascii85_test.go
+++ b/src/encoding/ascii85/ascii85_test.go
@@ -7,7 +7,6 @@ package ascii85
import (
"bytes"
"io"
- "io/ioutil"
"strings"
"testing"
)
@@ -118,7 +117,7 @@ func TestDecode(t *testing.T) {
func TestDecoder(t *testing.T) {
for _, p := range pairs {
decoder := NewDecoder(strings.NewReader(p.encoded))
- dbuf, err := ioutil.ReadAll(decoder)
+ dbuf, err := io.ReadAll(decoder)
if err != nil {
t.Fatal("Read failed", err)
}
@@ -187,7 +186,7 @@ func TestBig(t *testing.T) {
if err != nil {
t.Fatalf("Encoder.Close() = %v want nil", err)
}
- decoded, err := ioutil.ReadAll(NewDecoder(encoded))
+ decoded, err := io.ReadAll(NewDecoder(encoded))
if err != nil {
t.Fatalf("io.ReadAll(NewDecoder(...)): %v", err)
}
@@ -205,7 +204,7 @@ func TestBig(t *testing.T) {
func TestDecoderInternalWhitespace(t *testing.T) {
s := strings.Repeat(" ", 2048) + "z"
- decoded, err := ioutil.ReadAll(NewDecoder(strings.NewReader(s)))
+ decoded, err := io.ReadAll(NewDecoder(strings.NewReader(s)))
if err != nil {
t.Errorf("Decode gave error %v", err)
}
diff --git a/src/encoding/base32/base32_test.go b/src/encoding/base32/base32_test.go
index 0b611db0b2..8fb22b9078 100644
--- a/src/encoding/base32/base32_test.go
+++ b/src/encoding/base32/base32_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"errors"
"io"
- "io/ioutil"
"strings"
"testing"
)
@@ -361,9 +360,9 @@ func TestBig(t *testing.T) {
if err != nil {
t.Fatalf("Encoder.Close() = %v want nil", err)
}
- decoded, err := ioutil.ReadAll(NewDecoder(StdEncoding, encoded))
+ decoded, err := io.ReadAll(NewDecoder(StdEncoding, encoded))
if err != nil {
- t.Fatalf("ioutil.ReadAll(NewDecoder(...)): %v", err)
+ t.Fatalf("io.ReadAll(NewDecoder(...)): %v", err)
}
if !bytes.Equal(raw, decoded) {
@@ -428,14 +427,14 @@ LNEBUWIIDFON2CA3DBMJXXE5LNFY==
encodedShort := strings.ReplaceAll(encoded, "\n", "")
dec := NewDecoder(StdEncoding, strings.NewReader(encoded))
- res1, err := ioutil.ReadAll(dec)
+ res1, err := io.ReadAll(dec)
if err != nil {
t.Errorf("ReadAll failed: %v", err)
}
dec = NewDecoder(StdEncoding, strings.NewReader(encodedShort))
var res2 []byte
- res2, err = ioutil.ReadAll(dec)
+ res2, err = io.ReadAll(dec)
if err != nil {
t.Errorf("ReadAll failed: %v", err)
}
@@ -619,7 +618,7 @@ func TestBufferedDecodingSameError(t *testing.T) {
}()
decoder := NewDecoder(StdEncoding, pr)
- _, err := ioutil.ReadAll(decoder)
+ _, err := io.ReadAll(decoder)
if err != testcase.expected {
t.Errorf("Expected %v, got %v; case %s %+v", testcase.expected, err, testcase.prefix, chunks)
@@ -718,7 +717,7 @@ func TestDecodeReadAll(t *testing.T) {
encoded = strings.ReplaceAll(encoded, "=", "")
}
- decReader, err := ioutil.ReadAll(NewDecoder(encoding, strings.NewReader(encoded)))
+ decReader, err := io.ReadAll(NewDecoder(encoding, strings.NewReader(encoded)))
if err != nil {
t.Errorf("NewDecoder error: %v", err)
}
diff --git a/src/encoding/base64/base64_test.go b/src/encoding/base64/base64_test.go
index c2c9478a43..51047402bd 100644
--- a/src/encoding/base64/base64_test.go
+++ b/src/encoding/base64/base64_test.go
@@ -9,7 +9,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"reflect"
"runtime/debug"
"strings"
@@ -324,9 +323,9 @@ func TestBig(t *testing.T) {
if err != nil {
t.Fatalf("Encoder.Close() = %v want nil", err)
}
- decoded, err := ioutil.ReadAll(NewDecoder(StdEncoding, encoded))
+ decoded, err := io.ReadAll(NewDecoder(StdEncoding, encoded))
if err != nil {
- t.Fatalf("ioutil.ReadAll(NewDecoder(...)): %v", err)
+ t.Fatalf("io.ReadAll(NewDecoder(...)): %v", err)
}
if !bytes.Equal(raw, decoded) {
@@ -403,7 +402,7 @@ func TestDecoderIssue3577(t *testing.T) {
})
errc := make(chan error, 1)
go func() {
- _, err := ioutil.ReadAll(d)
+ _, err := io.ReadAll(d)
errc <- err
}()
select {
@@ -436,14 +435,14 @@ bqbPb06551Y4
encodedShort := strings.ReplaceAll(encoded, "\n", "")
dec := NewDecoder(StdEncoding, strings.NewReader(encoded))
- res1, err := ioutil.ReadAll(dec)
+ res1, err := io.ReadAll(dec)
if err != nil {
t.Errorf("ReadAll failed: %v", err)
}
dec = NewDecoder(StdEncoding, strings.NewReader(encodedShort))
var res2 []byte
- res2, err = ioutil.ReadAll(dec)
+ res2, err = io.ReadAll(dec)
if err != nil {
t.Errorf("ReadAll failed: %v", err)
}
@@ -517,14 +516,14 @@ func TestDecoderRaw(t *testing.T) {
// Through reader. Used to fail.
r := NewDecoder(RawURLEncoding, bytes.NewReader([]byte(source)))
- dec2, err := ioutil.ReadAll(io.LimitReader(r, 100))
+ dec2, err := io.ReadAll(io.LimitReader(r, 100))
if err != nil || !bytes.Equal(dec2, want) {
t.Errorf("reading NewDecoder(RawURLEncoding, %q) = %x, %v, want %x, nil", source, dec2, err, want)
}
// Should work with padding.
r = NewDecoder(URLEncoding, bytes.NewReader([]byte(source+"==")))
- dec3, err := ioutil.ReadAll(r)
+ dec3, err := io.ReadAll(r)
if err != nil || !bytes.Equal(dec3, want) {
t.Errorf("reading NewDecoder(URLEncoding, %q) = %x, %v, want %x, nil", source+"==", dec3, err, want)
}
diff --git a/src/encoding/binary/binary_test.go b/src/encoding/binary/binary_test.go
index 5971e0966a..83af89e8a7 100644
--- a/src/encoding/binary/binary_test.go
+++ b/src/encoding/binary/binary_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"math"
"reflect"
"strings"
@@ -524,7 +523,7 @@ func BenchmarkWriteStruct(b *testing.B) {
b.SetBytes(int64(Size(&s)))
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Write(ioutil.Discard, BigEndian, &s)
+ Write(io.Discard, BigEndian, &s)
}
}
diff --git a/src/encoding/gob/encoder_test.go b/src/encoding/gob/encoder_test.go
index 825f0d6f03..fe2774948a 100644
--- a/src/encoding/gob/encoder_test.go
+++ b/src/encoding/gob/encoder_test.go
@@ -8,7 +8,7 @@ import (
"bytes"
"encoding/hex"
"fmt"
- "io/ioutil"
+ "io"
"reflect"
"strings"
"testing"
@@ -938,7 +938,7 @@ func encodeAndRecover(value interface{}) (encodeErr, panicErr error) {
}
}()
- encodeErr = NewEncoder(ioutil.Discard).Encode(value)
+ encodeErr = NewEncoder(io.Discard).Encode(value)
return
}
diff --git a/src/encoding/hex/hex_test.go b/src/encoding/hex/hex_test.go
index 31e3f68936..7593e20db5 100644
--- a/src/encoding/hex/hex_test.go
+++ b/src/encoding/hex/hex_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"strings"
"testing"
)
@@ -150,7 +149,7 @@ func TestEncoderDecoder(t *testing.T) {
func TestDecoderErr(t *testing.T) {
for _, tt := range errTests {
dec := NewDecoder(strings.NewReader(tt.in))
- out, err := ioutil.ReadAll(dec)
+ out, err := io.ReadAll(dec)
wantErr := tt.err
// Decoder is reading from stream, so it reports io.ErrUnexpectedEOF instead of ErrLength.
if wantErr == ErrLength {
diff --git a/src/encoding/json/bench_test.go b/src/encoding/json/bench_test.go
index 4a5fe7ec84..73c7b09fb6 100644
--- a/src/encoding/json/bench_test.go
+++ b/src/encoding/json/bench_test.go
@@ -15,7 +15,7 @@ import (
"compress/gzip"
"fmt"
"internal/testenv"
- "io/ioutil"
+ "io"
"os"
"reflect"
"runtime"
@@ -52,7 +52,7 @@ func codeInit() {
if err != nil {
panic(err)
}
- data, err := ioutil.ReadAll(gz)
+ data, err := io.ReadAll(gz)
if err != nil {
panic(err)
}
@@ -89,7 +89,7 @@ func BenchmarkCodeEncoder(b *testing.B) {
b.StartTimer()
}
b.RunParallel(func(pb *testing.PB) {
- enc := NewEncoder(ioutil.Discard)
+ enc := NewEncoder(io.Discard)
for pb.Next() {
if err := enc.Encode(&codeStruct); err != nil {
b.Fatal("Encode:", err)
@@ -399,7 +399,7 @@ func BenchmarkEncodeMarshaler(b *testing.B) {
}{}
b.RunParallel(func(pb *testing.PB) {
- enc := NewEncoder(ioutil.Discard)
+ enc := NewEncoder(io.Discard)
for pb.Next() {
if err := enc.Encode(&m); err != nil {
diff --git a/src/encoding/json/stream_test.go b/src/encoding/json/stream_test.go
index c9e5334337..c284f2d965 100644
--- a/src/encoding/json/stream_test.go
+++ b/src/encoding/json/stream_test.go
@@ -7,7 +7,6 @@ package json
import (
"bytes"
"io"
- "io/ioutil"
"log"
"net"
"net/http"
@@ -215,7 +214,7 @@ func TestDecoderBuffered(t *testing.T) {
if m.Name != "Gopher" {
t.Errorf("Name = %q; want Gopher", m.Name)
}
- rest, err := ioutil.ReadAll(d.Buffered())
+ rest, err := io.ReadAll(d.Buffered())
if err != nil {
t.Fatal(err)
}
@@ -318,7 +317,7 @@ func BenchmarkEncoderEncode(b *testing.B) {
v := &T{"foo", "bar"}
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
- if err := NewEncoder(ioutil.Discard).Encode(v); err != nil {
+ if err := NewEncoder(io.Discard).Encode(v); err != nil {
b.Fatal(err)
}
}
diff --git a/src/encoding/pem/pem_test.go b/src/encoding/pem/pem_test.go
index 8515b46498..b2b6b15e73 100644
--- a/src/encoding/pem/pem_test.go
+++ b/src/encoding/pem/pem_test.go
@@ -6,7 +6,7 @@ package pem
import (
"bytes"
- "io/ioutil"
+ "io"
"reflect"
"strings"
"testing"
@@ -271,7 +271,7 @@ func BenchmarkEncode(b *testing.B) {
data := &Block{Bytes: make([]byte, 65536)}
b.SetBytes(int64(len(data.Bytes)))
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, data)
+ Encode(io.Discard, data)
}
}
diff --git a/src/flag/flag_test.go b/src/flag/flag_test.go
index 2793064511..06cab79405 100644
--- a/src/flag/flag_test.go
+++ b/src/flag/flag_test.go
@@ -10,7 +10,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"os/exec"
"runtime"
@@ -545,7 +544,7 @@ func TestGetters(t *testing.T) {
func TestParseError(t *testing.T) {
for _, typ := range []string{"bool", "int", "int64", "uint", "uint64", "float64", "duration"} {
fs := NewFlagSet("parse error test", ContinueOnError)
- fs.SetOutput(ioutil.Discard)
+ fs.SetOutput(io.Discard)
_ = fs.Bool("bool", false, "")
_ = fs.Int("int", 0, "")
_ = fs.Int64("int64", 0, "")
@@ -576,7 +575,7 @@ func TestRangeError(t *testing.T) {
}
for _, arg := range bad {
fs := NewFlagSet("parse error test", ContinueOnError)
- fs.SetOutput(ioutil.Discard)
+ fs.SetOutput(io.Discard)
_ = fs.Int("int", 0, "")
_ = fs.Int64("int64", 0, "")
_ = fs.Uint("uint", 0, "")
diff --git a/src/go/internal/gccgoimporter/importer.go b/src/go/internal/gccgoimporter/importer.go
index 2494fd7b2a..94f2defd8d 100644
--- a/src/go/internal/gccgoimporter/importer.go
+++ b/src/go/internal/gccgoimporter/importer.go
@@ -221,7 +221,7 @@ func GetImporter(searchpaths []string, initmap map[*types.Package]InitData) Impo
// Excluded for now: Standard gccgo doesn't support this import format currently.
// case goimporterMagic:
// var data []byte
- // data, err = ioutil.ReadAll(reader)
+ // data, err = io.ReadAll(reader)
// if err != nil {
// return
// }
diff --git a/src/go/internal/gcimporter/gcimporter.go b/src/go/internal/gcimporter/gcimporter.go
index fda15eaaae..b74daca246 100644
--- a/src/go/internal/gcimporter/gcimporter.go
+++ b/src/go/internal/gcimporter/gcimporter.go
@@ -12,7 +12,6 @@ import (
"go/token"
"go/types"
"io"
- "io/ioutil"
"os"
"path/filepath"
"strings"
@@ -147,7 +146,7 @@ func Import(fset *token.FileSet, packages map[string]*types.Package, path, srcDi
case "$$B\n":
var data []byte
- data, err = ioutil.ReadAll(buf)
+ data, err = io.ReadAll(buf)
if err != nil {
break
}
diff --git a/src/go/parser/interface.go b/src/go/parser/interface.go
index b2d834fdec..cc7e455c4d 100644
--- a/src/go/parser/interface.go
+++ b/src/go/parser/interface.go
@@ -35,7 +35,7 @@ func readSource(filename string, src interface{}) ([]byte, error) {
return s.Bytes(), nil
}
case io.Reader:
- return ioutil.ReadAll(s)
+ return io.ReadAll(s)
}
return nil, errors.New("invalid source")
}
diff --git a/src/go/printer/performance_test.go b/src/go/printer/performance_test.go
index 2e67154e6b..e23de3fbae 100644
--- a/src/go/printer/performance_test.go
+++ b/src/go/printer/performance_test.go
@@ -53,6 +53,6 @@ func BenchmarkPrint(b *testing.B) {
initialize()
}
for i := 0; i < b.N; i++ {
- testprint(ioutil.Discard, testfile)
+ testprint(io.Discard, testfile)
}
}
diff --git a/src/go/types/gotype.go b/src/go/types/gotype.go
index eacf68f52f..52709df17b 100644
--- a/src/go/types/gotype.go
+++ b/src/go/types/gotype.go
@@ -88,7 +88,7 @@ import (
"go/scanner"
"go/token"
"go/types"
- "io/ioutil"
+ "io"
"os"
"path/filepath"
"sync"
@@ -191,7 +191,7 @@ func parse(filename string, src interface{}) (*ast.File, error) {
}
func parseStdin() (*ast.File, error) {
- src, err := ioutil.ReadAll(os.Stdin)
+ src, err := io.ReadAll(os.Stdin)
if err != nil {
return nil, err
}
diff --git a/src/html/template/clone_test.go b/src/html/template/clone_test.go
index c9c619f0d4..7cb1b9ca06 100644
--- a/src/html/template/clone_test.go
+++ b/src/html/template/clone_test.go
@@ -8,7 +8,7 @@ import (
"bytes"
"errors"
"fmt"
- "io/ioutil"
+ "io"
"strings"
"sync"
"testing"
@@ -171,7 +171,7 @@ func TestCloneThenParse(t *testing.T) {
t.Error("adding a template to a clone added it to the original")
}
// double check that the embedded template isn't available in the original
- err := t0.ExecuteTemplate(ioutil.Discard, "a", nil)
+ err := t0.ExecuteTemplate(io.Discard, "a", nil)
if err == nil {
t.Error("expected 'no such template' error")
}
@@ -185,13 +185,13 @@ func TestFuncMapWorksAfterClone(t *testing.T) {
// get the expected error output (no clone)
uncloned := Must(New("").Funcs(funcs).Parse("{{customFunc}}"))
- wantErr := uncloned.Execute(ioutil.Discard, nil)
+ wantErr := uncloned.Execute(io.Discard, nil)
// toClone must be the same as uncloned. It has to be recreated from scratch,
// since cloning cannot occur after execution.
toClone := Must(New("").Funcs(funcs).Parse("{{customFunc}}"))
cloned := Must(toClone.Clone())
- gotErr := cloned.Execute(ioutil.Discard, nil)
+ gotErr := cloned.Execute(io.Discard, nil)
if wantErr.Error() != gotErr.Error() {
t.Errorf("clone error message mismatch want %q got %q", wantErr, gotErr)
@@ -213,7 +213,7 @@ func TestTemplateCloneExecuteRace(t *testing.T) {
go func() {
defer wg.Done()
for i := 0; i < 100; i++ {
- if err := tmpl.Execute(ioutil.Discard, "data"); err != nil {
+ if err := tmpl.Execute(io.Discard, "data"); err != nil {
panic(err)
}
}
@@ -237,7 +237,7 @@ func TestCloneGrowth(t *testing.T) {
tmpl = Must(tmpl.Clone())
Must(tmpl.Parse(`{{define "B"}}Text{{end}}`))
for i := 0; i < 10; i++ {
- tmpl.Execute(ioutil.Discard, nil)
+ tmpl.Execute(io.Discard, nil)
}
if len(tmpl.DefinedTemplates()) > 200 {
t.Fatalf("too many templates: %v", len(tmpl.DefinedTemplates()))
@@ -257,7 +257,7 @@ func TestCloneRedefinedName(t *testing.T) {
for i := 0; i < 2; i++ {
t2 := Must(t1.Clone())
t2 = Must(t2.New(fmt.Sprintf("%d", i)).Parse(page))
- err := t2.Execute(ioutil.Discard, nil)
+ err := t2.Execute(io.Discard, nil)
if err != nil {
t.Fatal(err)
}
diff --git a/src/html/template/exec_test.go b/src/html/template/exec_test.go
index fc76ee40e5..232945a0bb 100644
--- a/src/html/template/exec_test.go
+++ b/src/html/template/exec_test.go
@@ -11,7 +11,7 @@ import (
"errors"
"flag"
"fmt"
- "io/ioutil"
+ "io"
"reflect"
"strings"
"testing"
@@ -1335,7 +1335,7 @@ func TestExecuteGivesExecError(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- err = tmpl.Execute(ioutil.Discard, 0)
+ err = tmpl.Execute(io.Discard, 0)
if err == nil {
t.Fatal("expected error; got none")
}
@@ -1481,7 +1481,7 @@ func TestEvalFieldErrors(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
tmpl := Must(New("tmpl").Parse(tc.src))
- err := tmpl.Execute(ioutil.Discard, tc.value)
+ err := tmpl.Execute(io.Discard, tc.value)
got := ""
if err != nil {
got = err.Error()
@@ -1498,7 +1498,7 @@ func TestMaxExecDepth(t *testing.T) {
t.Skip("skipping in -short mode")
}
tmpl := Must(New("tmpl").Parse(`{{template "tmpl" .}}`))
- err := tmpl.Execute(ioutil.Discard, nil)
+ err := tmpl.Execute(io.Discard, nil)
got := ""
if err != nil {
got = err.Error()
diff --git a/src/image/gif/writer_test.go b/src/image/gif/writer_test.go
index 1e622b3674..af0105c6be 100644
--- a/src/image/gif/writer_test.go
+++ b/src/image/gif/writer_test.go
@@ -11,7 +11,7 @@ import (
"image/color/palette"
"image/draw"
_ "image/png"
- "io/ioutil"
+ "io"
"math/rand"
"os"
"reflect"
@@ -285,7 +285,7 @@ func TestEncodeMismatchDelay(t *testing.T) {
Image: images,
Delay: make([]int, 1),
}
- if err := EncodeAll(ioutil.Discard, g0); err == nil {
+ if err := EncodeAll(io.Discard, g0); err == nil {
t.Error("expected error from mismatched delay and image slice lengths")
}
@@ -297,13 +297,13 @@ func TestEncodeMismatchDelay(t *testing.T) {
for i := range g1.Disposal {
g1.Disposal[i] = DisposalNone
}
- if err := EncodeAll(ioutil.Discard, g1); err == nil {
+ if err := EncodeAll(io.Discard, g1); err == nil {
t.Error("expected error from mismatched disposal and image slice lengths")
}
}
func TestEncodeZeroGIF(t *testing.T) {
- if err := EncodeAll(ioutil.Discard, &GIF{}); err == nil {
+ if err := EncodeAll(io.Discard, &GIF{}); err == nil {
t.Error("expected error from providing empty gif")
}
}
@@ -324,7 +324,7 @@ func TestEncodeAllFramesOutOfBounds(t *testing.T) {
Height: upperBound,
},
}
- err := EncodeAll(ioutil.Discard, g)
+ err := EncodeAll(io.Discard, g)
if upperBound >= 8 {
if err != nil {
t.Errorf("upperBound=%d: %v", upperBound, err)
@@ -430,7 +430,7 @@ func TestEncodeImplicitConfigSize(t *testing.T) {
Image: images,
Delay: make([]int, len(images)),
}
- err := EncodeAll(ioutil.Discard, g)
+ err := EncodeAll(io.Discard, g)
if lowerBound >= 0 {
if err != nil {
t.Errorf("lowerBound=%d: %v", lowerBound, err)
@@ -509,7 +509,7 @@ func TestEncodeBadPalettes(t *testing.T) {
}
}
- err := EncodeAll(ioutil.Discard, &GIF{
+ err := EncodeAll(io.Discard, &GIF{
Image: []*image.Paletted{
image.NewPaletted(image.Rect(0, 0, w, h), pal),
},
@@ -668,7 +668,7 @@ func BenchmarkEncodeRandomPaletted(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, paletted, nil)
+ Encode(io.Discard, paletted, nil)
}
}
@@ -691,7 +691,7 @@ func BenchmarkEncodeRandomRGBA(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, rgba, nil)
+ Encode(io.Discard, rgba, nil)
}
}
@@ -708,7 +708,7 @@ func BenchmarkEncodeRealisticPaletted(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, paletted, nil)
+ Encode(io.Discard, paletted, nil)
}
}
@@ -729,6 +729,6 @@ func BenchmarkEncodeRealisticRGBA(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, rgba, nil)
+ Encode(io.Discard, rgba, nil)
}
}
diff --git a/src/image/jpeg/writer_test.go b/src/image/jpeg/writer_test.go
index 3aff742632..abd5e32333 100644
--- a/src/image/jpeg/writer_test.go
+++ b/src/image/jpeg/writer_test.go
@@ -10,7 +10,7 @@ import (
"image"
"image/color"
"image/png"
- "io/ioutil"
+ "io"
"math/rand"
"os"
"testing"
@@ -261,7 +261,7 @@ func BenchmarkEncodeRGBA(b *testing.B) {
b.ResetTimer()
options := &Options{Quality: 90}
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, img, options)
+ Encode(io.Discard, img, options)
}
}
@@ -283,6 +283,6 @@ func BenchmarkEncodeYCbCr(b *testing.B) {
b.ResetTimer()
options := &Options{Quality: 90}
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, img, options)
+ Encode(io.Discard, img, options)
}
}
diff --git a/src/image/png/writer_test.go b/src/image/png/writer_test.go
index 5d131ff823..47aa861339 100644
--- a/src/image/png/writer_test.go
+++ b/src/image/png/writer_test.go
@@ -12,7 +12,6 @@ import (
"image"
"image/color"
"io"
- "io/ioutil"
"testing"
)
@@ -169,7 +168,7 @@ func TestWriterPaletted(t *testing.T) {
t.Error(err)
return
}
- n, err := io.Copy(ioutil.Discard, r)
+ n, err := io.Copy(io.Discard, r)
if err != nil {
t.Errorf("got error while reading image data: %v", err)
}
@@ -234,7 +233,7 @@ func BenchmarkEncodeGray(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, img)
+ Encode(io.Discard, img)
}
}
@@ -259,7 +258,7 @@ func BenchmarkEncodeGrayWithBufferPool(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- e.Encode(ioutil.Discard, img)
+ e.Encode(io.Discard, img)
}
}
@@ -279,7 +278,7 @@ func BenchmarkEncodeNRGBOpaque(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, img)
+ Encode(io.Discard, img)
}
}
@@ -292,7 +291,7 @@ func BenchmarkEncodeNRGBA(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, img)
+ Encode(io.Discard, img)
}
}
@@ -305,7 +304,7 @@ func BenchmarkEncodePaletted(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, img)
+ Encode(io.Discard, img)
}
}
@@ -325,7 +324,7 @@ func BenchmarkEncodeRGBOpaque(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, img)
+ Encode(io.Discard, img)
}
}
@@ -338,6 +337,6 @@ func BenchmarkEncodeRGBA(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()
for i := 0; i < b.N; i++ {
- Encode(ioutil.Discard, img)
+ Encode(io.Discard, img)
}
}
diff --git a/src/internal/obscuretestdata/obscuretestdata.go b/src/internal/obscuretestdata/obscuretestdata.go
index 512f3759b4..06cd1df22c 100644
--- a/src/internal/obscuretestdata/obscuretestdata.go
+++ b/src/internal/obscuretestdata/obscuretestdata.go
@@ -47,5 +47,5 @@ func ReadFile(name string) ([]byte, error) {
return nil, err
}
defer f.Close()
- return ioutil.ReadAll(base64.NewDecoder(base64.StdEncoding, f))
+ return io.ReadAll(base64.NewDecoder(base64.StdEncoding, f))
}
diff --git a/src/internal/profile/profile.go b/src/internal/profile/profile.go
index a6275bc6de..29568aa4b5 100644
--- a/src/internal/profile/profile.go
+++ b/src/internal/profile/profile.go
@@ -12,7 +12,6 @@ import (
"compress/gzip"
"fmt"
"io"
- "io/ioutil"
"regexp"
"strings"
"time"
@@ -125,7 +124,7 @@ type Function struct {
// may be a gzip-compressed encoded protobuf or one of many legacy
// profile formats which may be unsupported in the future.
func Parse(r io.Reader) (*Profile, error) {
- orig, err := ioutil.ReadAll(r)
+ orig, err := io.ReadAll(r)
if err != nil {
return nil, err
}
@@ -136,7 +135,7 @@ func Parse(r io.Reader) (*Profile, error) {
if err != nil {
return nil, fmt.Errorf("decompressing profile: %v", err)
}
- data, err := ioutil.ReadAll(gz)
+ data, err := io.ReadAll(gz)
if err != nil {
return nil, fmt.Errorf("decompressing profile: %v", err)
}
diff --git a/src/io/example_test.go b/src/io/example_test.go
index 4706032429..6d338acd14 100644
--- a/src/io/example_test.go
+++ b/src/io/example_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"log"
"os"
"strings"
@@ -141,7 +140,7 @@ func ExampleTeeReader() {
r = io.TeeReader(r, os.Stdout)
// Everything read from r will be copied to stdout.
- ioutil.ReadAll(r)
+ io.ReadAll(r)
// Output:
// some io.Reader stream to be read
@@ -245,7 +244,7 @@ func ExamplePipe() {
func ExampleReadAll() {
r := strings.NewReader("Go is a general-purpose language designed with systems programming in mind.")
- b, err := ioutil.ReadAll(r)
+ b, err := io.ReadAll(r)
if err != nil {
log.Fatal(err)
}
diff --git a/src/io/io.go b/src/io/io.go
index 269ebf6ed0..ffd3cedc25 100644
--- a/src/io/io.go
+++ b/src/io/io.go
@@ -573,7 +573,7 @@ var Discard Writer = discard{}
type discard struct{}
// discard implements ReaderFrom as an optimization so Copy to
-// ioutil.Discard can avoid doing unnecessary work.
+// io.Discard can avoid doing unnecessary work.
var _ ReaderFrom = discard{}
func (discard) Write(p []byte) (int, error) {
diff --git a/src/io/multi_test.go b/src/io/multi_test.go
index f05d5f74ef..909b6d8be2 100644
--- a/src/io/multi_test.go
+++ b/src/io/multi_test.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
. "io"
- "io/ioutil"
"runtime"
"strings"
"testing"
@@ -142,7 +141,7 @@ func testMultiWriter(t *testing.T, sink interface {
}
}
-// writerFunc is an io.Writer implemented by the underlying func.
+// writerFunc is an Writer implemented by the underlying func.
type writerFunc func(p []byte) (int, error)
func (f writerFunc) Write(p []byte) (int, error) {
@@ -196,7 +195,7 @@ func TestMultiReaderCopy(t *testing.T) {
slice := []Reader{strings.NewReader("hello world")}
r := MultiReader(slice...)
slice[0] = nil
- data, err := ioutil.ReadAll(r)
+ data, err := ReadAll(r)
if err != nil || string(data) != "hello world" {
t.Errorf("ReadAll() = %q, %v, want %q, nil", data, err, "hello world")
}
@@ -217,7 +216,7 @@ func TestMultiWriterCopy(t *testing.T) {
}
}
-// readerFunc is an io.Reader implemented by the underlying func.
+// readerFunc is an Reader implemented by the underlying func.
type readerFunc func(p []byte) (int, error)
func (f readerFunc) Read(p []byte) (int, error) {
@@ -261,7 +260,7 @@ func TestMultiReaderFlatten(t *testing.T) {
}
// byteAndEOFReader is a Reader which reads one byte (the underlying
-// byte) and io.EOF at once in its Read call.
+// byte) and EOF at once in its Read call.
type byteAndEOFReader byte
func (b byteAndEOFReader) Read(p []byte) (n int, err error) {
@@ -276,7 +275,7 @@ func (b byteAndEOFReader) Read(p []byte) (n int, err error) {
// This used to yield bytes forever; issue 16795.
func TestMultiReaderSingleByteWithEOF(t *testing.T) {
- got, err := ioutil.ReadAll(LimitReader(MultiReader(byteAndEOFReader('a'), byteAndEOFReader('b')), 10))
+ got, err := ReadAll(LimitReader(MultiReader(byteAndEOFReader('a'), byteAndEOFReader('b')), 10))
if err != nil {
t.Fatal(err)
}
diff --git a/src/mime/encodedword_test.go b/src/mime/encodedword_test.go
index 6c54e502ad..2a98794380 100644
--- a/src/mime/encodedword_test.go
+++ b/src/mime/encodedword_test.go
@@ -7,7 +7,6 @@ package mime
import (
"errors"
"io"
- "io/ioutil"
"strings"
"testing"
)
@@ -182,7 +181,7 @@ func TestCharsetDecoder(t *testing.T) {
if charset != test.charsets[i] {
t.Errorf("DecodeHeader(%q), got charset %q, want %q", test.src, charset, test.charsets[i])
}
- content, err := ioutil.ReadAll(input)
+ content, err := io.ReadAll(input)
if err != nil {
t.Errorf("DecodeHeader(%q), error in reader: %v", test.src, err)
}
diff --git a/src/mime/example_test.go b/src/mime/example_test.go
index 85795976f0..8a96873e5d 100644
--- a/src/mime/example_test.go
+++ b/src/mime/example_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"mime"
)
@@ -38,7 +37,7 @@ func ExampleWordDecoder_Decode() {
// Fake character set for example.
// Real use would integrate with packages such
// as code.google.com/p/go-charset
- content, err := ioutil.ReadAll(input)
+ content, err := io.ReadAll(input)
if err != nil {
return nil, err
}
@@ -77,7 +76,7 @@ func ExampleWordDecoder_DecodeHeader() {
// Fake character set for example.
// Real use would integrate with packages such
// as code.google.com/p/go-charset
- content, err := ioutil.ReadAll(input)
+ content, err := io.ReadAll(input)
if err != nil {
return nil, err
}
diff --git a/src/mime/multipart/example_test.go b/src/mime/multipart/example_test.go
index 6d6ba81d5e..fe154ac4f6 100644
--- a/src/mime/multipart/example_test.go
+++ b/src/mime/multipart/example_test.go
@@ -7,7 +7,6 @@ package multipart_test
import (
"fmt"
"io"
- "io/ioutil"
"log"
"mime"
"mime/multipart"
@@ -39,7 +38,7 @@ func ExampleNewReader() {
if err != nil {
log.Fatal(err)
}
- slurp, err := ioutil.ReadAll(p)
+ slurp, err := io.ReadAll(p)
if err != nil {
log.Fatal(err)
}
diff --git a/src/mime/multipart/multipart.go b/src/mime/multipart/multipart.go
index 1750300fb5..cb8bf39338 100644
--- a/src/mime/multipart/multipart.go
+++ b/src/mime/multipart/multipart.go
@@ -17,7 +17,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"mime"
"mime/quotedprintable"
"net/textproto"
@@ -278,7 +277,7 @@ func matchAfterPrefix(buf, prefix []byte, readErr error) int {
}
func (p *Part) Close() error {
- io.Copy(ioutil.Discard, p)
+ io.Copy(io.Discard, p)
return nil
}
diff --git a/src/mime/multipart/multipart_test.go b/src/mime/multipart/multipart_test.go
index b60c54a204..741d2304ed 100644
--- a/src/mime/multipart/multipart_test.go
+++ b/src/mime/multipart/multipart_test.go
@@ -9,7 +9,6 @@ import (
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"net/textproto"
"os"
"reflect"
@@ -307,7 +306,7 @@ Oh no, premature EOF!
if err != nil {
t.Fatalf("didn't get a part")
}
- _, err = io.Copy(ioutil.Discard, part)
+ _, err = io.Copy(io.Discard, part)
if err != io.ErrUnexpectedEOF {
t.Fatalf("expected error io.ErrUnexpectedEOF; got %v", err)
}
@@ -372,7 +371,7 @@ Body 2
if !reflect.DeepEqual(part.Header, hdr) {
t.Errorf("Part %d: part.Header = %v, want %v", i, part.Header, hdr)
}
- data, err := ioutil.ReadAll(part)
+ data, err := io.ReadAll(part)
expectEq(t, body, string(data), fmt.Sprintf("Part %d body", i))
if err != nil {
t.Fatalf("Part %d: ReadAll failed: %v", i, err)
@@ -530,14 +529,14 @@ func TestNested(t *testing.T) {
if err != nil {
t.Fatalf("reading text/plain part: %v", err)
}
- if b, err := ioutil.ReadAll(p); string(b) != "*body*\r\n" || err != nil {
+ if b, err := io.ReadAll(p); string(b) != "*body*\r\n" || err != nil {
t.Fatalf("reading text/plain part: got %q, %v", b, err)
}
p, err = mr2.NextPart()
if err != nil {
t.Fatalf("reading text/html part: %v", err)
}
- if b, err := ioutil.ReadAll(p); string(b) != "body\r\n" || err != nil {
+ if b, err := io.ReadAll(p); string(b) != "body\r\n" || err != nil {
t.Fatalf("reading text/html part: got %q, %v", b, err)
}
@@ -850,7 +849,7 @@ Cases:
t.Errorf("in test %q, NextPart: %v", tt.name, err)
continue Cases
}
- pbody, err := ioutil.ReadAll(p)
+ pbody, err := io.ReadAll(p)
if err != nil {
t.Errorf("in test %q, error reading part: %v", tt.name, err)
continue Cases
@@ -882,7 +881,7 @@ func partsFromReader(r *Reader) ([]headerBody, error) {
if err != nil {
return nil, fmt.Errorf("NextPart: %v", err)
}
- pbody, err := ioutil.ReadAll(p)
+ pbody, err := io.ReadAll(p)
if err != nil {
return nil, fmt.Errorf("error reading part: %v", err)
}
diff --git a/src/mime/multipart/writer_test.go b/src/mime/multipart/writer_test.go
index b89b093fff..cfc0f09f37 100644
--- a/src/mime/multipart/writer_test.go
+++ b/src/mime/multipart/writer_test.go
@@ -6,7 +6,7 @@ package multipart
import (
"bytes"
- "io/ioutil"
+ "io"
"mime"
"net/textproto"
"strings"
@@ -51,7 +51,7 @@ func TestWriter(t *testing.T) {
if g, e := part.FormName(), "myfile"; g != e {
t.Errorf("part 1: want form name %q, got %q", e, g)
}
- slurp, err := ioutil.ReadAll(part)
+ slurp, err := io.ReadAll(part)
if err != nil {
t.Fatalf("part 1: ReadAll: %v", err)
}
@@ -66,7 +66,7 @@ func TestWriter(t *testing.T) {
if g, e := part.FormName(), "key"; g != e {
t.Errorf("part 2: want form name %q, got %q", e, g)
}
- slurp, err = ioutil.ReadAll(part)
+ slurp, err = io.ReadAll(part)
if err != nil {
t.Fatalf("part 2: ReadAll: %v", err)
}
@@ -134,7 +134,7 @@ func TestWriterBoundaryGoroutines(t *testing.T) {
// different goroutines. This was previously broken by
// https://codereview.appspot.com/95760043/ and reverted in
// https://codereview.appspot.com/117600043/
- w := NewWriter(ioutil.Discard)
+ w := NewWriter(io.Discard)
done := make(chan int)
go func() {
w.CreateFormField("foo")
diff --git a/src/mime/quotedprintable/example_test.go b/src/mime/quotedprintable/example_test.go
index 5a9ab450a3..e5a479a3a7 100644
--- a/src/mime/quotedprintable/example_test.go
+++ b/src/mime/quotedprintable/example_test.go
@@ -6,7 +6,7 @@ package quotedprintable_test
import (
"fmt"
- "io/ioutil"
+ "io"
"mime/quotedprintable"
"os"
"strings"
@@ -18,7 +18,7 @@ func ExampleNewReader() {
`invalid escape: hello`,
"Hello, Gophers! This symbol will be unescaped: =3D and this will be written in =\r\none line.",
} {
- b, err := ioutil.ReadAll(quotedprintable.NewReader(strings.NewReader(s)))
+ b, err := io.ReadAll(quotedprintable.NewReader(strings.NewReader(s)))
fmt.Printf("%s %v\n", b, err)
}
// Output:
diff --git a/src/mime/quotedprintable/writer_test.go b/src/mime/quotedprintable/writer_test.go
index d494c1e3dc..42de0f3d6e 100644
--- a/src/mime/quotedprintable/writer_test.go
+++ b/src/mime/quotedprintable/writer_test.go
@@ -6,7 +6,7 @@ package quotedprintable
import (
"bytes"
- "io/ioutil"
+ "io"
"strings"
"testing"
)
@@ -128,7 +128,7 @@ func TestRoundTrip(t *testing.T) {
}
r := NewReader(buf)
- gotBytes, err := ioutil.ReadAll(r)
+ gotBytes, err := io.ReadAll(r)
if err != nil {
t.Fatalf("Error while reading from Reader: %v", err)
}
@@ -151,7 +151,7 @@ var testMsg = []byte("Quoted-Printable (QP) est un format d'encodage de données
func BenchmarkWriter(b *testing.B) {
for i := 0; i < b.N; i++ {
- w := NewWriter(ioutil.Discard)
+ w := NewWriter(io.Discard)
w.Write(testMsg)
w.Close()
}
diff --git a/src/net/http/alpn_test.go b/src/net/http/alpn_test.go
index 618bdbe54a..a51038c355 100644
--- a/src/net/http/alpn_test.go
+++ b/src/net/http/alpn_test.go
@@ -11,7 +11,6 @@ import (
"crypto/x509"
"fmt"
"io"
- "io/ioutil"
. "net/http"
"net/http/httptest"
"strings"
@@ -49,7 +48,7 @@ func TestNextProtoUpgrade(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -93,7 +92,7 @@ func TestNextProtoUpgrade(t *testing.T) {
t.Fatal(err)
}
conn.Write([]byte("GET /foo\n"))
- body, err := ioutil.ReadAll(conn)
+ body, err := io.ReadAll(conn)
if err != nil {
t.Fatal(err)
}
diff --git a/src/net/http/cgi/child.go b/src/net/http/cgi/child.go
index 690986335c..0114da377b 100644
--- a/src/net/http/cgi/child.go
+++ b/src/net/http/cgi/child.go
@@ -13,7 +13,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"net"
"net/http"
"net/url"
@@ -32,7 +31,7 @@ func Request() (*http.Request, error) {
return nil, err
}
if r.ContentLength > 0 {
- r.Body = ioutil.NopCloser(io.LimitReader(os.Stdin, r.ContentLength))
+ r.Body = io.NopCloser(io.LimitReader(os.Stdin, r.ContentLength))
}
return r, nil
}
diff --git a/src/net/http/client.go b/src/net/http/client.go
index 6ca0d2e6cf..88e2028bc3 100644
--- a/src/net/http/client.go
+++ b/src/net/http/client.go
@@ -16,7 +16,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"log"
"net/url"
"reflect"
@@ -282,7 +281,7 @@ func send(ireq *Request, rt RoundTripper, deadline time.Time) (resp *Response, d
if resp.ContentLength > 0 && req.Method != "HEAD" {
return nil, didTimeout, fmt.Errorf("http: RoundTripper implementation (%T) returned a *Response with content length %d but a nil Body", rt, resp.ContentLength)
}
- resp.Body = ioutil.NopCloser(strings.NewReader(""))
+ resp.Body = io.NopCloser(strings.NewReader(""))
}
if !deadline.IsZero() {
resp.Body = &cancelTimerBody{
@@ -697,7 +696,7 @@ func (c *Client) do(req *Request) (retres *Response, reterr error) {
// fails, the Transport won't reuse it anyway.
const maxBodySlurpSize = 2 << 10
if resp.ContentLength == -1 || resp.ContentLength <= maxBodySlurpSize {
- io.CopyN(ioutil.Discard, resp.Body, maxBodySlurpSize)
+ io.CopyN(io.Discard, resp.Body, maxBodySlurpSize)
}
resp.Body.Close()
diff --git a/src/net/http/client_test.go b/src/net/http/client_test.go
index 4bd62735e8..d90b4841c6 100644
--- a/src/net/http/client_test.go
+++ b/src/net/http/client_test.go
@@ -14,7 +14,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"log"
"net"
. "net/http"
@@ -35,7 +34,7 @@ var robotsTxtHandler = HandlerFunc(func(w ResponseWriter, r *Request) {
fmt.Fprintf(w, "User-agent: go\nDisallow: /something/")
})
-// pedanticReadAll works like ioutil.ReadAll but additionally
+// pedanticReadAll works like io.ReadAll but additionally
// verifies that r obeys the documented io.Reader contract.
func pedanticReadAll(r io.Reader) (b []byte, err error) {
var bufa [64]byte
@@ -190,7 +189,7 @@ func TestPostFormRequestFormat(t *testing.T) {
if g, e := tr.req.ContentLength, int64(len(expectedBody)); g != e {
t.Errorf("got ContentLength %d, want %d", g, e)
}
- bodyb, err := ioutil.ReadAll(tr.req.Body)
+ bodyb, err := io.ReadAll(tr.req.Body)
if err != nil {
t.Fatalf("ReadAll on req.Body: %v", err)
}
@@ -421,7 +420,7 @@ func testRedirectsByMethod(t *testing.T, method string, table []redirectTest, wa
var ts *httptest.Server
ts = httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
log.Lock()
- slurp, _ := ioutil.ReadAll(r.Body)
+ slurp, _ := io.ReadAll(r.Body)
fmt.Fprintf(&log.Buffer, "%s %s %q", r.Method, r.RequestURI, slurp)
if cl := r.Header.Get("Content-Length"); r.Method == "GET" && len(slurp) == 0 && (r.ContentLength != 0 || cl != "") {
fmt.Fprintf(&log.Buffer, " (but with body=%T, content-length = %v, %q)", r.Body, r.ContentLength, cl)
@@ -452,7 +451,7 @@ func testRedirectsByMethod(t *testing.T, method string, table []redirectTest, wa
for _, tt := range table {
content := tt.redirectBody
req, _ := NewRequest(method, ts.URL+tt.suffix, strings.NewReader(content))
- req.GetBody = func() (io.ReadCloser, error) { return ioutil.NopCloser(strings.NewReader(content)), nil }
+ req.GetBody = func() (io.ReadCloser, error) { return io.NopCloser(strings.NewReader(content)), nil }
res, err := c.Do(req)
if err != nil {
@@ -522,7 +521,7 @@ func TestClientRedirectUseResponse(t *testing.T) {
t.Errorf("status = %d; want %d", res.StatusCode, StatusFound)
}
defer res.Body.Close()
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -1042,7 +1041,7 @@ func testClientHeadContentLength(t *testing.T, h2 bool) {
if res.ContentLength != tt.want {
t.Errorf("Content-Length = %d; want %d", res.ContentLength, tt.want)
}
- bs, err := ioutil.ReadAll(res.Body)
+ bs, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -1257,7 +1256,7 @@ func testClientTimeout(t *testing.T, h2 bool) {
errc := make(chan error, 1)
go func() {
- _, err := ioutil.ReadAll(res.Body)
+ _, err := io.ReadAll(res.Body)
errc <- err
res.Body.Close()
}()
@@ -1348,7 +1347,7 @@ func TestClientTimeoutCancel(t *testing.T) {
t.Fatal(err)
}
cancel()
- _, err = io.Copy(ioutil.Discard, res.Body)
+ _, err = io.Copy(io.Discard, res.Body)
if err != ExportErrRequestCanceled {
t.Fatalf("error = %v; want errRequestCanceled", err)
}
@@ -1372,7 +1371,7 @@ func testClientRedirectEatsBody(t *testing.T, h2 bool) {
if err != nil {
t.Fatal(err)
}
- _, err = ioutil.ReadAll(res.Body)
+ _, err = io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
t.Fatal(err)
@@ -1450,7 +1449,7 @@ func (issue15577Tripper) RoundTrip(*Request) (*Response, error) {
resp := &Response{
StatusCode: 303,
Header: map[string][]string{"Location": {"http://www.example.com/"}},
- Body: ioutil.NopCloser(strings.NewReader("")),
+ Body: io.NopCloser(strings.NewReader("")),
}
return resp, nil
}
@@ -1591,7 +1590,7 @@ func TestClientCopyHostOnRedirect(t *testing.T) {
if resp.StatusCode != 200 {
t.Fatal(resp.Status)
}
- if got, err := ioutil.ReadAll(resp.Body); err != nil || string(got) != wantBody {
+ if got, err := io.ReadAll(resp.Body); err != nil || string(got) != wantBody {
t.Errorf("body = %q; want %q", got, wantBody)
}
}
@@ -2020,7 +2019,7 @@ func TestClientPopulatesNilResponseBody(t *testing.T) {
}
}()
- if b, err := ioutil.ReadAll(resp.Body); err != nil {
+ if b, err := io.ReadAll(resp.Body); err != nil {
t.Errorf("read error from substitute Response.Body: %v", err)
} else if len(b) != 0 {
t.Errorf("substitute Response.Body was unexpectedly non-empty: %q", b)
diff --git a/src/net/http/clientserver_test.go b/src/net/http/clientserver_test.go
index 439818bb2f..5e227181ac 100644
--- a/src/net/http/clientserver_test.go
+++ b/src/net/http/clientserver_test.go
@@ -15,7 +15,6 @@ import (
"fmt"
"hash"
"io"
- "io/ioutil"
"log"
"net"
. "net/http"
@@ -53,7 +52,7 @@ func (t *clientServerTest) getURL(u string) string {
t.t.Fatal(err)
}
defer res.Body.Close()
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.t.Fatal(err)
}
@@ -152,7 +151,7 @@ func TestChunkedResponseHeaders_h2(t *testing.T) { testChunkedResponseHeaders(t,
func testChunkedResponseHeaders(t *testing.T, h2 bool) {
defer afterTest(t)
- log.SetOutput(ioutil.Discard) // is noisy otherwise
+ log.SetOutput(io.Discard) // is noisy otherwise
defer log.SetOutput(os.Stderr)
cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {
w.Header().Set("Content-Length", "intentional gibberish") // we check that this is deleted
@@ -266,11 +265,11 @@ func (tt h12Compare) normalizeRes(t *testing.T, res *Response, wantProto string)
} else {
t.Errorf("got %q response; want %q", res.Proto, wantProto)
}
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
res.Body.Close()
res.Body = slurpResult{
- ReadCloser: ioutil.NopCloser(bytes.NewReader(slurp)),
+ ReadCloser: io.NopCloser(bytes.NewReader(slurp)),
body: slurp,
err: err,
}
@@ -477,7 +476,7 @@ func test304Responses(t *testing.T, h2 bool) {
if len(res.TransferEncoding) > 0 {
t.Errorf("expected no TransferEncoding; got %v", res.TransferEncoding)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Error(err)
}
@@ -564,7 +563,7 @@ func testCancelRequestMidBody(t *testing.T, h2 bool) {
close(cancel)
- rest, err := ioutil.ReadAll(res.Body)
+ rest, err := io.ReadAll(res.Body)
all := string(firstRead) + string(rest)
if all != "Hello" {
t.Errorf("Read %q (%q + %q); want Hello", all, firstRead, rest)
@@ -587,7 +586,7 @@ func testTrailersClientToServer(t *testing.T, h2 bool) {
}
sort.Strings(decl)
- slurp, err := ioutil.ReadAll(r.Body)
+ slurp, err := io.ReadAll(r.Body)
if err != nil {
t.Errorf("Server reading request body: %v", err)
}
@@ -721,7 +720,7 @@ func testResponseBodyReadAfterClose(t *testing.T, h2 bool) {
t.Fatal(err)
}
res.Body.Close()
- data, err := ioutil.ReadAll(res.Body)
+ data, err := io.ReadAll(res.Body)
if len(data) != 0 || err == nil {
t.Fatalf("ReadAll returned %q, %v; want error", data, err)
}
@@ -740,7 +739,7 @@ func testConcurrentReadWriteReqBody(t *testing.T, h2 bool) {
// Read in one goroutine.
go func() {
defer wg.Done()
- data, err := ioutil.ReadAll(r.Body)
+ data, err := io.ReadAll(r.Body)
if string(data) != reqBody {
t.Errorf("Handler read %q; want %q", data, reqBody)
}
@@ -770,7 +769,7 @@ func testConcurrentReadWriteReqBody(t *testing.T, h2 bool) {
if err != nil {
t.Fatal(err)
}
- data, err := ioutil.ReadAll(res.Body)
+ data, err := io.ReadAll(res.Body)
defer res.Body.Close()
if err != nil {
t.Fatal(err)
@@ -887,7 +886,7 @@ func testTransportUserAgent(t *testing.T, h2 bool) {
t.Errorf("%d. RoundTrip = %v", i, err)
continue
}
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
t.Errorf("%d. read body = %v", i, err)
@@ -1019,7 +1018,7 @@ func TestTransportDiscardsUnneededConns(t *testing.T) {
}
}
defer resp.Body.Close()
- slurp, err := ioutil.ReadAll(resp.Body)
+ slurp, err := io.ReadAll(resp.Body)
if err != nil {
t.Error(err)
}
@@ -1064,7 +1063,7 @@ func testTransportGCRequest(t *testing.T, h2, body bool) {
setParallel(t)
defer afterTest(t)
cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {
- ioutil.ReadAll(r.Body)
+ io.ReadAll(r.Body)
if body {
io.WriteString(w, "Hello.")
}
@@ -1080,7 +1079,7 @@ func testTransportGCRequest(t *testing.T, h2, body bool) {
if err != nil {
t.Fatal(err)
}
- if _, err := ioutil.ReadAll(res.Body); err != nil {
+ if _, err := io.ReadAll(res.Body); err != nil {
t.Fatal(err)
}
if err := res.Body.Close(); err != nil {
@@ -1141,7 +1140,7 @@ func testTransportRejectsInvalidHeaders(t *testing.T, h2 bool) {
res, err := cst.c.Do(req)
var body []byte
if err == nil {
- body, _ = ioutil.ReadAll(res.Body)
+ body, _ = io.ReadAll(res.Body)
res.Body.Close()
}
var dialed bool
@@ -1198,7 +1197,7 @@ func testInterruptWithPanic(t *testing.T, h2 bool, panicValue interface{}) {
}
gotHeaders <- true
defer res.Body.Close()
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if string(slurp) != msg {
t.Errorf("client read %q; want %q", slurp, msg)
}
@@ -1363,7 +1362,7 @@ func testServerUndeclaredTrailers(t *testing.T, h2 bool) {
if err != nil {
t.Fatal(err)
}
- if _, err := io.Copy(ioutil.Discard, res.Body); err != nil {
+ if _, err := io.Copy(io.Discard, res.Body); err != nil {
t.Fatal(err)
}
res.Body.Close()
@@ -1381,7 +1380,7 @@ func testServerUndeclaredTrailers(t *testing.T, h2 bool) {
func TestBadResponseAfterReadingBody(t *testing.T) {
defer afterTest(t)
cst := newClientServerTest(t, false, HandlerFunc(func(w ResponseWriter, r *Request) {
- _, err := io.Copy(ioutil.Discard, r.Body)
+ _, err := io.Copy(io.Discard, r.Body)
if err != nil {
t.Fatal(err)
}
@@ -1474,7 +1473,7 @@ func testWriteHeaderAfterWrite(t *testing.T, h2, hijack bool) {
t.Fatal(err)
}
defer res.Body.Close()
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
diff --git a/src/net/http/doc.go b/src/net/http/doc.go
index 7855feaaa9..ae9b708c69 100644
--- a/src/net/http/doc.go
+++ b/src/net/http/doc.go
@@ -21,7 +21,7 @@ The client must close the response body when finished with it:
// handle error
}
defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
// ...
For control over HTTP client headers, redirect policy, and other
diff --git a/src/net/http/example_test.go b/src/net/http/example_test.go
index a783b46618..c677d52238 100644
--- a/src/net/http/example_test.go
+++ b/src/net/http/example_test.go
@@ -8,7 +8,6 @@ import (
"context"
"fmt"
"io"
- "io/ioutil"
"log"
"net/http"
"os"
@@ -46,7 +45,7 @@ func ExampleGet() {
if err != nil {
log.Fatal(err)
}
- robots, err := ioutil.ReadAll(res.Body)
+ robots, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
diff --git a/src/net/http/fcgi/child.go b/src/net/http/fcgi/child.go
index 34761f32ee..e97b8440e1 100644
--- a/src/net/http/fcgi/child.go
+++ b/src/net/http/fcgi/child.go
@@ -11,7 +11,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"net"
"net/http"
"net/http/cgi"
@@ -186,7 +185,7 @@ func (c *child) serve() {
var errCloseConn = errors.New("fcgi: connection should be closed")
-var emptyBody = ioutil.NopCloser(strings.NewReader(""))
+var emptyBody = io.NopCloser(strings.NewReader(""))
// ErrRequestAborted is returned by Read when a handler attempts to read the
// body of a request that has been aborted by the web server.
@@ -325,7 +324,7 @@ func (c *child) serveRequest(req *request, body io.ReadCloser) {
// some sort of abort request to the host, so the host
// can properly cut off the client sending all the data.
// For now just bound it a little and
- io.CopyN(ioutil.Discard, body, 100<<20)
+ io.CopyN(io.Discard, body, 100<<20)
body.Close()
if !req.keepConn {
diff --git a/src/net/http/fcgi/fcgi_test.go b/src/net/http/fcgi/fcgi_test.go
index 4a27a12c35..d3b704f821 100644
--- a/src/net/http/fcgi/fcgi_test.go
+++ b/src/net/http/fcgi/fcgi_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"errors"
"io"
- "io/ioutil"
"net/http"
"strings"
"testing"
@@ -243,7 +242,7 @@ func TestChildServeCleansUp(t *testing.T) {
r *http.Request,
) {
// block on reading body of request
- _, err := io.Copy(ioutil.Discard, r.Body)
+ _, err := io.Copy(io.Discard, r.Body)
if err != tt.err {
t.Errorf("Expected %#v, got %#v", tt.err, err)
}
@@ -275,7 +274,7 @@ func TestMalformedParams(t *testing.T) {
// end of params
1, 4, 0, 1, 0, 0, 0, 0,
}
- rw := rwNopCloser{bytes.NewReader(input), ioutil.Discard}
+ rw := rwNopCloser{bytes.NewReader(input), io.Discard}
c := newChild(rw, http.DefaultServeMux)
c.serve()
}
diff --git a/src/net/http/filetransport_test.go b/src/net/http/filetransport_test.go
index 2a2f32c769..fdfd44d967 100644
--- a/src/net/http/filetransport_test.go
+++ b/src/net/http/filetransport_test.go
@@ -5,6 +5,7 @@
package http
import (
+ "io"
"io/ioutil"
"os"
"path/filepath"
@@ -48,7 +49,7 @@ func TestFileTransport(t *testing.T) {
if res.Body == nil {
t.Fatalf("for %s, nil Body", urlstr)
}
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
res.Body.Close()
check("ReadAll "+urlstr, err)
if string(slurp) != "Bar" {
diff --git a/src/net/http/fs_test.go b/src/net/http/fs_test.go
index c9f324cff6..2e4751114d 100644
--- a/src/net/http/fs_test.go
+++ b/src/net/http/fs_test.go
@@ -160,7 +160,7 @@ Cases:
if g, w := part.Header.Get("Content-Range"), wantContentRange; g != w {
t.Errorf("range=%q: part Content-Range = %q; want %q", rt.r, g, w)
}
- body, err := ioutil.ReadAll(part)
+ body, err := io.ReadAll(part)
if err != nil {
t.Errorf("range=%q, reading part index %d body: %v", rt.r, ri, err)
continue Cases
@@ -312,7 +312,7 @@ func TestFileServerEscapesNames(t *testing.T) {
if err != nil {
t.Fatalf("test %q: Get: %v", test.name, err)
}
- b, err := ioutil.ReadAll(res.Body)
+ b, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("test %q: read Body: %v", test.name, err)
}
@@ -360,7 +360,7 @@ func TestFileServerSortsNames(t *testing.T) {
}
defer res.Body.Close()
- b, err := ioutil.ReadAll(res.Body)
+ b, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("read Body: %v", err)
}
@@ -394,7 +394,7 @@ func TestFileServerImplicitLeadingSlash(t *testing.T) {
if err != nil {
t.Fatalf("Get %s: %v", suffix, err)
}
- b, err := ioutil.ReadAll(res.Body)
+ b, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("ReadAll %s: %v", suffix, err)
}
@@ -617,7 +617,7 @@ func TestServeIndexHtmlFS(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- b, err := ioutil.ReadAll(res.Body)
+ b, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal("reading Body:", err)
}
@@ -745,7 +745,7 @@ func TestDirectoryIfNotModified(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- b, err := ioutil.ReadAll(res.Body)
+ b, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -1082,7 +1082,7 @@ func TestServeContent(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- io.Copy(ioutil.Discard, res.Body)
+ io.Copy(io.Discard, res.Body)
res.Body.Close()
if res.StatusCode != tt.wantStatus {
t.Errorf("test %q using %q: got status = %d; want %d", testName, method, res.StatusCode, tt.wantStatus)
@@ -1196,7 +1196,7 @@ func TestLinuxSendfile(t *testing.T) {
if err != nil {
t.Fatalf("http client error: %v", err)
}
- _, err = io.Copy(ioutil.Discard, res.Body)
+ _, err = io.Copy(io.Discard, res.Body)
if err != nil {
t.Fatalf("client body read error: %v", err)
}
@@ -1218,7 +1218,7 @@ func getBody(t *testing.T, testName string, req Request, client *Client) (*Respo
if err != nil {
t.Fatalf("%s: for URL %q, send error: %v", testName, req.URL.String(), err)
}
- b, err := ioutil.ReadAll(r.Body)
+ b, err := io.ReadAll(r.Body)
if err != nil {
t.Fatalf("%s: for URL %q, reading body: %v", testName, req.URL.String(), err)
}
@@ -1401,7 +1401,7 @@ func testServeFileRejectsInvalidSuffixLengths(t *testing.T, h2 bool) {
if g, w := res.StatusCode, tt.wantCode; g != w {
t.Errorf("StatusCode mismatch: got %d want %d", g, w)
}
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
t.Fatal(err)
diff --git a/src/net/http/httptest/example_test.go b/src/net/http/httptest/example_test.go
index 54e77dbb84..a6738432eb 100644
--- a/src/net/http/httptest/example_test.go
+++ b/src/net/http/httptest/example_test.go
@@ -7,7 +7,6 @@ package httptest_test
import (
"fmt"
"io"
- "io/ioutil"
"log"
"net/http"
"net/http/httptest"
@@ -23,7 +22,7 @@ func ExampleResponseRecorder() {
handler(w, req)
resp := w.Result()
- body, _ := ioutil.ReadAll(resp.Body)
+ body, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode)
fmt.Println(resp.Header.Get("Content-Type"))
@@ -45,7 +44,7 @@ func ExampleServer() {
if err != nil {
log.Fatal(err)
}
- greeting, err := ioutil.ReadAll(res.Body)
+ greeting, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
@@ -67,7 +66,7 @@ func ExampleServer_hTTP2() {
if err != nil {
log.Fatal(err)
}
- greeting, err := ioutil.ReadAll(res.Body)
+ greeting, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
@@ -89,7 +88,7 @@ func ExampleNewTLSServer() {
log.Fatal(err)
}
- greeting, err := ioutil.ReadAll(res.Body)
+ greeting, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
diff --git a/src/net/http/httptest/httptest.go b/src/net/http/httptest/httptest.go
index f7202da92f..9bedefd2bc 100644
--- a/src/net/http/httptest/httptest.go
+++ b/src/net/http/httptest/httptest.go
@@ -10,7 +10,6 @@ import (
"bytes"
"crypto/tls"
"io"
- "io/ioutil"
"net/http"
"strings"
)
@@ -66,7 +65,7 @@ func NewRequest(method, target string, body io.Reader) *http.Request {
if rc, ok := body.(io.ReadCloser); ok {
req.Body = rc
} else {
- req.Body = ioutil.NopCloser(body)
+ req.Body = io.NopCloser(body)
}
}
diff --git a/src/net/http/httptest/httptest_test.go b/src/net/http/httptest/httptest_test.go
index ef7d943837..071add67ea 100644
--- a/src/net/http/httptest/httptest_test.go
+++ b/src/net/http/httptest/httptest_test.go
@@ -7,7 +7,6 @@ package httptest
import (
"crypto/tls"
"io"
- "io/ioutil"
"net/http"
"net/url"
"reflect"
@@ -155,7 +154,7 @@ func TestNewRequest(t *testing.T) {
} {
t.Run(tt.name, func(t *testing.T) {
got := NewRequest(tt.method, tt.uri, tt.body)
- slurp, err := ioutil.ReadAll(got.Body)
+ slurp, err := io.ReadAll(got.Body)
if err != nil {
t.Errorf("ReadAll: %v", err)
}
diff --git a/src/net/http/httptest/recorder.go b/src/net/http/httptest/recorder.go
index 66e67e78b3..2428482612 100644
--- a/src/net/http/httptest/recorder.go
+++ b/src/net/http/httptest/recorder.go
@@ -7,7 +7,7 @@ package httptest
import (
"bytes"
"fmt"
- "io/ioutil"
+ "io"
"net/http"
"net/textproto"
"strconv"
@@ -179,7 +179,7 @@ func (rw *ResponseRecorder) Result() *http.Response {
}
res.Status = fmt.Sprintf("%03d %s", res.StatusCode, http.StatusText(res.StatusCode))
if rw.Body != nil {
- res.Body = ioutil.NopCloser(bytes.NewReader(rw.Body.Bytes()))
+ res.Body = io.NopCloser(bytes.NewReader(rw.Body.Bytes()))
} else {
res.Body = http.NoBody
}
diff --git a/src/net/http/httptest/recorder_test.go b/src/net/http/httptest/recorder_test.go
index e9534894b6..a865e878b9 100644
--- a/src/net/http/httptest/recorder_test.go
+++ b/src/net/http/httptest/recorder_test.go
@@ -7,7 +7,6 @@ package httptest
import (
"fmt"
"io"
- "io/ioutil"
"net/http"
"testing"
)
@@ -42,7 +41,7 @@ func TestRecorder(t *testing.T) {
}
hasResultContents := func(want string) checkFunc {
return func(rec *ResponseRecorder) error {
- contentBytes, err := ioutil.ReadAll(rec.Result().Body)
+ contentBytes, err := io.ReadAll(rec.Result().Body)
if err != nil {
return err
}
diff --git a/src/net/http/httptest/server_test.go b/src/net/http/httptest/server_test.go
index 0aad15c5ed..39568b358c 100644
--- a/src/net/http/httptest/server_test.go
+++ b/src/net/http/httptest/server_test.go
@@ -6,7 +6,7 @@ package httptest
import (
"bufio"
- "io/ioutil"
+ "io"
"net"
"net/http"
"testing"
@@ -61,7 +61,7 @@ func testServer(t *testing.T, newServer newServerFunc) {
if err != nil {
t.Fatal(err)
}
- got, err := ioutil.ReadAll(res.Body)
+ got, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
t.Fatal(err)
@@ -81,7 +81,7 @@ func testGetAfterClose(t *testing.T, newServer newServerFunc) {
if err != nil {
t.Fatal(err)
}
- got, err := ioutil.ReadAll(res.Body)
+ got, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -93,7 +93,7 @@ func testGetAfterClose(t *testing.T, newServer newServerFunc) {
res, err = http.Get(ts.URL)
if err == nil {
- body, _ := ioutil.ReadAll(res.Body)
+ body, _ := io.ReadAll(res.Body)
t.Fatalf("Unexpected response after close: %v, %v, %s", res.Status, res.Header, body)
}
}
@@ -152,7 +152,7 @@ func testServerClient(t *testing.T, newTLSServer newServerFunc) {
if err != nil {
t.Fatal(err)
}
- got, err := ioutil.ReadAll(res.Body)
+ got, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
t.Fatal(err)
diff --git a/src/net/http/httputil/dump.go b/src/net/http/httputil/dump.go
index c97be066d7..4c9d28bed8 100644
--- a/src/net/http/httputil/dump.go
+++ b/src/net/http/httputil/dump.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"net"
"net/http"
"net/url"
@@ -35,7 +34,7 @@ func drainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err error) {
if err = b.Close(); err != nil {
return nil, b, err
}
- return ioutil.NopCloser(&buf), ioutil.NopCloser(bytes.NewReader(buf.Bytes())), nil
+ return io.NopCloser(&buf), io.NopCloser(bytes.NewReader(buf.Bytes())), nil
}
// dumpConn is a net.Conn which writes to Writer and reads from Reader
@@ -81,7 +80,7 @@ func DumpRequestOut(req *http.Request, body bool) ([]byte, error) {
if !body {
contentLength := outgoingLength(req)
if contentLength != 0 {
- req.Body = ioutil.NopCloser(io.LimitReader(neverEnding('x'), contentLength))
+ req.Body = io.NopCloser(io.LimitReader(neverEnding('x'), contentLength))
dummyBody = true
}
} else {
@@ -133,7 +132,7 @@ func DumpRequestOut(req *http.Request, body bool) ([]byte, error) {
if err == nil {
// Ensure all the body is read; otherwise
// we'll get a partial dump.
- io.Copy(ioutil.Discard, req.Body)
+ io.Copy(io.Discard, req.Body)
req.Body.Close()
}
select {
@@ -296,7 +295,7 @@ func (failureToReadBody) Read([]byte) (int, error) { return 0, errNoBody }
func (failureToReadBody) Close() error { return nil }
// emptyBody is an instance of empty reader.
-var emptyBody = ioutil.NopCloser(strings.NewReader(""))
+var emptyBody = io.NopCloser(strings.NewReader(""))
// DumpResponse is like DumpRequest but dumps a response.
func DumpResponse(resp *http.Response, body bool) ([]byte, error) {
diff --git a/src/net/http/httputil/dump_test.go b/src/net/http/httputil/dump_test.go
index ead56bc172..7571eb0820 100644
--- a/src/net/http/httputil/dump_test.go
+++ b/src/net/http/httputil/dump_test.go
@@ -9,7 +9,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"net/http"
"net/url"
"runtime"
@@ -268,7 +267,7 @@ func TestDumpRequest(t *testing.T) {
}
switch b := ti.Body.(type) {
case []byte:
- req.Body = ioutil.NopCloser(bytes.NewReader(b))
+ req.Body = io.NopCloser(bytes.NewReader(b))
case func() io.ReadCloser:
req.Body = b()
default:
@@ -363,7 +362,7 @@ var dumpResTests = []struct {
Header: http.Header{
"Foo": []string{"Bar"},
},
- Body: ioutil.NopCloser(strings.NewReader("foo")), // shouldn't be used
+ Body: io.NopCloser(strings.NewReader("foo")), // shouldn't be used
},
body: false, // to verify we see 50, not empty or 3.
want: `HTTP/1.1 200 OK
@@ -379,7 +378,7 @@ Foo: Bar`,
ProtoMajor: 1,
ProtoMinor: 1,
ContentLength: 3,
- Body: ioutil.NopCloser(strings.NewReader("foo")),
+ Body: io.NopCloser(strings.NewReader("foo")),
},
body: true,
want: `HTTP/1.1 200 OK
@@ -396,7 +395,7 @@ foo`,
ProtoMajor: 1,
ProtoMinor: 1,
ContentLength: -1,
- Body: ioutil.NopCloser(strings.NewReader("foo")),
+ Body: io.NopCloser(strings.NewReader("foo")),
TransferEncoding: []string{"chunked"},
},
body: true,
diff --git a/src/net/http/httputil/example_test.go b/src/net/http/httputil/example_test.go
index 6191603674..b77a243ca3 100644
--- a/src/net/http/httputil/example_test.go
+++ b/src/net/http/httputil/example_test.go
@@ -6,7 +6,7 @@ package httputil_test
import (
"fmt"
- "io/ioutil"
+ "io"
"log"
"net/http"
"net/http/httptest"
@@ -39,7 +39,7 @@ func ExampleDumpRequest() {
}
defer resp.Body.Close()
- b, err := ioutil.ReadAll(resp.Body)
+ b, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
@@ -111,7 +111,7 @@ func ExampleReverseProxy() {
log.Fatal(err)
}
- b, err := ioutil.ReadAll(resp.Body)
+ b, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go
index cc05d55d87..3acbd940e4 100644
--- a/src/net/http/httputil/reverseproxy_test.go
+++ b/src/net/http/httputil/reverseproxy_test.go
@@ -13,7 +13,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"log"
"net/http"
"net/http/httptest"
@@ -84,7 +83,7 @@ func TestReverseProxy(t *testing.T) {
t.Fatal(err)
}
proxyHandler := NewSingleHostReverseProxy(backendURL)
- proxyHandler.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
+ proxyHandler.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
frontend := httptest.NewServer(proxyHandler)
defer frontend.Close()
frontendClient := frontend.Client()
@@ -124,7 +123,7 @@ func TestReverseProxy(t *testing.T) {
if cookie := res.Cookies()[0]; cookie.Name != "flavor" {
t.Errorf("unexpected cookie %q", cookie.Name)
}
- bodyBytes, _ := ioutil.ReadAll(res.Body)
+ bodyBytes, _ := io.ReadAll(res.Body)
if g, e := string(bodyBytes), backendResponse; g != e {
t.Errorf("got body %q; expected %q", g, e)
}
@@ -218,7 +217,7 @@ func TestReverseProxyStripHeadersPresentInConnection(t *testing.T) {
t.Fatalf("Get: %v", err)
}
defer res.Body.Close()
- bodyBytes, err := ioutil.ReadAll(res.Body)
+ bodyBytes, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("reading body: %v", err)
}
@@ -271,7 +270,7 @@ func TestXForwardedFor(t *testing.T) {
if g, e := res.StatusCode, backendStatus; g != e {
t.Errorf("got res.StatusCode %d; expected %d", g, e)
}
- bodyBytes, _ := ioutil.ReadAll(res.Body)
+ bodyBytes, _ := io.ReadAll(res.Body)
if g, e := string(bodyBytes), backendResponse; g != e {
t.Errorf("got body %q; expected %q", g, e)
}
@@ -373,7 +372,7 @@ func TestReverseProxyFlushInterval(t *testing.T) {
t.Fatalf("Get: %v", err)
}
defer res.Body.Close()
- if bodyBytes, _ := ioutil.ReadAll(res.Body); string(bodyBytes) != expected {
+ if bodyBytes, _ := io.ReadAll(res.Body); string(bodyBytes) != expected {
t.Errorf("got body %q; expected %q", bodyBytes, expected)
}
}
@@ -441,7 +440,7 @@ func TestReverseProxyCancellation(t *testing.T) {
defer backend.Close()
- backend.Config.ErrorLog = log.New(ioutil.Discard, "", 0)
+ backend.Config.ErrorLog = log.New(io.Discard, "", 0)
backendURL, err := url.Parse(backend.URL)
if err != nil {
@@ -452,7 +451,7 @@ func TestReverseProxyCancellation(t *testing.T) {
// Discards errors of the form:
// http: proxy error: read tcp 127.0.0.1:44643: use of closed network connection
- proxyHandler.ErrorLog = log.New(ioutil.Discard, "", 0)
+ proxyHandler.ErrorLog = log.New(io.Discard, "", 0)
frontend := httptest.NewServer(proxyHandler)
defer frontend.Close()
@@ -504,7 +503,7 @@ func TestNilBody(t *testing.T) {
t.Fatal(err)
}
defer res.Body.Close()
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -533,7 +532,7 @@ func TestUserAgentHeader(t *testing.T) {
t.Fatal(err)
}
proxyHandler := NewSingleHostReverseProxy(backendURL)
- proxyHandler.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
+ proxyHandler.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
frontend := httptest.NewServer(proxyHandler)
defer frontend.Close()
frontendClient := frontend.Client()
@@ -606,7 +605,7 @@ func TestReverseProxyGetPutBuffer(t *testing.T) {
if err != nil {
t.Fatalf("Get: %v", err)
}
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
t.Fatalf("reading body: %v", err)
@@ -627,7 +626,7 @@ func TestReverseProxy_Post(t *testing.T) {
const backendStatus = 200
var requestBody = bytes.Repeat([]byte("a"), 1<<20)
backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- slurp, err := ioutil.ReadAll(r.Body)
+ slurp, err := io.ReadAll(r.Body)
if err != nil {
t.Errorf("Backend body read = %v", err)
}
@@ -656,7 +655,7 @@ func TestReverseProxy_Post(t *testing.T) {
if g, e := res.StatusCode, backendStatus; g != e {
t.Errorf("got res.StatusCode %d; expected %d", g, e)
}
- bodyBytes, _ := ioutil.ReadAll(res.Body)
+ bodyBytes, _ := io.ReadAll(res.Body)
if g, e := string(bodyBytes), backendResponse; g != e {
t.Errorf("got body %q; expected %q", g, e)
}
@@ -672,7 +671,7 @@ func (fn RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error)
func TestReverseProxy_NilBody(t *testing.T) {
backendURL, _ := url.Parse("http://fake.tld/")
proxyHandler := NewSingleHostReverseProxy(backendURL)
- proxyHandler.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
+ proxyHandler.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
proxyHandler.Transport = RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
if req.Body != nil {
t.Error("Body != nil; want a nil Body")
@@ -695,8 +694,8 @@ func TestReverseProxy_NilBody(t *testing.T) {
// Issue 33142: always allocate the request headers
func TestReverseProxy_AllocatedHeader(t *testing.T) {
proxyHandler := new(ReverseProxy)
- proxyHandler.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
- proxyHandler.Director = func(*http.Request) {} // noop
+ proxyHandler.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
+ proxyHandler.Director = func(*http.Request) {} // noop
proxyHandler.Transport = RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
if req.Header == nil {
t.Error("Header == nil; want a non-nil Header")
@@ -722,7 +721,7 @@ func TestReverseProxyModifyResponse(t *testing.T) {
rpURL, _ := url.Parse(backendServer.URL)
rproxy := NewSingleHostReverseProxy(rpURL)
- rproxy.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
+ rproxy.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
rproxy.ModifyResponse = func(resp *http.Response) error {
if resp.Header.Get("X-Hit-Mod") != "true" {
return fmt.Errorf("tried to by-pass proxy")
@@ -821,7 +820,7 @@ func TestReverseProxyErrorHandler(t *testing.T) {
if rproxy.Transport == nil {
rproxy.Transport = failingRoundTripper{}
}
- rproxy.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
+ rproxy.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
if tt.errorHandler != nil {
rproxy.ErrorHandler = tt.errorHandler
}
@@ -896,7 +895,7 @@ func (t *staticTransport) RoundTrip(r *http.Request) (*http.Response, error) {
func BenchmarkServeHTTP(b *testing.B) {
res := &http.Response{
StatusCode: 200,
- Body: ioutil.NopCloser(strings.NewReader("")),
+ Body: io.NopCloser(strings.NewReader("")),
}
proxy := &ReverseProxy{
Director: func(*http.Request) {},
@@ -953,7 +952,7 @@ func TestServeHTTPDeepCopy(t *testing.T) {
// Issue 18327: verify we always do a deep copy of the Request.Header map
// before any mutations.
func TestClonesRequestHeaders(t *testing.T) {
- log.SetOutput(ioutil.Discard)
+ log.SetOutput(io.Discard)
defer log.SetOutput(os.Stderr)
req, _ := http.NewRequest("GET", "http://foo.tld/", nil)
req.RemoteAddr = "1.2.3.4:56789"
@@ -1031,7 +1030,7 @@ func (cc *checkCloser) Read(b []byte) (int, error) {
// Issue 23643: panic on body copy error
func TestReverseProxy_PanicBodyError(t *testing.T) {
- log.SetOutput(ioutil.Discard)
+ log.SetOutput(io.Discard)
defer log.SetOutput(os.Stderr)
backendServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
out := "this call was relayed by the reverse proxy"
@@ -1148,7 +1147,7 @@ func TestReverseProxyWebSocket(t *testing.T) {
backURL, _ := url.Parse(backendServer.URL)
rproxy := NewSingleHostReverseProxy(backURL)
- rproxy.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
+ rproxy.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
rproxy.ModifyResponse = func(res *http.Response) error {
res.Header.Add("X-Modified", "true")
return nil
@@ -1265,7 +1264,7 @@ func TestReverseProxyWebSocketCancelation(t *testing.T) {
backendURL, _ := url.Parse(cst.URL)
rproxy := NewSingleHostReverseProxy(backendURL)
- rproxy.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
+ rproxy.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
rproxy.ModifyResponse = func(res *http.Response) error {
res.Header.Add("X-Modified", "true")
return nil
@@ -1352,7 +1351,7 @@ func TestUnannouncedTrailer(t *testing.T) {
t.Fatal(err)
}
proxyHandler := NewSingleHostReverseProxy(backendURL)
- proxyHandler.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests
+ proxyHandler.ErrorLog = log.New(io.Discard, "", 0) // quiet for tests
frontend := httptest.NewServer(proxyHandler)
defer frontend.Close()
frontendClient := frontend.Client()
@@ -1362,7 +1361,7 @@ func TestUnannouncedTrailer(t *testing.T) {
t.Fatalf("Get: %v", err)
}
- ioutil.ReadAll(res.Body)
+ io.ReadAll(res.Body)
if g, w := res.Trailer.Get("X-Unannounced-Trailer"), "unannounced_trailer_value"; g != w {
t.Errorf("Trailer(X-Unannounced-Trailer) = %q; want %q", g, w)
diff --git a/src/net/http/internal/chunked_test.go b/src/net/http/internal/chunked_test.go
index d06716591a..08152ed1e2 100644
--- a/src/net/http/internal/chunked_test.go
+++ b/src/net/http/internal/chunked_test.go
@@ -9,7 +9,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"strings"
"testing"
)
@@ -29,7 +28,7 @@ func TestChunk(t *testing.T) {
}
r := NewChunkedReader(&b)
- data, err := ioutil.ReadAll(r)
+ data, err := io.ReadAll(r)
if err != nil {
t.Logf(`data: "%s"`, data)
t.Fatalf("ReadAll from reader: %v", err)
@@ -177,7 +176,7 @@ func TestChunkReadingIgnoresExtensions(t *testing.T) {
"17;someext\r\n" + // token without value
"world! 0123456789abcdef\r\n" +
"0;someextension=sometoken\r\n" // token=token
- data, err := ioutil.ReadAll(NewChunkedReader(strings.NewReader(in)))
+ data, err := io.ReadAll(NewChunkedReader(strings.NewReader(in)))
if err != nil {
t.Fatalf("ReadAll = %q, %v", data, err)
}
diff --git a/src/net/http/main_test.go b/src/net/http/main_test.go
index 35cc80977c..6564627998 100644
--- a/src/net/http/main_test.go
+++ b/src/net/http/main_test.go
@@ -6,7 +6,7 @@ package http_test
import (
"fmt"
- "io/ioutil"
+ "io"
"log"
"net/http"
"os"
@@ -17,7 +17,7 @@ import (
"time"
)
-var quietLog = log.New(ioutil.Discard, "", 0)
+var quietLog = log.New(io.Discard, "", 0)
func TestMain(m *testing.M) {
v := m.Run()
diff --git a/src/net/http/pprof/pprof_test.go b/src/net/http/pprof/pprof_test.go
index f6f9ef5b04..84757e401a 100644
--- a/src/net/http/pprof/pprof_test.go
+++ b/src/net/http/pprof/pprof_test.go
@@ -8,7 +8,7 @@ import (
"bytes"
"fmt"
"internal/profile"
- "io/ioutil"
+ "io"
"net/http"
"net/http/httptest"
"runtime"
@@ -63,7 +63,7 @@ func TestHandlers(t *testing.T) {
t.Errorf("status code: got %d; want %d", got, want)
}
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
if err != nil {
t.Errorf("when reading response body, expected non-nil err; got %v", err)
}
@@ -227,7 +227,7 @@ func query(endpoint string) (*profile.Profile, error) {
return nil, fmt.Errorf("failed to fetch %q: %v", url, r.Status)
}
- b, err := ioutil.ReadAll(r.Body)
+ b, err := io.ReadAll(r.Body)
r.Body.Close()
if err != nil {
return nil, fmt.Errorf("failed to read and parse the result from %q: %v", url, err)
diff --git a/src/net/http/readrequest_test.go b/src/net/http/readrequest_test.go
index b227bb6d38..1950f4907a 100644
--- a/src/net/http/readrequest_test.go
+++ b/src/net/http/readrequest_test.go
@@ -9,7 +9,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"net/url"
"reflect"
"strings"
@@ -468,7 +467,7 @@ func TestReadRequest_Bad(t *testing.T) {
for _, tt := range badRequestTests {
got, err := ReadRequest(bufio.NewReader(bytes.NewReader(tt.req)))
if err == nil {
- all, err := ioutil.ReadAll(got.Body)
+ all, err := io.ReadAll(got.Body)
t.Errorf("%s: got unexpected request = %#v\n Body = %q, %v", tt.name, got, all, err)
}
}
diff --git a/src/net/http/request.go b/src/net/http/request.go
index df73d5f62d..adba5406e9 100644
--- a/src/net/http/request.go
+++ b/src/net/http/request.go
@@ -15,7 +15,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"mime"
"mime/multipart"
"net"
@@ -870,7 +869,7 @@ func NewRequestWithContext(ctx context.Context, method, url string, body io.Read
}
rc, ok := body.(io.ReadCloser)
if !ok && body != nil {
- rc = ioutil.NopCloser(body)
+ rc = io.NopCloser(body)
}
// The host's colon:port should be normalized. See Issue 14836.
u.Host = removeEmptyPort(u.Host)
@@ -892,21 +891,21 @@ func NewRequestWithContext(ctx context.Context, method, url string, body io.Read
buf := v.Bytes()
req.GetBody = func() (io.ReadCloser, error) {
r := bytes.NewReader(buf)
- return ioutil.NopCloser(r), nil
+ return io.NopCloser(r), nil
}
case *bytes.Reader:
req.ContentLength = int64(v.Len())
snapshot := *v
req.GetBody = func() (io.ReadCloser, error) {
r := snapshot
- return ioutil.NopCloser(&r), nil
+ return io.NopCloser(&r), nil
}
case *strings.Reader:
req.ContentLength = int64(v.Len())
snapshot := *v
req.GetBody = func() (io.ReadCloser, error) {
r := snapshot
- return ioutil.NopCloser(&r), nil
+ return io.NopCloser(&r), nil
}
default:
// This is where we'd set it to -1 (at least
@@ -1205,7 +1204,7 @@ func parsePostForm(r *Request) (vs url.Values, err error) {
maxFormSize = int64(10 << 20) // 10 MB is a lot of text.
reader = io.LimitReader(r.Body, maxFormSize+1)
}
- b, e := ioutil.ReadAll(reader)
+ b, e := io.ReadAll(reader)
if e != nil {
if err == nil {
err = e
diff --git a/src/net/http/request_test.go b/src/net/http/request_test.go
index 461d66e05d..b4ef472e71 100644
--- a/src/net/http/request_test.go
+++ b/src/net/http/request_test.go
@@ -103,7 +103,7 @@ func TestParseFormUnknownContentType(t *testing.T) {
req := &Request{
Method: "POST",
Header: test.contentType,
- Body: ioutil.NopCloser(strings.NewReader("body")),
+ Body: io.NopCloser(strings.NewReader("body")),
}
err := req.ParseForm()
switch {
@@ -150,7 +150,7 @@ func TestMultipartReader(t *testing.T) {
req := &Request{
Method: "POST",
Header: Header{"Content-Type": {test.contentType}},
- Body: ioutil.NopCloser(new(bytes.Buffer)),
+ Body: io.NopCloser(new(bytes.Buffer)),
}
multipart, err := req.MultipartReader()
if test.shouldError {
@@ -187,7 +187,7 @@ binary data
req := &Request{
Method: "POST",
Header: Header{"Content-Type": {`multipart/form-data; boundary=xxx`}},
- Body: ioutil.NopCloser(strings.NewReader(postData)),
+ Body: io.NopCloser(strings.NewReader(postData)),
}
initialFormItems := map[string]string{
@@ -231,7 +231,7 @@ func TestParseMultipartForm(t *testing.T) {
req := &Request{
Method: "POST",
Header: Header{"Content-Type": {`multipart/form-data; boundary="foo123"`}},
- Body: ioutil.NopCloser(new(bytes.Buffer)),
+ Body: io.NopCloser(new(bytes.Buffer)),
}
err := req.ParseMultipartForm(25)
if err == nil {
@@ -756,10 +756,10 @@ func (dr delayedEOFReader) Read(p []byte) (n int, err error) {
}
func TestIssue10884_MaxBytesEOF(t *testing.T) {
- dst := ioutil.Discard
+ dst := io.Discard
_, err := io.Copy(dst, MaxBytesReader(
responseWriterJustWriter{dst},
- ioutil.NopCloser(delayedEOFReader{strings.NewReader("12345")}),
+ io.NopCloser(delayedEOFReader{strings.NewReader("12345")}),
5))
if err != nil {
t.Fatal(err)
@@ -799,7 +799,7 @@ func TestMaxBytesReaderStickyError(t *testing.T) {
2: {101, 100},
}
for i, tt := range tests {
- rc := MaxBytesReader(nil, ioutil.NopCloser(bytes.NewReader(make([]byte, tt.readable))), tt.limit)
+ rc := MaxBytesReader(nil, io.NopCloser(bytes.NewReader(make([]byte, tt.readable))), tt.limit)
if err := isSticky(rc); err != nil {
t.Errorf("%d. error: %v", i, err)
}
@@ -900,7 +900,7 @@ func TestNewRequestGetBody(t *testing.T) {
t.Errorf("test[%d]: GetBody = nil", i)
continue
}
- slurp1, err := ioutil.ReadAll(req.Body)
+ slurp1, err := io.ReadAll(req.Body)
if err != nil {
t.Errorf("test[%d]: ReadAll(Body) = %v", i, err)
}
@@ -908,7 +908,7 @@ func TestNewRequestGetBody(t *testing.T) {
if err != nil {
t.Errorf("test[%d]: GetBody = %v", i, err)
}
- slurp2, err := ioutil.ReadAll(newBody)
+ slurp2, err := io.ReadAll(newBody)
if err != nil {
t.Errorf("test[%d]: ReadAll(GetBody()) = %v", i, err)
}
@@ -1145,7 +1145,7 @@ func benchmarkFileAndServer(b *testing.B, n int64) {
func runFileAndServerBenchmarks(b *testing.B, tlsOption bool, f *os.File, n int64) {
handler := HandlerFunc(func(rw ResponseWriter, req *Request) {
defer req.Body.Close()
- nc, err := io.Copy(ioutil.Discard, req.Body)
+ nc, err := io.Copy(io.Discard, req.Body)
if err != nil {
panic(err)
}
@@ -1172,7 +1172,7 @@ func runFileAndServerBenchmarks(b *testing.B, tlsOption bool, f *os.File, n int6
}
b.StartTimer()
- req, err := NewRequest("PUT", cst.URL, ioutil.NopCloser(f))
+ req, err := NewRequest("PUT", cst.URL, io.NopCloser(f))
if err != nil {
b.Fatal(err)
}
diff --git a/src/net/http/requestwrite_test.go b/src/net/http/requestwrite_test.go
index 9ac6701cfd..1157bdfff9 100644
--- a/src/net/http/requestwrite_test.go
+++ b/src/net/http/requestwrite_test.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"net"
"net/url"
"strings"
@@ -229,7 +228,7 @@ var reqWriteTests = []reqWriteTest{
ContentLength: 0, // as if unset by user
},
- Body: func() io.ReadCloser { return ioutil.NopCloser(io.LimitReader(strings.NewReader("xx"), 0)) },
+ Body: func() io.ReadCloser { return io.NopCloser(io.LimitReader(strings.NewReader("xx"), 0)) },
WantWrite: "POST / HTTP/1.1\r\n" +
"Host: example.com\r\n" +
@@ -281,7 +280,7 @@ var reqWriteTests = []reqWriteTest{
ContentLength: 0, // as if unset by user
},
- Body: func() io.ReadCloser { return ioutil.NopCloser(io.LimitReader(strings.NewReader("xx"), 1)) },
+ Body: func() io.ReadCloser { return io.NopCloser(io.LimitReader(strings.NewReader("xx"), 1)) },
WantWrite: "POST / HTTP/1.1\r\n" +
"Host: example.com\r\n" +
@@ -351,7 +350,7 @@ var reqWriteTests = []reqWriteTest{
Body: func() io.ReadCloser {
err := errors.New("Custom reader error")
errReader := iotest.ErrReader(err)
- return ioutil.NopCloser(io.MultiReader(strings.NewReader("x"), errReader))
+ return io.NopCloser(io.MultiReader(strings.NewReader("x"), errReader))
},
WantError: errors.New("Custom reader error"),
@@ -371,7 +370,7 @@ var reqWriteTests = []reqWriteTest{
Body: func() io.ReadCloser {
err := errors.New("Custom reader error")
errReader := iotest.ErrReader(err)
- return ioutil.NopCloser(errReader)
+ return io.NopCloser(errReader)
},
WantError: errors.New("Custom reader error"),
@@ -620,7 +619,7 @@ func TestRequestWrite(t *testing.T) {
}
switch b := tt.Body.(type) {
case []byte:
- tt.Req.Body = ioutil.NopCloser(bytes.NewReader(b))
+ tt.Req.Body = io.NopCloser(bytes.NewReader(b))
case func() io.ReadCloser:
tt.Req.Body = b()
}
@@ -716,20 +715,20 @@ func TestRequestWriteTransport(t *testing.T) {
},
{
method: "GET",
- body: ioutil.NopCloser(strings.NewReader("")),
+ body: io.NopCloser(strings.NewReader("")),
want: noContentLengthOrTransferEncoding,
},
{
method: "GET",
clen: -1,
- body: ioutil.NopCloser(strings.NewReader("")),
+ body: io.NopCloser(strings.NewReader("")),
want: noContentLengthOrTransferEncoding,
},
// A GET with a body, with explicit content length:
{
method: "GET",
clen: 7,
- body: ioutil.NopCloser(strings.NewReader("foobody")),
+ body: io.NopCloser(strings.NewReader("foobody")),
want: all(matchSubstr("Content-Length: 7"),
matchSubstr("foobody")),
},
@@ -737,7 +736,7 @@ func TestRequestWriteTransport(t *testing.T) {
{
method: "GET",
clen: -1,
- body: ioutil.NopCloser(strings.NewReader("foobody")),
+ body: io.NopCloser(strings.NewReader("foobody")),
want: all(matchSubstr("Transfer-Encoding: chunked"),
matchSubstr("\r\n1\r\nf\r\n"),
matchSubstr("oobody")),
@@ -747,14 +746,14 @@ func TestRequestWriteTransport(t *testing.T) {
{
method: "POST",
clen: -1,
- body: ioutil.NopCloser(strings.NewReader("foobody")),
+ body: io.NopCloser(strings.NewReader("foobody")),
want: all(matchSubstr("Transfer-Encoding: chunked"),
matchSubstr("foobody")),
},
{
method: "POST",
clen: -1,
- body: ioutil.NopCloser(strings.NewReader("")),
+ body: io.NopCloser(strings.NewReader("")),
want: all(matchSubstr("Transfer-Encoding: chunked")),
},
// Verify that a blocking Request.Body doesn't block forever.
@@ -766,7 +765,7 @@ func TestRequestWriteTransport(t *testing.T) {
tt.afterReqRead = func() {
pw.Close()
}
- tt.body = ioutil.NopCloser(pr)
+ tt.body = io.NopCloser(pr)
},
want: matchSubstr("Transfer-Encoding: chunked"),
},
@@ -937,7 +936,7 @@ func dumpRequestOut(req *Request, onReadHeaders func()) ([]byte, error) {
}
// Ensure all the body is read; otherwise
// we'll get a partial dump.
- io.Copy(ioutil.Discard, req.Body)
+ io.Copy(io.Discard, req.Body)
req.Body.Close()
}
dr.c <- strings.NewReader("HTTP/1.1 204 No Content\r\nConnection: close\r\n\r\n")
diff --git a/src/net/http/response_test.go b/src/net/http/response_test.go
index ce872606b1..8eef65474e 100644
--- a/src/net/http/response_test.go
+++ b/src/net/http/response_test.go
@@ -12,7 +12,6 @@ import (
"fmt"
"go/token"
"io"
- "io/ioutil"
"net/http/internal"
"net/url"
"reflect"
@@ -620,7 +619,7 @@ func TestWriteResponse(t *testing.T) {
t.Errorf("#%d: %v", i, err)
continue
}
- err = resp.Write(ioutil.Discard)
+ err = resp.Write(io.Discard)
if err != nil {
t.Errorf("#%d: %v", i, err)
continue
@@ -722,7 +721,7 @@ func TestReadResponseCloseInMiddle(t *testing.T) {
}
resp.Body.Close()
- rest, err := ioutil.ReadAll(bufr)
+ rest, err := io.ReadAll(bufr)
checkErr(err, "ReadAll on remainder")
if e, g := "Next Request Here", string(rest); e != g {
g = regexp.MustCompile(`(xx+)`).ReplaceAllStringFunc(g, func(match string) string {
diff --git a/src/net/http/responsewrite_test.go b/src/net/http/responsewrite_test.go
index d41d89896e..1cc87b942e 100644
--- a/src/net/http/responsewrite_test.go
+++ b/src/net/http/responsewrite_test.go
@@ -6,7 +6,7 @@ package http
import (
"bytes"
- "io/ioutil"
+ "io"
"strings"
"testing"
)
@@ -26,7 +26,7 @@ func TestResponseWrite(t *testing.T) {
ProtoMinor: 0,
Request: dummyReq("GET"),
Header: Header{},
- Body: ioutil.NopCloser(strings.NewReader("abcdef")),
+ Body: io.NopCloser(strings.NewReader("abcdef")),
ContentLength: 6,
},
@@ -42,7 +42,7 @@ func TestResponseWrite(t *testing.T) {
ProtoMinor: 0,
Request: dummyReq("GET"),
Header: Header{},
- Body: ioutil.NopCloser(strings.NewReader("abcdef")),
+ Body: io.NopCloser(strings.NewReader("abcdef")),
ContentLength: -1,
},
"HTTP/1.0 200 OK\r\n" +
@@ -57,7 +57,7 @@ func TestResponseWrite(t *testing.T) {
ProtoMinor: 1,
Request: dummyReq("GET"),
Header: Header{},
- Body: ioutil.NopCloser(strings.NewReader("abcdef")),
+ Body: io.NopCloser(strings.NewReader("abcdef")),
ContentLength: -1,
Close: true,
},
@@ -74,7 +74,7 @@ func TestResponseWrite(t *testing.T) {
ProtoMinor: 1,
Request: dummyReq11("GET"),
Header: Header{},
- Body: ioutil.NopCloser(strings.NewReader("abcdef")),
+ Body: io.NopCloser(strings.NewReader("abcdef")),
ContentLength: -1,
Close: false,
},
@@ -92,7 +92,7 @@ func TestResponseWrite(t *testing.T) {
ProtoMinor: 1,
Request: dummyReq11("GET"),
Header: Header{},
- Body: ioutil.NopCloser(strings.NewReader("abcdef")),
+ Body: io.NopCloser(strings.NewReader("abcdef")),
ContentLength: -1,
TransferEncoding: []string{"chunked"},
Close: false,
@@ -125,7 +125,7 @@ func TestResponseWrite(t *testing.T) {
ProtoMinor: 1,
Request: dummyReq11("GET"),
Header: Header{},
- Body: ioutil.NopCloser(strings.NewReader("")),
+ Body: io.NopCloser(strings.NewReader("")),
ContentLength: 0,
Close: false,
},
@@ -141,7 +141,7 @@ func TestResponseWrite(t *testing.T) {
ProtoMinor: 1,
Request: dummyReq11("GET"),
Header: Header{},
- Body: ioutil.NopCloser(strings.NewReader("foo")),
+ Body: io.NopCloser(strings.NewReader("foo")),
ContentLength: 0,
Close: false,
},
@@ -157,7 +157,7 @@ func TestResponseWrite(t *testing.T) {
ProtoMinor: 1,
Request: dummyReq("GET"),
Header: Header{},
- Body: ioutil.NopCloser(strings.NewReader("abcdef")),
+ Body: io.NopCloser(strings.NewReader("abcdef")),
ContentLength: 6,
TransferEncoding: []string{"chunked"},
Close: true,
@@ -218,7 +218,7 @@ func TestResponseWrite(t *testing.T) {
Request: &Request{Method: "POST"},
Header: Header{},
ContentLength: -1,
- Body: ioutil.NopCloser(strings.NewReader("abcdef")),
+ Body: io.NopCloser(strings.NewReader("abcdef")),
},
"HTTP/1.1 200 OK\r\nConnection: close\r\n\r\nabcdef",
},
diff --git a/src/net/http/roundtrip_js.go b/src/net/http/roundtrip_js.go
index b09923c386..c6a221ac62 100644
--- a/src/net/http/roundtrip_js.go
+++ b/src/net/http/roundtrip_js.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"strconv"
"syscall/js"
)
@@ -92,7 +91,7 @@ func (t *Transport) RoundTrip(req *Request) (*Response, error) {
// See https://github.com/web-platform-tests/wpt/issues/7693 for WHATWG tests issue.
// See https://developer.mozilla.org/en-US/docs/Web/API/Streams_API for more details on the Streams API
// and browser support.
- body, err := ioutil.ReadAll(req.Body)
+ body, err := io.ReadAll(req.Body)
if err != nil {
req.Body.Close() // RoundTrip must always close the body, including on errors.
return nil, err
diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go
index d84804c2e9..ba54b31a29 100644
--- a/src/net/http/serve_test.go
+++ b/src/net/http/serve_test.go
@@ -18,7 +18,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"log"
"math/rand"
"net"
@@ -529,7 +528,7 @@ func TestServeWithSlashRedirectKeepsQueryString(t *testing.T) {
if err != nil {
continue
}
- slurp, _ := ioutil.ReadAll(res.Body)
+ slurp, _ := io.ReadAll(res.Body)
res.Body.Close()
if !tt.statusOk {
if got, want := res.StatusCode, 404; got != want {
@@ -689,7 +688,7 @@ func testServerTimeouts(timeout time.Duration) error {
if err != nil {
return fmt.Errorf("http Get #1: %v", err)
}
- got, err := ioutil.ReadAll(r.Body)
+ got, err := io.ReadAll(r.Body)
expected := "req=1"
if string(got) != expected || err != nil {
return fmt.Errorf("Unexpected response for request #1; got %q ,%v; expected %q, nil",
@@ -721,7 +720,7 @@ func testServerTimeouts(timeout time.Duration) error {
if err != nil {
return fmt.Errorf("http Get #2: %v", err)
}
- got, err = ioutil.ReadAll(r.Body)
+ got, err = io.ReadAll(r.Body)
r.Body.Close()
expected = "req=2"
if string(got) != expected || err != nil {
@@ -734,7 +733,7 @@ func testServerTimeouts(timeout time.Duration) error {
return fmt.Errorf("long Dial: %v", err)
}
defer conn.Close()
- go io.Copy(ioutil.Discard, conn)
+ go io.Copy(io.Discard, conn)
for i := 0; i < 5; i++ {
_, err := conn.Write([]byte("GET / HTTP/1.1\r\nHost: foo\r\n\r\n"))
if err != nil {
@@ -954,7 +953,7 @@ func TestOnlyWriteTimeout(t *testing.T) {
errc <- err
return
}
- _, err = io.Copy(ioutil.Discard, res.Body)
+ _, err = io.Copy(io.Discard, res.Body)
res.Body.Close()
errc <- err
}()
@@ -1058,7 +1057,7 @@ func TestIdentityResponse(t *testing.T) {
}
// The ReadAll will hang for a failing test.
- got, _ := ioutil.ReadAll(conn)
+ got, _ := io.ReadAll(conn)
expectedSuffix := "\r\n\r\ntoo short"
if !strings.HasSuffix(string(got), expectedSuffix) {
t.Errorf("Expected output to end with %q; got response body %q",
@@ -1099,7 +1098,7 @@ func testTCPConnectionCloses(t *testing.T, req string, h Handler) {
}
}()
- _, err = ioutil.ReadAll(r)
+ _, err = io.ReadAll(r)
if err != nil {
t.Fatal("read error:", err)
}
@@ -1129,7 +1128,7 @@ func testTCPConnectionStaysOpen(t *testing.T, req string, handler Handler) {
if err != nil {
t.Fatalf("res %d: %v", i+1, err)
}
- if _, err := io.Copy(ioutil.Discard, res.Body); err != nil {
+ if _, err := io.Copy(io.Discard, res.Body); err != nil {
t.Fatalf("res %d body copy: %v", i+1, err)
}
res.Body.Close()
@@ -1235,7 +1234,7 @@ func testSetsRemoteAddr(t *testing.T, h2 bool) {
if err != nil {
t.Fatalf("Get error: %v", err)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("ReadAll error: %v", err)
}
@@ -1299,7 +1298,7 @@ func TestServerAllowsBlockingRemoteAddr(t *testing.T) {
return
}
defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
if err != nil {
t.Errorf("Request %d: %v", num, err)
response <- ""
@@ -1381,7 +1380,7 @@ func testHeadResponses(t *testing.T, h2 bool) {
if v := res.ContentLength; v != 10 {
t.Errorf("Content-Length: %d; want 10", v)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Error(err)
}
@@ -1432,7 +1431,7 @@ func TestTLSServer(t *testing.T) {
}
}
}))
- ts.Config.ErrorLog = log.New(ioutil.Discard, "", 0)
+ ts.Config.ErrorLog = log.New(io.Discard, "", 0)
defer ts.Close()
// Connect an idle TCP connection to this server before we run
@@ -1540,7 +1539,7 @@ func TestTLSServerRejectHTTPRequests(t *testing.T) {
}
defer conn.Close()
io.WriteString(conn, "GET / HTTP/1.1\r\nHost: foo\r\n\r\n")
- slurp, err := ioutil.ReadAll(conn)
+ slurp, err := io.ReadAll(conn)
if err != nil {
t.Fatal(err)
}
@@ -1734,7 +1733,7 @@ func TestServerExpect(t *testing.T) {
// requests that would read from r.Body, which we only
// conditionally want to do.
if strings.Contains(r.URL.RawQuery, "readbody=true") {
- ioutil.ReadAll(r.Body)
+ io.ReadAll(r.Body)
w.Write([]byte("Hi"))
} else {
w.WriteHeader(StatusUnauthorized)
@@ -1773,7 +1772,7 @@ func TestServerExpect(t *testing.T) {
io.Closer
}{
conn,
- ioutil.NopCloser(nil),
+ io.NopCloser(nil),
}
if test.chunked {
targ = httputil.NewChunkedWriter(conn)
@@ -2072,7 +2071,7 @@ type testHandlerBodyConsumer struct {
var testHandlerBodyConsumers = []testHandlerBodyConsumer{
{"nil", func(io.ReadCloser) {}},
{"close", func(r io.ReadCloser) { r.Close() }},
- {"discard", func(r io.ReadCloser) { io.Copy(ioutil.Discard, r) }},
+ {"discard", func(r io.ReadCloser) { io.Copy(io.Discard, r) }},
}
func TestRequestBodyReadErrorClosesConnection(t *testing.T) {
@@ -2298,7 +2297,7 @@ func testTimeoutHandler(t *testing.T, h2 bool) {
if g, e := res.StatusCode, StatusOK; g != e {
t.Errorf("got res.StatusCode %d; expected %d", g, e)
}
- body, _ := ioutil.ReadAll(res.Body)
+ body, _ := io.ReadAll(res.Body)
if g, e := string(body), "hi"; g != e {
t.Errorf("got body %q; expected %q", g, e)
}
@@ -2315,7 +2314,7 @@ func testTimeoutHandler(t *testing.T, h2 bool) {
if g, e := res.StatusCode, StatusServiceUnavailable; g != e {
t.Errorf("got res.StatusCode %d; expected %d", g, e)
}
- body, _ = ioutil.ReadAll(res.Body)
+ body, _ = io.ReadAll(res.Body)
if !strings.Contains(string(body), "Timeout") {
t.Errorf("expected timeout body; got %q", string(body))
}
@@ -2367,7 +2366,7 @@ func TestTimeoutHandlerRace(t *testing.T) {
defer func() { <-gate }()
res, err := c.Get(fmt.Sprintf("%s/%d", ts.URL, rand.Intn(50)))
if err == nil {
- io.Copy(ioutil.Discard, res.Body)
+ io.Copy(io.Discard, res.Body)
res.Body.Close()
}
}()
@@ -2410,7 +2409,7 @@ func TestTimeoutHandlerRaceHeader(t *testing.T) {
return
}
defer res.Body.Close()
- io.Copy(ioutil.Discard, res.Body)
+ io.Copy(io.Discard, res.Body)
}()
}
wg.Wait()
@@ -2441,7 +2440,7 @@ func TestTimeoutHandlerRaceHeaderTimeout(t *testing.T) {
if g, e := res.StatusCode, StatusOK; g != e {
t.Errorf("got res.StatusCode %d; expected %d", g, e)
}
- body, _ := ioutil.ReadAll(res.Body)
+ body, _ := io.ReadAll(res.Body)
if g, e := string(body), "hi"; g != e {
t.Errorf("got body %q; expected %q", g, e)
}
@@ -2458,7 +2457,7 @@ func TestTimeoutHandlerRaceHeaderTimeout(t *testing.T) {
if g, e := res.StatusCode, StatusServiceUnavailable; g != e {
t.Errorf("got res.StatusCode %d; expected %d", g, e)
}
- body, _ = ioutil.ReadAll(res.Body)
+ body, _ = io.ReadAll(res.Body)
if !strings.Contains(string(body), "Timeout") {
t.Errorf("expected timeout body; got %q", string(body))
}
@@ -2630,7 +2629,7 @@ func TestRedirectContentTypeAndBody(t *testing.T) {
t.Errorf("Redirect(%q, %#v) generated Content-Type header %q; want %q", tt.method, tt.ct, got, want)
}
resp := rec.Result()
- body, err := ioutil.ReadAll(resp.Body)
+ body, err := io.ReadAll(resp.Body)
if err != nil {
t.Fatal(err)
}
@@ -2657,7 +2656,7 @@ func testZeroLengthPostAndResponse(t *testing.T, h2 bool) {
setParallel(t)
defer afterTest(t)
cst := newClientServerTest(t, h2, HandlerFunc(func(rw ResponseWriter, r *Request) {
- all, err := ioutil.ReadAll(r.Body)
+ all, err := io.ReadAll(r.Body)
if err != nil {
t.Fatalf("handler ReadAll: %v", err)
}
@@ -2683,7 +2682,7 @@ func testZeroLengthPostAndResponse(t *testing.T, h2 bool) {
}
for i := range resp {
- all, err := ioutil.ReadAll(resp[i].Body)
+ all, err := io.ReadAll(resp[i].Body)
if err != nil {
t.Fatalf("req #%d: client ReadAll: %v", i, err)
}
@@ -2710,7 +2709,7 @@ func TestHandlerPanicWithHijack(t *testing.T) {
func testHandlerPanic(t *testing.T, withHijack, h2 bool, wrapper func(Handler) Handler, panicValue interface{}) {
defer afterTest(t)
- // Unlike the other tests that set the log output to ioutil.Discard
+ // Unlike the other tests that set the log output to io.Discard
// to quiet the output, this test uses a pipe. The pipe serves three
// purposes:
//
@@ -2970,7 +2969,7 @@ func testRequestBodyLimit(t *testing.T, h2 bool) {
const limit = 1 << 20
cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {
r.Body = MaxBytesReader(w, r.Body, limit)
- n, err := io.Copy(ioutil.Discard, r.Body)
+ n, err := io.Copy(io.Discard, r.Body)
if err == nil {
t.Errorf("expected error from io.Copy")
}
@@ -3020,7 +3019,7 @@ func TestClientWriteShutdown(t *testing.T) {
donec := make(chan bool)
go func() {
defer close(donec)
- bs, err := ioutil.ReadAll(conn)
+ bs, err := io.ReadAll(conn)
if err != nil {
t.Errorf("ReadAll: %v", err)
}
@@ -3341,7 +3340,7 @@ func TestHijackBeforeRequestBodyRead(t *testing.T) {
r.Body = nil // to test that server.go doesn't use this value.
gone := w.(CloseNotifier).CloseNotify()
- slurp, err := ioutil.ReadAll(reqBody)
+ slurp, err := io.ReadAll(reqBody)
if err != nil {
t.Errorf("Body read: %v", err)
return
@@ -3643,7 +3642,7 @@ func TestAcceptMaxFds(t *testing.T) {
}}}
server := &Server{
Handler: HandlerFunc(HandlerFunc(func(ResponseWriter, *Request) {})),
- ErrorLog: log.New(ioutil.Discard, "", 0), // noisy otherwise
+ ErrorLog: log.New(io.Discard, "", 0), // noisy otherwise
}
err := server.Serve(ln)
if err != io.EOF {
@@ -3782,7 +3781,7 @@ func testServerReaderFromOrder(t *testing.T, h2 bool) {
close(done)
}()
time.Sleep(25 * time.Millisecond) // give Copy a chance to break things
- n, err := io.Copy(ioutil.Discard, req.Body)
+ n, err := io.Copy(io.Discard, req.Body)
if err != nil {
t.Errorf("handler Copy: %v", err)
return
@@ -3804,7 +3803,7 @@ func testServerReaderFromOrder(t *testing.T, h2 bool) {
if err != nil {
t.Fatal(err)
}
- all, err := ioutil.ReadAll(res.Body)
+ all, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -3929,7 +3928,7 @@ func testTransportAndServerSharedBodyRace(t *testing.T, h2 bool) {
errorf("Proxy outbound request: %v", err)
return
}
- _, err = io.CopyN(ioutil.Discard, bresp.Body, bodySize/2)
+ _, err = io.CopyN(io.Discard, bresp.Body, bodySize/2)
if err != nil {
errorf("Proxy copy error: %v", err)
return
@@ -4136,7 +4135,7 @@ func TestServerConnState(t *testing.T) {
ts.Close()
}()
- ts.Config.ErrorLog = log.New(ioutil.Discard, "", 0)
+ ts.Config.ErrorLog = log.New(io.Discard, "", 0)
ts.Config.ConnState = func(c net.Conn, state ConnState) {
if c == nil {
t.Errorf("nil conn seen in state %s", state)
@@ -4176,7 +4175,7 @@ func TestServerConnState(t *testing.T) {
t.Errorf("Error fetching %s: %v", url, err)
return
}
- _, err = ioutil.ReadAll(res.Body)
+ _, err = io.ReadAll(res.Body)
defer res.Body.Close()
if err != nil {
t.Errorf("Error reading %s: %v", url, err)
@@ -4233,7 +4232,7 @@ func TestServerConnState(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if _, err := io.Copy(ioutil.Discard, res.Body); err != nil {
+ if _, err := io.Copy(io.Discard, res.Body); err != nil {
t.Fatal(err)
}
c.Close()
@@ -4285,7 +4284,7 @@ func testServerEmptyBodyRace(t *testing.T, h2 bool) {
}
}
defer res.Body.Close()
- _, err = io.Copy(ioutil.Discard, res.Body)
+ _, err = io.Copy(io.Discard, res.Body)
if err != nil {
t.Error(err)
return
@@ -4311,7 +4310,7 @@ func TestServerConnStateNew(t *testing.T) {
srv.Serve(&oneConnListener{
conn: &rwTestConn{
Reader: strings.NewReader("GET / HTTP/1.1\r\nHost: foo\r\n\r\n"),
- Writer: ioutil.Discard,
+ Writer: io.Discard,
},
})
if !sawNew { // testing that this read isn't racy
@@ -4367,7 +4366,7 @@ func TestServerFlushAndHijack(t *testing.T) {
t.Fatal(err)
}
defer res.Body.Close()
- all, err := ioutil.ReadAll(res.Body)
+ all, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -4555,7 +4554,7 @@ Host: foo
go Serve(ln, HandlerFunc(func(w ResponseWriter, r *Request) {
numReq++
if r.URL.Path == "/readbody" {
- ioutil.ReadAll(r.Body)
+ io.ReadAll(r.Body)
}
io.WriteString(w, "Hello world!")
}))
@@ -4608,7 +4607,7 @@ func testHandlerSetsBodyNil(t *testing.T, h2 bool) {
t.Fatal(err)
}
defer res.Body.Close()
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -4724,7 +4723,7 @@ func TestServerHandlersCanHandleH2PRI(t *testing.T) {
}
defer c.Close()
io.WriteString(c, "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n")
- slurp, err := ioutil.ReadAll(c)
+ slurp, err := io.ReadAll(c)
if err != nil {
t.Fatal(err)
}
@@ -4958,7 +4957,7 @@ func BenchmarkClientServer(b *testing.B) {
if err != nil {
b.Fatal("Get:", err)
}
- all, err := ioutil.ReadAll(res.Body)
+ all, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
b.Fatal("ReadAll:", err)
@@ -5009,7 +5008,7 @@ func benchmarkClientServerParallel(b *testing.B, parallelism int, useTLS bool) {
b.Logf("Get: %v", err)
continue
}
- all, err := ioutil.ReadAll(res.Body)
+ all, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
b.Logf("ReadAll: %v", err)
@@ -5044,7 +5043,7 @@ func BenchmarkServer(b *testing.B) {
if err != nil {
log.Panicf("Get: %v", err)
}
- all, err := ioutil.ReadAll(res.Body)
+ all, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Panicf("ReadAll: %v", err)
@@ -5167,7 +5166,7 @@ func BenchmarkClient(b *testing.B) {
if err != nil {
b.Fatalf("Get: %v", err)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
b.Fatalf("ReadAll: %v", err)
@@ -5257,7 +5256,7 @@ Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
conn := &rwTestConn{
Reader: &repeatReader{content: req, count: b.N},
- Writer: ioutil.Discard,
+ Writer: io.Discard,
closec: make(chan bool, 1),
}
handled := 0
@@ -5286,7 +5285,7 @@ Host: golang.org
conn := &rwTestConn{
Reader: &repeatReader{content: req, count: b.N},
- Writer: ioutil.Discard,
+ Writer: io.Discard,
closec: make(chan bool, 1),
}
handled := 0
@@ -5346,7 +5345,7 @@ Host: golang.org
`)
conn := &rwTestConn{
Reader: &repeatReader{content: req, count: b.N},
- Writer: ioutil.Discard,
+ Writer: io.Discard,
closec: make(chan bool, 1),
}
handled := 0
@@ -5375,7 +5374,7 @@ Host: golang.org
conn.Close()
})
conn := &rwTestConn{
- Writer: ioutil.Discard,
+ Writer: io.Discard,
closec: make(chan bool, 1),
}
ln := &oneConnListener{conn: conn}
@@ -5438,7 +5437,7 @@ func TestServerIdleTimeout(t *testing.T) {
setParallel(t)
defer afterTest(t)
ts := httptest.NewUnstartedServer(HandlerFunc(func(w ResponseWriter, r *Request) {
- io.Copy(ioutil.Discard, r.Body)
+ io.Copy(io.Discard, r.Body)
io.WriteString(w, r.RemoteAddr)
}))
ts.Config.ReadHeaderTimeout = 1 * time.Second
@@ -5453,7 +5452,7 @@ func TestServerIdleTimeout(t *testing.T) {
t.Fatal(err)
}
defer res.Body.Close()
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -5478,7 +5477,7 @@ func TestServerIdleTimeout(t *testing.T) {
defer conn.Close()
conn.Write([]byte("GET / HTTP/1.1\r\nHost: foo.com\r\n"))
time.Sleep(2 * time.Second)
- if _, err := io.CopyN(ioutil.Discard, conn, 1); err == nil {
+ if _, err := io.CopyN(io.Discard, conn, 1); err == nil {
t.Fatal("copy byte succeeded; want err")
}
}
@@ -5489,7 +5488,7 @@ func get(t *testing.T, c *Client, url string) string {
t.Fatal(err)
}
defer res.Body.Close()
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -5739,7 +5738,7 @@ func TestServerCancelsReadTimeoutWhenIdle(t *testing.T) {
if err != nil {
return fmt.Errorf("Get: %v", err)
}
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
return fmt.Errorf("Body ReadAll: %v", err)
@@ -5802,7 +5801,7 @@ func TestServerDuplicateBackgroundRead(t *testing.T) {
wg.Add(1)
go func() {
defer wg.Done()
- io.Copy(ioutil.Discard, cn)
+ io.Copy(io.Discard, cn)
}()
for j := 0; j < requests; j++ {
@@ -5902,7 +5901,7 @@ func TestServerHijackGetsBackgroundByte_big(t *testing.T) {
return
}
defer conn.Close()
- slurp, err := ioutil.ReadAll(buf.Reader)
+ slurp, err := io.ReadAll(buf.Reader)
if err != nil {
t.Errorf("Copy: %v", err)
}
@@ -6436,13 +6435,13 @@ func fetchWireResponse(host string, http1ReqBody []byte) ([]byte, error) {
if _, err := conn.Write(http1ReqBody); err != nil {
return nil, err
}
- return ioutil.ReadAll(conn)
+ return io.ReadAll(conn)
}
func BenchmarkResponseStatusLine(b *testing.B) {
b.ReportAllocs()
b.RunParallel(func(pb *testing.PB) {
- bw := bufio.NewWriter(ioutil.Discard)
+ bw := bufio.NewWriter(io.Discard)
var buf3 [3]byte
for pb.Next() {
Export_writeStatusLine(bw, true, 200, buf3[:])
diff --git a/src/net/http/server.go b/src/net/http/server.go
index fab229c92a..ba473d14f5 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -14,7 +14,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"log"
"net"
"net/textproto"
@@ -1368,7 +1367,7 @@ func (cw *chunkWriter) writeHeader(p []byte) {
}
if discard {
- _, err := io.CopyN(ioutil.Discard, w.reqBody, maxPostHandlerReadBytes+1)
+ _, err := io.CopyN(io.Discard, w.reqBody, maxPostHandlerReadBytes+1)
switch err {
case nil:
// There must be even more data left over.
@@ -3407,7 +3406,7 @@ func (globalOptionsHandler) ServeHTTP(w ResponseWriter, r *Request) {
// (or an attack) and we abort and close the connection,
// courtesy of MaxBytesReader's EOF behavior.
mb := MaxBytesReader(w, r.Body, 4<<10)
- io.Copy(ioutil.Discard, mb)
+ io.Copy(io.Discard, mb)
}
}
diff --git a/src/net/http/sniff_test.go b/src/net/http/sniff_test.go
index a1157a0823..8d5350374d 100644
--- a/src/net/http/sniff_test.go
+++ b/src/net/http/sniff_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"log"
. "net/http"
"reflect"
@@ -123,7 +122,7 @@ func testServerContentType(t *testing.T, h2 bool) {
if ct := resp.Header.Get("Content-Type"); ct != wantContentType {
t.Errorf("%v: Content-Type = %q, want %q", tt.desc, ct, wantContentType)
}
- data, err := ioutil.ReadAll(resp.Body)
+ data, err := io.ReadAll(resp.Body)
if err != nil {
t.Errorf("%v: reading body: %v", tt.desc, err)
} else if !bytes.Equal(data, tt.data) {
@@ -185,7 +184,7 @@ func testContentTypeWithCopy(t *testing.T, h2 bool) {
if ct := resp.Header.Get("Content-Type"); ct != expected {
t.Errorf("Content-Type = %q, want %q", ct, expected)
}
- data, err := ioutil.ReadAll(resp.Body)
+ data, err := io.ReadAll(resp.Body)
if err != nil {
t.Errorf("reading body: %v", err)
} else if !bytes.Equal(data, []byte(input)) {
@@ -216,7 +215,7 @@ func testSniffWriteSize(t *testing.T, h2 bool) {
if err != nil {
t.Fatalf("size %d: %v", size, err)
}
- if _, err := io.Copy(ioutil.Discard, res.Body); err != nil {
+ if _, err := io.Copy(io.Discard, res.Body); err != nil {
t.Fatalf("size %d: io.Copy of body = %v", size, err)
}
if err := res.Body.Close(); err != nil {
diff --git a/src/net/http/transfer.go b/src/net/http/transfer.go
index c3234f30cc..fbb0c39829 100644
--- a/src/net/http/transfer.go
+++ b/src/net/http/transfer.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"net/http/httptrace"
"net/http/internal"
"net/textproto"
@@ -156,7 +155,7 @@ func newTransferWriter(r interface{}) (t *transferWriter, err error) {
// servers. See Issue 18257, as one example.
//
// The only reason we'd send such a request is if the user set the Body to a
-// non-nil value (say, ioutil.NopCloser(bytes.NewReader(nil))) and didn't
+// non-nil value (say, io.NopCloser(bytes.NewReader(nil))) and didn't
// set ContentLength, or NewRequest set it to -1 (unknown), so then we assume
// there's bytes to send.
//
@@ -370,7 +369,7 @@ func (t *transferWriter) writeBody(w io.Writer) (err error) {
return err
}
var nextra int64
- nextra, err = t.doBodyCopy(ioutil.Discard, body)
+ nextra, err = t.doBodyCopy(io.Discard, body)
ncopy += nextra
}
if err != nil {
@@ -992,7 +991,7 @@ func (b *body) Close() error {
var n int64
// Consume the body, or, which will also lead to us reading
// the trailer headers after the body, if present.
- n, err = io.CopyN(ioutil.Discard, bodyLocked{b}, maxPostHandlerReadBytes)
+ n, err = io.CopyN(io.Discard, bodyLocked{b}, maxPostHandlerReadBytes)
if err == io.EOF {
err = nil
}
@@ -1003,7 +1002,7 @@ func (b *body) Close() error {
default:
// Fully consume the body, which will also lead to us reading
// the trailer headers after the body, if present.
- _, err = io.Copy(ioutil.Discard, bodyLocked{b})
+ _, err = io.Copy(io.Discard, bodyLocked{b})
}
b.closed = true
return err
@@ -1075,7 +1074,7 @@ func (fr finishAsyncByteRead) Read(p []byte) (n int, err error) {
return
}
-var nopCloserType = reflect.TypeOf(ioutil.NopCloser(nil))
+var nopCloserType = reflect.TypeOf(io.NopCloser(nil))
// isKnownInMemoryReader reports whether r is a type known to not
// block on Read. Its caller uses this as an optional optimization to
diff --git a/src/net/http/transfer_test.go b/src/net/http/transfer_test.go
index 185225fa93..1f3d32526d 100644
--- a/src/net/http/transfer_test.go
+++ b/src/net/http/transfer_test.go
@@ -81,11 +81,11 @@ func TestDetectInMemoryReaders(t *testing.T) {
{bytes.NewBuffer(nil), true},
{strings.NewReader(""), true},
- {ioutil.NopCloser(pr), false},
+ {io.NopCloser(pr), false},
- {ioutil.NopCloser(bytes.NewReader(nil)), true},
- {ioutil.NopCloser(bytes.NewBuffer(nil)), true},
- {ioutil.NopCloser(strings.NewReader("")), true},
+ {io.NopCloser(bytes.NewReader(nil)), true},
+ {io.NopCloser(bytes.NewBuffer(nil)), true},
+ {io.NopCloser(strings.NewReader("")), true},
}
for i, tt := range tests {
got := isKnownInMemoryReader(tt.r)
@@ -104,12 +104,12 @@ var _ io.ReaderFrom = (*mockTransferWriter)(nil)
func (w *mockTransferWriter) ReadFrom(r io.Reader) (int64, error) {
w.CalledReader = r
- return io.Copy(ioutil.Discard, r)
+ return io.Copy(io.Discard, r)
}
func (w *mockTransferWriter) Write(p []byte) (int, error) {
w.WriteCalled = true
- return ioutil.Discard.Write(p)
+ return io.Discard.Write(p)
}
func TestTransferWriterWriteBodyReaderTypes(t *testing.T) {
@@ -166,7 +166,7 @@ func TestTransferWriterWriteBodyReaderTypes(t *testing.T) {
method: "PUT",
bodyFunc: func() (io.Reader, func(), error) {
r, cleanup, err := newFileFunc()
- return ioutil.NopCloser(r), cleanup, err
+ return io.NopCloser(r), cleanup, err
},
contentLength: nBytes,
limitedReader: true,
@@ -206,7 +206,7 @@ func TestTransferWriterWriteBodyReaderTypes(t *testing.T) {
method: "PUT",
bodyFunc: func() (io.Reader, func(), error) {
r, cleanup, err := newBufferFunc()
- return ioutil.NopCloser(r), cleanup, err
+ return io.NopCloser(r), cleanup, err
},
contentLength: nBytes,
limitedReader: true,
diff --git a/src/net/http/transport_internal_test.go b/src/net/http/transport_internal_test.go
index 92729e65b2..1097ffd173 100644
--- a/src/net/http/transport_internal_test.go
+++ b/src/net/http/transport_internal_test.go
@@ -11,7 +11,6 @@ import (
"crypto/tls"
"errors"
"io"
- "io/ioutil"
"net"
"net/http/internal"
"strings"
@@ -226,7 +225,7 @@ func TestTransportBodyAltRewind(t *testing.T) {
TLSNextProto: map[string]func(string, *tls.Conn) RoundTripper{
"foo": func(authority string, c *tls.Conn) RoundTripper {
return roundTripFunc(func(r *Request) (*Response, error) {
- n, _ := io.Copy(ioutil.Discard, r.Body)
+ n, _ := io.Copy(io.Discard, r.Body)
if n == 0 {
t.Error("body length is zero")
}
diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go
index b152007282..58f0d9db98 100644
--- a/src/net/http/transport_test.go
+++ b/src/net/http/transport_test.go
@@ -173,7 +173,7 @@ func TestTransportKeepAlives(t *testing.T) {
if err != nil {
t.Fatalf("error in disableKeepAlive=%v, req #%d, GET: %v", disableKeepAlive, n, err)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("error in disableKeepAlive=%v, req #%d, ReadAll: %v", disableKeepAlive, n, err)
}
@@ -220,7 +220,7 @@ func TestTransportConnectionCloseOnResponse(t *testing.T) {
t.Fatalf("error in connectionClose=%v, req #%d, Do: %v", connectionClose, n, err)
}
defer res.Body.Close()
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("error in connectionClose=%v, req #%d, ReadAll: %v", connectionClose, n, err)
}
@@ -273,7 +273,7 @@ func TestTransportConnectionCloseOnRequest(t *testing.T) {
t.Errorf("For connectionClose = %v; handler's X-Saw-Close was %v; want %v",
connectionClose, got, !connectionClose)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("error in connectionClose=%v, req #%d, ReadAll: %v", connectionClose, n, err)
}
@@ -382,7 +382,7 @@ func TestTransportIdleCacheKeys(t *testing.T) {
if err != nil {
t.Error(err)
}
- ioutil.ReadAll(resp.Body)
+ io.ReadAll(resp.Body)
keys := tr.IdleConnKeysForTesting()
if e, g := 1, len(keys); e != g {
@@ -495,7 +495,7 @@ func TestTransportMaxPerHostIdleConns(t *testing.T) {
t.Error(err)
return
}
- if _, err := ioutil.ReadAll(resp.Body); err != nil {
+ if _, err := io.ReadAll(resp.Body); err != nil {
t.Errorf("ReadAll: %v", err)
return
}
@@ -575,7 +575,7 @@ func TestTransportMaxConnsPerHostIncludeDialInProgress(t *testing.T) {
if err != nil {
t.Errorf("unexpected error for request %s: %v", reqId, err)
}
- _, err = ioutil.ReadAll(resp.Body)
+ _, err = io.ReadAll(resp.Body)
if err != nil {
t.Errorf("unexpected error for request %s: %v", reqId, err)
}
@@ -655,7 +655,7 @@ func TestTransportMaxConnsPerHost(t *testing.T) {
t.Fatalf("request failed: %v", err)
}
defer resp.Body.Close()
- _, err = ioutil.ReadAll(resp.Body)
+ _, err = io.ReadAll(resp.Body)
if err != nil {
t.Fatalf("read body failed: %v", err)
}
@@ -733,7 +733,7 @@ func TestTransportRemovesDeadIdleConnections(t *testing.T) {
t.Fatalf("%s: %v", name, res.Status)
}
defer res.Body.Close()
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("%s: %v", name, err)
}
@@ -783,7 +783,7 @@ func TestTransportServerClosingUnexpectedly(t *testing.T) {
condFatalf("error in req #%d, GET: %v", n, err)
continue
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
condFatalf("error in req #%d, ReadAll: %v", n, err)
continue
@@ -903,7 +903,7 @@ func TestTransportHeadResponses(t *testing.T) {
if e, g := int64(123), res.ContentLength; e != g {
t.Errorf("loop %d: expected res.ContentLength of %v, got %v", i, e, g)
}
- if all, err := ioutil.ReadAll(res.Body); err != nil {
+ if all, err := io.ReadAll(res.Body); err != nil {
t.Errorf("loop %d: Body ReadAll: %v", i, err)
} else if len(all) != 0 {
t.Errorf("Bogus body %q", all)
@@ -1006,10 +1006,10 @@ func TestRoundTripGzip(t *testing.T) {
t.Errorf("%d. gzip NewReader: %v", i, err)
continue
}
- body, err = ioutil.ReadAll(r)
+ body, err = io.ReadAll(r)
res.Body.Close()
} else {
- body, err = ioutil.ReadAll(res.Body)
+ body, err = io.ReadAll(res.Body)
}
if err != nil {
t.Errorf("%d. Error: %q", i, err)
@@ -1090,7 +1090,7 @@ func TestTransportGzip(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -1133,7 +1133,7 @@ func TestTransportExpect100Continue(t *testing.T) {
switch req.URL.Path {
case "/100":
// This endpoint implicitly responds 100 Continue and reads body.
- if _, err := io.Copy(ioutil.Discard, req.Body); err != nil {
+ if _, err := io.Copy(io.Discard, req.Body); err != nil {
t.Error("Failed to read Body", err)
}
rw.WriteHeader(StatusOK)
@@ -1159,7 +1159,7 @@ func TestTransportExpect100Continue(t *testing.T) {
if err != nil {
log.Fatal(err)
}
- if _, err := io.CopyN(ioutil.Discard, bufrw, req.ContentLength); err != nil {
+ if _, err := io.CopyN(io.Discard, bufrw, req.ContentLength); err != nil {
t.Error("Failed to read Body", err)
}
bufrw.WriteString("HTTP/1.1 200 OK\r\n\r\n")
@@ -1625,7 +1625,7 @@ func TestTransportGzipRecursive(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -1654,7 +1654,7 @@ func TestTransportGzipShort(t *testing.T) {
t.Fatal(err)
}
defer res.Body.Close()
- _, err = ioutil.ReadAll(res.Body)
+ _, err = io.ReadAll(res.Body)
if err == nil {
t.Fatal("Expect an error from reading a body.")
}
@@ -1999,7 +1999,7 @@ func TestIssue3644(t *testing.T) {
t.Fatal(err)
}
defer res.Body.Close()
- bs, err := ioutil.ReadAll(res.Body)
+ bs, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -2024,7 +2024,7 @@ func TestIssue3595(t *testing.T) {
t.Errorf("Post: %v", err)
return
}
- got, err := ioutil.ReadAll(res.Body)
+ got, err := io.ReadAll(res.Body)
if err != nil {
t.Fatalf("Body ReadAll: %v", err)
}
@@ -2096,7 +2096,7 @@ func TestTransportConcurrency(t *testing.T) {
wg.Done()
continue
}
- all, err := ioutil.ReadAll(res.Body)
+ all, err := io.ReadAll(res.Body)
if err != nil {
t.Errorf("read error on req %s: %v", req, err)
wg.Done()
@@ -2163,7 +2163,7 @@ func TestIssue4191_InfiniteGetTimeout(t *testing.T) {
t.Errorf("Error issuing GET: %v", err)
break
}
- _, err = io.Copy(ioutil.Discard, sres.Body)
+ _, err = io.Copy(io.Discard, sres.Body)
if err == nil {
t.Errorf("Unexpected successful copy")
break
@@ -2184,7 +2184,7 @@ func TestIssue4191_InfiniteGetToPutTimeout(t *testing.T) {
})
mux.HandleFunc("/put", func(w ResponseWriter, r *Request) {
defer r.Body.Close()
- io.Copy(ioutil.Discard, r.Body)
+ io.Copy(io.Discard, r.Body)
})
ts := httptest.NewServer(mux)
timeout := 100 * time.Millisecond
@@ -2338,7 +2338,7 @@ func TestTransportCancelRequest(t *testing.T) {
tr.CancelRequest(req)
}()
t0 := time.Now()
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
d := time.Since(t0)
if err != ExportErrRequestCanceled {
@@ -2497,7 +2497,7 @@ func TestCancelRequestWithChannel(t *testing.T) {
close(ch)
}()
t0 := time.Now()
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
d := time.Since(t0)
if err != ExportErrRequestCanceled {
@@ -2678,7 +2678,7 @@ func (fooProto) RoundTrip(req *Request) (*Response, error) {
Status: "200 OK",
StatusCode: 200,
Header: make(Header),
- Body: ioutil.NopCloser(strings.NewReader("You wanted " + req.URL.String())),
+ Body: io.NopCloser(strings.NewReader("You wanted " + req.URL.String())),
}
return res, nil
}
@@ -2692,7 +2692,7 @@ func TestTransportAltProto(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- bodyb, err := ioutil.ReadAll(res.Body)
+ bodyb, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -2769,7 +2769,7 @@ func TestTransportSocketLateBinding(t *testing.T) {
// let the foo response finish so we can use its
// connection for /bar
fooGate <- true
- io.Copy(ioutil.Discard, fooRes.Body)
+ io.Copy(io.Discard, fooRes.Body)
fooRes.Body.Close()
})
@@ -2808,7 +2808,7 @@ func TestTransportReading100Continue(t *testing.T) {
t.Error(err)
return
}
- slurp, err := ioutil.ReadAll(req.Body)
+ slurp, err := io.ReadAll(req.Body)
if err != nil {
t.Errorf("Server request body slurp: %v", err)
return
@@ -2872,7 +2872,7 @@ Content-Length: %d
if id, idBack := req.Header.Get("Request-Id"), res.Header.Get("Echo-Request-Id"); id != "" && id != idBack {
t.Errorf("%s: response id %q != request id %q", name, idBack, id)
}
- _, err = ioutil.ReadAll(res.Body)
+ _, err = io.ReadAll(res.Body)
if err != nil {
t.Fatalf("%s: Slurp error: %v", name, err)
}
@@ -3151,7 +3151,7 @@ func TestIdleConnChannelLeak(t *testing.T) {
func TestTransportClosesRequestBody(t *testing.T) {
defer afterTest(t)
ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
- io.Copy(ioutil.Discard, r.Body)
+ io.Copy(io.Discard, r.Body)
}))
defer ts.Close()
@@ -3258,7 +3258,7 @@ func TestTLSServerClosesConnection(t *testing.T) {
t.Fatal(err)
}
<-closedc
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -3273,7 +3273,7 @@ func TestTLSServerClosesConnection(t *testing.T) {
errs = append(errs, err)
continue
}
- slurp, err = ioutil.ReadAll(res.Body)
+ slurp, err = io.ReadAll(res.Body)
if err != nil {
errs = append(errs, err)
continue
@@ -3344,7 +3344,7 @@ func TestTransportNoReuseAfterEarlyResponse(t *testing.T) {
sconn.c = conn
sconn.Unlock()
conn.Write([]byte("HTTP/1.1 200 OK\r\nContent-Length: 3\r\n\r\nfoo")) // keep-alive
- go io.Copy(ioutil.Discard, conn)
+ go io.Copy(io.Discard, conn)
}))
defer ts.Close()
c := ts.Client()
@@ -3593,7 +3593,7 @@ func TestTransportClosesBodyOnError(t *testing.T) {
defer afterTest(t)
readBody := make(chan error, 1)
ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
- _, err := ioutil.ReadAll(r.Body)
+ _, err := io.ReadAll(r.Body)
readBody <- err
}))
defer ts.Close()
@@ -3941,7 +3941,7 @@ func TestTransportResponseCancelRace(t *testing.T) {
// If we do an early close, Transport just throws the connection away and
// doesn't reuse it. In order to trigger the bug, it has to reuse the connection
// so read the body
- if _, err := io.Copy(ioutil.Discard, res.Body); err != nil {
+ if _, err := io.Copy(io.Discard, res.Body); err != nil {
t.Fatal(err)
}
@@ -3978,7 +3978,7 @@ func TestTransportContentEncodingCaseInsensitive(t *testing.T) {
t.Fatal(err)
}
- body, err := ioutil.ReadAll(res.Body)
+ body, err := io.ReadAll(res.Body)
res.Body.Close()
if err != nil {
t.Fatal(err)
@@ -4085,7 +4085,7 @@ func TestTransportFlushesBodyChunks(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- io.Copy(ioutil.Discard, req.Body)
+ io.Copy(io.Discard, req.Body)
// Unblock the transport's roundTrip goroutine.
resBody <- strings.NewReader("HTTP/1.1 204 No Content\r\nConnection: close\r\n\r\n")
@@ -4466,7 +4466,7 @@ func testTransportEventTrace(t *testing.T, h2 bool, noHooks bool) {
// Do nothing for the second request.
return
}
- if _, err := ioutil.ReadAll(r.Body); err != nil {
+ if _, err := io.ReadAll(r.Body); err != nil {
t.Error(err)
}
if !noHooks {
@@ -4554,7 +4554,7 @@ func testTransportEventTrace(t *testing.T, h2 bool, noHooks bool) {
t.Fatal(err)
}
logf("got roundtrip.response")
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -5236,7 +5236,7 @@ func wantBody(res *Response, err error, want string) error {
if err != nil {
return err
}
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
return fmt.Errorf("error reading body: %v", err)
}
@@ -5335,7 +5335,7 @@ func TestMissingStatusNoPanic(t *testing.T) {
conn, _ := ln.Accept()
if conn != nil {
io.WriteString(conn, raw)
- ioutil.ReadAll(conn)
+ io.ReadAll(conn)
conn.Close()
}
}()
@@ -5353,7 +5353,7 @@ func TestMissingStatusNoPanic(t *testing.T) {
t.Error("panicked, expecting an error")
}
if res != nil && res.Body != nil {
- io.Copy(ioutil.Discard, res.Body)
+ io.Copy(io.Discard, res.Body)
res.Body.Close()
}
@@ -5539,7 +5539,7 @@ func TestClientTimeoutKillsConn_AfterHeaders(t *testing.T) {
}
close(cancel)
- got, err := ioutil.ReadAll(res.Body)
+ got, err := io.ReadAll(res.Body)
if err == nil {
t.Fatalf("unexpected success; read %q, nil", got)
}
@@ -5678,7 +5678,7 @@ func TestTransportCONNECTBidi(t *testing.T) {
}
func TestTransportRequestReplayable(t *testing.T) {
- someBody := ioutil.NopCloser(strings.NewReader(""))
+ someBody := io.NopCloser(strings.NewReader(""))
tests := []struct {
name string
req *Request
@@ -5839,7 +5839,7 @@ func TestTransportRequestWriteRoundTrip(t *testing.T) {
t,
h1Mode,
HandlerFunc(func(w ResponseWriter, r *Request) {
- io.Copy(ioutil.Discard, r.Body)
+ io.Copy(io.Discard, r.Body)
r.Body.Close()
w.WriteHeader(200)
}),
@@ -5975,7 +5975,7 @@ func TestTransportIgnores408(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- slurp, err := ioutil.ReadAll(res.Body)
+ slurp, err := io.ReadAll(res.Body)
if err != nil {
t.Fatal(err)
}
@@ -6237,7 +6237,7 @@ func TestTransportDecrementConnWhenIdleConnRemoved(t *testing.T) {
return
}
defer resp.Body.Close()
- _, err = ioutil.ReadAll(resp.Body)
+ _, err = io.ReadAll(resp.Body)
if err != nil {
errCh <- fmt.Errorf("read body failed: %v", err)
}
@@ -6299,7 +6299,7 @@ func (f roundTripFunc) RoundTrip(r *Request) (*Response, error) { return f(r) }
func TestIssue32441(t *testing.T) {
defer afterTest(t)
ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
- if n, _ := io.Copy(ioutil.Discard, r.Body); n == 0 {
+ if n, _ := io.Copy(io.Discard, r.Body); n == 0 {
t.Error("body length is zero")
}
}))
@@ -6307,7 +6307,7 @@ func TestIssue32441(t *testing.T) {
c := ts.Client()
c.Transport.(*Transport).RegisterProtocol("http", roundTripFunc(func(r *Request) (*Response, error) {
// Draining body to trigger failure condition on actual request to server.
- if n, _ := io.Copy(ioutil.Discard, r.Body); n == 0 {
+ if n, _ := io.Copy(io.Discard, r.Body); n == 0 {
t.Error("body length is zero during round trip")
}
return nil, ErrSkipAltProtocol
@@ -6389,7 +6389,7 @@ func testTransportRace(req *Request) {
if err == nil {
// Ensure all the body is read; otherwise
// we'll get a partial dump.
- io.Copy(ioutil.Discard, req.Body)
+ io.Copy(io.Discard, req.Body)
req.Body.Close()
}
select {
diff --git a/src/net/mail/example_test.go b/src/net/mail/example_test.go
index c3365642aa..d325dc791f 100644
--- a/src/net/mail/example_test.go
+++ b/src/net/mail/example_test.go
@@ -6,7 +6,7 @@ package mail_test
import (
"fmt"
- "io/ioutil"
+ "io"
"log"
"net/mail"
"strings"
@@ -62,7 +62,7 @@ Message body
fmt.Println("To:", header.Get("To"))
fmt.Println("Subject:", header.Get("Subject"))
- body, err := ioutil.ReadAll(m.Body)
+ body, err := io.ReadAll(m.Body)
if err != nil {
log.Fatal(err)
}
diff --git a/src/net/mail/message_test.go b/src/net/mail/message_test.go
index 67e3643aeb..188d0bf766 100644
--- a/src/net/mail/message_test.go
+++ b/src/net/mail/message_test.go
@@ -7,7 +7,6 @@ package mail
import (
"bytes"
"io"
- "io/ioutil"
"mime"
"reflect"
"strings"
@@ -53,7 +52,7 @@ func TestParsing(t *testing.T) {
t.Errorf("test #%d: Incorrectly parsed message header.\nGot:\n%+v\nWant:\n%+v",
i, msg.Header, test.header)
}
- body, err := ioutil.ReadAll(msg.Body)
+ body, err := io.ReadAll(msg.Body)
if err != nil {
t.Errorf("test #%d: Failed reading body: %v", i, err)
continue
@@ -842,7 +841,7 @@ func TestAddressParser(t *testing.T) {
ap := AddressParser{WordDecoder: &mime.WordDecoder{
CharsetReader: func(charset string, input io.Reader) (io.Reader, error) {
- in, err := ioutil.ReadAll(input)
+ in, err := io.ReadAll(input)
if err != nil {
return nil, err
}
diff --git a/src/net/rpc/jsonrpc/all_test.go b/src/net/rpc/jsonrpc/all_test.go
index 4e73edc70b..667f839f58 100644
--- a/src/net/rpc/jsonrpc/all_test.go
+++ b/src/net/rpc/jsonrpc/all_test.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"net"
"net/rpc"
"reflect"
@@ -249,7 +248,7 @@ func TestMalformedInput(t *testing.T) {
func TestMalformedOutput(t *testing.T) {
cli, srv := net.Pipe()
go srv.Write([]byte(`{"id":0,"result":null,"error":null}`))
- go ioutil.ReadAll(srv)
+ go io.ReadAll(srv)
client := NewClient(cli)
defer client.Close()
@@ -271,7 +270,7 @@ func TestServerErrorHasNullResult(t *testing.T) {
}{
Reader: strings.NewReader(`{"method": "Arith.Add", "id": "123", "params": []}`),
Writer: &out,
- Closer: ioutil.NopCloser(nil),
+ Closer: io.NopCloser(nil),
})
r := new(rpc.Request)
if err := sc.ReadRequestHeader(r); err != nil {
diff --git a/src/net/sendfile_test.go b/src/net/sendfile_test.go
index 13842a1261..657a36599f 100644
--- a/src/net/sendfile_test.go
+++ b/src/net/sendfile_test.go
@@ -12,7 +12,6 @@ import (
"encoding/hex"
"fmt"
"io"
- "io/ioutil"
"os"
"runtime"
"sync"
@@ -282,7 +281,7 @@ func TestSendfilePipe(t *testing.T) {
return
}
defer conn.Close()
- io.Copy(ioutil.Discard, conn)
+ io.Copy(io.Discard, conn)
}()
// Wait for the byte to be copied, meaning that sendfile has
diff --git a/src/net/splice_test.go b/src/net/splice_test.go
index 0ba2f164c2..8a0cda6564 100644
--- a/src/net/splice_test.go
+++ b/src/net/splice_test.go
@@ -8,7 +8,6 @@ package net
import (
"io"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -202,7 +201,7 @@ func testSpliceIssue25985(t *testing.T, upNet, downNet string) {
}
defer fromProxy.Close()
- _, err = ioutil.ReadAll(fromProxy)
+ _, err = io.ReadAll(fromProxy)
if err != nil {
t.Fatal(err)
}
diff --git a/src/net/textproto/reader.go b/src/net/textproto/reader.go
index a00fd2395f..5c3084f8a7 100644
--- a/src/net/textproto/reader.go
+++ b/src/net/textproto/reader.go
@@ -9,7 +9,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"strconv"
"strings"
"sync"
@@ -426,7 +425,7 @@ func (r *Reader) closeDot() {
//
// See the documentation for the DotReader method for details about dot-encoding.
func (r *Reader) ReadDotBytes() ([]byte, error) {
- return ioutil.ReadAll(r.DotReader())
+ return io.ReadAll(r.DotReader())
}
// ReadDotLines reads a dot-encoding and returns a slice
diff --git a/src/net/timeout_test.go b/src/net/timeout_test.go
index ad14cd79ac..205aaa430b 100644
--- a/src/net/timeout_test.go
+++ b/src/net/timeout_test.go
@@ -11,7 +11,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"net/internal/socktest"
"os"
"runtime"
@@ -874,7 +873,7 @@ func testVariousDeadlines(t *testing.T) {
if err := c.SetDeadline(t0.Add(timeout)); err != nil {
t.Error(err)
}
- n, err := io.Copy(ioutil.Discard, c)
+ n, err := io.Copy(io.Discard, c)
dt := time.Since(t0)
c.Close()
ch <- result{n, err, dt}
diff --git a/src/net/writev_test.go b/src/net/writev_test.go
index a6b3285e57..d603b7f70a 100644
--- a/src/net/writev_test.go
+++ b/src/net/writev_test.go
@@ -11,7 +11,6 @@ import (
"fmt"
"internal/poll"
"io"
- "io/ioutil"
"reflect"
"runtime"
"sync"
@@ -28,7 +27,7 @@ func TestBuffers_read(t *testing.T) {
[]byte("in "),
[]byte("Gopherland ... "),
}
- got, err := ioutil.ReadAll(&buffers)
+ got, err := io.ReadAll(&buffers)
if err != nil {
t.Fatal(err)
}
@@ -141,7 +140,7 @@ func testBuffer_writeTo(t *testing.T, chunks int, useCopy bool) {
}
return nil
}, func(c *TCPConn) error {
- all, err := ioutil.ReadAll(c)
+ all, err := io.ReadAll(c)
if !bytes.Equal(all, want.Bytes()) || err != nil {
return fmt.Errorf("client read %q, %v; want %q, nil", all, err, want.Bytes())
}
diff --git a/src/os/exec/example_test.go b/src/os/exec/example_test.go
index 62866fa710..a66890be69 100644
--- a/src/os/exec/example_test.go
+++ b/src/os/exec/example_test.go
@@ -10,7 +10,6 @@ import (
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -128,7 +127,7 @@ func ExampleCmd_StderrPipe() {
log.Fatal(err)
}
- slurp, _ := ioutil.ReadAll(stderr)
+ slurp, _ := io.ReadAll(stderr)
fmt.Printf("%s\n", slurp)
if err := cmd.Wait(); err != nil {
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
index 9746722980..cd3d759ebc 100644
--- a/src/os/exec/exec_test.go
+++ b/src/os/exec/exec_test.go
@@ -637,7 +637,7 @@ func TestExtraFiles(t *testing.T) {
// cgo), to make sure none of that potential C code leaks fds.
ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
// quiet expected TLS handshake error "remote error: bad certificate"
- ts.Config.ErrorLog = log.New(ioutil.Discard, "", 0)
+ ts.Config.ErrorLog = log.New(io.Discard, "", 0)
ts.StartTLS()
defer ts.Close()
_, err = http.Get(ts.URL)
@@ -830,7 +830,7 @@ func TestHelperProcess(*testing.T) {
}
}
case "stdinClose":
- b, err := ioutil.ReadAll(os.Stdin)
+ b, err := io.ReadAll(os.Stdin)
if err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
diff --git a/src/os/exec/read3.go b/src/os/exec/read3.go
index 25d732a991..8852023e77 100644
--- a/src/os/exec/read3.go
+++ b/src/os/exec/read3.go
@@ -15,7 +15,7 @@ package main
import (
"fmt"
"internal/poll"
- "io/ioutil"
+ "io"
"os"
"os/exec"
"runtime"
@@ -24,7 +24,7 @@ import (
func main() {
fd3 := os.NewFile(3, "fd3")
- bs, err := ioutil.ReadAll(fd3)
+ bs, err := io.ReadAll(fd3)
if err != nil {
fmt.Printf("ReadAll from fd 3: %v\n", err)
os.Exit(1)
diff --git a/src/os/timeout_test.go b/src/os/timeout_test.go
index 99b94c2e4c..d848e41642 100644
--- a/src/os/timeout_test.go
+++ b/src/os/timeout_test.go
@@ -429,7 +429,7 @@ func testVariousDeadlines(t *testing.T) {
if err := r.SetDeadline(t0.Add(timeout)); err != nil {
t.Error(err)
}
- n, err := io.Copy(ioutil.Discard, r)
+ n, err := io.Copy(io.Discard, r)
dt := time.Since(t0)
r.Close()
actvch <- result{n, err, dt}
@@ -565,7 +565,7 @@ func TestRacyWrite(t *testing.T) {
var wg sync.WaitGroup
defer wg.Wait()
- go io.Copy(ioutil.Discard, r)
+ go io.Copy(io.Discard, r)
w.SetWriteDeadline(time.Now().Add(time.Millisecond))
for i := 0; i < 10; i++ {
diff --git a/src/runtime/crash_unix_test.go b/src/runtime/crash_unix_test.go
index 8ef52aba48..fc87f37408 100644
--- a/src/runtime/crash_unix_test.go
+++ b/src/runtime/crash_unix_test.go
@@ -241,7 +241,7 @@ func TestPanicSystemstack(t *testing.T) {
}
// Get traceback.
- tb, err := ioutil.ReadAll(pr)
+ tb, err := io.ReadAll(pr)
if err != nil {
t.Fatal("reading traceback from pipe: ", err)
}
diff --git a/src/runtime/testdata/testprogcgo/eintr.go b/src/runtime/testdata/testprogcgo/eintr.go
index 791ff1bedc..1722a75eb9 100644
--- a/src/runtime/testdata/testprogcgo/eintr.go
+++ b/src/runtime/testdata/testprogcgo/eintr.go
@@ -32,7 +32,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"log"
"net"
"os"
@@ -242,5 +241,5 @@ func testExec(wg *sync.WaitGroup) {
// Block blocks until stdin is closed.
func Block() {
- io.Copy(ioutil.Discard, os.Stdin)
+ io.Copy(io.Discard, os.Stdin)
}
diff --git a/src/strings/reader_test.go b/src/strings/reader_test.go
index a4c211d699..5adea6f7ab 100644
--- a/src/strings/reader_test.go
+++ b/src/strings/reader_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"strings"
"sync"
"testing"
@@ -162,7 +161,7 @@ func TestWriteTo(t *testing.T) {
// tests that Len is affected by reads, but Size is not.
func TestReaderLenSize(t *testing.T) {
r := strings.NewReader("abc")
- io.CopyN(ioutil.Discard, r, 1)
+ io.CopyN(io.Discard, r, 1)
if r.Len() != 2 {
t.Errorf("Len = %d; want 2", r.Len())
}
@@ -182,7 +181,7 @@ func TestReaderReset(t *testing.T) {
if err := r.UnreadRune(); err == nil {
t.Errorf("UnreadRune: expected error, got nil")
}
- buf, err := ioutil.ReadAll(r)
+ buf, err := io.ReadAll(r)
if err != nil {
t.Errorf("ReadAll: unexpected error: %v", err)
}
@@ -228,7 +227,7 @@ func TestReaderZero(t *testing.T) {
t.Errorf("UnreadRune: got nil, want error")
}
- if n, err := (&strings.Reader{}).WriteTo(ioutil.Discard); n != 0 || err != nil {
+ if n, err := (&strings.Reader{}).WriteTo(io.Discard); n != 0 || err != nil {
t.Errorf("WriteTo: got %d, %v; want 0, nil", n, err)
}
}
diff --git a/src/syscall/mkpost.go b/src/syscall/mkpost.go
index d5f5c8d6d6..ef89128310 100644
--- a/src/syscall/mkpost.go
+++ b/src/syscall/mkpost.go
@@ -14,7 +14,7 @@ package main
import (
"fmt"
"go/format"
- "io/ioutil"
+ "io"
"log"
"os"
"regexp"
@@ -22,7 +22,7 @@ import (
)
func main() {
- b, err := ioutil.ReadAll(os.Stdin)
+ b, err := io.ReadAll(os.Stdin)
if err != nil {
log.Fatal(err)
}
diff --git a/src/syscall/syscall_unix_test.go b/src/syscall/syscall_unix_test.go
index d754c075f1..1c34ed2c27 100644
--- a/src/syscall/syscall_unix_test.go
+++ b/src/syscall/syscall_unix_test.go
@@ -225,7 +225,7 @@ func TestPassFD(t *testing.T) {
f := os.NewFile(uintptr(gotFds[0]), "fd-from-child")
defer f.Close()
- got, err := ioutil.ReadAll(f)
+ got, err := io.ReadAll(f)
want := "Hello from child process!\n"
if string(got) != want {
t.Errorf("child process ReadAll: %q, %v; want %q", got, err, want)
diff --git a/src/testing/iotest/reader.go b/src/testing/iotest/reader.go
index 33b782dcb6..770d87f26b 100644
--- a/src/testing/iotest/reader.go
+++ b/src/testing/iotest/reader.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
)
// OneByteReader returns a Reader that implements
@@ -142,7 +141,7 @@ func TestReader(r io.Reader, content []byte) error {
}
}
- data, err := ioutil.ReadAll(&smallByteReader{r: r})
+ data, err := io.ReadAll(&smallByteReader{r: r})
if err != nil {
return err
}
@@ -181,7 +180,7 @@ func TestReader(r io.Reader, content []byte) error {
}
// Reading forward should return the last part of the file.
- data, err := ioutil.ReadAll(&smallByteReader{r: r})
+ data, err := io.ReadAll(&smallByteReader{r: r})
if err != nil {
return fmt.Errorf("ReadAll from offset %d: %v", middle, err)
}
@@ -198,7 +197,7 @@ func TestReader(r io.Reader, content []byte) error {
}
// Reading forward should return the last part of the file (again).
- data, err = ioutil.ReadAll(&smallByteReader{r: r})
+ data, err = io.ReadAll(&smallByteReader{r: r})
if err != nil {
return fmt.Errorf("ReadAll from offset %d: %v", middle, err)
}
@@ -210,7 +209,7 @@ func TestReader(r io.Reader, content []byte) error {
if off, err := r.Seek(int64(middle/2), 0); off != int64(middle/2) || err != nil {
return fmt.Errorf("Seek(%d, 0) from EOF = %d, %v, want %d, nil", middle/2, off, err, middle/2)
}
- data, err = ioutil.ReadAll(r)
+ data, err = io.ReadAll(r)
if err != nil {
return fmt.Errorf("ReadAll from offset %d: %v", middle/2, err)
}
diff --git a/src/text/tabwriter/tabwriter_test.go b/src/text/tabwriter/tabwriter_test.go
index 6a97d4c427..a51358dbed 100644
--- a/src/text/tabwriter/tabwriter_test.go
+++ b/src/text/tabwriter/tabwriter_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"testing"
. "text/tabwriter"
)
@@ -664,7 +663,7 @@ func BenchmarkTable(b *testing.B) {
b.Run("new", func(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
- w := NewWriter(ioutil.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
+ w := NewWriter(io.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
// Write the line h times.
for j := 0; j < h; j++ {
w.Write(line)
@@ -675,7 +674,7 @@ func BenchmarkTable(b *testing.B) {
b.Run("reuse", func(b *testing.B) {
b.ReportAllocs()
- w := NewWriter(ioutil.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
+ w := NewWriter(io.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
for i := 0; i < b.N; i++ {
// Write the line h times.
for j := 0; j < h; j++ {
@@ -696,7 +695,7 @@ func BenchmarkPyramid(b *testing.B) {
b.Run(fmt.Sprintf("%d", x), func(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
- w := NewWriter(ioutil.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
+ w := NewWriter(io.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
// Write increasing prefixes of that line.
for j := 0; j < x; j++ {
w.Write(line[:j*2])
@@ -718,7 +717,7 @@ func BenchmarkRagged(b *testing.B) {
b.Run(fmt.Sprintf("%d", h), func(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
- w := NewWriter(ioutil.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
+ w := NewWriter(io.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
// Write the lines in turn h times.
for j := 0; j < h; j++ {
w.Write(lines[j%len(lines)])
@@ -746,7 +745,7 @@ lines
func BenchmarkCode(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
- w := NewWriter(ioutil.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
+ w := NewWriter(io.Discard, 4, 4, 1, ' ', 0) // no particular reason for these settings
// The code is small, so it's reasonable for the tabwriter user
// to write it all at once, or buffer the writes.
w.Write([]byte(codeSnippet))
diff --git a/src/text/template/exec_test.go b/src/text/template/exec_test.go
index 3309b33e3e..1611ee054f 100644
--- a/src/text/template/exec_test.go
+++ b/src/text/template/exec_test.go
@@ -9,7 +9,7 @@ import (
"errors"
"flag"
"fmt"
- "io/ioutil"
+ "io"
"reflect"
"strings"
"testing"
@@ -1328,7 +1328,7 @@ func TestExecuteGivesExecError(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- err = tmpl.Execute(ioutil.Discard, 0)
+ err = tmpl.Execute(io.Discard, 0)
if err == nil {
t.Fatal("expected error; got none")
}
@@ -1474,7 +1474,7 @@ func TestEvalFieldErrors(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
tmpl := Must(New("tmpl").Parse(tc.src))
- err := tmpl.Execute(ioutil.Discard, tc.value)
+ err := tmpl.Execute(io.Discard, tc.value)
got := ""
if err != nil {
got = err.Error()
@@ -1491,7 +1491,7 @@ func TestMaxExecDepth(t *testing.T) {
t.Skip("skipping in -short mode")
}
tmpl := Must(New("tmpl").Parse(`{{template "tmpl" .}}`))
- err := tmpl.Execute(ioutil.Discard, nil)
+ err := tmpl.Execute(io.Discard, nil)
got := ""
if err != nil {
got = err.Error()
diff --git a/src/time/genzabbrs.go b/src/time/genzabbrs.go
index 38397f91b7..1d59ba73ce 100644
--- a/src/time/genzabbrs.go
+++ b/src/time/genzabbrs.go
@@ -17,6 +17,7 @@ import (
"encoding/xml"
"flag"
"go/format"
+ "io"
"io/ioutil"
"log"
"net/http"
@@ -71,7 +72,7 @@ func readWindowsZones() ([]*zone, error) {
}
defer r.Body.Close()
- data, err := ioutil.ReadAll(r.Body)
+ data, err := io.ReadAll(r.Body)
if err != nil {
return nil, err
}
--
cgit v1.3
From a36493eb3c7f8c990f5112f70e66270372a5b12e Mon Sep 17 00:00:00 2001
From: Thom Wiggers
Date: Tue, 29 Sep 2020 09:34:08 +0000
Subject: crypto/tls: add no-shared to openssl build instructions
This prevents the custom-built version of openssl prefering the system
libraries over the ones compiled with the specified (weak crypto)
options necessary to generate the updates. This difference can lead to
confusing failures when updating the tests.
Fixes #31809
Change-Id: I2dd257f3121d6c6c62c6aeba52e1c74046b3c584
GitHub-Last-Rev: 6d4eeafadf0b4671b7e17c6810f1a66a9fda7d3c
GitHub-Pull-Request: golang/go#41630
Reviewed-on: https://go-review.googlesource.com/c/go/+/257517
Trust: Emmanuel Odeke
Reviewed-by: Filippo Valsorda
---
src/crypto/tls/handshake_test.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/handshake_test.go b/src/crypto/tls/handshake_test.go
index 224edcd5c7..605be587b5 100644
--- a/src/crypto/tls/handshake_test.go
+++ b/src/crypto/tls/handshake_test.go
@@ -86,7 +86,7 @@ func checkOpenSSLVersion() error {
println("to update the test data.")
println("")
println("Configure it with:")
- println("./Configure enable-weak-ssl-ciphers")
+ println("./Configure enable-weak-ssl-ciphers no-shared")
println("and then add the apps/ directory at the front of your PATH.")
println("***********************************************")
--
cgit v1.3
From 5d3666e1a48d0976718c75dddc2ef0232be835d8 Mon Sep 17 00:00:00 2001
From: Roland Shoemaker
Date: Wed, 21 Oct 2020 10:59:22 -0700
Subject: crypto/tls: document the ClientAuthType consts
Fixes #34023
Change-Id: Ib7552a8873a79a91e8d971f906c6d7283da7a80c
Reviewed-on: https://go-review.googlesource.com/c/go/+/264027
Trust: Roland Shoemaker
Reviewed-by: Katie Hockman
---
src/crypto/tls/common.go | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go
index e4f18bf5eb..66d2c005a7 100644
--- a/src/crypto/tls/common.go
+++ b/src/crypto/tls/common.go
@@ -294,10 +294,26 @@ func (cs *ConnectionState) ExportKeyingMaterial(label string, context []byte, le
type ClientAuthType int
const (
+ // NoClientCert indicates that no client certificate should be requested
+ // during the handshake, and if any certificates are sent they will not
+ // be verified.
NoClientCert ClientAuthType = iota
+ // RequestClientCert indicates that a client certificate should be requested
+ // during the handshake, but does not require that the client send any
+ // certificates.
RequestClientCert
+ // RequireAnyClientCert indicates that a client certificate should be requested
+ // during the handshake, and that at least one certificate is required to be
+ // sent by the client, but that certificate is not required to be valid.
RequireAnyClientCert
+ // VerifyClientCertIfGiven indicates that a client certificate should be requested
+ // during the handshake, but does not require that the client sends a
+ // certificate. If the client does send a certificate it is required to be
+ // valid.
VerifyClientCertIfGiven
+ // RequireAndVerifyClientCert indicates that a client certificate should be requested
+ // during the handshake, and that at least one valid certificate is required
+ // to be sent by the client.
RequireAndVerifyClientCert
)
--
cgit v1.3
From c9b9cd73bb7a7828d34f4a7844f16c3fbc0674dd Mon Sep 17 00:00:00 2001
From: Katie Hockman
Date: Wed, 28 Oct 2020 15:13:33 -0400
Subject: crypto/tls: set Deadline before sending close notify alert
This change also documents the need to set a Deadline before
calling Read or Write.
Fixes #31224
Change-Id: I89d6fe3ecb0a0076b4c61765f61c88056f951406
Reviewed-on: https://go-review.googlesource.com/c/go/+/266037
Trust: Katie Hockman
Run-TryBot: Katie Hockman
TryBot-Result: Go Bot
Reviewed-by: Filippo Valsorda
---
doc/go1.16.html | 10 ++++++++--
src/crypto/tls/conn.go | 22 ++++++++++++++++++----
2 files changed, 26 insertions(+), 6 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/doc/go1.16.html b/doc/go1.16.html
index 99e8e3c980..a97c369885 100644
--- a/doc/go1.16.html
+++ b/doc/go1.16.html
@@ -237,12 +237,18 @@ Do not send CLs removing the interior tags from such phrases.
I/O operations on closing or closed TLS connections can now be detected using
- the new ErrClosed error. A typical use
- would be errors.Is(err, net.ErrClosed). In earlier releases
+ the new ErrClosed error. A typical use
+ would be errors.Is(err, net.ErrClosed). In earlier releases
the only way to reliably detect this case was to match the string returned
by the Error method with "tls: use of closed connection".
+
+ A default deadline is set in Close
+ before sending the close notify alert, in order to prevent blocking
+ indefinitely.
+
+
diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go
index f1d4cb926c..ada19d6e7a 100644
--- a/src/crypto/tls/conn.go
+++ b/src/crypto/tls/conn.go
@@ -1074,6 +1074,11 @@ var (
)
// Write writes data to the connection.
+//
+// As Write calls Handshake, in order to prevent indefinite blocking a deadline
+// must be set for both Read and Write before Write is called when the handshake
+// has not yet completed. See SetDeadline, SetReadDeadline, and
+// SetWriteDeadline.
func (c *Conn) Write(b []byte) (int, error) {
// interlock with Close below
for {
@@ -1232,8 +1237,12 @@ func (c *Conn) handleKeyUpdate(keyUpdate *keyUpdateMsg) error {
return nil
}
-// Read can be made to time out and return a net.Error with Timeout() == true
-// after a fixed time limit; see SetDeadline and SetReadDeadline.
+// Read reads data from the connection.
+//
+// As Read calls Handshake, in order to prevent indefinite blocking a deadline
+// must be set for both Read and Write before Read is called when the handshake
+// has not yet completed. See SetDeadline, SetReadDeadline, and
+// SetWriteDeadline.
func (c *Conn) Read(b []byte) (int, error) {
if err := c.Handshake(); err != nil {
return 0, err
@@ -1301,9 +1310,10 @@ func (c *Conn) Close() error {
}
var alertErr error
-
if c.handshakeComplete() {
- alertErr = c.closeNotify()
+ if err := c.closeNotify(); err != nil {
+ alertErr = fmt.Errorf("tls: failed to send closeNotify alert (but connection was closed anyway): %w", err)
+ }
}
if err := c.conn.Close(); err != nil {
@@ -1330,8 +1340,12 @@ func (c *Conn) closeNotify() error {
defer c.out.Unlock()
if !c.closeNotifySent {
+ // Set a Write Deadline to prevent possibly blocking forever.
+ c.SetWriteDeadline(time.Now().Add(time.Second * 5))
c.closeNotifyErr = c.sendAlertLocked(alertCloseNotify)
c.closeNotifySent = true
+ // Any subsequent writes will fail.
+ c.SetWriteDeadline(time.Now())
}
return c.closeNotifyErr
}
--
cgit v1.3
From 22312437ee1e72451c70b79c90e36ad0b849e3f6 Mon Sep 17 00:00:00 2001
From: cch123
Date: Mon, 19 Oct 2020 12:55:46 +0000
Subject: crypto/tls: pool Conn's outBuf to reduce memory cost of idle
connections
Derived from CL 263277, which includes benchmarks.
Fixes #42035
Co-authored-by: Filippo Valsorda
Change-Id: I5f28673f95d4568b7d13dbc20e9d4b48d481a93d
Reviewed-on: https://go-review.googlesource.com/c/go/+/267957
Run-TryBot: Dmitri Shuralyov
TryBot-Result: Go Bot
Trust: Filippo Valsorda
Trust: Roland Shoemaker
Reviewed-by: Roland Shoemaker
Reviewed-by: Roberto Clapis
---
src/crypto/tls/conn.go | 36 +++++++++++++++++++++++++++---------
1 file changed, 27 insertions(+), 9 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go
index ada19d6e7a..b9a1095862 100644
--- a/src/crypto/tls/conn.go
+++ b/src/crypto/tls/conn.go
@@ -94,7 +94,6 @@ type Conn struct {
rawInput bytes.Buffer // raw input, starting with a record header
input bytes.Reader // application data waiting to be read, from rawInput.Next
hand bytes.Buffer // handshake data waiting to be read
- outBuf []byte // scratch buffer used by out.encrypt
buffering bool // whether records are buffered in sendBuf
sendBuf []byte // a buffer of records waiting to be sent
@@ -928,9 +927,28 @@ func (c *Conn) flush() (int, error) {
return n, err
}
+// outBufPool pools the record-sized scratch buffers used by writeRecordLocked.
+var outBufPool = sync.Pool{
+ New: func() interface{} {
+ return new([]byte)
+ },
+}
+
// writeRecordLocked writes a TLS record with the given type and payload to the
// connection and updates the record layer state.
func (c *Conn) writeRecordLocked(typ recordType, data []byte) (int, error) {
+ outBufPtr := outBufPool.Get().(*[]byte)
+ outBuf := *outBufPtr
+ defer func() {
+ // You might be tempted to simplify this by just passing &outBuf to Put,
+ // but that would make the local copy of the outBuf slice header escape
+ // to the heap, causing an allocation. Instead, we keep around the
+ // pointer to the slice header returned by Get, which is already on the
+ // heap, and overwrite and return that.
+ *outBufPtr = outBuf
+ outBufPool.Put(outBufPtr)
+ }()
+
var n int
for len(data) > 0 {
m := len(data)
@@ -938,8 +956,8 @@ func (c *Conn) writeRecordLocked(typ recordType, data []byte) (int, error) {
m = maxPayload
}
- _, c.outBuf = sliceForAppend(c.outBuf[:0], recordHeaderLen)
- c.outBuf[0] = byte(typ)
+ _, outBuf = sliceForAppend(outBuf[:0], recordHeaderLen)
+ outBuf[0] = byte(typ)
vers := c.vers
if vers == 0 {
// Some TLS servers fail if the record version is
@@ -950,17 +968,17 @@ func (c *Conn) writeRecordLocked(typ recordType, data []byte) (int, error) {
// See RFC 8446, Section 5.1.
vers = VersionTLS12
}
- c.outBuf[1] = byte(vers >> 8)
- c.outBuf[2] = byte(vers)
- c.outBuf[3] = byte(m >> 8)
- c.outBuf[4] = byte(m)
+ outBuf[1] = byte(vers >> 8)
+ outBuf[2] = byte(vers)
+ outBuf[3] = byte(m >> 8)
+ outBuf[4] = byte(m)
var err error
- c.outBuf, err = c.out.encrypt(c.outBuf, data[:m], c.config.rand())
+ outBuf, err = c.out.encrypt(outBuf, data[:m], c.config.rand())
if err != nil {
return n, err
}
- if _, err := c.write(c.outBuf); err != nil {
+ if _, err := c.write(outBuf); err != nil {
return n, err
}
n += m
--
cgit v1.3
From 564ec4867bd867ccf37d149243d016abfa5a857c Mon Sep 17 00:00:00 2001
From: Filippo Valsorda
Date: Fri, 30 Oct 2020 16:12:13 +0100
Subject: crypto/tls: don't use CN in BuildNameToCertificate if SANs are
present
Change-Id: I18d5b9fc392a6a52fbdd240254d6d9db838073a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/266540
Trust: Filippo Valsorda
Run-TryBot: Filippo Valsorda
TryBot-Result: Go Bot
Reviewed-by: Katie Hockman
---
src/crypto/tls/common.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go
index 66d2c005a7..86dc0dd3b2 100644
--- a/src/crypto/tls/common.go
+++ b/src/crypto/tls/common.go
@@ -1263,7 +1263,9 @@ func (c *Config) BuildNameToCertificate() {
if err != nil {
continue
}
- if len(x509Cert.Subject.CommonName) > 0 {
+ // If SANs are *not* present, some clients will consider the certificate
+ // valid for the name in the Common Name.
+ if x509Cert.Subject.CommonName != "" && len(x509Cert.DNSNames) == 0 {
c.NameToCertificate[x509Cert.Subject.CommonName] = cert
}
for _, san := range x509Cert.DNSNames {
--
cgit v1.3
From fdecb5c5b46a3f0b8f299d9069d428c656576dcb Mon Sep 17 00:00:00 2001
From: Johan Brandhorst
Date: Sat, 1 Aug 2020 12:18:31 +0100
Subject: crypto/tls: add HandshakeContext method to Conn
Adds the (*tls.Conn).HandshakeContext method. This allows
us to pass the context provided down the call stack to
eventually reach the tls.ClientHelloInfo and
tls.CertificateRequestInfo structs.
These contexts are exposed to the user as read-only via Context()
methods.
This allows users of (*tls.Config).GetCertificate and
(*tls.Config).GetClientCertificate to use the context for
request scoped parameters and cancellation.
Replace uses of (*tls.Conn).Handshake with (*tls.Conn).HandshakeContext
where appropriate, to propagate existing contexts.
Fixes #32406
Change-Id: I33c228904fe82dcf57683b63627497d3eb841ff2
Reviewed-on: https://go-review.googlesource.com/c/go/+/246338
Run-TryBot: Filippo Valsorda
TryBot-Result: Go Bot
Trust: Roland Shoemaker
Reviewed-by: Filippo Valsorda
---
doc/go1.16.html | 22 ++++++++++++
src/crypto/tls/common.go | 21 +++++++++++
src/crypto/tls/conn.go | 62 +++++++++++++++++++++++++++++---
src/crypto/tls/handshake_client.go | 11 ++++--
src/crypto/tls/handshake_client_test.go | 36 +++++++++++++++++++
src/crypto/tls/handshake_client_tls13.go | 3 ++
src/crypto/tls/handshake_server.go | 17 +++++----
src/crypto/tls/handshake_server_test.go | 50 ++++++++++++++++++++++++--
src/crypto/tls/handshake_server_tls13.go | 4 ++-
src/crypto/tls/tls.go | 55 +++++-----------------------
src/net/http/server.go | 2 +-
src/net/http/transport.go | 10 +++---
src/net/http/transport_test.go | 2 +-
13 files changed, 226 insertions(+), 69 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/doc/go1.16.html b/doc/go1.16.html
index 6c4d076d50..bb920a0cb8 100644
--- a/doc/go1.16.html
+++ b/doc/go1.16.html
@@ -271,6 +271,21 @@ Do not send CLs removing the interior tags from such phrases.
indefinitely.
+
+ (*Conn).HandshakeContext was added to
+ allow the user to control cancellation of an in-progress TLS Handshake.
+ The context provided is propagated into the
+ ClientHelloInfo
+ and CertificateRequestInfo
+ structs and accessible through the new
+ (*ClientHelloInfo).Context
+ and
+
+ (*CertificateRequestInfo).Context
+ methods respectively. Canceling the context after the handshake has finished
+ has no effect.
+
+
@@ -405,6 +420,13 @@ Do not send CLs removing the interior tags from such phrases.
Cookies set with SameSiteDefaultMode now behave according to the current
spec (no attribute is set) instead of generating a SameSite key without a value.
+
+
+ The net/http package now uses the new
+ (*tls.Conn).HandshakeContext
+ with the Request context
+ when performing TLS handshakes in the client or server.
+
diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go
index 86dc0dd3b2..1370d26fe2 100644
--- a/src/crypto/tls/common.go
+++ b/src/crypto/tls/common.go
@@ -7,6 +7,7 @@ package tls
import (
"bytes"
"container/list"
+ "context"
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
@@ -444,6 +445,16 @@ type ClientHelloInfo struct {
// config is embedded by the GetCertificate or GetConfigForClient caller,
// for use with SupportsCertificate.
config *Config
+
+ // ctx is the context of the handshake that is in progress.
+ ctx context.Context
+}
+
+// Context returns the context of the handshake that is in progress.
+// This context is a child of the context passed to HandshakeContext,
+// if any, and is canceled when the handshake concludes.
+func (c *ClientHelloInfo) Context() context.Context {
+ return c.ctx
}
// CertificateRequestInfo contains information from a server's
@@ -462,6 +473,16 @@ type CertificateRequestInfo struct {
// Version is the TLS version that was negotiated for this connection.
Version uint16
+
+ // ctx is the context of the handshake that is in progress.
+ ctx context.Context
+}
+
+// Context returns the context of the handshake that is in progress.
+// This context is a child of the context passed to HandshakeContext,
+// if any, and is canceled when the handshake concludes.
+func (c *CertificateRequestInfo) Context() context.Context {
+ return c.ctx
}
// RenegotiationSupport enumerates the different levels of support for TLS
diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go
index b9a1095862..2f5d4303c2 100644
--- a/src/crypto/tls/conn.go
+++ b/src/crypto/tls/conn.go
@@ -8,6 +8,7 @@ package tls
import (
"bytes"
+ "context"
"crypto/cipher"
"crypto/subtle"
"crypto/x509"
@@ -26,7 +27,7 @@ type Conn struct {
// constant
conn net.Conn
isClient bool
- handshakeFn func() error // (*Conn).clientHandshake or serverHandshake
+ handshakeFn func(context.Context) error // (*Conn).clientHandshake or serverHandshake
// handshakeStatus is 1 if the connection is currently transferring
// application data (i.e. is not currently processing a handshake).
@@ -1192,7 +1193,7 @@ func (c *Conn) handleRenegotiation() error {
defer c.handshakeMutex.Unlock()
atomic.StoreUint32(&c.handshakeStatus, 0)
- if c.handshakeErr = c.clientHandshake(); c.handshakeErr == nil {
+ if c.handshakeErr = c.clientHandshake(context.Background()); c.handshakeErr == nil {
c.handshakes++
}
return c.handshakeErr
@@ -1375,8 +1376,61 @@ func (c *Conn) closeNotify() error {
// first Read or Write will call it automatically.
//
// For control over canceling or setting a timeout on a handshake, use
-// the Dialer's DialContext method.
+// HandshakeContext or the Dialer's DialContext method instead.
func (c *Conn) Handshake() error {
+ return c.HandshakeContext(context.Background())
+}
+
+// HandshakeContext runs the client or server handshake
+// protocol if it has not yet been run.
+//
+// The provided Context must be non-nil. If the context is canceled before
+// the handshake is complete, the handshake is interrupted and an error is returned.
+// Once the handshake has completed, cancellation of the context will not affect the
+// connection.
+//
+// Most uses of this package need not call HandshakeContext explicitly: the
+// first Read or Write will call it automatically.
+func (c *Conn) HandshakeContext(ctx context.Context) error {
+ // Delegate to unexported method for named return
+ // without confusing documented signature.
+ return c.handshakeContext(ctx)
+}
+
+func (c *Conn) handshakeContext(ctx context.Context) (ret error) {
+ handshakeCtx, cancel := context.WithCancel(ctx)
+ // Note: defer this before starting the "interrupter" goroutine
+ // so that we can tell the difference between the input being canceled and
+ // this cancellation. In the former case, we need to close the connection.
+ defer cancel()
+
+ // Start the "interrupter" goroutine, if this context might be canceled.
+ // (The background context cannot).
+ //
+ // The interrupter goroutine waits for the input context to be done and
+ // closes the connection if this happens before the function returns.
+ if ctx.Done() != nil {
+ done := make(chan struct{})
+ interruptRes := make(chan error, 1)
+ defer func() {
+ close(done)
+ if ctxErr := <-interruptRes; ctxErr != nil {
+ // Return context error to user.
+ ret = ctxErr
+ }
+ }()
+ go func() {
+ select {
+ case <-handshakeCtx.Done():
+ // Close the connection, discarding the error
+ _ = c.conn.Close()
+ interruptRes <- handshakeCtx.Err()
+ case <-done:
+ interruptRes <- nil
+ }
+ }()
+ }
+
c.handshakeMutex.Lock()
defer c.handshakeMutex.Unlock()
@@ -1390,7 +1444,7 @@ func (c *Conn) Handshake() error {
c.in.Lock()
defer c.in.Unlock()
- c.handshakeErr = c.handshakeFn()
+ c.handshakeErr = c.handshakeFn(handshakeCtx)
if c.handshakeErr == nil {
c.handshakes++
} else {
diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go
index 46b0a770d5..d09a8c8ccf 100644
--- a/src/crypto/tls/handshake_client.go
+++ b/src/crypto/tls/handshake_client.go
@@ -6,6 +6,7 @@ package tls
import (
"bytes"
+ "context"
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
@@ -23,6 +24,7 @@ import (
type clientHandshakeState struct {
c *Conn
+ ctx context.Context
serverHello *serverHelloMsg
hello *clientHelloMsg
suite *cipherSuite
@@ -133,7 +135,7 @@ func (c *Conn) makeClientHello() (*clientHelloMsg, ecdheParameters, error) {
return hello, params, nil
}
-func (c *Conn) clientHandshake() (err error) {
+func (c *Conn) clientHandshake(ctx context.Context) (err error) {
if c.config == nil {
c.config = defaultConfig()
}
@@ -197,6 +199,7 @@ func (c *Conn) clientHandshake() (err error) {
if c.vers == VersionTLS13 {
hs := &clientHandshakeStateTLS13{
c: c,
+ ctx: ctx,
serverHello: serverHello,
hello: hello,
ecdheParams: ecdheParams,
@@ -211,6 +214,7 @@ func (c *Conn) clientHandshake() (err error) {
hs := &clientHandshakeState{
c: c,
+ ctx: ctx,
serverHello: serverHello,
hello: hello,
session: session,
@@ -539,7 +543,7 @@ func (hs *clientHandshakeState) doFullHandshake() error {
certRequested = true
hs.finishedHash.Write(certReq.marshal())
- cri := certificateRequestInfoFromMsg(c.vers, certReq)
+ cri := certificateRequestInfoFromMsg(hs.ctx, c.vers, certReq)
if chainToSend, err = c.getClientCertificate(cri); err != nil {
c.sendAlert(alertInternalError)
return err
@@ -879,10 +883,11 @@ func (c *Conn) verifyServerCertificate(certificates [][]byte) error {
// certificateRequestInfoFromMsg generates a CertificateRequestInfo from a TLS
// <= 1.2 CertificateRequest, making an effort to fill in missing information.
-func certificateRequestInfoFromMsg(vers uint16, certReq *certificateRequestMsg) *CertificateRequestInfo {
+func certificateRequestInfoFromMsg(ctx context.Context, vers uint16, certReq *certificateRequestMsg) *CertificateRequestInfo {
cri := &CertificateRequestInfo{
AcceptableCAs: certReq.certificateAuthorities,
Version: vers,
+ ctx: ctx,
}
var rsaAvail, ecAvail bool
diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go
index 12b0254123..8889e2c8c3 100644
--- a/src/crypto/tls/handshake_client_test.go
+++ b/src/crypto/tls/handshake_client_test.go
@@ -6,6 +6,7 @@ package tls
import (
"bytes"
+ "context"
"crypto/rsa"
"crypto/x509"
"encoding/base64"
@@ -20,6 +21,7 @@ import (
"os/exec"
"path/filepath"
"reflect"
+ "runtime"
"strconv"
"strings"
"testing"
@@ -2511,3 +2513,37 @@ func testResumptionKeepsOCSPAndSCT(t *testing.T, ver uint16) {
serverConfig.Certificates[0].SignedCertificateTimestamps, ccs.SignedCertificateTimestamps)
}
}
+
+func TestClientHandshakeContextCancellation(t *testing.T) {
+ c, s := localPipe(t)
+ serverConfig := testConfig.Clone()
+ serverErr := make(chan error, 1)
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ go func() {
+ defer close(serverErr)
+ defer s.Close()
+ conn := Server(s, serverConfig)
+ _, err := conn.readClientHello(ctx)
+ cancel()
+ serverErr <- err
+ }()
+ cli := Client(c, testConfig)
+ err := cli.HandshakeContext(ctx)
+ if err == nil {
+ t.Fatal("Client handshake did not error when the context was canceled")
+ }
+ if err != context.Canceled {
+ t.Errorf("Unexpected client handshake error: %v", err)
+ }
+ if err := <-serverErr; err != nil {
+ t.Errorf("Unexpected server error: %v", err)
+ }
+ if runtime.GOARCH == "wasm" {
+ t.Skip("conn.Close does not error as expected when called multiple times on WASM")
+ }
+ err = cli.Close()
+ if err == nil {
+ t.Error("Client connection was not closed when the context was canceled")
+ }
+}
diff --git a/src/crypto/tls/handshake_client_tls13.go b/src/crypto/tls/handshake_client_tls13.go
index 9c61105cf7..0e4b380035 100644
--- a/src/crypto/tls/handshake_client_tls13.go
+++ b/src/crypto/tls/handshake_client_tls13.go
@@ -6,6 +6,7 @@ package tls
import (
"bytes"
+ "context"
"crypto"
"crypto/hmac"
"crypto/rsa"
@@ -17,6 +18,7 @@ import (
type clientHandshakeStateTLS13 struct {
c *Conn
+ ctx context.Context
serverHello *serverHelloMsg
hello *clientHelloMsg
ecdheParams ecdheParameters
@@ -549,6 +551,7 @@ func (hs *clientHandshakeStateTLS13) sendClientCertificate() error {
AcceptableCAs: hs.certReq.certificateAuthorities,
SignatureSchemes: hs.certReq.supportedSignatureAlgorithms,
Version: c.vers,
+ ctx: hs.ctx,
})
if err != nil {
return err
diff --git a/src/crypto/tls/handshake_server.go b/src/crypto/tls/handshake_server.go
index 16d3e643f0..1fe026ae0e 100644
--- a/src/crypto/tls/handshake_server.go
+++ b/src/crypto/tls/handshake_server.go
@@ -5,6 +5,7 @@
package tls
import (
+ "context"
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
@@ -22,6 +23,7 @@ import (
// It's discarded once the handshake has completed.
type serverHandshakeState struct {
c *Conn
+ ctx context.Context
clientHello *clientHelloMsg
hello *serverHelloMsg
suite *cipherSuite
@@ -36,8 +38,8 @@ type serverHandshakeState struct {
}
// serverHandshake performs a TLS handshake as a server.
-func (c *Conn) serverHandshake() error {
- clientHello, err := c.readClientHello()
+func (c *Conn) serverHandshake(ctx context.Context) error {
+ clientHello, err := c.readClientHello(ctx)
if err != nil {
return err
}
@@ -45,6 +47,7 @@ func (c *Conn) serverHandshake() error {
if c.vers == VersionTLS13 {
hs := serverHandshakeStateTLS13{
c: c,
+ ctx: ctx,
clientHello: clientHello,
}
return hs.handshake()
@@ -52,6 +55,7 @@ func (c *Conn) serverHandshake() error {
hs := serverHandshakeState{
c: c,
+ ctx: ctx,
clientHello: clientHello,
}
return hs.handshake()
@@ -123,7 +127,7 @@ func (hs *serverHandshakeState) handshake() error {
}
// readClientHello reads a ClientHello message and selects the protocol version.
-func (c *Conn) readClientHello() (*clientHelloMsg, error) {
+func (c *Conn) readClientHello(ctx context.Context) (*clientHelloMsg, error) {
msg, err := c.readHandshake()
if err != nil {
return nil, err
@@ -137,7 +141,7 @@ func (c *Conn) readClientHello() (*clientHelloMsg, error) {
var configForClient *Config
originalConfig := c.config
if c.config.GetConfigForClient != nil {
- chi := clientHelloInfo(c, clientHello)
+ chi := clientHelloInfo(ctx, c, clientHello)
if configForClient, err = c.config.GetConfigForClient(chi); err != nil {
c.sendAlert(alertInternalError)
return nil, err
@@ -219,7 +223,7 @@ func (hs *serverHandshakeState) processClientHello() error {
}
}
- hs.cert, err = c.config.getCertificate(clientHelloInfo(c, hs.clientHello))
+ hs.cert, err = c.config.getCertificate(clientHelloInfo(hs.ctx, c, hs.clientHello))
if err != nil {
if err == errNoCertificates {
c.sendAlert(alertUnrecognizedName)
@@ -813,7 +817,7 @@ func (c *Conn) processCertsFromClient(certificate Certificate) error {
return nil
}
-func clientHelloInfo(c *Conn, clientHello *clientHelloMsg) *ClientHelloInfo {
+func clientHelloInfo(ctx context.Context, c *Conn, clientHello *clientHelloMsg) *ClientHelloInfo {
supportedVersions := clientHello.supportedVersions
if len(clientHello.supportedVersions) == 0 {
supportedVersions = supportedVersionsFromMax(clientHello.vers)
@@ -829,5 +833,6 @@ func clientHelloInfo(c *Conn, clientHello *clientHelloMsg) *ClientHelloInfo {
SupportedVersions: supportedVersions,
Conn: c.conn,
config: c.config,
+ ctx: ctx,
}
}
diff --git a/src/crypto/tls/handshake_server_test.go b/src/crypto/tls/handshake_server_test.go
index a7a5324312..c4416c379a 100644
--- a/src/crypto/tls/handshake_server_test.go
+++ b/src/crypto/tls/handshake_server_test.go
@@ -6,6 +6,7 @@ package tls
import (
"bytes"
+ "context"
"crypto"
"crypto/elliptic"
"crypto/x509"
@@ -17,6 +18,7 @@ import (
"os"
"os/exec"
"path/filepath"
+ "runtime"
"strings"
"testing"
"time"
@@ -36,10 +38,12 @@ func testClientHelloFailure(t *testing.T, serverConfig *Config, m handshakeMessa
cli.writeRecord(recordTypeHandshake, m.marshal())
c.Close()
}()
+ ctx := context.Background()
conn := Server(s, serverConfig)
- ch, err := conn.readClientHello()
+ ch, err := conn.readClientHello(ctx)
hs := serverHandshakeState{
c: conn,
+ ctx: ctx,
clientHello: ch,
}
if err == nil {
@@ -1418,9 +1422,11 @@ func TestSNIGivenOnFailure(t *testing.T) {
c.Close()
}()
conn := Server(s, serverConfig)
- ch, err := conn.readClientHello()
+ ctx := context.Background()
+ ch, err := conn.readClientHello(ctx)
hs := serverHandshakeState{
c: conn,
+ ctx: ctx,
clientHello: ch,
}
if err == nil {
@@ -1673,3 +1679,43 @@ func TestMultipleCertificates(t *testing.T) {
t.Errorf("expected RSA certificate, got %v", got)
}
}
+
+func TestServerHandshakeContextCancellation(t *testing.T) {
+ c, s := localPipe(t)
+ clientConfig := testConfig.Clone()
+ clientErr := make(chan error, 1)
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ go func() {
+ defer close(clientErr)
+ defer c.Close()
+ clientHello := &clientHelloMsg{
+ vers: VersionTLS10,
+ random: make([]byte, 32),
+ cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
+ compressionMethods: []uint8{compressionNone},
+ }
+ cli := Client(c, clientConfig)
+ _, err := cli.writeRecord(recordTypeHandshake, clientHello.marshal())
+ cancel()
+ clientErr <- err
+ }()
+ conn := Server(s, testConfig)
+ err := conn.HandshakeContext(ctx)
+ if err == nil {
+ t.Fatal("Server handshake did not error when the context was canceled")
+ }
+ if err != context.Canceled {
+ t.Errorf("Unexpected server handshake error: %v", err)
+ }
+ if err := <-clientErr; err != nil {
+ t.Errorf("Unexpected client error: %v", err)
+ }
+ if runtime.GOARCH == "wasm" {
+ t.Skip("conn.Close does not error as expected when called multiple times on WASM")
+ }
+ err = conn.Close()
+ if err == nil {
+ t.Error("Server connection was not closed when the context was canceled")
+ }
+}
diff --git a/src/crypto/tls/handshake_server_tls13.go b/src/crypto/tls/handshake_server_tls13.go
index 92d55e0293..25c37b92c5 100644
--- a/src/crypto/tls/handshake_server_tls13.go
+++ b/src/crypto/tls/handshake_server_tls13.go
@@ -6,6 +6,7 @@ package tls
import (
"bytes"
+ "context"
"crypto"
"crypto/hmac"
"crypto/rsa"
@@ -23,6 +24,7 @@ const maxClientPSKIdentities = 5
type serverHandshakeStateTLS13 struct {
c *Conn
+ ctx context.Context
clientHello *clientHelloMsg
hello *serverHelloMsg
sentDummyCCS bool
@@ -361,7 +363,7 @@ func (hs *serverHandshakeStateTLS13) pickCertificate() error {
return c.sendAlert(alertMissingExtension)
}
- certificate, err := c.config.getCertificate(clientHelloInfo(c, hs.clientHello))
+ certificate, err := c.config.getCertificate(clientHelloInfo(hs.ctx, c, hs.clientHello))
if err != nil {
if err == errNoCertificates {
c.sendAlert(alertUnrecognizedName)
diff --git a/src/crypto/tls/tls.go b/src/crypto/tls/tls.go
index 454aa0bbbc..bf577cadea 100644
--- a/src/crypto/tls/tls.go
+++ b/src/crypto/tls/tls.go
@@ -25,7 +25,6 @@ import (
"io/ioutil"
"net"
"strings"
- "time"
)
// Server returns a new TLS server side connection
@@ -116,28 +115,16 @@ func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*
}
func dial(ctx context.Context, netDialer *net.Dialer, network, addr string, config *Config) (*Conn, error) {
- // We want the Timeout and Deadline values from dialer to cover the
- // whole process: TCP connection and TLS handshake. This means that we
- // also need to start our own timers now.
- timeout := netDialer.Timeout
-
- if !netDialer.Deadline.IsZero() {
- deadlineTimeout := time.Until(netDialer.Deadline)
- if timeout == 0 || deadlineTimeout < timeout {
- timeout = deadlineTimeout
- }
+ if netDialer.Timeout != 0 {
+ var cancel context.CancelFunc
+ ctx, cancel = context.WithTimeout(ctx, netDialer.Timeout)
+ defer cancel()
}
- // hsErrCh is non-nil if we might not wait for Handshake to complete.
- var hsErrCh chan error
- if timeout != 0 || ctx.Done() != nil {
- hsErrCh = make(chan error, 2)
- }
- if timeout != 0 {
- timer := time.AfterFunc(timeout, func() {
- hsErrCh <- timeoutError{}
- })
- defer timer.Stop()
+ if !netDialer.Deadline.IsZero() {
+ var cancel context.CancelFunc
+ ctx, cancel = context.WithDeadline(ctx, netDialer.Deadline)
+ defer cancel()
}
rawConn, err := netDialer.DialContext(ctx, network, addr)
@@ -164,34 +151,10 @@ func dial(ctx context.Context, netDialer *net.Dialer, network, addr string, conf
}
conn := Client(rawConn, config)
-
- if hsErrCh == nil {
- err = conn.Handshake()
- } else {
- go func() {
- hsErrCh <- conn.Handshake()
- }()
-
- select {
- case <-ctx.Done():
- err = ctx.Err()
- case err = <-hsErrCh:
- if err != nil {
- // If the error was due to the context
- // closing, prefer the context's error, rather
- // than some random network teardown error.
- if e := ctx.Err(); e != nil {
- err = e
- }
- }
- }
- }
-
- if err != nil {
+ if err := conn.HandshakeContext(ctx); err != nil {
rawConn.Close()
return nil, err
}
-
return conn, nil
}
diff --git a/src/net/http/server.go b/src/net/http/server.go
index 4776d960e5..6c7d281705 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -1831,7 +1831,7 @@ func (c *conn) serve(ctx context.Context) {
if d := c.server.WriteTimeout; d != 0 {
c.rwc.SetWriteDeadline(time.Now().Add(d))
}
- if err := tlsConn.Handshake(); err != nil {
+ if err := tlsConn.HandshakeContext(ctx); err != nil {
// If the handshake failed due to the client not speaking
// TLS, assume they're speaking plaintext HTTP and write a
// 400 response on the TLS conn's underlying net.Conn.
diff --git a/src/net/http/transport.go b/src/net/http/transport.go
index 29d7434f2a..65ba664415 100644
--- a/src/net/http/transport.go
+++ b/src/net/http/transport.go
@@ -1502,7 +1502,7 @@ func (t *Transport) decConnsPerHost(key connectMethodKey) {
// Add TLS to a persistent connection, i.e. negotiate a TLS session. If pconn is already a TLS
// tunnel, this function establishes a nested TLS session inside the encrypted channel.
// The remote endpoint's name may be overridden by TLSClientConfig.ServerName.
-func (pconn *persistConn) addTLS(name string, trace *httptrace.ClientTrace) error {
+func (pconn *persistConn) addTLS(ctx context.Context, name string, trace *httptrace.ClientTrace) error {
// Initiate TLS and check remote host name against certificate.
cfg := cloneTLSConfig(pconn.t.TLSClientConfig)
if cfg.ServerName == "" {
@@ -1524,7 +1524,7 @@ func (pconn *persistConn) addTLS(name string, trace *httptrace.ClientTrace) erro
if trace != nil && trace.TLSHandshakeStart != nil {
trace.TLSHandshakeStart()
}
- err := tlsConn.Handshake()
+ err := tlsConn.HandshakeContext(ctx)
if timer != nil {
timer.Stop()
}
@@ -1580,7 +1580,7 @@ func (t *Transport) dialConn(ctx context.Context, cm connectMethod) (pconn *pers
if trace != nil && trace.TLSHandshakeStart != nil {
trace.TLSHandshakeStart()
}
- if err := tc.Handshake(); err != nil {
+ if err := tc.HandshakeContext(ctx); err != nil {
go pconn.conn.Close()
if trace != nil && trace.TLSHandshakeDone != nil {
trace.TLSHandshakeDone(tls.ConnectionState{}, err)
@@ -1604,7 +1604,7 @@ func (t *Transport) dialConn(ctx context.Context, cm connectMethod) (pconn *pers
if firstTLSHost, _, err = net.SplitHostPort(cm.addr()); err != nil {
return nil, wrapErr(err)
}
- if err = pconn.addTLS(firstTLSHost, trace); err != nil {
+ if err = pconn.addTLS(ctx, firstTLSHost, trace); err != nil {
return nil, wrapErr(err)
}
}
@@ -1718,7 +1718,7 @@ func (t *Transport) dialConn(ctx context.Context, cm connectMethod) (pconn *pers
}
if cm.proxyURL != nil && cm.targetScheme == "https" {
- if err := pconn.addTLS(cm.tlsHost(), trace); err != nil {
+ if err := pconn.addTLS(ctx, cm.tlsHost(), trace); err != nil {
return nil, err
}
}
diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go
index e69133e786..9086507d57 100644
--- a/src/net/http/transport_test.go
+++ b/src/net/http/transport_test.go
@@ -3735,7 +3735,7 @@ func TestTransportDialTLSContext(t *testing.T) {
if err != nil {
return nil, err
}
- return c, c.Handshake()
+ return c, c.HandshakeContext(ctx)
}
req, err := NewRequest("GET", ts.URL, nil)
--
cgit v1.3
From 01cdd365a9c9e934d878553016377dc476c3fa4f Mon Sep 17 00:00:00 2001
From: Filippo Valsorda
Date: Mon, 31 Aug 2020 17:09:57 -0400
Subject: crypto/tls: drop macFunction abstraction
Since we dropped SSLv3, there is only one MAC scheme, and it doesn't
need any state beyond a keyed HMAC, so we can replace the macFunction
with the hash.Hash it wraps.
Pointed out by mtp@.
Change-Id: I5545be0e6ccb34a3055fad7f6cb5f628ff748e9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/251859
Run-TryBot: Filippo Valsorda
TryBot-Result: Go Bot
Reviewed-by: Roland Shoemaker
Trust: Roland Shoemaker
Trust: Filippo Valsorda
---
src/crypto/tls/cipher_suites.go | 51 +++++++++++---------------------------
src/crypto/tls/conn.go | 46 ++++++++++++++++------------------
src/crypto/tls/handshake_client.go | 7 +++---
src/crypto/tls/handshake_server.go | 7 +++---
4 files changed, 45 insertions(+), 66 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/src/crypto/tls/cipher_suites.go b/src/crypto/tls/cipher_suites.go
index ea16ef95bf..9a356758fb 100644
--- a/src/crypto/tls/cipher_suites.go
+++ b/src/crypto/tls/cipher_suites.go
@@ -160,7 +160,7 @@ type cipherSuite struct {
// flags is a bitmask of the suite* values, above.
flags int
cipher func(key, iv []byte, isRead bool) interface{}
- mac func(version uint16, macKey []byte) macFunction
+ mac func(key []byte) hash.Hash
aead func(key, fixedNonce []byte) aead
}
@@ -247,24 +247,15 @@ func cipherAES(key, iv []byte, isRead bool) interface{} {
return cipher.NewCBCEncrypter(block, iv)
}
-// macSHA1 returns a macFunction for the given protocol version.
-func macSHA1(version uint16, key []byte) macFunction {
- return tls10MAC{h: hmac.New(newConstantTimeHash(sha1.New), key)}
+// macSHA1 returns a SHA-1 based constant time MAC.
+func macSHA1(key []byte) hash.Hash {
+ return hmac.New(newConstantTimeHash(sha1.New), key)
}
-// macSHA256 returns a SHA-256 based MAC. These are only supported in TLS 1.2
-// so the given version is ignored.
-func macSHA256(version uint16, key []byte) macFunction {
- return tls10MAC{h: hmac.New(sha256.New, key)}
-}
-
-type macFunction interface {
- // Size returns the length of the MAC.
- Size() int
- // MAC appends the MAC of (seq, header, data) to out. The extra data is fed
- // into the MAC after obtaining the result to normalize timing. The result
- // is only valid until the next invocation of MAC as the buffer is reused.
- MAC(seq, header, data, extra []byte) []byte
+// macSHA256 returns a SHA-256 based MAC. This is only supported in TLS 1.2 and
+// is currently only used in disabled-by-default cipher suites.
+func macSHA256(key []byte) hash.Hash {
+ return hmac.New(sha256.New, key)
}
type aead interface {
@@ -412,26 +403,14 @@ func newConstantTimeHash(h func() hash.Hash) func() hash.Hash {
}
// tls10MAC implements the TLS 1.0 MAC function. RFC 2246, Section 6.2.3.
-type tls10MAC struct {
- h hash.Hash
- buf []byte
-}
-
-func (s tls10MAC) Size() int {
- return s.h.Size()
-}
-
-// MAC is guaranteed to take constant time, as long as
-// len(seq)+len(header)+len(data)+len(extra) is constant. extra is not fed into
-// the MAC, but is only provided to make the timing profile constant.
-func (s tls10MAC) MAC(seq, header, data, extra []byte) []byte {
- s.h.Reset()
- s.h.Write(seq)
- s.h.Write(header)
- s.h.Write(data)
- res := s.h.Sum(s.buf[:0])
+func tls10MAC(h hash.Hash, out, seq, header, data, extra []byte) []byte {
+ h.Reset()
+ h.Write(seq)
+ h.Write(header)
+ h.Write(data)
+ res := h.Sum(out)
if extra != nil {
- s.h.Write(extra)
+ h.Write(extra)
}
return res
}
diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go
index 2f5d4303c2..2788c3c393 100644
--- a/src/crypto/tls/conn.go
+++ b/src/crypto/tls/conn.go
@@ -14,6 +14,7 @@ import (
"crypto/x509"
"errors"
"fmt"
+ "hash"
"io"
"net"
"sync"
@@ -155,15 +156,16 @@ func (c *Conn) SetWriteDeadline(t time.Time) error {
type halfConn struct {
sync.Mutex
- err error // first permanent error
- version uint16 // protocol version
- cipher interface{} // cipher algorithm
- mac macFunction
- seq [8]byte // 64-bit sequence number
- additionalData [13]byte // to avoid allocs; interface method args escape
+ err error // first permanent error
+ version uint16 // protocol version
+ cipher interface{} // cipher algorithm
+ mac hash.Hash
+ seq [8]byte // 64-bit sequence number
+
+ scratchBuf [13]byte // to avoid allocs; interface method args escape
nextCipher interface{} // next encryption state
- nextMac macFunction // next MAC algorithm
+ nextMac hash.Hash // next MAC algorithm
trafficSecret []byte // current TLS 1.3 traffic secret
}
@@ -188,7 +190,7 @@ func (hc *halfConn) setErrorLocked(err error) error {
// prepareCipherSpec sets the encryption and MAC states
// that a subsequent changeCipherSpec will use.
-func (hc *halfConn) prepareCipherSpec(version uint16, cipher interface{}, mac macFunction) {
+func (hc *halfConn) prepareCipherSpec(version uint16, cipher interface{}, mac hash.Hash) {
hc.version = version
hc.nextCipher = cipher
hc.nextMac = mac
@@ -350,15 +352,14 @@ func (hc *halfConn) decrypt(record []byte) ([]byte, recordType, error) {
}
payload = payload[explicitNonceLen:]
- additionalData := hc.additionalData[:]
+ var additionalData []byte
if hc.version == VersionTLS13 {
additionalData = record[:recordHeaderLen]
} else {
- copy(additionalData, hc.seq[:])
- copy(additionalData[8:], record[:3])
+ additionalData = append(hc.scratchBuf[:0], hc.seq[:]...)
+ additionalData = append(additionalData, record[:3]...)
n := len(payload) - c.Overhead()
- additionalData[11] = byte(n >> 8)
- additionalData[12] = byte(n)
+ additionalData = append(additionalData, byte(n>>8), byte(n))
}
var err error
@@ -424,7 +425,7 @@ func (hc *halfConn) decrypt(record []byte) ([]byte, recordType, error) {
record[3] = byte(n >> 8)
record[4] = byte(n)
remoteMAC := payload[n : n+macSize]
- localMAC := hc.mac.MAC(hc.seq[0:], record[:recordHeaderLen], payload[:n], payload[n+macSize:])
+ localMAC := tls10MAC(hc.mac, hc.scratchBuf[:0], hc.seq[:], record[:recordHeaderLen], payload[:n], payload[n+macSize:])
// This is equivalent to checking the MACs and paddingGood
// separately, but in constant-time to prevent distinguishing
@@ -460,7 +461,7 @@ func sliceForAppend(in []byte, n int) (head, tail []byte) {
}
// encrypt encrypts payload, adding the appropriate nonce and/or MAC, and
-// appends it to record, which contains the record header.
+// appends it to record, which must already contain the record header.
func (hc *halfConn) encrypt(record, payload []byte, rand io.Reader) ([]byte, error) {
if hc.cipher == nil {
return append(record, payload...), nil
@@ -477,7 +478,7 @@ func (hc *halfConn) encrypt(record, payload []byte, rand io.Reader) ([]byte, err
// an 8 bytes nonce but its nonces must be unpredictable (see RFC
// 5246, Appendix F.3), forcing us to use randomness. That's not
// 3DES' biggest problem anyway because the birthday bound on block
- // collision is reached first due to its simlarly small block size
+ // collision is reached first due to its similarly small block size
// (see the Sweet32 attack).
copy(explicitNonce, hc.seq[:])
} else {
@@ -487,14 +488,10 @@ func (hc *halfConn) encrypt(record, payload []byte, rand io.Reader) ([]byte, err
}
}
- var mac []byte
- if hc.mac != nil {
- mac = hc.mac.MAC(hc.seq[:], record[:recordHeaderLen], payload, nil)
- }
-
var dst []byte
switch c := hc.cipher.(type) {
case cipher.Stream:
+ mac := tls10MAC(hc.mac, hc.scratchBuf[:0], hc.seq[:], record[:recordHeaderLen], payload, nil)
record, dst = sliceForAppend(record, len(payload)+len(mac))
c.XORKeyStream(dst[:len(payload)], payload)
c.XORKeyStream(dst[len(payload):], mac)
@@ -518,11 +515,12 @@ func (hc *halfConn) encrypt(record, payload []byte, rand io.Reader) ([]byte, err
record = c.Seal(record[:recordHeaderLen],
nonce, record[recordHeaderLen:], record[:recordHeaderLen])
} else {
- copy(hc.additionalData[:], hc.seq[:])
- copy(hc.additionalData[8:], record)
- record = c.Seal(record, nonce, payload, hc.additionalData[:])
+ additionalData := append(hc.scratchBuf[:0], hc.seq[:]...)
+ additionalData = append(additionalData, record[:recordHeaderLen]...)
+ record = c.Seal(record, nonce, payload, additionalData)
}
case cbcMode:
+ mac := tls10MAC(hc.mac, hc.scratchBuf[:0], hc.seq[:], record[:recordHeaderLen], payload, nil)
blockSize := c.BlockSize()
plaintextLen := len(payload) + len(mac)
paddingLen := blockSize - plaintextLen%blockSize
diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go
index d09a8c8ccf..123df7b07a 100644
--- a/src/crypto/tls/handshake_client.go
+++ b/src/crypto/tls/handshake_client.go
@@ -15,6 +15,7 @@ import (
"crypto/x509"
"errors"
"fmt"
+ "hash"
"io"
"net"
"strings"
@@ -651,12 +652,12 @@ func (hs *clientHandshakeState) establishKeys() error {
clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
keysFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.hello.random, hs.serverHello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
var clientCipher, serverCipher interface{}
- var clientHash, serverHash macFunction
+ var clientHash, serverHash hash.Hash
if hs.suite.cipher != nil {
clientCipher = hs.suite.cipher(clientKey, clientIV, false /* not for reading */)
- clientHash = hs.suite.mac(c.vers, clientMAC)
+ clientHash = hs.suite.mac(clientMAC)
serverCipher = hs.suite.cipher(serverKey, serverIV, true /* for reading */)
- serverHash = hs.suite.mac(c.vers, serverMAC)
+ serverHash = hs.suite.mac(serverMAC)
} else {
clientCipher = hs.suite.aead(clientKey, clientIV)
serverCipher = hs.suite.aead(serverKey, serverIV)
diff --git a/src/crypto/tls/handshake_server.go b/src/crypto/tls/handshake_server.go
index 1fe026ae0e..73df19d10f 100644
--- a/src/crypto/tls/handshake_server.go
+++ b/src/crypto/tls/handshake_server.go
@@ -14,6 +14,7 @@ import (
"crypto/x509"
"errors"
"fmt"
+ "hash"
"io"
"sync/atomic"
"time"
@@ -645,13 +646,13 @@ func (hs *serverHandshakeState) establishKeys() error {
keysFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.clientHello.random, hs.hello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
var clientCipher, serverCipher interface{}
- var clientHash, serverHash macFunction
+ var clientHash, serverHash hash.Hash
if hs.suite.aead == nil {
clientCipher = hs.suite.cipher(clientKey, clientIV, true /* for reading */)
- clientHash = hs.suite.mac(c.vers, clientMAC)
+ clientHash = hs.suite.mac(clientMAC)
serverCipher = hs.suite.cipher(serverKey, serverIV, false /* not for reading */)
- serverHash = hs.suite.mac(c.vers, serverMAC)
+ serverHash = hs.suite.mac(serverMAC)
} else {
clientCipher = hs.suite.aead(clientKey, clientIV)
serverCipher = hs.suite.aead(serverKey, serverIV)
--
cgit v1.3
From d7fff1f2cf2c0cb7cb2e03a3d057c600c4ec545a Mon Sep 17 00:00:00 2001
From: Filippo Valsorda
Date: Wed, 24 Jun 2020 17:01:00 -0400
Subject: crypto/tls: ensure the server picked an advertised ALPN protocol
This is a SHALL in RFC 7301, Section 3.2.
Also some more cleanup after NPN, which worked the other way around
(with the possibility that the client could pick a protocol the server
did not suggest).
Change-Id: I83cc43ca1b3c686dfece8315436441c077065d82
Reviewed-on: https://go-review.googlesource.com/c/go/+/239748
Run-TryBot: Filippo Valsorda
TryBot-Result: Go Bot
Trust: Filippo Valsorda
Trust: Roland Shoemaker
Reviewed-by: Roland Shoemaker
---
doc/go1.16.html | 8 ++++++++
src/crypto/tls/common.go | 3 ---
src/crypto/tls/conn.go | 6 +++---
src/crypto/tls/handshake_client.go | 33 +++++++++++++++-----------------
src/crypto/tls/handshake_client_tls13.go | 14 ++++++++++----
src/crypto/tls/handshake_server.go | 2 +-
src/crypto/tls/handshake_server_tls13.go | 2 +-
7 files changed, 38 insertions(+), 30 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/doc/go1.16.html b/doc/go1.16.html
index bb920a0cb8..43ffb9dd7c 100644
--- a/doc/go1.16.html
+++ b/doc/go1.16.html
@@ -286,6 +286,14 @@ Do not send CLs removing the interior tags from such phrases.
has no effect.
+
+ Clients now ensure that the server selects
+
+ an ALPN protocol from
+
+ the list advertised by the client.
+
+
diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go
index 1370d26fe2..98b31b09fa 100644
--- a/src/crypto/tls/common.go
+++ b/src/crypto/tls/common.go
@@ -229,9 +229,6 @@ type ConnectionState struct {
CipherSuite uint16
// NegotiatedProtocol is the application protocol negotiated with ALPN.
- //
- // Note that on the client side, this is currently not guaranteed to be from
- // Config.NextProtos.
NegotiatedProtocol string
// NegotiatedProtocolIsMutual used to indicate a mutual NPN negotiation.
diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go
index 2788c3c393..969f357834 100644
--- a/src/crypto/tls/conn.go
+++ b/src/crypto/tls/conn.go
@@ -88,8 +88,8 @@ type Conn struct {
clientFinished [12]byte
serverFinished [12]byte
- clientProtocol string
- clientProtocolFallback bool
+ // clientProtocol is the negotiated ALPN protocol.
+ clientProtocol string
// input/output
in, out halfConn
@@ -1471,7 +1471,7 @@ func (c *Conn) connectionStateLocked() ConnectionState {
state.Version = c.vers
state.NegotiatedProtocol = c.clientProtocol
state.DidResume = c.didResume
- state.NegotiatedProtocolIsMutual = !c.clientProtocolFallback
+ state.NegotiatedProtocolIsMutual = true
state.ServerName = c.serverName
state.CipherSuite = c.cipherSuite
state.PeerCertificates = c.peerCertificates
diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go
index 123df7b07a..92e33e7169 100644
--- a/src/crypto/tls/handshake_client.go
+++ b/src/crypto/tls/handshake_client.go
@@ -705,18 +705,18 @@ func (hs *clientHandshakeState) processServerHello() (bool, error) {
}
}
- clientDidALPN := len(hs.hello.alpnProtocols) > 0
- serverHasALPN := len(hs.serverHello.alpnProtocol) > 0
-
- if !clientDidALPN && serverHasALPN {
- c.sendAlert(alertHandshakeFailure)
- return false, errors.New("tls: server advertised unrequested ALPN extension")
- }
-
- if serverHasALPN {
+ if hs.serverHello.alpnProtocol != "" {
+ if len(hs.hello.alpnProtocols) == 0 {
+ c.sendAlert(alertUnsupportedExtension)
+ return false, errors.New("tls: server advertised unrequested ALPN extension")
+ }
+ if mutualProtocol([]string{hs.serverHello.alpnProtocol}, hs.hello.alpnProtocols) == "" {
+ c.sendAlert(alertUnsupportedExtension)
+ return false, errors.New("tls: server selected unadvertised ALPN protocol")
+ }
c.clientProtocol = hs.serverHello.alpnProtocol
- c.clientProtocolFallback = false
}
+
c.scts = hs.serverHello.scts
if !hs.serverResumedSession() {
@@ -973,20 +973,17 @@ func clientSessionCacheKey(serverAddr net.Addr, config *Config) string {
return serverAddr.String()
}
-// mutualProtocol finds the mutual Next Protocol Negotiation or ALPN protocol
-// given list of possible protocols and a list of the preference order. The
-// first list must not be empty. It returns the resulting protocol and flag
-// indicating if the fallback case was reached.
-func mutualProtocol(protos, preferenceProtos []string) (string, bool) {
+// mutualProtocol finds the mutual ALPN protocol given list of possible
+// protocols and a list of the preference order.
+func mutualProtocol(protos, preferenceProtos []string) string {
for _, s := range preferenceProtos {
for _, c := range protos {
if s == c {
- return s, false
+ return s
}
}
}
-
- return protos[0], true
+ return ""
}
// hostnameInSNI converts name into an appropriate hostname for SNI.
diff --git a/src/crypto/tls/handshake_client_tls13.go b/src/crypto/tls/handshake_client_tls13.go
index 0e4b380035..be37c681c6 100644
--- a/src/crypto/tls/handshake_client_tls13.go
+++ b/src/crypto/tls/handshake_client_tls13.go
@@ -396,11 +396,17 @@ func (hs *clientHandshakeStateTLS13) readServerParameters() error {
}
hs.transcript.Write(encryptedExtensions.marshal())
- if len(encryptedExtensions.alpnProtocol) != 0 && len(hs.hello.alpnProtocols) == 0 {
- c.sendAlert(alertUnsupportedExtension)
- return errors.New("tls: server advertised unrequested ALPN extension")
+ if encryptedExtensions.alpnProtocol != "" {
+ if len(hs.hello.alpnProtocols) == 0 {
+ c.sendAlert(alertUnsupportedExtension)
+ return errors.New("tls: server advertised unrequested ALPN extension")
+ }
+ if mutualProtocol([]string{encryptedExtensions.alpnProtocol}, hs.hello.alpnProtocols) == "" {
+ c.sendAlert(alertUnsupportedExtension)
+ return errors.New("tls: server selected unadvertised ALPN protocol")
+ }
+ c.clientProtocol = encryptedExtensions.alpnProtocol
}
- c.clientProtocol = encryptedExtensions.alpnProtocol
return nil
}
diff --git a/src/crypto/tls/handshake_server.go b/src/crypto/tls/handshake_server.go
index 73df19d10f..a7d44144cb 100644
--- a/src/crypto/tls/handshake_server.go
+++ b/src/crypto/tls/handshake_server.go
@@ -218,7 +218,7 @@ func (hs *serverHandshakeState) processClientHello() error {
}
if len(hs.clientHello.alpnProtocols) > 0 {
- if selectedProto, fallback := mutualProtocol(hs.clientHello.alpnProtocols, c.config.NextProtos); !fallback {
+ if selectedProto := mutualProtocol(hs.clientHello.alpnProtocols, c.config.NextProtos); selectedProto != "" {
hs.hello.alpnProtocol = selectedProto
c.clientProtocol = selectedProto
}
diff --git a/src/crypto/tls/handshake_server_tls13.go b/src/crypto/tls/handshake_server_tls13.go
index 25c37b92c5..41f7ac2324 100644
--- a/src/crypto/tls/handshake_server_tls13.go
+++ b/src/crypto/tls/handshake_server_tls13.go
@@ -555,7 +555,7 @@ func (hs *serverHandshakeStateTLS13) sendServerParameters() error {
encryptedExtensions := new(encryptedExtensionsMsg)
if len(hs.clientHello.alpnProtocols) > 0 {
- if selectedProto, fallback := mutualProtocol(hs.clientHello.alpnProtocols, c.config.NextProtos); !fallback {
+ if selectedProto := mutualProtocol(hs.clientHello.alpnProtocols, c.config.NextProtos); selectedProto != "" {
encryptedExtensions.alpnProtocol = selectedProto
c.clientProtocol = selectedProto
}
--
cgit v1.3
From 9f39a43e0d728721d5a9e2586ce47a57585591c5 Mon Sep 17 00:00:00 2001
From: Roland Shoemaker
Date: Thu, 15 Oct 2020 18:32:20 -0700
Subject: crypto/tls: de-prioritize AES-GCM ciphers when lacking hardware
support
When either the server or client are lacking hardware support for
AES-GCM ciphers, indicated by the server lacking the relevant
instructions and by the client not putting AES-GCM ciphers at the top
of its preference list, reorder the preference list to de-prioritize
AES-GCM based ciphers when they are adjacent to other AEAD ciphers.
Also updates a number of recorded openssl TLS tests which previously
only specified TLS 1.2 cipher preferences (using -cipher), but not
TLS 1.3 cipher preferences (using -ciphersuites), to specify both
preferences, making these tests more predictable.
Fixes #41181.
Change-Id: Ied896c96c095481e755aaff9ff0746fb4cb9568e
Reviewed-on: https://go-review.googlesource.com/c/go/+/262857
Run-TryBot: Roland Shoemaker
TryBot-Result: Go Bot
Reviewed-by: Filippo Valsorda
Trust: Roland Shoemaker
Trust: Katie Hockman
---
doc/go1.16.html | 11 +
src/crypto/tls/common.go | 74 ++++-
src/crypto/tls/handshake_server.go | 14 +
src/crypto/tls/handshake_server_test.go | 308 ++++++++++++++++--
src/crypto/tls/handshake_server_tls13.go | 13 +
src/crypto/tls/testdata/Server-TLSv12-ALPN | 84 +++--
src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch | 84 +++--
.../Server-TLSv12-ClientAuthRequestedAndECDSAGiven | 170 +++++-----
...erver-TLSv12-ClientAuthRequestedAndEd25519Given | 171 +++++-----
.../Server-TLSv12-ClientAuthRequestedAndGiven | 170 +++++-----
...rver-TLSv12-ClientAuthRequestedAndPKCS1v15Given | 170 +++++-----
.../Server-TLSv12-ClientAuthRequestedNotGiven | 152 +++++----
src/crypto/tls/testdata/Server-TLSv12-Ed25519 | 61 ++--
.../testdata/Server-TLSv12-ExportKeyingMaterial | 81 +++--
src/crypto/tls/testdata/Server-TLSv12-IssueTicket | 66 ++--
.../testdata/Server-TLSv12-IssueTicketPreDisable | 66 ++--
.../tls/testdata/Server-TLSv12-RSA-RSAPKCS1v15 | 63 ++--
src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPSS | 48 ++-
src/crypto/tls/testdata/Server-TLSv12-Resume | 60 ++--
.../tls/testdata/Server-TLSv12-ResumeDisabled | 167 +++++-----
src/crypto/tls/testdata/Server-TLSv13-ALPN | 186 ++++++-----
src/crypto/tls/testdata/Server-TLSv13-ALPN-NoMatch | 186 ++++++-----
.../Server-TLSv13-ClientAuthRequestedAndECDSAGiven | 345 ++++++++++-----------
...erver-TLSv13-ClientAuthRequestedAndEd25519Given | 285 +++++++++--------
.../Server-TLSv13-ClientAuthRequestedAndGiven | 339 ++++++++++----------
.../Server-TLSv13-ClientAuthRequestedNotGiven | 195 ++++++------
src/crypto/tls/testdata/Server-TLSv13-Ed25519 | 139 ++++-----
.../testdata/Server-TLSv13-ExportKeyingMaterial | 184 ++++++-----
.../tls/testdata/Server-TLSv13-HelloRetryRequest | 218 +++++++------
src/crypto/tls/testdata/Server-TLSv13-IssueTicket | 184 ++++++-----
.../testdata/Server-TLSv13-IssueTicketPreDisable | 184 ++++++-----
src/crypto/tls/testdata/Server-TLSv13-P256 | 186 ++++++-----
src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS | 109 ++++++-
.../tls/testdata/Server-TLSv13-RSA-RSAPSS-TooSmall | 25 +-
src/crypto/tls/testdata/Server-TLSv13-Resume | 106 +++----
.../Server-TLSv13-Resume-HelloRetryRequest | 168 +++++-----
.../tls/testdata/Server-TLSv13-ResumeDisabled | 185 ++++++-----
src/crypto/tls/testdata/Server-TLSv13-X25519 | 182 ++++++-----
38 files changed, 2890 insertions(+), 2549 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/doc/go1.16.html b/doc/go1.16.html
index 43ffb9dd7c..98fa595ea5 100644
--- a/doc/go1.16.html
+++ b/doc/go1.16.html
@@ -294,6 +294,17 @@ Do not send CLs removing the interior tags from such phrases.
the list advertised by the client.
+
+ TLS servers will now prefer other AEAD cipher suites (such as ChaCha20Poly1305)
+ over AES-GCM cipher suites if either the client or server doesn't have AES hardware
+ support, unless the application set both
+ Config.PreferServerCipherSuites
+ and Config.CipherSuites
+ or there are no other AEAD cipher suites supported.
+ The client is assumed not to have AES hardware support if it does not signal a
+ preference for AES-GCM cipher suites.
+
+
diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go
index 98b31b09fa..5b68742975 100644
--- a/src/crypto/tls/common.go
+++ b/src/crypto/tls/common.go
@@ -21,6 +21,8 @@ import (
"internal/cpu"
"io"
"net"
+ "runtime"
+ "sort"
"strings"
"sync"
"time"
@@ -1454,21 +1456,21 @@ func defaultCipherSuitesTLS13() []uint16 {
return varDefaultCipherSuitesTLS13
}
+var (
+ hasGCMAsmAMD64 = cpu.X86.HasAES && cpu.X86.HasPCLMULQDQ
+ hasGCMAsmARM64 = cpu.ARM64.HasAES && cpu.ARM64.HasPMULL
+ // Keep in sync with crypto/aes/cipher_s390x.go.
+ hasGCMAsmS390X = cpu.S390X.HasAES && cpu.S390X.HasAESCBC && cpu.S390X.HasAESCTR && (cpu.S390X.HasGHASH || cpu.S390X.HasAESGCM)
+
+ hasAESGCMHardwareSupport = runtime.GOARCH == "amd64" && hasGCMAsmAMD64 ||
+ runtime.GOARCH == "arm64" && hasGCMAsmARM64 ||
+ runtime.GOARCH == "s390x" && hasGCMAsmS390X
+)
+
func initDefaultCipherSuites() {
var topCipherSuites []uint16
- // Check the cpu flags for each platform that has optimized GCM implementations.
- // Worst case, these variables will just all be false.
- var (
- hasGCMAsmAMD64 = cpu.X86.HasAES && cpu.X86.HasPCLMULQDQ
- hasGCMAsmARM64 = cpu.ARM64.HasAES && cpu.ARM64.HasPMULL
- // Keep in sync with crypto/aes/cipher_s390x.go.
- hasGCMAsmS390X = cpu.S390X.HasAES && cpu.S390X.HasAESCBC && cpu.S390X.HasAESCTR && (cpu.S390X.HasGHASH || cpu.S390X.HasAESGCM)
-
- hasGCMAsm = hasGCMAsmAMD64 || hasGCMAsmARM64 || hasGCMAsmS390X
- )
-
- if hasGCMAsm {
+ if hasAESGCMHardwareSupport {
// If AES-GCM hardware is provided then prioritise AES-GCM
// cipher suites.
topCipherSuites = []uint16{
@@ -1531,3 +1533,51 @@ func isSupportedSignatureAlgorithm(sigAlg SignatureScheme, supportedSignatureAlg
}
return false
}
+
+var aesgcmCiphers = map[uint16]bool{
+ // 1.2
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: true,
+ TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: true,
+ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: true,
+ TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: true,
+ // 1.3
+ TLS_AES_128_GCM_SHA256: true,
+ TLS_AES_256_GCM_SHA384: true,
+}
+
+var nonAESGCMAEADCiphers = map[uint16]bool{
+ // 1.2
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: true,
+ TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: true,
+ // 1.3
+ TLS_CHACHA20_POLY1305_SHA256: true,
+}
+
+// aesgcmPreferred returns whether the first valid cipher in the preference list
+// is an AES-GCM cipher, implying the peer has hardware support for it.
+func aesgcmPreferred(ciphers []uint16) bool {
+ for _, cID := range ciphers {
+ c := cipherSuiteByID(cID)
+ if c == nil {
+ c13 := cipherSuiteTLS13ByID(cID)
+ if c13 == nil {
+ continue
+ }
+ return aesgcmCiphers[cID]
+ }
+ return aesgcmCiphers[cID]
+ }
+ return false
+}
+
+// deprioritizeAES reorders cipher preference lists by rearranging
+// adjacent AEAD ciphers such that AES-GCM based ciphers are moved
+// after other AEAD ciphers. It returns a fresh slice.
+func deprioritizeAES(ciphers []uint16) []uint16 {
+ reordered := make([]uint16, len(ciphers))
+ copy(reordered, ciphers)
+ sort.SliceStable(reordered, func(i, j int) bool {
+ return nonAESGCMAEADCiphers[reordered[i]] && aesgcmCiphers[reordered[j]]
+ })
+ return reordered
+}
diff --git a/src/crypto/tls/handshake_server.go b/src/crypto/tls/handshake_server.go
index a7d44144cb..5a572a9db1 100644
--- a/src/crypto/tls/handshake_server.go
+++ b/src/crypto/tls/handshake_server.go
@@ -303,9 +303,23 @@ func (hs *serverHandshakeState) pickCipherSuite() error {
if c.config.PreferServerCipherSuites {
preferenceList = c.config.cipherSuites()
supportedList = hs.clientHello.cipherSuites
+
+ // If the client does not seem to have hardware support for AES-GCM,
+ // and the application did not specify a cipher suite preference order,
+ // prefer other AEAD ciphers even if we prioritized AES-GCM ciphers
+ // by default.
+ if c.config.CipherSuites == nil && !aesgcmPreferred(hs.clientHello.cipherSuites) {
+ preferenceList = deprioritizeAES(preferenceList)
+ }
} else {
preferenceList = hs.clientHello.cipherSuites
supportedList = c.config.cipherSuites()
+
+ // If we don't have hardware support for AES-GCM, prefer other AEAD
+ // ciphers even if the client prioritized AES-GCM.
+ if !hasAESGCMHardwareSupport {
+ preferenceList = deprioritizeAES(preferenceList)
+ }
}
hs.suite = selectCipherSuite(preferenceList, supportedList, hs.cipherSuiteOk)
diff --git a/src/crypto/tls/handshake_server_test.go b/src/crypto/tls/handshake_server_test.go
index c4416c379a..ad851b6edf 100644
--- a/src/crypto/tls/handshake_server_test.go
+++ b/src/crypto/tls/handshake_server_test.go
@@ -22,6 +22,8 @@ import (
"strings"
"testing"
"time"
+
+ "golang.org/x/crypto/curve25519"
)
func testClientHello(t *testing.T, serverConfig *Config, m handshakeMessage) {
@@ -856,7 +858,7 @@ func TestHandshakeServerX25519(t *testing.T) {
test := &serverTest{
name: "X25519",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-AES128-GCM-SHA256", "-curves", "X25519"},
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-CHACHA20-POLY1305", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256", "-curves", "X25519"},
config: config,
}
runServerTestTLS12(t, test)
@@ -869,7 +871,7 @@ func TestHandshakeServerP256(t *testing.T) {
test := &serverTest{
name: "P256",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-AES128-GCM-SHA256", "-curves", "P-256"},
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-CHACHA20-POLY1305", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256", "-curves", "P-256"},
config: config,
}
runServerTestTLS12(t, test)
@@ -882,7 +884,7 @@ func TestHandshakeServerHelloRetryRequest(t *testing.T) {
test := &serverTest{
name: "HelloRetryRequest",
- command: []string{"openssl", "s_client", "-no_ticket", "-curves", "X25519:P-256"},
+ command: []string{"openssl", "s_client", "-no_ticket", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256", "-curves", "X25519:P-256"},
config: config,
}
runServerTestTLS13(t, test)
@@ -896,7 +898,7 @@ func TestHandshakeServerALPN(t *testing.T) {
name: "ALPN",
// Note that this needs OpenSSL 1.0.2 because that is the first
// version that supports the -alpn flag.
- command: []string{"openssl", "s_client", "-alpn", "proto2,proto1"},
+ command: []string{"openssl", "s_client", "-alpn", "proto2,proto1", "-cipher", "ECDHE-RSA-CHACHA20-POLY1305", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256"},
config: config,
validate: func(state ConnectionState) error {
// The server's preferences should override the client.
@@ -918,7 +920,7 @@ func TestHandshakeServerALPNNoMatch(t *testing.T) {
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_client", "-alpn", "proto2,proto1"},
+ command: []string{"openssl", "s_client", "-alpn", "proto2,proto1", "-cipher", "ECDHE-RSA-CHACHA20-POLY1305", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256"},
config: config,
validate: func(state ConnectionState) error {
// Rather than reject the connection, Go doesn't select
@@ -1071,12 +1073,12 @@ func TestServerResumption(t *testing.T) {
testIssue := &serverTest{
name: "IssueTicket",
- command: []string{"openssl", "s_client", "-cipher", "AES128-SHA", "-sess_out", sessionFilePath},
+ command: []string{"openssl", "s_client", "-cipher", "AES128-SHA", "-ciphersuites", "TLS_AES_128_GCM_SHA256", "-sess_out", sessionFilePath},
wait: true,
}
testResume := &serverTest{
name: "Resume",
- command: []string{"openssl", "s_client", "-cipher", "AES128-SHA", "-sess_in", sessionFilePath},
+ command: []string{"openssl", "s_client", "-cipher", "AES128-SHA", "-ciphersuites", "TLS_AES_128_GCM_SHA256", "-sess_in", sessionFilePath},
validate: func(state ConnectionState) error {
if !state.DidResume {
return errors.New("did not resume")
@@ -1095,9 +1097,10 @@ func TestServerResumption(t *testing.T) {
config.CurvePreferences = []CurveID{CurveP256}
testResumeHRR := &serverTest{
- name: "Resume-HelloRetryRequest",
- command: []string{"openssl", "s_client", "-curves", "X25519:P-256", "-sess_in", sessionFilePath},
- config: config,
+ name: "Resume-HelloRetryRequest",
+ command: []string{"openssl", "s_client", "-curves", "X25519:P-256", "-cipher", "AES128-SHA", "-ciphersuites",
+ "TLS_AES_128_GCM_SHA256", "-sess_in", sessionFilePath},
+ config: config,
validate: func(state ConnectionState) error {
if !state.DidResume {
return errors.New("did not resume")
@@ -1117,13 +1120,13 @@ func TestServerResumptionDisabled(t *testing.T) {
testIssue := &serverTest{
name: "IssueTicketPreDisable",
- command: []string{"openssl", "s_client", "-cipher", "AES128-SHA", "-sess_out", sessionFilePath},
+ command: []string{"openssl", "s_client", "-cipher", "AES128-SHA", "-ciphersuites", "TLS_AES_128_GCM_SHA256", "-sess_out", sessionFilePath},
config: config,
wait: true,
}
testResume := &serverTest{
name: "ResumeDisabled",
- command: []string{"openssl", "s_client", "-cipher", "AES128-SHA", "-sess_in", sessionFilePath},
+ command: []string{"openssl", "s_client", "-cipher", "AES128-SHA", "-ciphersuites", "TLS_AES_128_GCM_SHA256", "-sess_in", sessionFilePath},
config: config,
validate: func(state ConnectionState) error {
if state.DidResume {
@@ -1161,7 +1164,7 @@ func TestFallbackSCSV(t *testing.T) {
func TestHandshakeServerExportKeyingMaterial(t *testing.T) {
test := &serverTest{
name: "ExportKeyingMaterial",
- command: []string{"openssl", "s_client"},
+ command: []string{"openssl", "s_client", "-cipher", "ECDHE-RSA-CHACHA20-POLY1305", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256"},
config: testConfig.Clone(),
validate: func(state ConnectionState) error {
if km, err := state.ExportKeyingMaterial("test", nil, 42); err != nil {
@@ -1180,7 +1183,7 @@ func TestHandshakeServerExportKeyingMaterial(t *testing.T) {
func TestHandshakeServerRSAPKCS1v15(t *testing.T) {
test := &serverTest{
name: "RSA-RSAPKCS1v15",
- command: []string{"openssl", "s_client", "-no_ticket", "-sigalgs", "rsa_pkcs1_sha256"},
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-CHACHA20-POLY1305", "-sigalgs", "rsa_pkcs1_sha256"},
}
runServerTestTLS12(t, test)
}
@@ -1191,14 +1194,14 @@ func TestHandshakeServerRSAPSS(t *testing.T) {
// that case. See Issue 29793.
test := &serverTest{
name: "RSA-RSAPSS",
- command: []string{"openssl", "s_client", "-no_ticket", "-sigalgs", "rsa_pss_rsae_sha512:rsa_pss_rsae_sha256"},
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-CHACHA20-POLY1305", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256", "-sigalgs", "rsa_pss_rsae_sha512:rsa_pss_rsae_sha256"},
}
runServerTestTLS12(t, test)
runServerTestTLS13(t, test)
test = &serverTest{
name: "RSA-RSAPSS-TooSmall",
- command: []string{"openssl", "s_client", "-no_ticket", "-sigalgs", "rsa_pss_rsae_sha512"},
+ command: []string{"openssl", "s_client", "-no_ticket", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256", "-sigalgs", "rsa_pss_rsae_sha512"},
expectHandshakeErrorIncluding: "peer doesn't support any of the certificate's signature algorithms",
}
runServerTestTLS13(t, test)
@@ -1213,7 +1216,7 @@ func TestHandshakeServerEd25519(t *testing.T) {
test := &serverTest{
name: "Ed25519",
- command: []string{"openssl", "s_client", "-no_ticket"},
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-ECDSA-CHACHA20-POLY1305", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256"},
config: config,
}
runServerTestTLS12(t, test)
@@ -1353,7 +1356,7 @@ func TestClientAuth(t *testing.T) {
test := &serverTest{
name: "ClientAuthRequestedNotGiven",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA"},
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-ciphersuites", "TLS_AES_128_GCM_SHA256"},
config: config,
}
runServerTestTLS12(t, test)
@@ -1361,7 +1364,7 @@ func TestClientAuth(t *testing.T) {
test = &serverTest{
name: "ClientAuthRequestedAndGiven",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA",
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-ciphersuites", "TLS_AES_128_GCM_SHA256",
"-cert", certPath, "-key", keyPath, "-client_sigalgs", "rsa_pss_rsae_sha256"},
config: config,
expectedPeerCerts: []string{clientCertificatePEM},
@@ -1371,7 +1374,7 @@ func TestClientAuth(t *testing.T) {
test = &serverTest{
name: "ClientAuthRequestedAndECDSAGiven",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA",
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-ciphersuites", "TLS_AES_128_GCM_SHA256",
"-cert", ecdsaCertPath, "-key", ecdsaKeyPath},
config: config,
expectedPeerCerts: []string{clientECDSACertificatePEM},
@@ -1381,7 +1384,7 @@ func TestClientAuth(t *testing.T) {
test = &serverTest{
name: "ClientAuthRequestedAndEd25519Given",
- command: []string{"openssl", "s_client", "-no_ticket",
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-ciphersuites", "TLS_AES_128_GCM_SHA256",
"-cert", ed25519CertPath, "-key", ed25519KeyPath},
config: config,
expectedPeerCerts: []string{clientEd25519CertificatePEM},
@@ -1719,3 +1722,266 @@ func TestServerHandshakeContextCancellation(t *testing.T) {
t.Error("Server connection was not closed when the context was canceled")
}
}
+
+func TestAESCipherReordering(t *testing.T) {
+ currentAESSupport := hasAESGCMHardwareSupport
+ defer func() { hasAESGCMHardwareSupport = currentAESSupport; initDefaultCipherSuites() }()
+
+ tests := []struct {
+ name string
+ clientCiphers []uint16
+ serverHasAESGCM bool
+ preferServerCipherSuites bool
+ serverCiphers []uint16
+ expectedCipher uint16
+ }{
+ {
+ name: "server has hardware AES, client doesn't (pick ChaCha)",
+ clientCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ },
+ serverHasAESGCM: true,
+ preferServerCipherSuites: true,
+ expectedCipher: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ },
+ {
+ name: "server strongly prefers AES-GCM, client doesn't (pick AES-GCM)",
+ clientCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ },
+ serverHasAESGCM: true,
+ preferServerCipherSuites: true,
+ serverCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ },
+ expectedCipher: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ },
+ {
+ name: "client prefers AES-GCM, server doesn't have hardware AES (pick ChaCha)",
+ clientCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ },
+ serverHasAESGCM: false,
+ expectedCipher: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ },
+ {
+ name: "client prefers AES-GCM, server has hardware AES (pick AES-GCM)",
+ clientCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ },
+ serverHasAESGCM: true,
+ expectedCipher: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ },
+ {
+ name: "client prefers AES-GCM and sends GREASE, server has hardware AES (pick AES-GCM)",
+ clientCiphers: []uint16{
+ 0x0A0A, // GREASE value
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ },
+ serverHasAESGCM: true,
+ expectedCipher: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ },
+ {
+ name: "client prefers AES-GCM and doesn't support ChaCha, server doesn't have hardware AES (pick AES-GCM)",
+ clientCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ },
+ serverHasAESGCM: false,
+ expectedCipher: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ },
+ {
+ name: "client prefers AES-GCM and AES-CBC over ChaCha, server doesn't have hardware AES (pick AES-GCM)",
+ clientCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ },
+ serverHasAESGCM: false,
+ expectedCipher: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ },
+ {
+ name: "client prefers AES-GCM over ChaCha and sends GREASE, server doesn't have hardware AES (pick ChaCha)",
+ clientCiphers: []uint16{
+ 0x0A0A, // GREASE value
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ },
+ serverHasAESGCM: false,
+ expectedCipher: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ },
+ {
+ name: "client supports multiple AES-GCM, server doesn't have hardware AES and doesn't support ChaCha (pick corrent AES-GCM)",
+ clientCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
+ TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ },
+ serverHasAESGCM: false,
+ serverCiphers: []uint16{
+ TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
+ TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
+ },
+ expectedCipher: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
+ },
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ hasAESGCMHardwareSupport = tc.serverHasAESGCM
+ initDefaultCipherSuites()
+ hs := &serverHandshakeState{
+ c: &Conn{
+ config: &Config{
+ PreferServerCipherSuites: tc.preferServerCipherSuites,
+ CipherSuites: tc.serverCiphers,
+ },
+ vers: VersionTLS12,
+ },
+ clientHello: &clientHelloMsg{
+ cipherSuites: tc.clientCiphers,
+ vers: VersionTLS12,
+ },
+ ecdheOk: true,
+ rsaSignOk: true,
+ rsaDecryptOk: true,
+ }
+
+ err := hs.pickCipherSuite()
+ if err != nil {
+ t.Errorf("pickCipherSuite failed: %s", err)
+ }
+
+ if tc.expectedCipher != hs.suite.id {
+ t.Errorf("unexpected cipher chosen: want %d, got %d", tc.expectedCipher, hs.suite.id)
+ }
+ })
+ }
+}
+
+func TestAESCipherReordering13(t *testing.T) {
+ currentAESSupport := hasAESGCMHardwareSupport
+ defer func() { hasAESGCMHardwareSupport = currentAESSupport; initDefaultCipherSuites() }()
+
+ tests := []struct {
+ name string
+ clientCiphers []uint16
+ serverHasAESGCM bool
+ preferServerCipherSuites bool
+ expectedCipher uint16
+ }{
+ {
+ name: "server has hardware AES, client doesn't (pick ChaCha)",
+ clientCiphers: []uint16{
+ TLS_CHACHA20_POLY1305_SHA256,
+ TLS_AES_128_GCM_SHA256,
+ },
+ serverHasAESGCM: true,
+ preferServerCipherSuites: true,
+ expectedCipher: TLS_CHACHA20_POLY1305_SHA256,
+ },
+ {
+ name: "neither server nor client have hardware AES (pick ChaCha)",
+ clientCiphers: []uint16{
+ TLS_CHACHA20_POLY1305_SHA256,
+ TLS_AES_128_GCM_SHA256,
+ },
+ serverHasAESGCM: false,
+ preferServerCipherSuites: true,
+ expectedCipher: TLS_CHACHA20_POLY1305_SHA256,
+ },
+ {
+ name: "client prefers AES, server doesn't have hardware, prefer server ciphers (pick ChaCha)",
+ clientCiphers: []uint16{
+ TLS_AES_128_GCM_SHA256,
+ TLS_CHACHA20_POLY1305_SHA256,
+ },
+ serverHasAESGCM: false,
+ preferServerCipherSuites: true,
+ expectedCipher: TLS_CHACHA20_POLY1305_SHA256,
+ },
+ {
+ name: "client prefers AES and sends GREASE, server doesn't have hardware, prefer server ciphers (pick ChaCha)",
+ clientCiphers: []uint16{
+ 0x0A0A, // GREASE value
+ TLS_AES_128_GCM_SHA256,
+ TLS_CHACHA20_POLY1305_SHA256,
+ },
+ serverHasAESGCM: false,
+ preferServerCipherSuites: true,
+ expectedCipher: TLS_CHACHA20_POLY1305_SHA256,
+ },
+ {
+ name: "client prefers AES, server doesn't (pick ChaCha)",
+ clientCiphers: []uint16{
+ TLS_AES_128_GCM_SHA256,
+ TLS_CHACHA20_POLY1305_SHA256,
+ },
+ serverHasAESGCM: false,
+ expectedCipher: TLS_CHACHA20_POLY1305_SHA256,
+ },
+ {
+ name: "client prefers AES, server has hardware AES (pick AES)",
+ clientCiphers: []uint16{
+ TLS_AES_128_GCM_SHA256,
+ TLS_CHACHA20_POLY1305_SHA256,
+ },
+ serverHasAESGCM: true,
+ expectedCipher: TLS_AES_128_GCM_SHA256,
+ },
+ {
+ name: "client prefers AES and sends GREASE, server has hardware AES (pick AES)",
+ clientCiphers: []uint16{
+ 0x0A0A, // GREASE value
+ TLS_AES_128_GCM_SHA256,
+ TLS_CHACHA20_POLY1305_SHA256,
+ },
+ serverHasAESGCM: true,
+ expectedCipher: TLS_AES_128_GCM_SHA256,
+ },
+ }
+
+ for _, tc := range tests {
+ t.Run(tc.name, func(t *testing.T) {
+ hasAESGCMHardwareSupport = tc.serverHasAESGCM
+ initDefaultCipherSuites()
+ hs := &serverHandshakeStateTLS13{
+ c: &Conn{
+ config: &Config{
+ PreferServerCipherSuites: tc.preferServerCipherSuites,
+ },
+ vers: VersionTLS13,
+ },
+ clientHello: &clientHelloMsg{
+ cipherSuites: tc.clientCiphers,
+ supportedVersions: []uint16{VersionTLS13},
+ compressionMethods: []uint8{compressionNone},
+ keyShares: []keyShare{{group: X25519, data: curve25519.Basepoint}},
+ },
+ }
+
+ err := hs.processClientHello()
+ if err != nil {
+ t.Errorf("pickCipherSuite failed: %s", err)
+ }
+
+ if tc.expectedCipher != hs.suite.id {
+ t.Errorf("unexpected cipher chosen: want %d, got %d", tc.expectedCipher, hs.suite.id)
+ }
+ })
+ }
+}
diff --git a/src/crypto/tls/handshake_server_tls13.go b/src/crypto/tls/handshake_server_tls13.go
index 41f7ac2324..c7837d2955 100644
--- a/src/crypto/tls/handshake_server_tls13.go
+++ b/src/crypto/tls/handshake_server_tls13.go
@@ -153,9 +153,22 @@ func (hs *serverHandshakeStateTLS13) processClientHello() error {
if c.config.PreferServerCipherSuites {
preferenceList = defaultCipherSuitesTLS13()
supportedList = hs.clientHello.cipherSuites
+
+ // If the client does not seem to have hardware support for AES-GCM,
+ // prefer other AEAD ciphers even if we prioritized AES-GCM ciphers
+ // by default.
+ if !aesgcmPreferred(hs.clientHello.cipherSuites) {
+ preferenceList = deprioritizeAES(preferenceList)
+ }
} else {
preferenceList = hs.clientHello.cipherSuites
supportedList = defaultCipherSuitesTLS13()
+
+ // If we don't have hardware support for AES-GCM, prefer other AEAD
+ // ciphers even if the client prioritized AES-GCM.
+ if !hasAESGCMHardwareSupport {
+ preferenceList = deprioritizeAES(preferenceList)
+ }
}
for _, suiteID := range preferenceList {
hs.suite = mutualCipherSuiteTLS13(supportedList, suiteID)
diff --git a/src/crypto/tls/testdata/Server-TLSv12-ALPN b/src/crypto/tls/testdata/Server-TLSv12-ALPN
index d9e7e83766..d73866210d 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-ALPN
+++ b/src/crypto/tls/testdata/Server-TLSv12-ALPN
@@ -1,22 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 d1 01 00 00 cd 03 03 50 99 a9 e9 80 |...........P....|
-00000010 87 f1 0a 5a bc 9d a6 53 6d 08 36 4a 79 f8 48 c3 |...Z...Sm.6Jy.H.|
-00000020 fe c1 b4 02 d9 66 b2 cc f9 8d d4 00 00 38 c0 2c |.....f.......8.,|
-00000030 c0 30 00 9f cc a9 cc a8 cc aa c0 2b c0 2f 00 9e |.0.........+./..|
-00000040 c0 24 c0 28 00 6b c0 23 c0 27 00 67 c0 0a c0 14 |.$.(.k.#.'.g....|
-00000050 00 39 c0 09 c0 13 00 33 00 9d 00 9c 00 3d 00 3c |.9.....3.....=.<|
-00000060 00 35 00 2f 00 ff 01 00 00 6c 00 0b 00 04 03 00 |.5./.....l......|
-00000070 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 |................|
-00000080 00 18 00 23 00 00 00 10 00 10 00 0e 06 70 72 6f |...#.........pro|
-00000090 74 6f 32 06 70 72 6f 74 6f 31 00 16 00 00 00 17 |to2.proto1......|
-000000a0 00 00 00 0d 00 30 00 2e 04 03 05 03 06 03 08 07 |.....0..........|
-000000b0 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 |................|
-000000c0 05 01 06 01 03 03 02 03 03 01 02 01 03 02 02 02 |................|
-000000d0 04 02 05 02 06 02 |......|
+00000000 16 03 01 00 9d 01 00 00 99 03 03 53 49 69 68 95 |...........SIih.|
+00000010 b9 7b 2a 84 d2 03 93 d4 33 e7 b7 7e bc b5 97 b0 |.{*.....3..~....|
+00000020 4f 4f 6c d0 96 43 aa c8 6f da 90 00 00 04 cc a8 |OOl..C..o.......|
+00000030 00 ff 01 00 00 6c 00 0b 00 04 03 00 01 02 00 0a |.....l..........|
+00000040 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000050 00 00 00 10 00 10 00 0e 06 70 72 6f 74 6f 32 06 |.........proto2.|
+00000060 70 72 6f 74 6f 31 00 16 00 00 00 17 00 00 00 0d |proto1..........|
+00000070 00 30 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 |.0..............|
+00000080 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000090 03 03 02 03 03 01 02 01 03 02 02 02 04 02 05 02 |................|
+000000a0 06 02 |..|
>>> Flow 2 (server to client)
00000000 16 03 03 00 48 02 00 00 44 03 03 00 00 00 00 00 |....H...D.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 30 00 00 |...DOWNGRD...0..|
+00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 cc a8 00 00 |...DOWNGRD......|
00000030 1c 00 23 00 00 ff 01 00 01 00 00 10 00 09 00 07 |..#.............|
00000040 06 70 72 6f 74 6f 31 00 0b 00 02 01 00 16 03 03 |.proto1.........|
00000050 02 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b |.Y...U..R..O0..K|
@@ -59,38 +56,37 @@
000002a0 3d 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 ac |=.`.\!.;........|
000002b0 0c 00 00 a8 03 00 1d 20 2f e5 7d a3 47 cd 62 43 |....... /.}.G.bC|
000002c0 15 28 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 |.(.._.).0.......|
-000002d0 ed 90 99 5f 58 cb 3b 74 08 04 00 80 cb 03 45 70 |..._X.;t......Ep|
-000002e0 f5 51 af d7 cf db 26 79 d1 57 c2 06 4c 49 e6 ea |.Q....&y.W..LI..|
-000002f0 e7 f4 b8 2c 23 52 8a 1f bd 8e a3 9e 79 d4 8e 66 |...,#R......y..f|
-00000300 ee 92 39 97 cc ec 46 03 76 f9 59 b7 2e 6f e4 88 |..9...F.v.Y..o..|
-00000310 fd 39 65 59 88 c2 7e 7a bc de 86 49 98 45 a6 44 |.9eY..~z...I.E.D|
-00000320 82 41 19 94 53 3d 34 4b 73 52 5a af b2 3d 92 5e |.A..S=4KsRZ..=.^|
-00000330 f3 5b e8 fa 23 a7 71 5c 64 1b 43 bb bd 8e 01 2a |.[..#.q\d.C....*|
-00000340 59 2d 3b 73 0f b9 3d 02 9a 09 4a fc 0e 4b 65 07 |Y-;s..=...J..Ke.|
-00000350 82 f9 e1 ad ec 64 27 a4 07 60 c7 32 16 03 03 00 |.....d'..`.2....|
+000002d0 ed 90 99 5f 58 cb 3b 74 08 04 00 80 3b cd 7a 99 |..._X.;t....;.z.|
+000002e0 3f bf 03 5a 26 21 90 db b4 8d 3b 69 14 82 1c ae |?..Z&!....;i....|
+000002f0 7d 72 8f 4e eb ff c4 f0 13 fa 6f 69 48 e7 6d 3d |}r.N......oiH.m=|
+00000300 fc b3 1c 54 60 54 cf 83 48 1d a3 50 55 28 3f 2c |...T`T..H..PU(?,|
+00000310 db d3 dc c7 d9 58 74 de eb 5e 21 26 2f 32 c6 b2 |.....Xt..^!&/2..|
+00000320 be 1b 08 fa d6 9f 3b b0 2b e8 c2 36 2f 9d c1 35 |......;.+..6/..5|
+00000330 c1 54 4b 37 5f ff 99 4f c1 e4 ad 69 a0 c8 52 d3 |.TK7_..O...i..R.|
+00000340 01 23 0d 57 17 08 7c 07 9a 3a 6d c8 87 5d 7e 09 |.#.W..|..:m..]~.|
+00000350 7b 03 f9 5e de 83 4d 13 89 08 72 96 16 03 03 00 |{..^..M...r.....|
00000360 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 25 10 00 00 21 20 f6 5d 24 8e fc 1c |....%...! .]$...|
-00000010 39 bb 01 fc 23 ef f4 86 8b aa 2c 39 2a a1 4d e6 |9...#.....,9*.M.|
-00000020 7c 21 74 cc ed 2c 9b 4b f2 01 14 03 03 00 01 01 ||!t..,.K........|
-00000030 16 03 03 00 28 96 9c a6 78 4b 94 24 e2 31 5a 25 |....(...xK.$.1Z%|
-00000040 68 5e 6a 51 03 5d 9d cf 45 b1 78 17 0b bf ff c6 |h^jQ.]..E.x.....|
-00000050 72 5b e9 f0 a1 b1 46 ab a5 e1 3f 4d 67 |r[....F...?Mg|
+00000000 16 03 03 00 25 10 00 00 21 20 fb eb 44 09 0e 62 |....%...! ..D..b|
+00000010 b0 ce d8 1f c5 f9 46 31 1e 1d e8 fb 02 5f 34 3b |......F1....._4;|
+00000020 c1 6f 9a 38 6a 46 d2 cd a0 53 14 03 03 00 01 01 |.o.8jF...S......|
+00000030 16 03 03 00 20 88 73 90 39 bc 9b 02 e4 c0 35 f0 |.... .s.9.....5.|
+00000040 ef 40 b0 08 ca b9 bd 25 6b cd 03 7d ec 58 73 65 |.@.....%k..}.Xse|
+00000050 d5 89 f2 f1 70 |....p|
>>> Flow 4 (server to client)
00000000 16 03 03 00 8b 04 00 00 87 00 00 00 00 00 81 50 |...............P|
00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................|
-00000030 6f ec 80 83 51 ed 14 ef 68 ca 42 c5 4c 4a f5 b1 |o...Q...h.B.LJ..|
-00000040 56 86 3e f2 10 79 9e f3 a0 ed 07 6d 09 fc 77 63 |V.>..y.....m..wc|
-00000050 86 68 42 99 7b 13 c3 35 cf 5b a6 3a fa aa c2 ec |.hB.{..5.[.:....|
-00000060 80 a2 27 e4 97 24 07 48 2c 70 30 fc d6 49 38 16 |..'..$.H,p0..I8.|
-00000070 60 d5 b0 4c ec 4b 74 48 03 2a 5e fb 14 43 6c 5f |`..L.KtH.*^..Cl_|
-00000080 35 9c 1b a8 7d 62 f8 42 68 27 cb 6d 15 38 e7 8e |5...}b.Bh'.m.8..|
-00000090 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....|
-000000a0 00 00 00 8d 7a 5a 66 3b c9 fe 51 c2 71 ef a5 8b |....zZf;..Q.q...|
-000000b0 42 7d 79 33 4e 6d 66 12 cc e7 46 4f c3 30 12 8f |B}y3Nmf...FO.0..|
-000000c0 0c 57 60 17 03 03 00 25 00 00 00 00 00 00 00 01 |.W`....%........|
-000000d0 83 aa 62 fe a3 73 ed 67 87 c0 19 1c fa f0 2c 26 |..b..s.g......,&|
-000000e0 4b 16 44 9c a7 f8 c3 e1 ba 6a 85 8f 84 15 03 03 |K.D......j......|
-000000f0 00 1a 00 00 00 00 00 00 00 02 a8 b3 b2 dd 4b a6 |..............K.|
-00000100 ba 05 dc 8f ac 98 ae 01 10 60 9a 62 |.........`.b|
+00000030 6f e0 18 83 51 ed 14 ef 68 ca 42 c5 4c cd 0b 21 |o...Q...h.B.L..!|
+00000040 a5 29 ef 62 07 a5 11 b9 1f 4e 54 c3 66 4c 1e d3 |.).b.....NT.fL..|
+00000050 1a 00 52 34 67 2b af 73 02 5f c9 6c 7c 6e ba f2 |..R4g+.s._.l|n..|
+00000060 e6 38 bd 23 97 3f 80 6a 3b 8e bb 98 29 49 38 16 |.8.#.?.j;...)I8.|
+00000070 77 74 2a a1 c7 36 80 de c9 91 cd b2 7d bc 6c 64 |wt*..6......}.ld|
+00000080 6c 06 57 22 d1 f2 51 5f 84 ad 30 85 3a c0 4f e7 |l.W"..Q_..0.:.O.|
+00000090 14 03 03 00 01 01 16 03 03 00 20 32 71 5a d3 94 |.......... 2qZ..|
+000000a0 d5 17 e4 8c 3a 78 d1 48 4e 1b f5 83 36 f1 5a 38 |....:x.HN...6.Z8|
+000000b0 e4 b5 6d ab 46 89 e0 24 74 87 80 17 03 03 00 1d |..m.F..$t.......|
+000000c0 69 4c a6 24 67 79 18 59 92 4f 9a d0 2d 1d 57 e0 |iL.$gy.Y.O..-.W.|
+000000d0 ec 0c 00 25 6f 2f 3a be 8a aa 80 94 ac 15 03 03 |...%o/:.........|
+000000e0 00 12 ef 86 3e 93 42 bb 72 f1 1b 90 df 9a d3 ed |....>.B.r.......|
+000000f0 d8 74 35 23 |.t5#|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch b/src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch
index 589189ca84..fdfb175463 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch
+++ b/src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch
@@ -1,22 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 d1 01 00 00 cd 03 03 44 a5 b9 48 dd |...........D..H.|
-00000010 ca 91 9a c6 72 06 b3 dd a7 95 18 c6 95 0b f2 32 |....r..........2|
-00000020 84 37 78 12 0f 66 c7 6e e6 61 81 00 00 38 c0 2c |.7x..f.n.a...8.,|
-00000030 c0 30 00 9f cc a9 cc a8 cc aa c0 2b c0 2f 00 9e |.0.........+./..|
-00000040 c0 24 c0 28 00 6b c0 23 c0 27 00 67 c0 0a c0 14 |.$.(.k.#.'.g....|
-00000050 00 39 c0 09 c0 13 00 33 00 9d 00 9c 00 3d 00 3c |.9.....3.....=.<|
-00000060 00 35 00 2f 00 ff 01 00 00 6c 00 0b 00 04 03 00 |.5./.....l......|
-00000070 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 |................|
-00000080 00 18 00 23 00 00 00 10 00 10 00 0e 06 70 72 6f |...#.........pro|
-00000090 74 6f 32 06 70 72 6f 74 6f 31 00 16 00 00 00 17 |to2.proto1......|
-000000a0 00 00 00 0d 00 30 00 2e 04 03 05 03 06 03 08 07 |.....0..........|
-000000b0 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 |................|
-000000c0 05 01 06 01 03 03 02 03 03 01 02 01 03 02 02 02 |................|
-000000d0 04 02 05 02 06 02 |......|
+00000000 16 03 01 00 9d 01 00 00 99 03 03 7f fc 15 86 d1 |................|
+00000010 83 09 78 47 8d cd 7b 88 b3 86 52 27 bc da bc 8d |..xG..{...R'....|
+00000020 0e 5d 35 44 21 17 7b d9 67 b9 fb 00 00 04 cc a8 |.]5D!.{.g.......|
+00000030 00 ff 01 00 00 6c 00 0b 00 04 03 00 01 02 00 0a |.....l..........|
+00000040 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000050 00 00 00 10 00 10 00 0e 06 70 72 6f 74 6f 32 06 |.........proto2.|
+00000060 70 72 6f 74 6f 31 00 16 00 00 00 17 00 00 00 0d |proto1..........|
+00000070 00 30 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 |.0..............|
+00000080 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000090 03 03 02 03 03 01 02 01 03 02 02 02 04 02 05 02 |................|
+000000a0 06 02 |..|
>>> Flow 2 (server to client)
00000000 16 03 03 00 3b 02 00 00 37 03 03 00 00 00 00 00 |....;...7.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 30 00 00 |...DOWNGRD...0..|
+00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 cc a8 00 00 |...DOWNGRD......|
00000030 0f 00 23 00 00 ff 01 00 01 00 00 0b 00 02 01 00 |..#.............|
00000040 16 03 03 02 59 0b 00 02 55 00 02 52 00 02 4f 30 |....Y...U..R..O0|
00000050 82 02 4b 30 82 01 b4 a0 03 02 01 02 02 09 00 e8 |..K0............|
@@ -58,38 +55,37 @@
00000290 d4 db fe 3d 13 60 84 5c 21 d3 3b e9 fa e7 16 03 |...=.`.\!.;.....|
000002a0 03 00 ac 0c 00 00 a8 03 00 1d 20 2f e5 7d a3 47 |.......... /.}.G|
000002b0 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 af |.bC.(.._.).0....|
-000002c0 c4 cf c2 ed 90 99 5f 58 cb 3b 74 08 04 00 80 1d |......_X.;t.....|
-000002d0 ae 16 b9 7e 58 bb d5 1b 9e 51 09 a2 d1 a8 3f 1d |...~X....Q....?.|
-000002e0 f4 09 72 a5 c6 cc 9a 53 46 1c 9f 58 36 cd 91 39 |..r....SF..X6..9|
-000002f0 44 ca 56 da 50 77 d5 56 10 14 45 ad 98 b8 2f 44 |D.V.Pw.V..E.../D|
-00000300 33 ae a9 b1 b6 a6 2a ab 0a 0a 39 75 2c 4d 4c 51 |3.....*...9u,MLQ|
-00000310 71 07 83 bf ad 8b 37 c5 59 dd 8f d7 b8 85 2e 04 |q.....7.Y.......|
-00000320 9e 39 e6 e5 a5 48 9a 24 63 b3 a7 46 73 b2 5c 10 |.9...H.$c..Fs.\.|
-00000330 cc 4c e5 55 dd 97 b0 42 4e 8b fb 0d cd 47 e9 09 |.L.U...BN....G..|
-00000340 20 88 96 5e 76 0d 9b b1 91 3f 27 a1 f3 0d 77 16 | ..^v....?'...w.|
+000002c0 c4 cf c2 ed 90 99 5f 58 cb 3b 74 08 04 00 80 b8 |......_X.;t.....|
+000002d0 a8 88 ac 85 ea 59 ac f1 41 e8 2d a2 76 3c 3b 4f |.....Y..A.-.v<;O|
+000002e0 58 90 b7 03 74 4b 7a a7 5a 65 ea 08 9c cf e9 4d |X...tKz.Ze.....M|
+000002f0 b4 8a ef f3 e1 d8 0a 83 0f 50 29 0b 59 77 90 e9 |.........P).Yw..|
+00000300 f3 e8 ca 6c b5 da e5 2b 95 47 e7 ed ff d6 3b 30 |...l...+.G....;0|
+00000310 45 61 2c af 5c 8c 4c df bd c4 dc 28 dd d2 31 fa |Ea,.\.L....(..1.|
+00000320 be 65 2b a4 cd 7c 41 29 4c 99 07 97 5c 2a 3c a7 |.e+..|A)L...\*<.|
+00000330 4d 9c ed 72 eb a1 a4 9e db eb a0 cf c7 c2 b1 3b |M..r...........;|
+00000340 5a d9 f8 f8 8e d5 07 81 f6 65 aa 0d 4f 4d 11 16 |Z........e..OM..|
00000350 03 03 00 04 0e 00 00 00 |........|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 25 10 00 00 21 20 89 8e 03 11 92 ab |....%...! ......|
-00000010 51 f5 d7 dc 27 87 fd 38 eb 45 3d cc 75 1a 1e 07 |Q...'..8.E=.u...|
-00000020 d6 0f 2b 92 df 5a 7c 24 30 56 14 03 03 00 01 01 |..+..Z|$0V......|
-00000030 16 03 03 00 28 fa 24 69 6d 65 2f 34 35 47 9b 83 |....(.$ime/45G..|
-00000040 65 0f fd c1 33 61 1d 47 cf ec 87 6f 48 71 63 7d |e...3a.G...oHqc}|
-00000050 e8 aa bc 2e cd 7d 2e 4b d5 0f 4f 66 14 |.....}.K..Of.|
+00000000 16 03 03 00 25 10 00 00 21 20 5f d2 13 b1 79 f6 |....%...! _...y.|
+00000010 f3 2a 21 f5 89 a3 22 29 73 30 14 60 1d 1e 77 8a |.*!...")s0.`..w.|
+00000020 f4 1a 92 3f b0 04 06 98 1a 1e 14 03 03 00 01 01 |...?............|
+00000030 16 03 03 00 20 63 10 89 c0 c0 56 37 40 8c e8 5e |.... c....V7@..^|
+00000040 7f f0 f0 e3 a0 8e d5 20 33 5f dd c3 16 e8 eb 6c |....... 3_.....l|
+00000050 c3 a8 75 6d dc |..um.|
>>> Flow 4 (server to client)
00000000 16 03 03 00 8b 04 00 00 87 00 00 00 00 00 81 50 |...............P|
00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................|
-00000030 6f ec 80 83 51 ed 14 ef 68 ca 42 c5 4c 60 05 16 |o...Q...h.B.L`..|
-00000040 33 5b f7 bd 83 9c 69 80 c2 fe 5c 73 32 05 67 97 |3[....i...\s2.g.|
-00000050 fd 6b 3a d3 b4 6d a5 5e 18 c0 1e ba d5 2c 44 ad |.k:..m.^.....,D.|
-00000060 54 24 65 be 14 90 ab 6d a1 de d1 98 1e 49 38 16 |T$e....m.....I8.|
-00000070 f0 fe 8d 49 6d e1 5a 6d 10 30 26 64 5f 10 ad ab |...Im.Zm.0&d_...|
-00000080 d7 c9 3a bc 6a 3f 32 78 4b fe f1 38 08 2c 15 e7 |..:.j?2xK..8.,..|
-00000090 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....|
-000000a0 00 00 00 e9 3d 4c 8b 59 78 8c 49 77 08 3b c1 de |....=L.Yx.Iw.;..|
-000000b0 4c 78 9a d7 c6 1a 66 fb 43 de bd cb 8b ca a2 32 |Lx....f.C......2|
-000000c0 a2 26 1e 17 03 03 00 25 00 00 00 00 00 00 00 01 |.&.....%........|
-000000d0 47 c9 3a 0d 8d 8b d1 b7 66 17 8e 83 31 02 ed 51 |G.:.....f...1..Q|
-000000e0 e8 cb 1d 4a 42 d6 f9 ee b8 6d fd d0 4b 15 03 03 |...JB....m..K...|
-000000f0 00 1a 00 00 00 00 00 00 00 02 f3 00 56 6d fc 23 |............Vm.#|
-00000100 49 bb 65 00 b0 ae cd c7 62 ac 47 1f |I.e.....b.G.|
+00000030 6f e0 18 83 51 ed 14 ef 68 ca 42 c5 4c e3 f1 12 |o...Q...h.B.L...|
+00000040 a1 17 a6 ee 99 af e8 06 65 d0 6d c1 4f ce 92 7c |........e.m.O..||
+00000050 40 df 41 c1 90 e3 e0 d8 a1 95 da 38 25 26 ea b5 |@.A........8%&..|
+00000060 ca a9 42 5f 8c 55 d4 d2 73 a6 a2 b6 22 49 38 16 |..B_.U..s..."I8.|
+00000070 ec 70 52 f9 c0 12 18 9e 9b 4d e3 6d 49 b7 3b c0 |.pR......M.mI.;.|
+00000080 e9 53 9d 06 96 fc a9 06 8c 2a 7a c5 7d 48 47 ef |.S.......*z.}HG.|
+00000090 14 03 03 00 01 01 16 03 03 00 20 19 27 38 37 bf |.......... .'87.|
+000000a0 07 4e 2f 77 b9 73 4b dd c8 f8 4c c5 f1 35 86 2b |.N/w.sK...L..5.+|
+000000b0 97 7e 0f 89 4b bf db 81 76 8a 41 17 03 03 00 1d |.~..K...v.A.....|
+000000c0 6d b8 c3 eb b1 5a f3 06 97 04 61 fc 82 74 5d a0 |m....Z....a..t].|
+000000d0 73 57 75 6e 66 53 3e 12 5e 0d 60 31 52 15 03 03 |sWunfS>.^.`1R...|
+000000e0 00 12 e4 93 fb 7b cb ee d6 70 ac af 5f 8b 82 9b |.....{...p.._...|
+000000f0 e5 0b 68 9c |..h.|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
index 31776532f1..3d1ceaf903 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
+++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
@@ -1,60 +1,58 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 97 01 00 00 93 03 03 a8 4e d1 44 14 |............N.D.|
-00000010 46 11 b2 4f 03 b6 6f 89 cf fd dd 9b 6a dd 4d 1e |F..O..o.....j.M.|
-00000020 51 02 a2 10 d9 d3 a1 d8 54 a2 4a 00 00 04 00 2f |Q.......T.J..../|
-00000030 00 ff 01 00 00 66 00 00 00 0e 00 0c 00 00 09 31 |.....f.........1|
-00000040 32 37 2e 30 2e 30 2e 31 00 0b 00 04 03 00 01 02 |27.0.0.1........|
-00000050 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 |................|
-00000060 00 16 00 00 00 17 00 00 00 0d 00 30 00 2e 04 03 |...........0....|
-00000070 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 |................|
-00000080 08 05 08 06 04 01 05 01 06 01 03 03 02 03 03 01 |................|
-00000090 02 01 03 02 02 02 04 02 05 02 06 02 |............|
+00000000 16 03 01 00 6d 01 00 00 69 03 03 b0 00 44 aa 86 |....m...i....D..|
+00000010 30 87 8e 3f f1 89 9a 4a f6 4c 3b 11 f3 4f e9 9f |0..?...J.L;..O..|
+00000020 00 22 47 82 26 57 c7 d0 f9 59 6f 00 00 04 00 2f |."G.&W...Yo..../|
+00000030 00 ff 01 00 00 3c 00 16 00 00 00 17 00 00 00 0d |.....<..........|
+00000040 00 30 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 |.0..............|
+00000050 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000060 03 03 02 03 03 01 02 01 03 02 02 02 04 02 05 02 |................|
+00000070 06 02 |..|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
+00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 00 2f 00 00 |...DOWNGRD.../..|
-00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|
-00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|
-00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|
-00000060 5b ea a6 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b |[..0...*.H......|
-00000070 05 00 30 1f 31 0b 30 09 06 03 55 04 0a 13 02 47 |..0.1.0...U....G|
-00000080 6f 31 10 30 0e 06 03 55 04 03 13 07 47 6f 20 52 |o1.0...U....Go R|
-00000090 6f 6f 74 30 1e 17 0d 31 36 30 31 30 31 30 30 30 |oot0...160101000|
-000000a0 30 30 30 5a 17 0d 32 35 30 31 30 31 30 30 30 30 |000Z..2501010000|
-000000b0 30 30 5a 30 1a 31 0b 30 09 06 03 55 04 0a 13 02 |00Z0.1.0...U....|
-000000c0 47 6f 31 0b 30 09 06 03 55 04 03 13 02 47 6f 30 |Go1.0...U....Go0|
-000000d0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|
-000000e0 00 03 81 8d 00 30 81 89 02 81 81 00 db 46 7d 93 |.....0.......F}.|
-000000f0 2e 12 27 06 48 bc 06 28 21 ab 7e c4 b6 a2 5d fe |..'.H..(!.~...].|
-00000100 1e 52 45 88 7a 36 47 a5 08 0d 92 42 5b c2 81 c0 |.RE.z6G....B[...|
-00000110 be 97 79 98 40 fb 4f 6d 14 fd 2b 13 8b c2 a5 2e |..y.@.Om..+.....|
-00000120 67 d8 d4 09 9e d6 22 38 b7 4a 0b 74 73 2b c2 34 |g....."8.J.ts+.4|
-00000130 f1 d1 93 e5 96 d9 74 7b f3 58 9f 6c 61 3c c0 b0 |......t{.X.la<..|
-00000140 41 d4 d9 2b 2b 24 23 77 5b 1c 3b bd 75 5d ce 20 |A..++$#w[.;.u]. |
-00000150 54 cf a1 63 87 1d 1e 24 c4 f3 1d 1a 50 8b aa b6 |T..c...$....P...|
-00000160 14 43 ed 97 a7 75 62 f4 14 c8 52 d7 02 03 01 00 |.C...ub...R.....|
-00000170 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f 01 01 |....0..0...U....|
-00000180 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 04 16 |.......0...U.%..|
-00000190 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 2b 06 |0...+.........+.|
-000001a0 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 01 ff |......0...U.....|
-000001b0 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 10 9f |..0.0...U.......|
-000001c0 91 16 1f 43 43 3e 49 a6 de 6d b6 80 d7 9f 60 30 |...CC>I..m....`0|
-000001d0 1b 06 03 55 1d 23 04 14 30 12 80 10 48 13 49 4d |...U.#..0...H.IM|
-000001e0 13 7e 16 31 bb a3 01 d5 ac ab 6e 7b 30 19 06 03 |.~.1......n{0...|
-000001f0 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 6c 65 |U....0...example|
-00000200 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 86 f7 |.golang0...*.H..|
-00000210 0d 01 01 0b 05 00 03 81 81 00 9d 30 cc 40 2b 5b |...........0.@+[|
-00000220 50 a0 61 cb ba e5 53 58 e1 ed 83 28 a9 58 1a a9 |P.a...SX...(.X..|
-00000230 38 a4 95 a1 ac 31 5a 1a 84 66 3d 43 d3 2d d9 0b |8....1Z..f=C.-..|
-00000240 f2 97 df d3 20 64 38 92 24 3a 00 bc cf 9c 7d b7 |.... d8.$:....}.|
-00000250 40 20 01 5f aa d3 16 61 09 a2 76 fd 13 c3 cc e1 |@ ._...a..v.....|
-00000260 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 77 8d |.\.....l..s..Cw.|
-00000270 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d ae db |......@.a.Lr+...|
-00000280 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db fe 3d |F..M...>...B...=|
-00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 23 0d |.`.\!.;.......#.|
-000002a0 00 00 1f 02 01 40 00 18 08 04 04 03 08 07 08 05 |.....@..........|
-000002b0 08 06 04 01 05 01 06 01 05 03 06 03 02 01 02 03 |................|
-000002c0 00 00 16 03 03 00 04 0e 00 00 00 |...........|
+00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.|
+00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......|
+00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.|
+00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..|
+00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..|
+000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1|
+000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.|
+000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...|
+000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0|
+000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.|
+000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6|
+00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.|
+00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....|
+00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......|
+00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$|
+00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..|
+00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u|
+00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.|
+00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........|
+00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.|
+00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......|
+000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.|
+000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>|
+000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#|
+000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..|
+000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0|
+000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan|
+00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........|
+00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...|
+00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1|
+00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d|
+00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..|
+00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....|
+00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......|
+00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..|
+00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.|
+00000290 3b e9 fa e7 16 03 03 00 23 0d 00 00 1f 02 01 40 |;.......#......@|
+000002a0 00 18 08 04 04 03 08 07 08 05 08 06 04 01 05 01 |................|
+000002b0 06 01 05 03 06 03 02 01 02 03 00 00 16 03 03 00 |................|
+000002c0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
00000000 16 03 03 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0|
00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5|
@@ -89,40 +87,40 @@
000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.|
000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W|
00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..|
-00000210 03 03 00 86 10 00 00 82 00 80 94 7b c5 f9 b7 fa |...........{....|
-00000220 08 d2 59 d4 d5 ae 30 7f 9b d6 97 8e f8 ab 5c dc |..Y...0.......\.|
-00000230 b2 f2 f7 c2 f3 4a 2d c0 88 11 84 42 bf fe b9 ca |.....J-....B....|
-00000240 6f 6e b2 a4 c3 50 f1 bc 22 6e 12 bf 18 e2 12 1c |on...P.."n......|
-00000250 c2 53 f5 b4 03 f2 c8 a4 a6 29 da cd 3e 62 6d c0 |.S.......)..>bm.|
-00000260 34 58 5d 3b 1c 84 6e a6 d7 7c 63 67 0c 1a 7c a4 |4X];..n..|cg..|.|
-00000270 ea 66 ce 70 6c 6d fd c9 d5 b5 63 38 93 02 7c 3b |.f.plm....c8..|;|
-00000280 b2 0b 62 ff 32 2d 6a d0 59 27 e6 34 cc a6 25 aa |..b.2-j.Y'.4..%.|
-00000290 5b 77 4a f6 79 72 1f bf 30 f1 16 03 03 00 92 0f |[wJ.yr..0.......|
-000002a0 00 00 8e 04 03 00 8a 30 81 87 02 42 01 dc 84 5b |.......0...B...[|
-000002b0 f3 56 ac 18 07 45 f0 3d 2c 96 e8 ff 12 c0 59 0e |.V...E.=,.....Y.|
-000002c0 de ef 93 98 88 09 dd 82 14 65 20 72 a9 f2 bc 2d |.........e r...-|
-000002d0 7a d1 d7 f0 fe 99 f1 80 54 b8 30 b2 b9 01 3d a6 |z.......T.0...=.|
-000002e0 f2 c0 cd 8e 68 a2 e7 92 85 aa 13 8f 49 1c 02 41 |....h.......I..A|
-000002f0 2c 4c 7d f6 27 ea 31 e1 4d 68 b3 39 4a 2d 26 ae |,L}.'.1.Mh.9J-&.|
-00000300 42 4a 6c 4e cc fb bf b7 0b 1a bf df 57 0c fe b1 |BJlN........W...|
-00000310 fd fc bd a2 08 a2 fc 4f 91 89 ec e0 ea e3 b3 38 |.......O.......8|
-00000320 2f ba 17 8e 07 0a 4d cd a8 73 a4 e9 a3 02 ee 42 |/.....M..s.....B|
-00000330 07 14 03 03 00 01 01 16 03 03 00 40 75 26 df cd |...........@u&..|
-00000340 34 27 db 19 2f da d4 0d 0a ec b4 d5 03 1a a1 34 |4'../..........4|
-00000350 fa fd df a9 31 1e e0 78 87 f6 9b 31 4a 27 4d 4e |....1..x...1J'MN|
-00000360 54 d4 b0 a2 1a 72 52 02 89 47 93 a6 c4 57 d3 b8 |T....rR..G...W..|
-00000370 60 e5 1e db 60 ea fd 08 6f 13 fc 9d |`...`...o...|
+00000210 03 03 00 86 10 00 00 82 00 80 10 ab 2f 0f b9 29 |............/..)|
+00000220 9f 26 36 09 00 96 9a 3d 2a 01 50 03 f3 d6 ac fc |.&6....=*.P.....|
+00000230 40 76 96 d0 e6 a6 67 89 24 b0 56 80 58 5e 6d 03 |@v....g.$.V.X^m.|
+00000240 e3 0f dc 61 d1 de 25 95 8a 54 9f 5b 3e f2 31 dd |...a..%..T.[>.1.|
+00000250 14 2a e2 de 7b 70 66 b5 ed 95 d9 cc 6f c0 b3 a1 |.*..{pf.....o...|
+00000260 bb 41 b2 0f 7d e8 ce b5 11 eb 99 e2 ce c0 33 bc |.A..}.........3.|
+00000270 6a 67 10 84 d2 dd ac 15 8f 8e aa 2b 1a 7b ca d3 |jg.........+.{..|
+00000280 bb 4b 92 c4 b9 2b 08 c1 0d b2 cf 96 63 64 9d 12 |.K...+......cd..|
+00000290 a6 93 cd 21 3b bc 8e 94 72 76 16 03 03 00 93 0f |...!;...rv......|
+000002a0 00 00 8f 04 03 00 8b 30 81 88 02 42 00 d5 05 54 |.......0...B...T|
+000002b0 b2 68 a5 04 d6 3c 7b 7d c1 be e3 d1 b4 25 42 d6 |.h...<{}.....%B.|
+000002c0 2a 3a 2e ea 73 0d 57 ba 0f 96 78 66 c2 c5 d7 57 |*:..s.W...xf...W|
+000002d0 79 9c 22 8b 76 e9 45 ff ef 92 e9 43 3e b8 8b b4 |y.".v.E....C>...|
+000002e0 cf 3f 67 aa 70 d1 e8 a2 1c a8 3d 24 a2 78 02 42 |.?g.p.....=$.x.B|
+000002f0 01 b2 17 64 66 2f 2e 0d 2d b9 1d 67 45 de 48 9e |...df/..-..gE.H.|
+00000300 32 f2 1f 79 38 39 b8 bb 8b 7f 82 e9 46 fd 9b 1b |2..y89......F...|
+00000310 b3 dd a4 9c 15 b2 a2 88 4c f7 42 a2 62 92 c0 d0 |........L.B.b...|
+00000320 a1 78 aa 8b 2d 78 4f 02 5a f7 eb ca c7 34 fc b6 |.x..-xO.Z....4..|
+00000330 6c 6e 14 03 03 00 01 01 16 03 03 00 40 bd 47 9b |ln..........@.G.|
+00000340 ce 31 2c 09 d3 a8 2c bb 28 0c e8 bd 01 a9 54 34 |.1,...,.(.....T4|
+00000350 a5 74 af e0 d2 38 f3 1b fa d0 2b a6 39 24 ae de |.t...8....+.9$..|
+00000360 0a cf 4b c0 a2 3b bf 80 23 71 0a 60 ca 94 b7 23 |..K..;..#q.`...#|
+00000370 80 e3 89 89 42 74 0b a1 c6 f6 d2 c0 79 |....Bt......y|
>>> Flow 4 (server to client)
00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 b7 39 51 e9 91 |............9Q..|
-00000020 8a f0 d0 a9 6d fb 0e 30 bd 74 44 94 48 b0 6e a7 |....m..0.tD.H.n.|
-00000030 ab a8 8c ce 87 da 93 73 e1 da cc 53 e8 32 03 fe |.......s...S.2..|
-00000040 57 66 cf e1 ed ef e6 6f 80 32 eb 17 03 03 00 40 |Wf.....o.2.....@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 54 52 4a 33 9e |...........TRJ3.|
+00000020 bb 59 7e 21 03 a6 23 bd 68 18 43 b5 c5 c5 37 a2 |.Y~!..#.h.C...7.|
+00000030 6f ac 8c 78 c5 cf 8f e6 01 df 17 53 45 6f 1a e0 |o..x.......SEo..|
+00000040 9c 4a 3d 2c cb 0d 55 7d 32 81 ec 17 03 03 00 40 |.J=,..U}2......@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 37 8f 8a d3 8e 0a f5 24 28 95 5e 19 e1 40 b8 2a |7......$(.^..@.*|
-00000070 eb 4f 2a ec 6d 4d 7f f3 fb 63 52 46 52 57 c1 4a |.O*.mM...cRFRW.J|
-00000080 ec cc a0 6b 2e 49 41 51 38 25 e3 af 82 53 2a 15 |...k.IAQ8%...S*.|
+00000060 ba 75 93 00 86 1c bc 66 9e 27 2f 2b 5a 68 0e 44 |.u.....f.'/+Zh.D|
+00000070 81 15 0d 67 e6 ee 7a 43 08 78 93 71 91 00 56 0e |...g..zC.x.q..V.|
+00000080 c6 e1 73 4b af 2f e6 e0 92 4d e5 35 ea 53 7c 45 |..sK./...M.5.S|E|
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 83 24 3c 9d 31 f3 41 a5 35 8c 01 |......$<.1.A.5..|
-000000b0 70 f4 b7 6e 2b 9e 1a 48 cf ce a4 68 2a 2c 53 18 |p..n+..H...h*,S.|
-000000c0 1e 26 24 50 92 |.&$P.|
+000000a0 00 00 00 00 00 8d 7e 99 bb 93 bd 5d ba 31 b0 0d |......~....].1..|
+000000b0 1f 76 95 50 7c 1e 24 62 9d 05 65 3f ee b7 c2 24 |.v.P|.$b..e?...$|
+000000c0 13 60 43 69 3a |.`Ci:|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndEd25519Given b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndEd25519Given
index d535cb4d75..1c3b08f06f 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndEd25519Given
+++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndEd25519Given
@@ -1,74 +1,58 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 cb 01 00 00 c7 03 03 6e 46 fb 23 fe |...........nF.#.|
-00000010 6d b0 f4 4f bf fb c6 93 f8 29 f8 93 0e 13 51 9e |m..O.....)....Q.|
-00000020 d7 cc e8 bb d1 c1 69 06 66 4f 45 00 00 38 c0 2c |......i.fOE..8.,|
-00000030 c0 30 00 9f cc a9 cc a8 cc aa c0 2b c0 2f 00 9e |.0.........+./..|
-00000040 c0 24 c0 28 00 6b c0 23 c0 27 00 67 c0 0a c0 14 |.$.(.k.#.'.g....|
-00000050 00 39 c0 09 c0 13 00 33 00 9d 00 9c 00 3d 00 3c |.9.....3.....=.<|
-00000060 00 35 00 2f 00 ff 01 00 00 66 00 00 00 0e 00 0c |.5./.....f......|
-00000070 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000080 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000090 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 30 |...............0|
-000000a0 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................|
-000000b0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 03 03 |................|
-000000c0 02 03 03 01 02 01 03 02 02 02 04 02 05 02 06 02 |................|
+00000000 16 03 01 00 6d 01 00 00 69 03 03 aa ad c9 dc 56 |....m...i......V|
+00000010 79 2e da 42 a6 b2 9e 0a 85 a6 1b e0 5e cd 4e f5 |y..B........^.N.|
+00000020 93 93 0c d5 62 a8 53 17 10 f7 e6 00 00 04 00 2f |....b.S......../|
+00000030 00 ff 01 00 00 3c 00 16 00 00 00 17 00 00 00 0d |.....<..........|
+00000040 00 30 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 |.0..............|
+00000050 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000060 03 03 02 03 03 01 02 01 03 02 02 02 04 02 05 02 |................|
+00000070 06 02 |..|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
+00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 30 00 00 |...DOWNGRD...0..|
-00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|
-00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|
-00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|
-00000060 5b ea a6 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b |[..0...*.H......|
-00000070 05 00 30 1f 31 0b 30 09 06 03 55 04 0a 13 02 47 |..0.1.0...U....G|
-00000080 6f 31 10 30 0e 06 03 55 04 03 13 07 47 6f 20 52 |o1.0...U....Go R|
-00000090 6f 6f 74 30 1e 17 0d 31 36 30 31 30 31 30 30 30 |oot0...160101000|
-000000a0 30 30 30 5a 17 0d 32 35 30 31 30 31 30 30 30 30 |000Z..2501010000|
-000000b0 30 30 5a 30 1a 31 0b 30 09 06 03 55 04 0a 13 02 |00Z0.1.0...U....|
-000000c0 47 6f 31 0b 30 09 06 03 55 04 03 13 02 47 6f 30 |Go1.0...U....Go0|
-000000d0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|
-000000e0 00 03 81 8d 00 30 81 89 02 81 81 00 db 46 7d 93 |.....0.......F}.|
-000000f0 2e 12 27 06 48 bc 06 28 21 ab 7e c4 b6 a2 5d fe |..'.H..(!.~...].|
-00000100 1e 52 45 88 7a 36 47 a5 08 0d 92 42 5b c2 81 c0 |.RE.z6G....B[...|
-00000110 be 97 79 98 40 fb 4f 6d 14 fd 2b 13 8b c2 a5 2e |..y.@.Om..+.....|
-00000120 67 d8 d4 09 9e d6 22 38 b7 4a 0b 74 73 2b c2 34 |g....."8.J.ts+.4|
-00000130 f1 d1 93 e5 96 d9 74 7b f3 58 9f 6c 61 3c c0 b0 |......t{.X.la<..|
-00000140 41 d4 d9 2b 2b 24 23 77 5b 1c 3b bd 75 5d ce 20 |A..++$#w[.;.u]. |
-00000150 54 cf a1 63 87 1d 1e 24 c4 f3 1d 1a 50 8b aa b6 |T..c...$....P...|
-00000160 14 43 ed 97 a7 75 62 f4 14 c8 52 d7 02 03 01 00 |.C...ub...R.....|
-00000170 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f 01 01 |....0..0...U....|
-00000180 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 04 16 |.......0...U.%..|
-00000190 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 2b 06 |0...+.........+.|
-000001a0 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 01 ff |......0...U.....|
-000001b0 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 10 9f |..0.0...U.......|
-000001c0 91 16 1f 43 43 3e 49 a6 de 6d b6 80 d7 9f 60 30 |...CC>I..m....`0|
-000001d0 1b 06 03 55 1d 23 04 14 30 12 80 10 48 13 49 4d |...U.#..0...H.IM|
-000001e0 13 7e 16 31 bb a3 01 d5 ac ab 6e 7b 30 19 06 03 |.~.1......n{0...|
-000001f0 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 6c 65 |U....0...example|
-00000200 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 86 f7 |.golang0...*.H..|
-00000210 0d 01 01 0b 05 00 03 81 81 00 9d 30 cc 40 2b 5b |...........0.@+[|
-00000220 50 a0 61 cb ba e5 53 58 e1 ed 83 28 a9 58 1a a9 |P.a...SX...(.X..|
-00000230 38 a4 95 a1 ac 31 5a 1a 84 66 3d 43 d3 2d d9 0b |8....1Z..f=C.-..|
-00000240 f2 97 df d3 20 64 38 92 24 3a 00 bc cf 9c 7d b7 |.... d8.$:....}.|
-00000250 40 20 01 5f aa d3 16 61 09 a2 76 fd 13 c3 cc e1 |@ ._...a..v.....|
-00000260 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 77 8d |.\.....l..s..Cw.|
-00000270 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d ae db |......@.a.Lr+...|
-00000280 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db fe 3d |F..M...>...B...=|
-00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 ac 0c |.`.\!.;.........|
-000002a0 00 00 a8 03 00 1d 20 2f e5 7d a3 47 cd 62 43 15 |...... /.}.G.bC.|
-000002b0 28 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 ed |(.._.).0........|
-000002c0 90 99 5f 58 cb 3b 74 08 04 00 80 17 9f 15 d6 26 |.._X.;t........&|
-000002d0 36 78 d9 7f e6 48 27 56 a5 96 22 9f 9c f6 92 a0 |6x...H'V..".....|
-000002e0 dc 7d eb 66 6e b8 94 34 74 ac 96 50 63 f1 cd 92 |.}.fn..4t..Pc...|
-000002f0 bc 31 d2 f5 30 70 b2 d6 f3 09 0c 87 6a 8b f5 46 |.1..0p......j..F|
-00000300 0d 9a 87 4c de 94 80 49 43 26 28 e9 67 fa a8 1f |...L...IC&(.g...|
-00000310 dd 36 5c b1 49 05 37 ac 2d db b8 22 bf ed 64 dc |.6\.I.7.-.."..d.|
-00000320 50 53 12 3e e6 5a 78 fc b2 c5 6f 4c a9 86 40 da |PS.>.Zx...oL..@.|
-00000330 0a 9b 71 62 6d 12 c9 b7 9a 8b ca bd a5 77 37 0c |..qbm........w7.|
-00000340 1c f1 66 2c 63 2d 7b c6 6b f1 48 16 03 03 00 23 |..f,c-{.k.H....#|
-00000350 0d 00 00 1f 02 01 40 00 18 08 04 04 03 08 07 08 |......@.........|
-00000360 05 08 06 04 01 05 01 06 01 05 03 06 03 02 01 02 |................|
-00000370 03 00 00 16 03 03 00 04 0e 00 00 00 |............|
+00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 00 2f 00 00 |...DOWNGRD.../..|
+00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.|
+00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......|
+00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.|
+00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..|
+00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..|
+000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1|
+000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.|
+000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...|
+000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0|
+000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.|
+000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6|
+00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.|
+00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....|
+00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......|
+00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$|
+00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..|
+00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u|
+00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.|
+00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........|
+00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.|
+00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......|
+000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.|
+000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>|
+000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#|
+000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..|
+000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0|
+000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan|
+00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........|
+00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...|
+00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1|
+00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d|
+00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..|
+00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....|
+00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......|
+00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..|
+00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.|
+00000290 3b e9 fa e7 16 03 03 00 23 0d 00 00 1f 02 01 40 |;.......#......@|
+000002a0 00 18 08 04 04 03 08 07 08 05 08 06 04 01 05 01 |................|
+000002b0 06 01 05 03 06 03 02 01 02 03 00 00 16 03 03 00 |................|
+000002c0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
00000000 16 03 03 01 3c 0b 00 01 38 00 01 35 00 01 32 30 |....<...8..5..20|
00000010 82 01 2e 30 81 e1 a0 03 02 01 02 02 10 17 d1 81 |...0............|
@@ -90,23 +74,36 @@
00000110 8a 4e 34 40 39 d6 b3 10 dc 19 fe a0 22 71 b3 f5 |.N4@9......."q..|
00000120 8f a1 58 0d cd f4 f1 85 24 bf e6 3d 14 df df ed |..X.....$..=....|
00000130 0e e1 17 d8 11 a2 60 d0 8a 37 23 2a c2 46 aa 3a |......`..7#*.F.:|
-00000140 08 16 03 03 00 25 10 00 00 21 20 87 e9 7b d5 6c |.....%...! ..{.l|
-00000150 ed 43 f2 56 e4 00 5c 30 8b ec 63 cb ef da 90 aa |.C.V..\0..c.....|
-00000160 e2 eb 0e ad 23 db 90 c5 02 47 7c 16 03 03 00 48 |....#....G|....H|
-00000170 0f 00 00 44 08 07 00 40 71 03 0f a9 ed a8 cf 3c |...D...@q......<|
-00000180 73 e6 ae 21 92 93 68 10 bc e0 fd 07 d8 58 30 7c |s..!..h......X0||
-00000190 8d f2 1d ee e6 20 4c a4 6a 4b b8 66 6c 51 b5 1a |..... L.jK.flQ..|
-000001a0 06 f1 5d 13 83 43 60 6f b1 f7 56 97 b2 ef c6 b8 |..]..C`o..V.....|
-000001b0 97 0b 9a fe 46 3e 9a 00 14 03 03 00 01 01 16 03 |....F>..........|
-000001c0 03 00 28 de 17 73 c1 91 60 06 3d 0c 9c d0 5a c9 |..(..s..`.=...Z.|
-000001d0 f2 2b f4 80 8b e8 01 dc 84 ff a1 16 08 1e af 76 |.+.............v|
-000001e0 f2 fc 34 52 3f 87 60 9e 06 ff c2 |..4R?.`....|
+00000140 08 16 03 03 00 86 10 00 00 82 00 80 14 f2 ac 22 |..............."|
+00000150 fb 0b f8 03 a7 cf 23 d5 ea 9f b0 f2 64 ae 41 fe |......#.....d.A.|
+00000160 33 f7 54 69 f5 41 b7 c1 91 6d 2b 3e 14 2a f6 c8 |3.Ti.A...m+>.*..|
+00000170 96 45 00 28 13 f5 2f de 35 f9 64 89 5c 99 3e 89 |.E.(../.5.d.\.>.|
+00000180 06 ff 59 56 69 db 5f 6e 02 84 dd 1c 44 7b 86 e8 |..YVi._n....D{..|
+00000190 e3 d9 03 f1 16 9e 06 23 00 43 91 ec a9 dd da a4 |.......#.C......|
+000001a0 ac fe 5b f8 62 f9 76 19 38 83 54 b4 8c 0b 02 f0 |..[.b.v.8.T.....|
+000001b0 fa 7a 8e 2e da 9d e1 4a c6 51 92 9b f6 4b a1 31 |.z.....J.Q...K.1|
+000001c0 c9 64 b2 a6 9a 01 52 86 b3 7a 43 17 16 03 03 00 |.d....R..zC.....|
+000001d0 48 0f 00 00 44 08 07 00 40 29 35 71 34 aa b1 f1 |H...D...@)5q4...|
+000001e0 64 08 4e 06 43 db 00 f7 f5 98 8e b6 51 d7 c4 b5 |d.N.C.......Q...|
+000001f0 2b fa 56 8b bd 7b 18 f2 81 e9 2f 81 82 d8 90 e7 |+.V..{..../.....|
+00000200 5b bc 72 7e f7 97 43 df cd 07 bf 7b ae 60 08 8b |[.r~..C....{.`..|
+00000210 0a 71 c5 bf f0 7a 3e cc 0b 14 03 03 00 01 01 16 |.q...z>.........|
+00000220 03 03 00 40 85 4f e0 c0 f3 3e a4 51 68 d6 ec 1b |...@.O...>.Qh...|
+00000230 f1 4b 3e 0e 13 84 87 e3 3c 9a 5f 67 75 3a ad 08 |.K>.....<._gu:..|
+00000240 be 29 15 b0 1f 62 27 fd d8 dd 58 b1 65 e7 e2 db |.)...b'...X.e...|
+00000250 fe 55 a5 2d 2e 71 59 07 ad 12 12 80 12 bb 26 36 |.U.-.qY.......&6|
+00000260 93 fb ea b1 |....|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....|
-00000010 00 00 00 db 9b a0 e5 96 0d ca 2b ce 8a 3c 9e bc |..........+..<..|
-00000020 43 1a ad 0d fb a1 7e 0d 39 7d 3f b4 79 bd ee 7a |C.....~.9}?.y..z|
-00000030 e4 a1 6e 17 03 03 00 25 00 00 00 00 00 00 00 01 |..n....%........|
-00000040 05 bd 7f 40 dd 89 b2 fd 3c ef a6 72 a0 dd 9f be |...@....<..r....|
-00000050 ee 27 ca a6 e0 f1 c8 3c 69 3c 35 02 48 15 03 03 |.'.....>> Flow 1 (client to server)
-00000000 16 03 01 00 97 01 00 00 93 03 03 b1 ad 52 31 a1 |.............R1.|
-00000010 0a ff 18 7f 32 d2 83 f2 e2 9d 54 03 6f fc 58 66 |....2.....T.o.Xf|
-00000020 29 e8 3e bc c3 4d d9 75 6e 06 53 00 00 04 00 2f |).>..M.un.S..../|
-00000030 00 ff 01 00 00 66 00 00 00 0e 00 0c 00 00 09 31 |.....f.........1|
-00000040 32 37 2e 30 2e 30 2e 31 00 0b 00 04 03 00 01 02 |27.0.0.1........|
-00000050 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 |................|
-00000060 00 16 00 00 00 17 00 00 00 0d 00 30 00 2e 04 03 |...........0....|
-00000070 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 |................|
-00000080 08 05 08 06 04 01 05 01 06 01 03 03 02 03 03 01 |................|
-00000090 02 01 03 02 02 02 04 02 05 02 06 02 |............|
+00000000 16 03 01 00 6d 01 00 00 69 03 03 e7 7e 1f 56 df |....m...i...~.V.|
+00000010 f1 1b e5 92 47 3b fb 25 a6 57 7d 13 47 08 f0 0f |....G;.%.W}.G...|
+00000020 5b 64 64 00 d3 25 33 e5 a5 5b e3 00 00 04 00 2f |[dd..%3..[...../|
+00000030 00 ff 01 00 00 3c 00 16 00 00 00 17 00 00 00 0d |.....<..........|
+00000040 00 30 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 |.0..............|
+00000050 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000060 03 03 02 03 03 01 02 01 03 02 02 02 04 02 05 02 |................|
+00000070 06 02 |..|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
+00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 00 2f 00 00 |...DOWNGRD.../..|
-00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|
-00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|
-00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|
-00000060 5b ea a6 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b |[..0...*.H......|
-00000070 05 00 30 1f 31 0b 30 09 06 03 55 04 0a 13 02 47 |..0.1.0...U....G|
-00000080 6f 31 10 30 0e 06 03 55 04 03 13 07 47 6f 20 52 |o1.0...U....Go R|
-00000090 6f 6f 74 30 1e 17 0d 31 36 30 31 30 31 30 30 30 |oot0...160101000|
-000000a0 30 30 30 5a 17 0d 32 35 30 31 30 31 30 30 30 30 |000Z..2501010000|
-000000b0 30 30 5a 30 1a 31 0b 30 09 06 03 55 04 0a 13 02 |00Z0.1.0...U....|
-000000c0 47 6f 31 0b 30 09 06 03 55 04 03 13 02 47 6f 30 |Go1.0...U....Go0|
-000000d0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|
-000000e0 00 03 81 8d 00 30 81 89 02 81 81 00 db 46 7d 93 |.....0.......F}.|
-000000f0 2e 12 27 06 48 bc 06 28 21 ab 7e c4 b6 a2 5d fe |..'.H..(!.~...].|
-00000100 1e 52 45 88 7a 36 47 a5 08 0d 92 42 5b c2 81 c0 |.RE.z6G....B[...|
-00000110 be 97 79 98 40 fb 4f 6d 14 fd 2b 13 8b c2 a5 2e |..y.@.Om..+.....|
-00000120 67 d8 d4 09 9e d6 22 38 b7 4a 0b 74 73 2b c2 34 |g....."8.J.ts+.4|
-00000130 f1 d1 93 e5 96 d9 74 7b f3 58 9f 6c 61 3c c0 b0 |......t{.X.la<..|
-00000140 41 d4 d9 2b 2b 24 23 77 5b 1c 3b bd 75 5d ce 20 |A..++$#w[.;.u]. |
-00000150 54 cf a1 63 87 1d 1e 24 c4 f3 1d 1a 50 8b aa b6 |T..c...$....P...|
-00000160 14 43 ed 97 a7 75 62 f4 14 c8 52 d7 02 03 01 00 |.C...ub...R.....|
-00000170 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f 01 01 |....0..0...U....|
-00000180 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 04 16 |.......0...U.%..|
-00000190 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 2b 06 |0...+.........+.|
-000001a0 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 01 ff |......0...U.....|
-000001b0 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 10 9f |..0.0...U.......|
-000001c0 91 16 1f 43 43 3e 49 a6 de 6d b6 80 d7 9f 60 30 |...CC>I..m....`0|
-000001d0 1b 06 03 55 1d 23 04 14 30 12 80 10 48 13 49 4d |...U.#..0...H.IM|
-000001e0 13 7e 16 31 bb a3 01 d5 ac ab 6e 7b 30 19 06 03 |.~.1......n{0...|
-000001f0 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 6c 65 |U....0...example|
-00000200 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 86 f7 |.golang0...*.H..|
-00000210 0d 01 01 0b 05 00 03 81 81 00 9d 30 cc 40 2b 5b |...........0.@+[|
-00000220 50 a0 61 cb ba e5 53 58 e1 ed 83 28 a9 58 1a a9 |P.a...SX...(.X..|
-00000230 38 a4 95 a1 ac 31 5a 1a 84 66 3d 43 d3 2d d9 0b |8....1Z..f=C.-..|
-00000240 f2 97 df d3 20 64 38 92 24 3a 00 bc cf 9c 7d b7 |.... d8.$:....}.|
-00000250 40 20 01 5f aa d3 16 61 09 a2 76 fd 13 c3 cc e1 |@ ._...a..v.....|
-00000260 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 77 8d |.\.....l..s..Cw.|
-00000270 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d ae db |......@.a.Lr+...|
-00000280 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db fe 3d |F..M...>...B...=|
-00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 23 0d |.`.\!.;.......#.|
-000002a0 00 00 1f 02 01 40 00 18 08 04 04 03 08 07 08 05 |.....@..........|
-000002b0 08 06 04 01 05 01 06 01 05 03 06 03 02 01 02 03 |................|
-000002c0 00 00 16 03 03 00 04 0e 00 00 00 |...........|
+00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.|
+00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......|
+00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.|
+00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..|
+00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..|
+000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1|
+000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.|
+000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...|
+000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0|
+000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.|
+000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6|
+00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.|
+00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....|
+00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......|
+00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$|
+00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..|
+00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u|
+00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.|
+00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........|
+00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.|
+00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......|
+000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.|
+000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>|
+000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#|
+000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..|
+000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0|
+000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan|
+00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........|
+00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...|
+00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1|
+00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d|
+00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..|
+00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....|
+00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......|
+00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..|
+00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.|
+00000290 3b e9 fa e7 16 03 03 00 23 0d 00 00 1f 02 01 40 |;.......#......@|
+000002a0 00 18 08 04 04 03 08 07 08 05 08 06 04 01 05 01 |................|
+000002b0 06 01 05 03 06 03 02 01 02 03 00 00 16 03 03 00 |................|
+000002c0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
00000000 16 03 03 01 fd 0b 00 01 f9 00 01 f6 00 01 f3 30 |...............0|
00000010 82 01 ef 30 82 01 58 a0 03 02 01 02 02 10 5c 19 |...0..X.......\.|
@@ -88,40 +86,40 @@
000001d0 ac 11 b1 28 56 be 1d cd 61 62 84 09 bf d6 80 c6 |...(V...ab......|
000001e0 45 8d 82 2c b4 d8 83 9b db c9 22 b7 2a 12 11 7b |E..,......".*..{|
000001f0 fa 02 3b c1 c9 ff ea c9 9d a8 49 d3 95 d7 d5 0e |..;.......I.....|
-00000200 e5 35 16 03 03 00 86 10 00 00 82 00 80 48 d4 42 |.5...........H.B|
-00000210 f3 7f 89 ce 32 5a 89 32 c4 4e 6a 66 f7 0d 3d 63 |....2Z.2.Njf..=c|
-00000220 e9 69 74 b5 f4 5e cb 99 74 6c c5 85 39 a3 24 ab |.it..^..tl..9.$.|
-00000230 a0 0c 16 1b 9b 0f b5 57 8f 97 30 de ae 44 fd da |.......W..0..D..|
-00000240 9f 0d 09 47 d7 a1 f7 aa 88 1d a5 e2 6d de 5b 92 |...G........m.[.|
-00000250 25 8e 84 7e fd 21 fe 00 c2 c7 d8 4c df 0c 40 07 |%..~.!.....L..@.|
-00000260 7a e6 61 45 37 6d 36 fd e8 44 8e 9c c7 04 31 46 |z.aE7m6..D....1F|
-00000270 6b 24 51 37 e0 09 84 ba 56 39 5e df 99 9f 6e 8a |k$Q7....V9^...n.|
-00000280 35 b2 27 a1 29 83 fb f7 c9 06 88 c5 6a 16 03 03 |5.'.).......j...|
-00000290 00 88 0f 00 00 84 08 04 00 80 01 b3 d6 d0 58 c4 |..............X.|
-000002a0 bc 36 b2 c5 6e a2 90 77 52 33 19 a1 9c 2f a4 ed |.6..n..wR3.../..|
-000002b0 76 b7 7b 67 ce 36 e2 37 b3 23 68 78 c0 2f 80 d4 |v.{g.6.7.#hx./..|
-000002c0 58 0e fc 11 dc 85 b6 9c 25 7f 02 48 b9 a3 24 8c |X.......%..H..$.|
-000002d0 26 94 8c 6d 8d 87 6c 9b 20 97 b2 49 ea b6 4c 16 |&..m..l. ..I..L.|
-000002e0 03 96 0a 93 e7 15 e4 cb 5a 43 5c 11 77 0e a9 cb |........ZC\.w...|
-000002f0 5e c6 4a d3 84 9a 27 e7 81 84 56 ad fa 4b b3 fe |^.J...'...V..K..|
-00000300 03 d9 91 1a cf 6e 5b 5e f9 b0 fb 59 27 29 e2 09 |.....n[^...Y')..|
-00000310 db 63 69 05 28 7c 95 45 7b da 14 03 03 00 01 01 |.ci.(|.E{.......|
-00000320 16 03 03 00 40 20 4f 52 fa e4 4b 92 8e 3f 52 18 |....@ OR..K..?R.|
-00000330 42 ba 07 93 fe 1d 11 ee d9 2f 37 55 88 cd 03 18 |B......../7U....|
-00000340 e7 44 95 b4 c2 69 91 38 f1 39 ba 14 f6 59 98 22 |.D...i.8.9...Y."|
-00000350 64 a1 a0 a3 b9 2e ec cb 14 dc 85 60 b4 95 3a 5a |d..........`..:Z|
-00000360 77 a7 65 eb 02 |w.e..|
+00000200 e5 35 16 03 03 00 86 10 00 00 82 00 80 7f 38 c9 |.5............8.|
+00000210 56 ed de 7d a6 2c dc cc 24 61 ea d3 8a fc b8 18 |V..}.,..$a......|
+00000220 b8 e5 50 3e c3 d1 ca cf f7 0c d9 9b 22 d8 6d 0f |..P>........".m.|
+00000230 71 e7 dd 7c 24 84 c6 f1 6a ac a0 3d ea d7 65 24 |q..|$...j..=..e$|
+00000240 d7 3a 17 d5 b7 ec f7 03 bc 58 3a 01 d5 08 27 25 |.:.......X:...'%|
+00000250 b9 2f 3b 96 cb d5 7c 12 20 f4 f1 91 58 13 fb 50 |./;...|. ...X..P|
+00000260 f8 d5 5c e4 43 85 e8 41 37 3e ff fa a6 64 92 4d |..\.C..A7>...d.M|
+00000270 bd d4 96 59 bd 94 f1 95 21 ad 75 1e 0d a2 8d 30 |...Y....!.u....0|
+00000280 a3 82 f4 56 0f ba 5d 40 32 7f 0c 5f 5a 16 03 03 |...V..]@2.._Z...|
+00000290 00 88 0f 00 00 84 08 04 00 80 39 b4 f4 68 e9 96 |..........9..h..|
+000002a0 01 53 95 31 26 fa 3c 70 46 9f ba 62 b4 37 ea a6 |.S.1&..Gy..^p|
+000002f0 30 8c 11 3f 27 43 4f 5d 81 89 83 39 9d fe 0c c3 |0..?'CO]...9....|
+00000300 af 40 8d 2a 41 bf 57 67 7a df b4 89 29 10 9a 84 |.@.*A.Wgz...)...|
+00000310 ff 8c 2f 58 1a 0a b9 62 4e 8e 14 03 03 00 01 01 |../X...bN.......|
+00000320 16 03 03 00 40 7c 7a 79 ae 84 60 b8 95 83 30 78 |....@|zy..`...0x|
+00000330 e9 6e 02 36 52 85 5a 6a a7 b5 f5 6d 4d a9 09 9d |.n.6R.Zj...mM...|
+00000340 43 9d 46 da d0 cf 75 25 49 e1 79 0b 23 2d 85 c2 |C.F...u%I.y.#-..|
+00000350 fd 5d 90 08 f5 75 81 ab 01 a0 f4 93 12 87 fb e3 |.]...u..........|
+00000360 9b 99 4d fa c5 |..M..|
>>> Flow 4 (server to client)
00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 56 f9 31 18 46 |...........V.1.F|
-00000020 ce f2 b8 78 c8 34 ec b4 33 d4 ee 42 9f cc a1 40 |...x.4..3..B...@|
-00000030 45 fc 81 bd 33 86 93 6e 0d 59 01 15 2e 71 ae 8d |E...3..n.Y...q..|
-00000040 18 1a 10 6d 86 d5 17 7d 80 3f a3 17 03 03 00 40 |...m...}.?.....@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 48 61 67 c0 1e |...........Hag..|
+00000020 09 79 82 cc 55 60 fa e5 bd 1a 1d 14 d3 25 e6 4b |.y..U`.......%.K|
+00000030 b7 a6 47 64 01 65 12 b3 37 42 1a 13 d9 90 12 7e |..Gd.e..7B.....~|
+00000040 ea d8 30 39 e2 25 5e 9a 05 61 11 17 03 03 00 40 |..09.%^..a.....@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 c1 b4 84 5e 61 48 33 a2 91 ae 7c d9 ee 9a fc 78 |...^aH3...|....x|
-00000070 57 c9 7d 1f fa c8 16 dc 6b c1 ec ff 1b 3f 4d d2 |W.}.....k....?M.|
-00000080 69 57 aa e2 95 13 c5 92 81 14 63 bd ba 29 b9 3f |iW........c..).?|
+00000060 cf c5 73 08 e9 15 25 b6 d8 e3 fa 0c a1 25 33 75 |..s...%......%3u|
+00000070 8a 2e 66 03 c2 2d 50 c7 e1 10 b4 2a 0c 88 87 90 |..f..-P....*....|
+00000080 04 4a 80 26 85 4b fd 9a 4f 0e b1 2c f0 18 57 f5 |.J.&.K..O..,..W.|
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 b8 22 70 50 65 d6 ae 00 6b f7 e1 |......"pPe...k..|
-000000b0 76 1d 03 d7 f7 80 56 74 73 af f2 6c 70 6f cb 4a |v.....Vts..lpo.J|
-000000c0 b3 2a 18 1b b5 |.*...|
+000000a0 00 00 00 00 00 ce e0 a1 71 be 3d 1e b0 bd 06 4c |........q.=....L|
+000000b0 1f 5b 10 8d 77 18 e0 c5 81 c9 4e 1b 3b 96 f6 6d |.[..w.....N.;..m|
+000000c0 88 03 53 54 30 |..ST0|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndPKCS1v15Given b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndPKCS1v15Given
index b38cb416f6..8efbc912d9 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndPKCS1v15Given
+++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndPKCS1v15Given
@@ -1,60 +1,58 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 97 01 00 00 93 03 03 a1 ef 12 cf c0 |................|
-00000010 c2 32 71 56 71 e0 e9 24 ae 63 20 58 0f c0 39 b3 |.2qVq..$.c X..9.|
-00000020 74 89 9d 9c 00 96 e5 78 9c 0a 84 00 00 04 00 2f |t......x......./|
-00000030 00 ff 01 00 00 66 00 00 00 0e 00 0c 00 00 09 31 |.....f.........1|
-00000040 32 37 2e 30 2e 30 2e 31 00 0b 00 04 03 00 01 02 |27.0.0.1........|
-00000050 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 |................|
-00000060 00 16 00 00 00 17 00 00 00 0d 00 30 00 2e 04 03 |...........0....|
-00000070 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 |................|
-00000080 08 05 08 06 04 01 05 01 06 01 03 03 02 03 03 01 |................|
-00000090 02 01 03 02 02 02 04 02 05 02 06 02 |............|
+00000000 16 03 01 00 6d 01 00 00 69 03 03 4c 65 99 ab e0 |....m...i..Le...|
+00000010 4b 0a 08 f5 06 20 f9 3d 96 4f 05 e3 58 6f 41 50 |K.... .=.O..XoAP|
+00000020 c1 5f e8 a8 0a 5f 8f f2 de 7f 16 00 00 04 00 2f |._..._........./|
+00000030 00 ff 01 00 00 3c 00 16 00 00 00 17 00 00 00 0d |.....<..........|
+00000040 00 30 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 |.0..............|
+00000050 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000060 03 03 02 03 03 01 02 01 03 02 02 02 04 02 05 02 |................|
+00000070 06 02 |..|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
+00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 00 2f 00 00 |...DOWNGRD.../..|
-00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|
-00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|
-00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|
-00000060 5b ea a6 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b |[..0...*.H......|
-00000070 05 00 30 1f 31 0b 30 09 06 03 55 04 0a 13 02 47 |..0.1.0...U....G|
-00000080 6f 31 10 30 0e 06 03 55 04 03 13 07 47 6f 20 52 |o1.0...U....Go R|
-00000090 6f 6f 74 30 1e 17 0d 31 36 30 31 30 31 30 30 30 |oot0...160101000|
-000000a0 30 30 30 5a 17 0d 32 35 30 31 30 31 30 30 30 30 |000Z..2501010000|
-000000b0 30 30 5a 30 1a 31 0b 30 09 06 03 55 04 0a 13 02 |00Z0.1.0...U....|
-000000c0 47 6f 31 0b 30 09 06 03 55 04 03 13 02 47 6f 30 |Go1.0...U....Go0|
-000000d0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|
-000000e0 00 03 81 8d 00 30 81 89 02 81 81 00 db 46 7d 93 |.....0.......F}.|
-000000f0 2e 12 27 06 48 bc 06 28 21 ab 7e c4 b6 a2 5d fe |..'.H..(!.~...].|
-00000100 1e 52 45 88 7a 36 47 a5 08 0d 92 42 5b c2 81 c0 |.RE.z6G....B[...|
-00000110 be 97 79 98 40 fb 4f 6d 14 fd 2b 13 8b c2 a5 2e |..y.@.Om..+.....|
-00000120 67 d8 d4 09 9e d6 22 38 b7 4a 0b 74 73 2b c2 34 |g....."8.J.ts+.4|
-00000130 f1 d1 93 e5 96 d9 74 7b f3 58 9f 6c 61 3c c0 b0 |......t{.X.la<..|
-00000140 41 d4 d9 2b 2b 24 23 77 5b 1c 3b bd 75 5d ce 20 |A..++$#w[.;.u]. |
-00000150 54 cf a1 63 87 1d 1e 24 c4 f3 1d 1a 50 8b aa b6 |T..c...$....P...|
-00000160 14 43 ed 97 a7 75 62 f4 14 c8 52 d7 02 03 01 00 |.C...ub...R.....|
-00000170 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f 01 01 |....0..0...U....|
-00000180 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 04 16 |.......0...U.%..|
-00000190 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 2b 06 |0...+.........+.|
-000001a0 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 01 ff |......0...U.....|
-000001b0 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 10 9f |..0.0...U.......|
-000001c0 91 16 1f 43 43 3e 49 a6 de 6d b6 80 d7 9f 60 30 |...CC>I..m....`0|
-000001d0 1b 06 03 55 1d 23 04 14 30 12 80 10 48 13 49 4d |...U.#..0...H.IM|
-000001e0 13 7e 16 31 bb a3 01 d5 ac ab 6e 7b 30 19 06 03 |.~.1......n{0...|
-000001f0 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 6c 65 |U....0...example|
-00000200 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 86 f7 |.golang0...*.H..|
-00000210 0d 01 01 0b 05 00 03 81 81 00 9d 30 cc 40 2b 5b |...........0.@+[|
-00000220 50 a0 61 cb ba e5 53 58 e1 ed 83 28 a9 58 1a a9 |P.a...SX...(.X..|
-00000230 38 a4 95 a1 ac 31 5a 1a 84 66 3d 43 d3 2d d9 0b |8....1Z..f=C.-..|
-00000240 f2 97 df d3 20 64 38 92 24 3a 00 bc cf 9c 7d b7 |.... d8.$:....}.|
-00000250 40 20 01 5f aa d3 16 61 09 a2 76 fd 13 c3 cc e1 |@ ._...a..v.....|
-00000260 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 77 8d |.\.....l..s..Cw.|
-00000270 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d ae db |......@.a.Lr+...|
-00000280 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db fe 3d |F..M...>...B...=|
-00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 23 0d |.`.\!.;.......#.|
-000002a0 00 00 1f 02 01 40 00 18 08 04 04 03 08 07 08 05 |.....@..........|
-000002b0 08 06 04 01 05 01 06 01 05 03 06 03 02 01 02 03 |................|
-000002c0 00 00 16 03 03 00 04 0e 00 00 00 |...........|
+00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.|
+00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......|
+00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.|
+00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..|
+00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..|
+000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1|
+000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.|
+000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...|
+000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0|
+000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.|
+000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6|
+00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.|
+00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....|
+00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......|
+00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$|
+00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..|
+00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u|
+00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.|
+00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........|
+00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.|
+00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......|
+000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.|
+000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>|
+000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#|
+000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..|
+000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0|
+000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan|
+00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........|
+00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...|
+00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1|
+00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d|
+00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..|
+00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....|
+00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......|
+00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..|
+00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.|
+00000290 3b e9 fa e7 16 03 03 00 23 0d 00 00 1f 02 01 40 |;.......#......@|
+000002a0 00 18 08 04 04 03 08 07 08 05 08 06 04 01 05 01 |................|
+000002b0 06 01 05 03 06 03 02 01 02 03 00 00 16 03 03 00 |................|
+000002c0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
00000000 16 03 03 01 fd 0b 00 01 f9 00 01 f6 00 01 f3 30 |...............0|
00000010 82 01 ef 30 82 01 58 a0 03 02 01 02 02 10 5c 19 |...0..X.......\.|
@@ -88,40 +86,40 @@
000001d0 ac 11 b1 28 56 be 1d cd 61 62 84 09 bf d6 80 c6 |...(V...ab......|
000001e0 45 8d 82 2c b4 d8 83 9b db c9 22 b7 2a 12 11 7b |E..,......".*..{|
000001f0 fa 02 3b c1 c9 ff ea c9 9d a8 49 d3 95 d7 d5 0e |..;.......I.....|
-00000200 e5 35 16 03 03 00 86 10 00 00 82 00 80 64 8b 67 |.5...........d.g|
-00000210 fe b0 0e a0 a6 2b 95 2b 35 24 91 d0 29 6e 0a 3b |.....+.+5$..)n.;|
-00000220 bc 32 5f 28 30 a9 6e f3 b8 4a 1d 7c 11 7c c5 03 |.2_(0.n..J.|.|..|
-00000230 70 51 99 8f f5 2e 91 78 b9 65 23 3c 3a 7f a7 63 |pQ.....x.e#<:..c|
-00000240 1f ad 30 3c 91 b1 d8 79 76 b4 94 a7 76 26 20 c7 |..0<...yv...v& .|
-00000250 f1 93 17 13 8a 25 6e 9e 84 9e e5 21 b8 87 46 8d |.....%n....!..F.|
-00000260 46 37 7f ef 25 e2 8f 6e 52 58 cc a9 5c 40 ee 5e |F7..%..nRX..\@.^|
-00000270 f8 25 04 e9 e1 1e 33 31 ea 9e bd 79 e8 d8 f8 0b |.%....31...y....|
-00000280 a5 5d 63 79 1f 83 bc df 14 c9 92 a6 82 16 03 03 |.]cy............|
-00000290 00 88 0f 00 00 84 04 01 00 80 06 8a 73 2b 2d 45 |............s+-E|
-000002a0 09 3c cf 66 d9 ef d0 44 d0 89 07 03 67 56 b5 c9 |.<.f...D....gV..|
-000002b0 de 89 49 32 6e 44 b0 01 db 10 8b 1a 68 5c 2e 0b |..I2nD......h\..|
-000002c0 38 e7 75 60 0b 68 96 2e 3b ba bd a8 ce 1e ee 3d |8.u`.h..;......=|
-000002d0 e6 a4 c4 3a 5c d0 14 3b 64 52 56 ef 5b 74 45 3c |...:\..;dRV.[tE<|
-000002e0 2b eb f6 0b 6c 15 37 5c c3 d3 6d 4c 32 ea 3d 40 |+...l.7\..mL2.=@|
-000002f0 7b 60 35 16 44 a4 3c 4a 2e 85 d9 a2 a5 a6 79 11 |{`5.D..|
+00000300 9a 2a 39 e8 fe aa aa ee e3 00 a3 a8 1e 75 4a 21 |.*9..........uJ!|
+00000310 b4 ad 24 8f ee e8 30 85 b1 28 14 03 03 00 01 01 |..$...0..(......|
+00000320 16 03 03 00 40 71 47 13 68 49 74 9c 2a 81 35 94 |....@qG.hIt.*.5.|
+00000330 52 f6 44 44 67 3b 62 e1 ef 34 18 e7 8a 56 71 88 |R.DDg;b..4...Vq.|
+00000340 83 7e 67 28 20 18 b1 c5 8a c8 8b 6a fe ee bf da |.~g( ......j....|
+00000350 5f 6e cd fa a8 5c af 5c 3c 83 80 78 f3 fe 1b dc |_n...\.\<..x....|
+00000360 95 fe 22 16 82 |.."..|
>>> Flow 4 (server to client)
00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 1a 60 c5 8b a5 |............`...|
-00000020 6d be c2 a0 c7 23 e6 f8 e8 fb e7 31 7c 7f 37 67 |m....#.....1|.7g|
-00000030 7c 1e 39 2b ea cd 26 47 5c 7f 19 ad 78 be 11 3d ||.9+..&G\...x..=|
-00000040 98 f5 c8 97 22 1d 23 45 55 2b 25 17 03 03 00 40 |....".#EU+%....@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 20 f7 51 8f 23 |........... .Q.#|
+00000020 08 8d 67 5d 12 06 b0 48 81 2d 0c ba 88 03 88 31 |..g]...H.-.....1|
+00000030 d0 ab 63 0d 9f 28 60 21 0a a3 58 47 c2 04 cc f1 |..c..(`!..XG....|
+00000040 50 0d 88 b2 e5 54 50 26 e6 6e ed 17 03 03 00 40 |P....TP&.n.....@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 e0 a5 72 92 b6 6c ee e8 2d 7f cf d9 df 2d 4f 70 |..r..l..-....-Op|
-00000070 18 8a c3 9c 10 89 0f 11 df 83 d7 4c 35 ea 4e 19 |...........L5.N.|
-00000080 7f ab 8b f0 0e de 32 6e 86 d1 e9 78 90 f6 3b e7 |......2n...x..;.|
+00000060 fa 4d e5 00 14 2c 65 82 5d 1b bf 99 6a 54 16 98 |.M...,e.]...jT..|
+00000070 ef 55 15 00 f9 c4 3e 61 88 83 63 fd 60 66 f1 87 |.U....>a..c.`f..|
+00000080 fa c4 45 ae de b8 0a 36 75 f5 b2 b6 f5 d8 9b df |..E....6u.......|
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 db 5e ed de c0 26 10 13 a8 18 46 |......^...&....F|
-000000b0 70 3e a4 bd b7 df a1 bd 86 06 c6 97 ae cb ca f6 |p>..............|
-000000c0 8d 0f 85 82 f7 |.....|
+000000a0 00 00 00 00 00 54 cc c0 15 e5 6d 62 4d 13 54 e8 |.....T....mbM.T.|
+000000b0 fa cf 76 a6 de d6 48 f8 0d ef 30 b7 12 05 cf 75 |..v...H...0....u|
+000000c0 8b 00 9e d5 63 |....c|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
index 6f7c288421..a81c173153 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
+++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
@@ -1,87 +1,85 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 97 01 00 00 93 03 03 07 72 d5 84 85 |............r...|
-00000010 48 68 f6 83 2f 1d 22 96 61 9d 27 60 b9 70 d2 5f |Hh../.".a.'`.p._|
-00000020 5e 9e 41 cb 82 9b 61 c6 ae af a7 00 00 04 00 2f |^.A...a......../|
-00000030 00 ff 01 00 00 66 00 00 00 0e 00 0c 00 00 09 31 |.....f.........1|
-00000040 32 37 2e 30 2e 30 2e 31 00 0b 00 04 03 00 01 02 |27.0.0.1........|
-00000050 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 |................|
-00000060 00 16 00 00 00 17 00 00 00 0d 00 30 00 2e 04 03 |...........0....|
-00000070 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 |................|
-00000080 08 05 08 06 04 01 05 01 06 01 03 03 02 03 03 01 |................|
-00000090 02 01 03 02 02 02 04 02 05 02 06 02 |............|
+00000000 16 03 01 00 6d 01 00 00 69 03 03 be a7 a4 6c f7 |....m...i.....l.|
+00000010 f6 b4 f2 64 5d 0e 36 b6 05 f5 f1 c9 fe 3c c2 8e |...d].6......<..|
+00000020 c4 b7 18 68 b9 0c 1d 51 50 2f 1e 00 00 04 00 2f |...h...QP/...../|
+00000030 00 ff 01 00 00 3c 00 16 00 00 00 17 00 00 00 0d |.....<..........|
+00000040 00 30 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 |.0..............|
+00000050 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000060 03 03 02 03 03 01 02 01 03 02 02 02 04 02 05 02 |................|
+00000070 06 02 |..|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
+00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 00 2f 00 00 |...DOWNGRD.../..|
-00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|
-00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|
-00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|
-00000060 5b ea a6 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b |[..0...*.H......|
-00000070 05 00 30 1f 31 0b 30 09 06 03 55 04 0a 13 02 47 |..0.1.0...U....G|
-00000080 6f 31 10 30 0e 06 03 55 04 03 13 07 47 6f 20 52 |o1.0...U....Go R|
-00000090 6f 6f 74 30 1e 17 0d 31 36 30 31 30 31 30 30 30 |oot0...160101000|
-000000a0 30 30 30 5a 17 0d 32 35 30 31 30 31 30 30 30 30 |000Z..2501010000|
-000000b0 30 30 5a 30 1a 31 0b 30 09 06 03 55 04 0a 13 02 |00Z0.1.0...U....|
-000000c0 47 6f 31 0b 30 09 06 03 55 04 03 13 02 47 6f 30 |Go1.0...U....Go0|
-000000d0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|
-000000e0 00 03 81 8d 00 30 81 89 02 81 81 00 db 46 7d 93 |.....0.......F}.|
-000000f0 2e 12 27 06 48 bc 06 28 21 ab 7e c4 b6 a2 5d fe |..'.H..(!.~...].|
-00000100 1e 52 45 88 7a 36 47 a5 08 0d 92 42 5b c2 81 c0 |.RE.z6G....B[...|
-00000110 be 97 79 98 40 fb 4f 6d 14 fd 2b 13 8b c2 a5 2e |..y.@.Om..+.....|
-00000120 67 d8 d4 09 9e d6 22 38 b7 4a 0b 74 73 2b c2 34 |g....."8.J.ts+.4|
-00000130 f1 d1 93 e5 96 d9 74 7b f3 58 9f 6c 61 3c c0 b0 |......t{.X.la<..|
-00000140 41 d4 d9 2b 2b 24 23 77 5b 1c 3b bd 75 5d ce 20 |A..++$#w[.;.u]. |
-00000150 54 cf a1 63 87 1d 1e 24 c4 f3 1d 1a 50 8b aa b6 |T..c...$....P...|
-00000160 14 43 ed 97 a7 75 62 f4 14 c8 52 d7 02 03 01 00 |.C...ub...R.....|
-00000170 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f 01 01 |....0..0...U....|
-00000180 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 04 16 |.......0...U.%..|
-00000190 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 2b 06 |0...+.........+.|
-000001a0 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 01 ff |......0...U.....|
-000001b0 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 10 9f |..0.0...U.......|
-000001c0 91 16 1f 43 43 3e 49 a6 de 6d b6 80 d7 9f 60 30 |...CC>I..m....`0|
-000001d0 1b 06 03 55 1d 23 04 14 30 12 80 10 48 13 49 4d |...U.#..0...H.IM|
-000001e0 13 7e 16 31 bb a3 01 d5 ac ab 6e 7b 30 19 06 03 |.~.1......n{0...|
-000001f0 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 6c 65 |U....0...example|
-00000200 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 86 f7 |.golang0...*.H..|
-00000210 0d 01 01 0b 05 00 03 81 81 00 9d 30 cc 40 2b 5b |...........0.@+[|
-00000220 50 a0 61 cb ba e5 53 58 e1 ed 83 28 a9 58 1a a9 |P.a...SX...(.X..|
-00000230 38 a4 95 a1 ac 31 5a 1a 84 66 3d 43 d3 2d d9 0b |8....1Z..f=C.-..|
-00000240 f2 97 df d3 20 64 38 92 24 3a 00 bc cf 9c 7d b7 |.... d8.$:....}.|
-00000250 40 20 01 5f aa d3 16 61 09 a2 76 fd 13 c3 cc e1 |@ ._...a..v.....|
-00000260 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 77 8d |.\.....l..s..Cw.|
-00000270 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d ae db |......@.a.Lr+...|
-00000280 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db fe 3d |F..M...>...B...=|
-00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 23 0d |.`.\!.;.......#.|
-000002a0 00 00 1f 02 01 40 00 18 08 04 04 03 08 07 08 05 |.....@..........|
-000002b0 08 06 04 01 05 01 06 01 05 03 06 03 02 01 02 03 |................|
-000002c0 00 00 16 03 03 00 04 0e 00 00 00 |...........|
+00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.|
+00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......|
+00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.|
+00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..|
+00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..|
+000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1|
+000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.|
+000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...|
+000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0|
+000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.|
+000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6|
+00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.|
+00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....|
+00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......|
+00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$|
+00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..|
+00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u|
+00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.|
+00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........|
+00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.|
+00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......|
+000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.|
+000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>|
+000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#|
+000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..|
+000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0|
+000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan|
+00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........|
+00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...|
+00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1|
+00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d|
+00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..|
+00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....|
+00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......|
+00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..|
+00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.|
+00000290 3b e9 fa e7 16 03 03 00 23 0d 00 00 1f 02 01 40 |;.......#......@|
+000002a0 00 18 08 04 04 03 08 07 08 05 08 06 04 01 05 01 |................|
+000002b0 06 01 05 03 06 03 02 01 02 03 00 00 16 03 03 00 |................|
+000002c0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
00000000 16 03 03 00 07 0b 00 00 03 00 00 00 16 03 03 00 |................|
-00000010 86 10 00 00 82 00 80 60 6d 7c a2 1e 90 d3 14 55 |.......`m|.....U|
-00000020 2b 65 e6 14 10 59 51 ba f0 55 89 1d f6 d2 6e 85 |+e...YQ..U....n.|
-00000030 58 16 fc 45 a2 88 ae 24 b6 77 c0 f4 9e 6f de 76 |X..E...$.w...o.v|
-00000040 d4 9c 06 a3 6c 4f 54 da e5 41 e4 f8 fd 2d ca c6 |....lOT..A...-..|
-00000050 c4 7f 5a d4 c5 7b 3e 04 30 3e 64 b1 f5 c2 24 8f |..Z..{>.0>d...$.|
-00000060 49 98 2c f7 29 89 06 7e 5e 8f 9e 8e 6c fc 4c 08 |I.,.)..~^...l.L.|
-00000070 3e 05 f9 90 86 d9 38 b8 04 ff 7e a1 c2 a5 38 66 |>.....8...~...8f|
-00000080 41 63 7a 8e d2 7b 27 22 0e a1 0c 17 1e d7 9f 29 |Acz..{'".......)|
-00000090 5c fa fe 2d 11 b3 4a 14 03 03 00 01 01 16 03 03 |\..-..J.........|
-000000a0 00 40 e3 e5 62 d6 c9 93 bd 91 a4 60 2e 2d 9d 0b |.@..b......`.-..|
-000000b0 ce 75 2a e9 19 ed 36 03 ff 97 ee b7 b9 61 04 1b |.u*...6......a..|
-000000c0 a9 a3 4c 8a a0 c9 40 c4 92 55 bb ed 17 1f 38 c4 |..L...@..U....8.|
-000000d0 45 46 1f d6 53 b7 3b 6b 09 b6 d7 f1 a4 0e 25 21 |EF..S.;k......%!|
-000000e0 10 21 |.!|
+00000010 86 10 00 00 82 00 80 a9 b6 12 e2 84 71 62 7a 20 |............qbz |
+00000020 63 80 99 c6 ee f7 61 f9 74 d6 0b ab 31 74 69 ca |c.....a.t...1ti.|
+00000030 94 20 9e 1b 0e 52 45 c4 f4 b3 cb fb a4 07 61 6f |. ...RE.......ao|
+00000040 a1 5a 84 4c 4f f6 4a e4 bc c5 c2 b0 ee 8a 30 5b |.Z.LO.J.......0[|
+00000050 10 e0 ed d3 4c b7 32 8c ed 3f 89 a7 a7 95 60 86 |....L.2..?....`.|
+00000060 97 1a ae ab 2f 5c e6 6d 1b c3 35 bd f5 c1 f0 1a |..../\.m..5.....|
+00000070 d4 70 e5 00 f2 d4 d1 20 6a 82 db e7 52 ca 88 e5 |.p..... j...R...|
+00000080 2d cc 79 0c f6 09 84 65 f0 30 41 67 10 0a 48 d1 |-.y....e.0Ag..H.|
+00000090 09 3e 56 7a aa 57 bc 14 03 03 00 01 01 16 03 03 |.>Vz.W..........|
+000000a0 00 40 e6 0a 91 5f 30 f8 52 75 94 8e ab 82 ec 1d |.@..._0.Ru......|
+000000b0 b7 a1 1c 18 1a aa 1c f8 73 93 0e 20 ad 68 a7 65 |........s.. .h.e|
+000000c0 86 c9 f5 90 f9 b2 fd d1 32 94 52 6e 82 9b b9 45 |........2.Rn...E|
+000000d0 97 52 4b 1e c2 31 a6 2e c8 b3 1a 62 22 83 8f df |.RK..1.....b"...|
+000000e0 d7 06 |..|
>>> Flow 4 (server to client)
00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 17 ce 12 8e 1a |................|
-00000020 1f c2 d2 9c c9 28 c0 89 cb fa 8c 48 28 a2 d2 93 |.....(.....H(...|
-00000030 a6 aa 43 35 5f 29 ab e2 c6 f9 70 f6 8f d9 da af |..C5_)....p.....|
-00000040 da 2a 02 24 9c 74 57 3d a2 0f 6d 17 03 03 00 40 |.*.$.tW=..m....@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 b0 2c 61 79 87 |............,ay.|
+00000020 59 d4 9e 4d e7 56 4a 34 ba 78 d5 06 98 a2 92 35 |Y..M.VJ4.x.....5|
+00000030 a1 fc 57 5a 6e d3 0f 44 08 1c a1 7b 3c d3 f1 86 |..WZn..D...{<...|
+00000040 a2 04 04 5e 1b 7c 00 4f 51 71 73 17 03 03 00 40 |...^.|.OQqs....@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 58 99 9f 9b 65 fd 53 7e 4a 82 47 99 d7 16 b7 4f |X...e.S~J.G....O|
-00000070 84 7d 49 c0 af 42 84 54 e1 31 dc 01 00 de 8c 08 |.}I..B.T.1......|
-00000080 a3 ee 9b 32 b4 f0 30 d1 ae 8e f5 5d 11 ad eb fb |...2..0....]....|
+00000060 aa 5c 1a 9a 70 bc b3 fb 70 07 0b 24 cb 95 84 61 |.\..p...p..$...a|
+00000070 96 ed d8 97 2f d6 79 51 ed cd 67 44 e5 d4 a3 57 |..../.yQ..gD...W|
+00000080 95 f6 c8 31 a8 95 c2 07 a4 ce 1c fc 4a dc 93 d9 |...1........J...|
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 94 b8 23 55 00 7e 3a ba 67 86 03 |.......#U.~:.g..|
-000000b0 e6 19 11 4a 7d 58 69 6f 79 bb be 6d ba a7 9f a2 |...J}Xioy..m....|
-000000c0 1a 30 b7 83 2e |.0...|
+000000a0 00 00 00 00 00 ae dd c4 f4 04 d3 b1 1a 8a 56 f7 |..............V.|
+000000b0 73 c9 d5 aa 6c 59 d7 66 77 34 64 2d 19 79 13 80 |s...lY.fw4d-.y..|
+000000c0 98 60 6d f4 d9 |.`m..|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-Ed25519 b/src/crypto/tls/testdata/Server-TLSv12-Ed25519
index 6d8b28b82a..dd34592811 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-Ed25519
+++ b/src/crypto/tls/testdata/Server-TLSv12-Ed25519
@@ -1,21 +1,17 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 cb 01 00 00 c7 03 03 b8 0c b4 c2 92 |................|
-00000010 d9 b6 77 56 d9 9f 2b 94 c9 2f c8 28 4f bf 69 bc |..wV..+../.(O.i.|
-00000020 8f 4c 81 46 a6 43 4b e7 e5 70 b2 00 00 38 c0 2c |.L.F.CK..p...8.,|
-00000030 c0 30 00 9f cc a9 cc a8 cc aa c0 2b c0 2f 00 9e |.0.........+./..|
-00000040 c0 24 c0 28 00 6b c0 23 c0 27 00 67 c0 0a c0 14 |.$.(.k.#.'.g....|
-00000050 00 39 c0 09 c0 13 00 33 00 9d 00 9c 00 3d 00 3c |.9.....3.....=.<|
-00000060 00 35 00 2f 00 ff 01 00 00 66 00 00 00 0e 00 0c |.5./.....f......|
-00000070 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000080 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000090 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 30 |...............0|
-000000a0 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................|
-000000b0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 03 03 |................|
-000000c0 02 03 03 01 02 01 03 02 02 02 04 02 05 02 06 02 |................|
+00000000 16 03 01 00 85 01 00 00 81 03 03 f0 8d 1b 90 67 |...............g|
+00000010 3b 23 46 ac f7 79 f2 f9 e8 90 98 b3 52 b2 55 2a |;#F..y......R.U*|
+00000020 fb 0f 1e dd 4f b3 75 4b 9b 88 0e 00 00 04 cc a9 |....O.uK........|
+00000030 00 ff 01 00 00 54 00 0b 00 04 03 00 01 02 00 0a |.....T..........|
+00000040 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000050 00 00 00 17 00 00 00 0d 00 30 00 2e 04 03 05 03 |.........0......|
+00000060 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
+00000070 08 06 04 01 05 01 06 01 03 03 02 03 03 01 02 01 |................|
+00000080 03 02 02 02 04 02 05 02 06 02 |..........|
>>> Flow 2 (server to client)
00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 2c 00 00 |...DOWNGRD...,..|
+00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 cc a9 00 00 |...DOWNGRD......|
00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 01 |................|
00000040 3c 0b 00 01 38 00 01 35 00 01 32 30 82 01 2e 30 |<...8..5..20...0|
00000050 81 e1 a0 03 02 01 02 02 10 0f 43 1c 42 57 93 94 |..........C.BW..|
@@ -39,25 +35,24 @@
00000170 6c cd 4b 03 83 7c f2 08 58 cd ac cf 0c 16 03 03 |l.K..|..X.......|
00000180 00 6c 0c 00 00 68 03 00 1d 20 2f e5 7d a3 47 cd |.l...h... /.}.G.|
00000190 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 af c4 |bC.(.._.).0.....|
-000001a0 cf c2 ed 90 99 5f 58 cb 3b 74 08 07 00 40 b6 c5 |....._X.;t...@..|
-000001b0 00 07 5f 16 0d c5 5a 13 26 8e 74 09 1a 16 7f d2 |.._...Z.&.t.....|
-000001c0 4c 90 b5 ee 29 00 7b d6 d0 59 fe 79 1f f2 d9 66 |L...).{..Y.y...f|
-000001d0 e2 5e 22 c9 27 b8 09 e5 f3 b6 c4 be 46 4a c2 a9 |.^".'.......FJ..|
-000001e0 34 f8 ba ad b6 86 8d 47 58 00 55 d9 3c 03 16 03 |4......GX.U.<...|
+000001a0 cf c2 ed 90 99 5f 58 cb 3b 74 08 07 00 40 1f 56 |....._X.;t...@.V|
+000001b0 21 8a 44 04 69 65 ee f8 93 52 4c f0 49 42 57 4c |!.D.ie...RL.IBWL|
+000001c0 5b f5 1a ef 43 ad 39 93 03 a3 64 84 da e5 82 32 |[...C.9...d....2|
+000001d0 fc 77 12 61 f3 f4 2c d8 61 9e 86 01 1f c0 a0 98 |.w.a..,.a.......|
+000001e0 94 a3 7f 15 75 c8 e6 2f 20 bd af 7c be 0e 16 03 |....u../ ..|....|
000001f0 03 00 04 0e 00 00 00 |.......|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 25 10 00 00 21 20 6e 1a be aa e4 ca |....%...! n.....|
-00000010 43 15 88 b6 fe f7 6c 69 26 1c 99 1c a9 01 75 e3 |C.....li&.....u.|
-00000020 32 ef 37 85 6c 2e 15 6e 37 24 14 03 03 00 01 01 |2.7.l..n7$......|
-00000030 16 03 03 00 28 e8 ca d2 ac 7b 38 5e 23 0a c0 62 |....(....{8^#..b|
-00000040 05 c5 ec 9a 3b 99 48 6e 72 c0 30 b3 3c 69 a1 fd |....;.Hnr.0.|
+00000040 71 a7 13 f5 3a 8a cd 86 34 8b 7e 41 b5 2a 1b 03 |q...:...4.~A.*..|
+00000050 29 77 b3 b2 da |)w...|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....|
-00000010 00 00 00 09 61 1e 91 05 79 fe d3 ea 62 2c 4e 62 |....a...y...b,Nb|
-00000020 42 b4 68 20 ca 47 e3 a4 4f 33 ce ba 8c d7 ea 63 |B.h .G..O3.....c|
-00000030 54 c7 8c 17 03 03 00 25 00 00 00 00 00 00 00 01 |T......%........|
-00000040 fb 97 f4 60 38 95 26 f2 69 ea c7 91 99 08 73 7a |...`8.&.i.....sz|
-00000050 ca 96 97 6f 9f a6 be c2 ca 1d f1 2e 08 15 03 03 |...o............|
-00000060 00 1a 00 00 00 00 00 00 00 02 b4 06 50 09 ec 73 |............P..s|
-00000070 06 83 b4 fa bb 40 21 7f 4c d9 61 8a |.....@!.L.a.|
+00000000 14 03 03 00 01 01 16 03 03 00 20 54 5a ff 09 7d |.......... TZ..}|
+00000010 46 04 40 62 c5 63 71 85 c7 b4 6c 09 ee 15 71 6b |F.@b.cq...l...qk|
+00000020 60 3b 00 3d 46 47 13 a5 f7 15 16 17 03 03 00 1d |`;.=FG..........|
+00000030 13 8d 00 50 58 d0 2a 47 a8 d8 de 87 d4 3e ff ee |...PX.*G.....>..|
+00000040 f1 4d 6b 25 94 6f 01 7b 70 ee 53 d9 be 15 03 03 |.Mk%.o.{p.S.....|
+00000050 00 12 13 ea 17 69 00 0e 2b ae 21 a9 5e 0a 41 2d |.....i..+.!.^.A-|
+00000060 1b 73 f0 2d |.s.-|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-ExportKeyingMaterial b/src/crypto/tls/testdata/Server-TLSv12-ExportKeyingMaterial
index c9f0c5c0fc..e01c32c428 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-ExportKeyingMaterial
+++ b/src/crypto/tls/testdata/Server-TLSv12-ExportKeyingMaterial
@@ -1,21 +1,17 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 bd 01 00 00 b9 03 03 7e 75 ea 1f ec |...........~u...|
-00000010 47 ee de 51 9d 11 00 77 5b 1b fb 7e 05 22 0a 7a |G..Q...w[..~.".z|
-00000020 74 bc 6a d1 8a 67 03 a1 ae c9 23 00 00 38 c0 2c |t.j..g....#..8.,|
-00000030 c0 30 00 9f cc a9 cc a8 cc aa c0 2b c0 2f 00 9e |.0.........+./..|
-00000040 c0 24 c0 28 00 6b c0 23 c0 27 00 67 c0 0a c0 14 |.$.(.k.#.'.g....|
-00000050 00 39 c0 09 c0 13 00 33 00 9d 00 9c 00 3d 00 3c |.9.....3.....=.<|
-00000060 00 35 00 2f 00 ff 01 00 00 58 00 0b 00 04 03 00 |.5./.....X......|
-00000070 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 |................|
-00000080 00 18 00 23 00 00 00 16 00 00 00 17 00 00 00 0d |...#............|
-00000090 00 30 00 2e 04 03 05 03 06 03 08 07 08 08 08 09 |.0..............|
-000000a0 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
-000000b0 03 03 02 03 03 01 02 01 03 02 02 02 04 02 05 02 |................|
-000000c0 06 02 |..|
+00000000 16 03 01 00 89 01 00 00 85 03 03 9a d9 fe da 40 |...............@|
+00000010 cf 8b ed 11 09 8e 3f 29 4b 0d 46 ff fc f6 56 2c |......?)K.F...V,|
+00000020 a8 e7 16 84 8a a4 e9 44 89 97 0b 00 00 04 cc a8 |.......D........|
+00000030 00 ff 01 00 00 58 00 0b 00 04 03 00 01 02 00 0a |.....X..........|
+00000040 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000050 00 00 00 16 00 00 00 17 00 00 00 0d 00 30 00 2e |.............0..|
+00000060 04 03 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b |................|
+00000070 08 04 08 05 08 06 04 01 05 01 06 01 03 03 02 03 |................|
+00000080 03 01 02 01 03 02 02 02 04 02 05 02 06 02 |..............|
>>> Flow 2 (server to client)
00000000 16 03 03 00 3b 02 00 00 37 03 03 00 00 00 00 00 |....;...7.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 30 00 00 |...DOWNGRD...0..|
+00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 cc a8 00 00 |...DOWNGRD......|
00000030 0f 00 23 00 00 ff 01 00 01 00 00 0b 00 02 01 00 |..#.............|
00000040 16 03 03 02 59 0b 00 02 55 00 02 52 00 02 4f 30 |....Y...U..R..O0|
00000050 82 02 4b 30 82 01 b4 a0 03 02 01 02 02 09 00 e8 |..K0............|
@@ -57,38 +53,37 @@
00000290 d4 db fe 3d 13 60 84 5c 21 d3 3b e9 fa e7 16 03 |...=.`.\!.;.....|
000002a0 03 00 ac 0c 00 00 a8 03 00 1d 20 2f e5 7d a3 47 |.......... /.}.G|
000002b0 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 af |.bC.(.._.).0....|
-000002c0 c4 cf c2 ed 90 99 5f 58 cb 3b 74 08 04 00 80 d9 |......_X.;t.....|
-000002d0 5f d9 85 1f 13 34 60 85 c8 eb 27 79 14 ed 84 77 |_....4`...'y...w|
-000002e0 98 60 72 ce ee b9 92 87 50 4b 4a f8 25 7f 8d 92 |.`r.....PKJ.%...|
-000002f0 16 2a 19 65 96 b4 30 af fd 1b fe 1c 02 1f f4 77 |.*.e..0........w|
-00000300 6f 63 53 7c 54 a0 89 5d e9 32 b3 a9 5f e6 4b 60 |ocS|T..].2.._.K`|
-00000310 8b b1 c8 d2 61 8b 19 59 f3 5a b4 e2 71 16 b8 32 |....a..Y.Z..q..2|
-00000320 1f 8c 74 e2 4e 17 56 7e 69 01 39 8c c1 cf c7 0b |..t.N.V~i.9.....|
-00000330 56 c6 f6 c0 37 7b 3d 65 48 40 6b a0 67 e6 cd 70 |V...7{=eH@k.g..p|
-00000340 ce 8c 73 d4 e9 ba c0 04 18 b3 37 06 71 66 72 16 |..s.......7.qfr.|
+000002c0 c4 cf c2 ed 90 99 5f 58 cb 3b 74 08 04 00 80 89 |......_X.;t.....|
+000002d0 f8 62 c5 1a ba 78 74 da 6f 96 76 00 0f 6b a9 fb |.b...xt.o.v..k..|
+000002e0 83 d4 52 c0 80 0b 81 02 e3 b0 07 c2 9d ff b4 cc |..R.............|
+000002f0 ea 2e c7 82 91 35 74 ef 1e 9a ba 78 3e 60 6c 86 |.....5t....x>`l.|
+00000300 1d b0 14 52 84 84 70 ce 66 22 31 66 e2 53 04 bd |...R..p.f"1f.S..|
+00000310 4d 2b 5e 86 8b 79 dc 17 7a 4f bc 62 5a 21 a1 f6 |M+^..y..zO.bZ!..|
+00000320 46 1a 12 aa 7a 98 25 02 97 a8 9c 71 a4 4a 5b 28 |F...z.%....q.J[(|
+00000330 c8 11 6a 5f f1 b3 13 a7 f2 26 12 59 02 fa 28 e2 |..j_.....&.Y..(.|
+00000340 ba 8c c0 cd 50 c6 60 db 69 9a a1 92 12 26 23 16 |....P.`.i.....|
00000350 03 03 00 04 0e 00 00 00 |........|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 25 10 00 00 21 20 d5 13 c6 90 e0 4a |....%...! .....J|
-00000010 25 2f 5d cd 02 d8 fd 14 61 78 dd fc 42 57 ce bd |%/].....ax..BW..|
-00000020 e0 47 b8 cf 42 59 1c 7f 1f 1e 14 03 03 00 01 01 |.G..BY..........|
-00000030 16 03 03 00 28 96 2c 78 25 ee 20 88 53 69 57 96 |....(.,x%. .SiW.|
-00000040 d9 d2 53 6c 5b 5b e9 db 7d 0a 7c f9 16 27 43 df |..Sl[[..}.|..'C.|
-00000050 a9 e2 a6 e5 be c5 e9 d5 ff df 66 6b 81 |..........fk.|
+00000000 16 03 03 00 25 10 00 00 21 20 ba 1b c8 ae 22 78 |....%...! ...."x|
+00000010 84 ba d8 1c b3 87 52 f0 bf 13 76 2b a5 47 37 13 |......R...v+.G7.|
+00000020 30 89 01 13 1a cb 63 ea b3 37 14 03 03 00 01 01 |0.....c..7......|
+00000030 16 03 03 00 20 ac d7 79 45 e6 65 1d 20 1a 95 5e |.... ..yE.e. ..^|
+00000040 68 f7 0f ee 8c 3f 3d 0b bc 58 31 aa 46 d7 e3 00 |h....?=..X1.F...|
+00000050 7b 10 8c 01 5d |{...]|
>>> Flow 4 (server to client)
00000000 16 03 03 00 8b 04 00 00 87 00 00 00 00 00 81 50 |...............P|
00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................|
-00000030 6f ec 80 83 51 ed 14 ef 68 ca 42 c5 4c c7 ea d3 |o...Q...h.B.L...|
-00000040 9f e6 77 db 30 96 5c e3 bc f8 b7 c7 74 9d 0e 97 |..w.0.\.....t...|
-00000050 cf 3c ec 76 c8 9e ad 0c 49 86 9e 4f 4d 56 ce 95 |.<.v....I..OMV..|
-00000060 7f 75 79 aa dd 8e 66 8f 1f d8 01 2d c1 49 38 16 |.uy...f....-.I8.|
-00000070 b3 7a 6b 8d 3d ba 2b 81 4c 1c 75 c3 06 bb 8c 1e |.zk.=.+.L.u.....|
-00000080 df 59 35 29 5b d1 54 cc 5c 6b 37 74 29 19 0f 8b |.Y5)[.T.\k7t)...|
-00000090 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....|
-000000a0 00 00 00 c7 19 9a c9 cc 16 3b 8f b7 52 de 4c ab |.........;..R.L.|
-000000b0 90 83 b1 b5 60 0d c0 49 c4 28 f7 1d 1f e9 e0 b1 |....`..I.(......|
-000000c0 21 a1 49 17 03 03 00 25 00 00 00 00 00 00 00 01 |!.I....%........|
-000000d0 46 fe 03 14 ad 32 d5 ff 89 1f 08 15 6b 44 4f 2d |F....2......kDO-|
-000000e0 5e d6 f1 35 d9 c4 c4 cc bf 5a 26 df a6 15 03 03 |^..5.....Z&.....|
-000000f0 00 1a 00 00 00 00 00 00 00 02 4f 7b 8e 22 3c 85 |..........O{."<.|
-00000100 5c 41 f5 17 0d dd c8 41 b5 ef 5a 4c |\A.....A..ZL|
+00000030 6f e0 18 83 51 ed 14 ef 68 ca 42 c5 4c f8 79 c6 |o...Q...h.B.L.y.|
+00000040 80 85 74 9c 35 6f 4e 9d 60 0b a2 28 b0 45 b6 f6 |..t.5oN.`..(.E..|
+00000050 71 a3 f6 a6 95 71 cd 1e 53 e9 58 9f 94 18 ac d6 |q....q..S.X.....|
+00000060 6b 03 ba ac b4 4f c2 02 cc 1c 5b 88 84 49 38 16 |k....O....[..I8.|
+00000070 d9 5e b8 11 ab c6 f8 a7 9d 5d 58 99 b1 b6 8a be |.^.......]X.....|
+00000080 4e 9e 40 3d 00 22 11 25 c7 51 8e cb d2 10 d4 7d |N.@=.".%.Q.....}|
+00000090 14 03 03 00 01 01 16 03 03 00 20 ff 4b 1e 87 3e |.......... .K..>|
+000000a0 05 5c b4 3e e4 b9 5c 47 f0 a2 0b 67 47 89 c6 48 |.\.>..\G...gG..H|
+000000b0 d5 e3 73 d2 00 44 56 e4 8d b6 fb 17 03 03 00 1d |..s..DV.........|
+000000c0 58 28 94 02 c2 a9 99 3d b6 0b de 9c fd 52 61 bf |X(.....=.....Ra.|
+000000d0 55 c0 12 7f be a8 52 98 d7 99 a5 d0 60 15 03 03 |U.....R.....`...|
+000000e0 00 12 26 44 ad f0 a7 56 e5 23 6f 1b 7a 7e f8 e4 |..&D...V.#o.z~..|
+000000f0 42 49 5d 1d |BI].|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-IssueTicket b/src/crypto/tls/testdata/Server-TLSv12-IssueTicket
index 73d01585eb..f70c75993c 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-IssueTicket
+++ b/src/crypto/tls/testdata/Server-TLSv12-IssueTicket
@@ -1,7 +1,7 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 71 01 00 00 6d 03 03 60 fd 9b 74 aa |....q...m..`..t.|
-00000010 16 9f 07 32 7e 57 d0 91 86 ea 59 b7 f3 38 bb 4f |...2~W....Y..8.O|
-00000020 7f 2c 36 eb 67 21 57 f2 12 2b 38 00 00 04 00 2f |.,6.g!W..+8..../|
+00000000 16 03 01 00 71 01 00 00 6d 03 03 3d 21 91 3a 4e |....q...m..=!.:N|
+00000010 8e cd 65 eb 0f 1c ae 2a 58 40 4c 38 22 c9 46 2c |..e....*X@L8".F,|
+00000020 b8 cd dd 38 ad c6 4b a7 60 a9 56 00 00 04 00 2f |...8..K.`.V..../|
00000030 00 ff 01 00 00 40 00 23 00 00 00 16 00 00 00 17 |.....@.#........|
00000040 00 00 00 0d 00 30 00 2e 04 03 05 03 06 03 08 07 |.....0..........|
00000050 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 |................|
@@ -52,40 +52,40 @@
00000290 84 5c 21 d3 3b e9 fa e7 16 03 03 00 04 0e 00 00 |.\!.;...........|
000002a0 00 |.|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 2c d6 6d 84 0c |...........,.m..|
-00000010 d9 ef 52 bb cc 0b 41 47 d7 64 c7 a6 b0 fa 3c 6f |..R...AG.d......p..S..|
+00000060 2c 7e a9 42 25 e5 3a e2 55 3f 19 57 6b 83 43 6a |,~.B%.:.U?.Wk.Cj|
+00000070 93 34 2c 6e cb 4e 9d 25 8b 4d 7d d7 cc e1 16 59 |.4,n.N.%.M}....Y|
+00000080 2a 95 60 e4 31 0e df 7f cb 9d b7 14 03 03 00 01 |*.`.1...........|
+00000090 01 16 03 03 00 40 28 33 df 69 4f 4c 48 b1 fb 8d |.....@(3.iOLH...|
+000000a0 3f 3c d2 81 7c 33 cf 21 6a f7 d6 43 82 22 5b de |?<..|3.!j..C."[.|
+000000b0 46 7f 7b e2 39 23 bd 39 fa 03 bd 11 9d a8 a2 84 |F.{.9#.9........|
+000000c0 4a 90 1a ab e1 b4 23 9f 72 d0 97 9e 05 5c 47 2b |J.....#.r....\G+|
+000000d0 7a 53 bb ec a0 07 |zS....|
>>> Flow 4 (server to client)
00000000 16 03 03 00 8b 04 00 00 87 00 00 00 00 00 81 50 |...............P|
00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................|
-00000030 6f 2c 9f 83 51 ed 14 ef 68 ca 42 c5 4c 92 cc 13 |o,..Q...h.B.L...|
-00000040 05 4e 15 de 98 0a 74 d5 a9 2e 80 89 98 89 72 39 |.N....t.......r9|
-00000050 5f fe 49 56 66 ac 4d 73 b1 5b 4b 81 db 25 a7 5b |_.IVf.Ms.[K..%.[|
-00000060 54 5b 10 13 3d 96 71 d7 b7 23 53 ea 62 49 38 16 |T[..=.q..#S.bI8.|
-00000070 cc 4f 0d 9d 80 99 6e 0f 01 b3 d7 e4 8a 75 d1 b6 |.O....n......u..|
-00000080 7b 74 80 b2 b8 06 a9 71 6b 31 2a fd cf 6e 44 dc |{t.....qk1*..nD.|
+00000030 6f 2c 9f 83 51 ed 14 ef 68 ca 42 c5 4c 75 5e a5 |o,..Q...h.B.Lu^.|
+00000040 6f d2 49 61 e4 fb 83 46 7c 4c ab f9 c6 d1 3c 9e |o.Ia...F|L....<.|
+00000050 5b 8d d8 bc c0 a5 2d 84 db 24 dd a0 16 60 1d 87 |[.....-..$...`..|
+00000060 a0 52 88 25 6c c6 8e 5b 71 0f 74 c3 48 49 38 16 |.R.%l..[q.t.HI8.|
+00000070 92 8c de 77 bd 8a 2b 45 4d 58 86 40 b1 d6 0f 99 |...w..+EMX.@....|
+00000080 de 27 41 b2 41 27 aa fe 26 e9 24 91 2a 00 ff 08 |.'A.A'..&.$.*...|
00000090 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-000000a0 00 00 00 00 00 00 00 00 00 00 00 76 c4 85 3d 05 |...........v..=.|
-000000b0 60 a2 b3 ce 38 7f 1c f9 e3 19 87 b0 e1 af 08 b7 |`...8...........|
-000000c0 15 90 50 b9 51 85 c4 88 90 52 cd 6d b6 69 ee b5 |..P.Q....R.m.i..|
-000000d0 36 a8 0c 61 c4 78 09 6a 49 4d e9 17 03 03 00 40 |6..a.x.jIM.....@|
+000000a0 00 00 00 00 00 00 00 00 00 00 00 fc cd 6b 01 90 |.............k..|
+000000b0 7b 0c 31 54 a0 3a 8b f7 ba 45 e7 e0 df 9a 59 6d |{.1T.:...E....Ym|
+000000c0 83 b6 b2 c8 93 d8 d9 b6 fe 19 56 51 75 a3 ea 0e |..........VQu...|
+000000d0 f4 4b 64 27 66 fc 19 7b 7e 13 e7 17 03 03 00 40 |.Kd'f..{~......@|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-000000f0 76 31 e3 05 f8 b3 05 ca e2 55 84 b9 15 85 5d 4a |v1.......U....]J|
-00000100 83 a5 76 db b0 5f b9 65 b4 21 3e 00 36 9a e8 d7 |..v.._.e.!>.6...|
-00000110 02 81 23 83 19 13 c8 9c cd 02 ae 10 b9 cf 75 96 |..#...........u.|
+000000f0 c2 1b 6f f1 1e 05 1b 8a 19 16 67 00 0f dc a8 a2 |..o.......g.....|
+00000100 00 56 49 0a bb c5 df 7e 96 0c 5c db a0 f4 3e b4 |.VI....~..\...>.|
+00000110 30 3e b6 f0 16 dd d4 ed c9 de 64 49 00 9b 51 dc |0>........dI..Q.|
00000120 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000130 00 00 00 00 00 f9 ae b4 16 27 75 dc 72 4d 39 0e |.........'u.rM9.|
-00000140 ba 1f 31 b2 39 ec 99 36 bc 41 34 03 54 9b de 7b |..1.9..6.A4.T..{|
-00000150 4b 65 ef 99 a6 |Ke...|
+00000130 00 00 00 00 00 e1 9d 08 1a 2e 9a 0f 84 6d 4e e5 |.............mN.|
+00000140 2c 50 b9 28 5d 88 ea bb 48 4d af 26 7f 82 0b 56 |,P.(]...HM.&...V|
+00000150 c5 87 71 2a e7 |..q*.|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable b/src/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable
index c50fbcedf7..8cb57f5e95 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable
+++ b/src/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable
@@ -1,7 +1,7 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 71 01 00 00 6d 03 03 98 eb fe 13 a7 |....q...m.......|
-00000010 81 d8 8b 0b c6 78 c3 44 ce f7 7b 63 d1 7c 61 4d |.....x.D..{c.|aM|
-00000020 be fe 52 5f c0 24 88 c2 85 d1 40 00 00 04 00 2f |..R_.$....@..../|
+00000000 16 03 01 00 71 01 00 00 6d 03 03 e1 40 35 c8 5c |....q...m...@5.\|
+00000010 71 63 3f 5a 00 42 e6 3e 64 62 b8 c4 e7 e7 ba 98 |qc?Z.B.>db......|
+00000020 d8 fa 2c b5 65 f7 50 db 43 d9 70 00 00 04 00 2f |..,.e.P.C.p..../|
00000030 00 ff 01 00 00 40 00 23 00 00 00 16 00 00 00 17 |.....@.#........|
00000040 00 00 00 0d 00 30 00 2e 04 03 05 03 06 03 08 07 |.....0..........|
00000050 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 |................|
@@ -52,40 +52,40 @@
00000290 84 5c 21 d3 3b e9 fa e7 16 03 03 00 04 0e 00 00 |.\!.;...........|
000002a0 00 |.|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 11 4c a1 a0 ba |............L...|
-00000010 12 83 63 98 3c 1a 5d df a2 01 b6 6c 05 ec a1 1e |..c.<.]....l....|
-00000020 dc a5 6b b9 97 c3 76 51 06 45 4b 74 9e 1b 61 0f |..k...vQ.EKt..a.|
-00000030 9e d3 c7 db 7f d3 ee 23 1a 32 66 0f 2f 2c d3 52 |.......#.2f./,.R|
-00000040 e0 ec cc 31 71 d4 e6 2b b6 95 78 0b eb c9 70 b1 |...1q..+..x...p.|
-00000050 77 09 6f 8d 6d 8d 1b d7 b2 38 96 d3 f0 a2 94 37 |w.o.m....8.....7|
-00000060 14 ed d8 d6 b5 1e bc 71 b2 35 68 76 5b 10 dc 8f |.......q.5hv[...|
-00000070 de 9d 1d b5 59 d0 f1 04 70 9b 74 a9 af 7f b6 6b |....Y...p.t....k|
-00000080 de 29 5a fd 8f 95 cd 2c d6 b9 18 14 03 03 00 01 |.)Z....,........|
-00000090 01 16 03 03 00 40 02 70 cb 83 3c 42 32 58 9f 05 |.....@.p..>> Flow 4 (server to client)
00000000 16 03 03 00 8b 04 00 00 87 00 00 00 00 00 81 50 |...............P|
00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................|
-00000030 6f 2c 9f 83 51 ed 14 ef 68 ca 42 c5 4c 3e 73 fe |o,..Q...h.B.L>s.|
-00000040 72 ef 06 25 96 ef 3d 89 51 22 e3 10 57 02 e5 69 |r..%..=.Q"..W..i|
-00000050 aa d0 6d ad 66 b3 4c 07 fc ba a4 1e 3a ad a2 3b |..m.f.L.....:..;|
-00000060 40 f7 7d 9a 11 8e a0 9e 54 c5 7c 53 7d 49 38 16 |@.}.....T.|S}I8.|
-00000070 43 a6 1b 37 8e aa 02 78 25 9b 06 54 13 54 de 6a |C..7...x%..T.T.j|
-00000080 ae 62 72 97 47 1d f8 0a 32 c3 86 93 0e 64 cc 04 |.br.G...2....d..|
+00000030 6f 2c 9f 83 51 ed 14 ef 68 ca 42 c5 4c 20 33 6c |o,..Q...h.B.L 3l|
+00000040 01 97 a5 69 44 bf 8f ea db 83 05 fb ef cc 51 1f |...iD.........Q.|
+00000050 0b 4d 44 77 89 11 cf c8 38 16 67 ea a2 3e 8b 2a |.MDw....8.g..>.*|
+00000060 18 f2 f7 25 ce e0 d8 4c 93 31 b0 59 23 49 38 16 |...%...L.1.Y#I8.|
+00000070 3a f9 63 9e 61 21 1b ab 67 09 6a 23 07 8e d0 4a |:.c.a!..g.j#...J|
+00000080 19 78 9c 1e 60 40 a7 83 c5 9a 48 41 35 c4 e9 63 |.x..`@....HA5..c|
00000090 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-000000a0 00 00 00 00 00 00 00 00 00 00 00 ac 24 92 7d 6c |............$.}l|
-000000b0 d5 fe a8 a7 b7 45 fe 58 f6 13 02 ed de c8 ba 44 |.....E.X.......D|
-000000c0 18 59 1e f9 06 82 2f 42 22 62 5a 82 4d 70 9a c3 |.Y..../B"bZ.Mp..|
-000000d0 41 55 b0 66 ae e2 b1 1d d9 38 0a 17 03 03 00 40 |AU.f.....8.....@|
+000000a0 00 00 00 00 00 00 00 00 00 00 00 b8 46 07 9e 14 |............F...|
+000000b0 85 ba 6d e0 f1 f5 99 43 80 9a 54 6b 33 1e 4f c1 |..m....C..Tk3.O.|
+000000c0 88 b7 3d 60 04 d4 e9 b0 b2 6d c4 1a ca 3b 9f 83 |..=`.....m...;..|
+000000d0 28 5f ea b2 54 e4 11 78 69 de 1a 17 03 03 00 40 |(_..T..xi......@|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-000000f0 bd 16 9e 9c f2 9b 0d f8 f1 42 ba f3 38 64 69 ac |.........B..8di.|
-00000100 4a c9 25 d7 03 0b ec 8f 53 14 26 68 da b7 43 34 |J.%.....S.&h..C4|
-00000110 18 cd 66 dc 36 5e f5 16 ca 18 78 37 89 8a d5 9d |..f.6^....x7....|
+000000f0 55 34 ad ae 9b 37 df cd 88 ae fc 6a ac c5 cf 16 |U4...7.....j....|
+00000100 ec f1 bc 22 1e d2 c1 52 5e a2 e7 d2 6e 37 7a 29 |..."...R^...n7z)|
+00000110 c8 b9 d4 7d 81 63 1a f0 53 d9 10 fd 4f 3d 1c dd |...}.c..S...O=..|
00000120 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000130 00 00 00 00 00 64 f9 5c df db 60 b7 22 15 77 29 |.....d.\..`.".w)|
-00000140 33 6f 93 22 81 c4 e5 71 af 27 60 e5 76 5f a6 f6 |3o."...q.'`.v_..|
-00000150 e0 73 87 9f ed |.s...|
+00000130 00 00 00 00 00 8f f2 11 0d 93 99 83 29 d4 10 a4 |............)...|
+00000140 7c bb 26 7b 24 f1 15 3a 9b 81 0e cb 0a 51 4b 39 ||.&{$..:.....QK9|
+00000150 69 1d e5 38 5e |i..8^|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPKCS1v15 b/src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPKCS1v15
index 0e9be7fbdb..b193771e4e 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPKCS1v15
+++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPKCS1v15
@@ -1,18 +1,14 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 91 01 00 00 8d 03 03 84 aa e5 17 f4 |................|
-00000010 80 c4 fb ca 14 f7 c9 d9 55 f0 8e 63 f9 e1 7e ad |........U..c..~.|
-00000020 e7 5e 60 e9 2b dd 22 dd d1 11 93 00 00 2a c0 30 |.^`.+."......*.0|
-00000030 00 9f cc a8 cc aa c0 2f 00 9e c0 28 00 6b c0 27 |......./...(.k.'|
-00000040 00 67 c0 14 00 39 c0 13 00 33 00 9d 00 9c 00 3d |.g...9...3.....=|
-00000050 00 3c 00 35 00 2f 00 ff 01 00 00 3a 00 00 00 0e |.<.5./.....:....|
-00000060 00 0c 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b |.....127.0.0.1..|
-00000070 00 04 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 |................|
-00000080 00 1e 00 19 00 18 00 16 00 00 00 17 00 00 00 0d |................|
-00000090 00 04 00 02 04 01 |......|
+00000000 16 03 01 00 59 01 00 00 55 03 03 60 c3 e9 6a 99 |....Y...U..`..j.|
+00000010 72 7a 1c b9 1e 10 4b 9a 82 d5 ea b9 b0 6f 1e 05 |rz....K......o..|
+00000020 74 a4 35 bb 71 c7 d2 56 87 b8 69 00 00 04 cc a8 |t.5.q..V..i.....|
+00000030 00 ff 01 00 00 28 00 0b 00 04 03 00 01 02 00 0a |.....(..........|
+00000040 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000050 00 00 00 17 00 00 00 0d 00 04 00 02 04 01 |..............|
>>> Flow 2 (server to client)
00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 30 00 00 |...DOWNGRD...0..|
+00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 cc a8 00 00 |...DOWNGRD......|
00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|
00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|
00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|
@@ -54,29 +50,28 @@
00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 ac 0c |.`.\!.;.........|
000002a0 00 00 a8 03 00 1d 20 2f e5 7d a3 47 cd 62 43 15 |...... /.}.G.bC.|
000002b0 28 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 ed |(.._.).0........|
-000002c0 90 99 5f 58 cb 3b 74 04 01 00 80 2c d2 21 86 4f |.._X.;t....,.!.O|
-000002d0 e0 b7 f1 7d f8 8f ca b3 e7 ef 34 e5 ea 78 12 b1 |...}......4..x..|
-000002e0 92 1b 1b 7f 35 da 38 cb a9 1a 52 97 0e df 33 83 |....5.8...R...3.|
-000002f0 e2 10 cb 72 78 41 66 9b 55 c9 a3 0b de ef b5 f3 |...rxAf.U.......|
-00000300 8e 11 fa 5c a5 2a 93 29 b0 e2 42 9b 07 55 bd 6c |...\.*.)..B..U.l|
-00000310 fa 3e a5 5b 2c 5b 3e d8 fa 76 6b d4 63 2c 47 22 |.>.[,[>..vk.c,G"|
-00000320 17 92 9c 40 a4 f3 b3 a4 6d 12 da f7 d9 58 11 3f |...@....m....X.?|
-00000330 1a 12 8a c8 19 a6 f8 e0 49 b8 6b 79 34 5f f2 46 |........I.ky4_.F|
-00000340 27 62 e2 0e 13 93 74 b5 0b 63 8a 16 03 03 00 04 |'b....t..c......|
+000002c0 90 99 5f 58 cb 3b 74 04 01 00 80 4e c9 fd 39 89 |.._X.;t....N..9.|
+000002d0 52 c1 6b ba 3b c9 02 35 89 e8 e3 f8 41 15 ee 6d |R.k.;..5....A..m|
+000002e0 f6 08 6d 1a 47 aa 3b 5c 1d 9b 42 9b 50 85 af 56 |..m.G.;\..B.P..V|
+000002f0 a3 99 78 84 7f 06 91 97 e9 33 0d 1d 9b 17 ce 3b |..x......3.....;|
+00000300 30 f2 d0 10 1c b6 e2 7d fd b3 e1 bc 14 7a 1a 96 |0......}.....z..|
+00000310 be b9 dc 0d 29 33 84 5f d1 77 91 0a a1 f2 2b cc |....)3._.w....+.|
+00000320 dc 5e 9b f9 8b e3 34 d2 bd f3 46 b4 0d 97 de 44 |.^....4...F....D|
+00000330 aa 83 10 82 bd ca 83 27 d0 40 a7 b1 64 15 dd 84 |.......'.@..d...|
+00000340 5f 3c d9 62 42 0d 8f a6 19 0f b1 16 03 03 00 04 |_<.bB...........|
00000350 0e 00 00 00 |....|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 25 10 00 00 21 20 0a 81 a9 76 78 5f |....%...! ...vx_|
-00000010 f2 35 87 19 ed 3d 0b 1c 51 ff b7 51 c9 03 5a de |.5...=..Q..Q..Z.|
-00000020 04 e6 47 3c d0 fe 32 75 64 28 14 03 03 00 01 01 |..G<..2ud(......|
-00000030 16 03 03 00 28 90 38 86 3b 34 cf 30 74 00 91 55 |....(.8.;4.0t..U|
-00000040 82 bd 9b 3a 78 34 09 3f a6 33 3f 7a 77 a5 53 67 |...:x4.?.3?zw.Sg|
-00000050 30 94 30 cb 19 0c a8 ac 10 54 b8 90 57 |0.0......T..W|
+00000000 16 03 03 00 25 10 00 00 21 20 82 3a 50 41 f7 b1 |....%...! .:PA..|
+00000010 0f 97 ba 38 04 db f3 a6 ec 8b d1 db 06 c1 84 89 |...8............|
+00000020 a0 53 84 92 27 a2 53 e8 5d 21 14 03 03 00 01 01 |.S..'.S.]!......|
+00000030 16 03 03 00 20 7d 80 6d 7f a9 28 d6 0d 50 d6 b4 |.... }.m..(..P..|
+00000040 24 d3 92 f8 0b 8e 6b d8 7c 64 9e 6c 87 a9 8e 37 |$.....k.|d.l...7|
+00000050 9e 1b 0b 2d a5 |...-.|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....|
-00000010 00 00 00 e5 08 6e 55 df 84 0e 16 f9 e2 b0 44 3c |.....nU.......D<|
-00000020 e7 e4 a1 e2 61 ee 18 cb bd c1 71 8f aa 23 c7 e1 |....a.....q..#..|
-00000030 de ab 86 17 03 03 00 25 00 00 00 00 00 00 00 01 |.......%........|
-00000040 6d 0c 13 09 51 5e 5b e8 2a 85 c6 99 7e 9a 7d 79 |m...Q^[.*...~.}y|
-00000050 45 9b 63 18 d0 41 3d e7 78 24 93 52 11 15 03 03 |E.c..A=.x$.R....|
-00000060 00 1a 00 00 00 00 00 00 00 02 ec a4 cf b9 7a 35 |..............z5|
-00000070 9b 64 01 f4 7e 7d f0 08 05 79 7b 46 |.d..~}...y{F|
+00000000 14 03 03 00 01 01 16 03 03 00 20 e4 58 cf fb 81 |.......... .X...|
+00000010 be dd 5b 98 97 bd bd 6a f0 76 92 b6 bb 2c 8f a3 |..[....j.v...,..|
+00000020 e5 52 5b 1d f4 17 7b 2a a8 40 26 17 03 03 00 1d |.R[...{*.@&.....|
+00000030 58 ef 4f 1d 98 0f 3d 59 88 df 6e ac c9 37 43 d5 |X.O...=Y..n..7C.|
+00000040 f5 58 b3 7a 62 a3 7d 26 a2 a2 80 23 ef 15 03 03 |.X.zb.}&...#....|
+00000050 00 12 05 b8 57 6a 80 71 b6 a4 58 94 15 f4 2f 0c |....Wj.q..X.../.|
+00000060 8e 76 b2 aa |.v..|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPSS b/src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPSS
index 465d8db01f..af4c069fad 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPSS
+++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-RSAPSS
@@ -1,18 +1,14 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 91 01 00 00 8d 03 03 6d d9 a6 ff 3e |...........m...>|
-00000010 4b 00 33 67 b4 8c c6 e8 07 ee f3 77 83 31 81 e9 |K.3g.......w.1..|
-00000020 8f 3e 9e 77 8b 5c 8b 84 47 b4 33 00 00 2a c0 30 |.>.w.\..G.3..*.0|
-00000030 00 9f cc a8 cc aa c0 2f 00 9e c0 28 00 6b c0 27 |......./...(.k.'|
-00000040 00 67 c0 14 00 39 c0 13 00 33 00 9d 00 9c 00 3d |.g...9...3.....=|
-00000050 00 3c 00 35 00 2f 00 ff 01 00 00 3a 00 00 00 0e |.<.5./.....:....|
-00000060 00 0c 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b |.....127.0.0.1..|
-00000070 00 04 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 |................|
-00000080 00 1e 00 19 00 18 00 16 00 00 00 17 00 00 00 0d |................|
-00000090 00 04 00 02 08 06 |......|
+00000000 16 03 01 00 5b 01 00 00 57 03 03 e0 83 fd ef f8 |....[...W.......|
+00000010 cb 41 23 14 36 21 07 eb 4e 01 7d 80 63 e4 b9 45 |.A#.6!..N.}.c..E|
+00000020 f0 84 72 71 9b ac 60 49 6c 70 74 00 00 04 cc a8 |..rq..`Ilpt.....|
+00000030 00 ff 01 00 00 2a 00 0b 00 04 03 00 01 02 00 0a |.....*..........|
+00000040 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000050 00 00 00 17 00 00 00 0d 00 06 00 04 08 06 08 04 |................|
>>> Flow 2 (server to client)
00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 30 00 00 |...DOWNGRD...0..|
+00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 cc a8 00 00 |...DOWNGRD......|
00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|
00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|
00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|
@@ -51,5 +47,31 @@
00000260 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 77 8d |.\.....l..s..Cw.|
00000270 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d ae db |......@.a.Lr+...|
00000280 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db fe 3d |F..M...>...B...=|
-00000290 13 60 84 5c 21 d3 3b e9 fa e7 15 03 03 00 02 02 |.`.\!.;.........|
-000002a0 28 |(|
+00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 ac 0c |.`.\!.;.........|
+000002a0 00 00 a8 03 00 1d 20 2f e5 7d a3 47 cd 62 43 15 |...... /.}.G.bC.|
+000002b0 28 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 ed |(.._.).0........|
+000002c0 90 99 5f 58 cb 3b 74 08 04 00 80 58 d3 5f 28 bc |.._X.;t....X._(.|
+000002d0 50 79 b9 3d f1 ac a1 af 52 cd d3 fd e7 75 47 c3 |Py.=....R....uG.|
+000002e0 65 3a 6f 62 22 c2 b5 cc 2b 22 f3 5d 3f b5 b6 9e |e:ob"...+".]?...|
+000002f0 57 bf c7 4e 08 bd fb 5a 17 13 09 1a e9 6c b6 ce |W..N...Z.....l..|
+00000300 b2 0e 88 ae ba a3 a0 b5 2c ff 51 b5 87 95 14 09 |........,.Q.....|
+00000310 6d 9c 73 3f f0 c7 40 6b 4c ca 40 96 d6 44 96 d0 |m.s?..@kL.@..D..|
+00000320 6f b1 a0 1c 4f 66 cc 9b 4f 85 98 3c 03 68 e3 a8 |o...Of..O..<.h..|
+00000330 5b 28 04 fb 1e be 9e 2a 66 c1 6e f1 2e a4 20 08 |[(.....*f.n... .|
+00000340 7e 11 78 7b fc c4 43 af 2a b4 8b 16 03 03 00 04 |~.x{..C.*.......|
+00000350 0e 00 00 00 |....|
+>>> Flow 3 (client to server)
+00000000 16 03 03 00 25 10 00 00 21 20 e2 54 7d 82 d2 8d |....%...! .T}...|
+00000010 b8 d6 87 17 ec 2a 64 4e 15 6b b0 b3 01 66 b0 7d |.....*dN.k...f.}|
+00000020 73 20 9f cb 30 9d 3c 27 ac 13 14 03 03 00 01 01 |s ..0.<'........|
+00000030 16 03 03 00 20 fa a0 b7 eb ef 49 97 d5 da f0 9d |.... .....I.....|
+00000040 85 a6 e6 67 f3 30 e8 f0 82 3a 7a c4 3f 76 f6 c5 |...g.0...:z.?v..|
+00000050 8f d3 a5 65 f3 |...e.|
+>>> Flow 4 (server to client)
+00000000 14 03 03 00 01 01 16 03 03 00 20 6b cf 58 e1 52 |.......... k.X.R|
+00000010 e3 2c 05 e6 a3 05 c1 36 02 f0 90 63 bb 86 0f 54 |.,.....6...c...T|
+00000020 61 d7 1a 31 7d bd 08 00 22 71 09 17 03 03 00 1d |a..1}..."q......|
+00000030 4a 8e 05 28 e3 77 31 43 be ac 32 c6 af f2 7b 1c |J..(.w1C..2...{.|
+00000040 ab 11 7f 32 5a 6a eb 76 ac c6 eb f1 dc 15 03 03 |...2Zj.v........|
+00000050 00 12 3a f1 ee a3 6f bf 9b 9e 5e b8 20 76 84 bc |..:...o...^. v..|
+00000060 1e 2e a0 87 |....|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-Resume b/src/crypto/tls/testdata/Server-TLSv12-Resume
index e8205b743d..456fe2a17d 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-Resume
+++ b/src/crypto/tls/testdata/Server-TLSv12-Resume
@@ -1,18 +1,18 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 01 12 01 00 01 0e 03 03 3e 4f b2 97 44 |...........>O..D|
-00000010 64 a4 e1 33 32 21 98 ea c1 8c 3f 7b 5f 47 e6 54 |d..32!....?{_G.T|
-00000020 bf f1 a9 fd fb 5c 1e c9 23 7a 12 20 42 f6 4f a1 |.....\..#z. B.O.|
-00000030 85 90 ad 50 2b 3b 24 f7 2e 48 1f 2d 5b 0d fe 77 |...P+;$..H.-[..w|
-00000040 07 2b cb e9 03 23 d9 24 04 05 4e 26 00 04 00 2f |.+...#.$..N&.../|
+00000000 16 03 01 01 12 01 00 01 0e 03 03 90 27 78 df 71 |............'x.q|
+00000010 d3 0e ce 1d de ec d2 1b 70 e0 89 da 98 a9 45 3e |........p.....E>|
+00000020 9c ee 93 90 8f 61 d0 a3 b4 a4 5a 20 9d cd d4 81 |.....a....Z ....|
+00000030 e2 c0 59 81 21 bc 9f 2a 84 3e 91 15 3e b9 c0 a1 |..Y.!..*.>..>...|
+00000040 e0 6b 73 9c 45 53 03 ad b9 e6 c2 77 00 04 00 2f |.ks.ES.....w.../|
00000050 00 ff 01 00 00 c1 00 23 00 81 50 46 ad c1 db a8 |.......#..PF....|
00000060 38 86 7b 2b bb fd d0 c3 42 3e 00 00 00 00 00 00 |8.{+....B>......|
00000070 00 00 00 00 00 00 00 00 00 00 94 6f 2c 9f 83 51 |...........o,..Q|
-00000080 ed 14 ef 68 ca 42 c5 4c 92 cc 13 05 4e 15 de 98 |...h.B.L....N...|
-00000090 0a 74 d5 a9 2e 80 89 98 89 72 39 5f fe 49 56 66 |.t.......r9_.IVf|
-000000a0 ac 4d 73 b1 5b 4b 81 db 25 a7 5b 54 5b 10 13 3d |.Ms.[K..%.[T[..=|
-000000b0 96 71 d7 b7 23 53 ea 62 49 38 16 cc 4f 0d 9d 80 |.q..#S.bI8..O...|
-000000c0 99 6e 0f 01 b3 d7 e4 8a 75 d1 b6 7b 74 80 b2 b8 |.n......u..{t...|
-000000d0 06 a9 71 6b 31 2a fd cf 6e 44 dc 00 16 00 00 00 |..qk1*..nD......|
+00000080 ed 14 ef 68 ca 42 c5 4c 75 5e a5 6f d2 49 61 e4 |...h.B.Lu^.o.Ia.|
+00000090 fb 83 46 7c 4c ab f9 c6 d1 3c 9e 5b 8d d8 bc c0 |..F|L....<.[....|
+000000a0 a5 2d 84 db 24 dd a0 16 60 1d 87 a0 52 88 25 6c |.-..$...`...R.%l|
+000000b0 c6 8e 5b 71 0f 74 c3 48 49 38 16 92 8c de 77 bd |..[q.t.HI8....w.|
+000000c0 8a 2b 45 4d 58 86 40 b1 d6 0f 99 de 27 41 b2 41 |.+EMX.@.....'A.A|
+000000d0 27 aa fe 26 e9 24 91 2a 00 ff 08 00 16 00 00 00 |'..&.$.*........|
000000e0 17 00 00 00 0d 00 30 00 2e 04 03 05 03 06 03 08 |......0.........|
000000f0 07 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 04 |................|
00000100 01 05 01 06 01 03 03 02 03 03 01 02 01 03 02 02 |................|
@@ -20,27 +20,27 @@
>>> Flow 2 (server to client)
00000000 16 03 03 00 51 02 00 00 4d 03 03 00 00 00 00 00 |....Q...M.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 44 4f 57 4e 47 52 44 01 20 42 f6 4f a1 |...DOWNGRD. B.O.|
-00000030 85 90 ad 50 2b 3b 24 f7 2e 48 1f 2d 5b 0d fe 77 |...P+;$..H.-[..w|
-00000040 07 2b cb e9 03 23 d9 24 04 05 4e 26 00 2f 00 00 |.+...#.$..N&./..|
+00000020 00 00 00 44 4f 57 4e 47 52 44 01 20 9d cd d4 81 |...DOWNGRD. ....|
+00000030 e2 c0 59 81 21 bc 9f 2a 84 3e 91 15 3e b9 c0 a1 |..Y.!..*.>..>...|
+00000040 e0 6b 73 9c 45 53 03 ad b9 e6 c2 77 00 2f 00 00 |.ks.ES.....w./..|
00000050 05 ff 01 00 01 00 14 03 03 00 01 01 16 03 03 00 |................|
00000060 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |@...............|
-00000070 00 dc 9b ca 90 7b f0 70 bc 17 76 9c fb a7 74 49 |.....{.p..v...tI|
-00000080 0c 9f 3c 31 76 77 9b af 6a e0 00 a6 54 81 4a d5 |..<1vw..j...T.J.|
-00000090 de fa 75 cb d6 b4 b2 6c bc f4 30 7a a1 56 0a f5 |..u....l..0z.V..|
-000000a0 5c |\|
+00000070 00 57 8e 5f 0a f6 3f 3b 43 f1 33 bc ef 5e c6 8d |.W._..?;C.3..^..|
+00000080 86 92 58 58 71 51 e8 54 57 96 5f bd 36 3a 9f d3 |..XXqQ.TW._.6:..|
+00000090 e9 27 01 bf fb 6a 05 57 de 2d db b2 79 38 72 95 |.'...j.W.-..y8r.|
+000000a0 fd |.|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 16 03 03 00 40 cb 74 dc ec f5 |..........@.t...|
-00000010 ad ab c5 8e dc da 50 89 28 7b cc 0f 06 87 9a 19 |......P.({......|
-00000020 dd 4e 40 38 1d 8f 95 6f 0e 62 5f cb 7c db ab 24 |.N@8...o.b_.|..$|
-00000030 df 03 ef 7c 83 12 0e 3d 25 e8 de cf d0 aa 0e 91 |...|...=%.......|
-00000040 20 9b 38 39 4e 39 70 3c 0a ce c8 | .89N9p<...|
+00000000 14 03 03 00 01 01 16 03 03 00 40 6d 3c 76 31 a4 |..........@m.5v...K.|
+00000020 01 f8 a8 83 0c eb 58 f7 d6 93 c6 b6 40 0e c8 24 |......X.....@..$|
+00000030 46 58 0c 79 4a c6 b4 15 65 1e 9c bd ff 51 4d d0 |FX.yJ...e....QM.|
+00000040 44 66 fe c0 98 d5 26 11 98 cf 52 |Df....&...R|
>>> Flow 4 (server to client)
00000000 17 03 03 00 40 00 00 00 00 00 00 00 00 00 00 00 |....@...........|
-00000010 00 00 00 00 00 d1 5b 42 2c 10 9b 48 97 cf 8e 69 |......[B,..H...i|
-00000020 a4 b4 62 65 d9 f1 1f 86 07 f1 6c cd 5b 18 6e c7 |..be......l.[.n.|
-00000030 8d 57 20 3d f9 3f 68 1b 12 7b 29 13 b9 8d fe 7b |.W =.?h..{)....{|
-00000040 ad 52 22 c4 94 15 03 03 00 30 00 00 00 00 00 00 |.R"......0......|
-00000050 00 00 00 00 00 00 00 00 00 00 31 ae ae 06 b7 2c |..........1....,|
-00000060 5f a4 fc 8f a6 33 2b 42 1a f5 d5 b9 ad a4 fc a0 |_....3+B........|
-00000070 bc e9 c8 5d 4d 26 83 38 ca 57 |...]M&.8.W|
+00000010 00 00 00 00 00 4e 8e bd e5 c8 d4 1a 14 00 f1 ed |.....N..........|
+00000020 c4 88 b3 5c 92 b9 ad 8a 68 d4 f3 85 1b 02 25 aa |...\....h.....%.|
+00000030 a0 65 49 08 0d 2a b4 0a 64 eb ea ab 06 73 08 ca |.eI..*..d....s..|
+00000040 62 c9 56 45 a9 15 03 03 00 30 00 00 00 00 00 00 |b.VE.....0......|
+00000050 00 00 00 00 00 00 00 00 00 00 60 51 ae 81 79 6d |..........`Q..ym|
+00000060 91 95 02 42 30 3f c4 3c 2b fc 74 47 a7 a9 17 22 |...B0?.<+.tG..."|
+00000070 88 26 6d 18 b9 8f ad 43 e3 b0 |.&m....C..|
diff --git a/src/crypto/tls/testdata/Server-TLSv12-ResumeDisabled b/src/crypto/tls/testdata/Server-TLSv12-ResumeDisabled
index 2adf586209..339fd9a0f2 100644
--- a/src/crypto/tls/testdata/Server-TLSv12-ResumeDisabled
+++ b/src/crypto/tls/testdata/Server-TLSv12-ResumeDisabled
@@ -1,94 +1,91 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 01 33 01 00 01 2f 03 03 3a 1d a7 55 e5 |....3.../..:..U.|
-00000010 e7 ab ac 09 74 a3 4e e1 b9 cf 90 92 74 83 13 1c |....t.N.....t...|
-00000020 e7 0b 57 c7 4a 48 bb a6 86 f0 93 20 29 15 61 8f |..W.JH..... ).a.|
-00000030 f1 20 4a 95 e5 ce 8b 8d 60 4c 3c d6 2e 40 22 f4 |. J.....`L<..@".|
-00000040 8d 4e 07 f7 76 c7 28 e8 b0 5d 79 4f 00 04 00 2f |.N..v.(..]yO.../|
-00000050 00 ff 01 00 00 e2 00 00 00 0e 00 0c 00 00 09 31 |...............1|
-00000060 32 37 2e 30 2e 30 2e 31 00 0b 00 04 03 00 01 02 |27.0.0.1........|
-00000070 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 |................|
-00000080 00 23 00 78 50 46 ad c1 db a8 38 86 7b 2b bb fd |.#.xPF....8.{+..|
-00000090 d0 c3 42 3e 00 00 00 00 00 00 00 00 00 00 00 00 |..B>............|
-000000a0 00 00 00 00 94 6f 2c 9f 83 61 31 33 93 70 cd 6a |.....o,..a13.p.j|
-000000b0 19 a2 67 e8 7d cb a4 dc bb 80 d9 23 20 05 4d 53 |..g.}......# .MS|
-000000c0 1f b6 9f 48 01 e4 84 75 10 25 f9 ed 98 bb 39 7e |...H...u.%....9~|
-000000d0 fc 8b 16 d8 bc c7 e9 88 e8 1c 33 94 10 13 6b d4 |..........3...k.|
-000000e0 3d fa d7 73 b2 d4 ea 89 58 ed 38 f8 f3 6a e0 5f |=..s....X.8..j._|
-000000f0 1e f7 49 ed f7 5f 64 39 6b b5 6c fb 00 16 00 00 |..I.._d9k.l.....|
-00000100 00 17 00 00 00 0d 00 30 00 2e 04 03 05 03 06 03 |.......0........|
-00000110 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 |................|
-00000120 04 01 05 01 06 01 03 03 02 03 03 01 02 01 03 02 |................|
-00000130 02 02 04 02 05 02 06 02 |........|
+00000000 16 03 01 01 12 01 00 01 0e 03 03 b8 aa 9b e6 98 |................|
+00000010 be 93 d6 03 f2 cd 62 23 76 dd 74 6c 48 ac 9a f6 |......b#v.tlH...|
+00000020 f3 27 62 93 6e 99 b2 0d 54 af b7 20 2d 20 97 9a |.'b.n...T.. - ..|
+00000030 c8 88 50 65 95 2a 02 8f 7b 47 77 6d 3c 49 ba a9 |..Pe.*..{Gwm......|
+00000070 00 00 00 00 00 00 00 00 00 00 94 6f 2c 9f 83 51 |...........o,..Q|
+00000080 ed 14 ef 68 ca 42 c5 4c 20 33 6c 01 97 a5 69 44 |...h.B.L 3l...iD|
+00000090 bf 8f ea db 83 05 fb ef cc 51 1f 0b 4d 44 77 89 |.........Q..MDw.|
+000000a0 11 cf c8 38 16 67 ea a2 3e 8b 2a 18 f2 f7 25 ce |...8.g..>.*...%.|
+000000b0 e0 d8 4c 93 31 b0 59 23 49 38 16 3a f9 63 9e 61 |..L.1.Y#I8.:.c.a|
+000000c0 21 1b ab 67 09 6a 23 07 8e d0 4a 19 78 9c 1e 60 |!..g.j#...J.x..`|
+000000d0 40 a7 83 c5 9a 48 41 35 c4 e9 63 00 16 00 00 00 |@....HA5..c.....|
+000000e0 17 00 00 00 0d 00 30 00 2e 04 03 05 03 06 03 08 |......0.........|
+000000f0 07 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 04 |................|
+00000100 01 05 01 06 01 03 03 02 03 03 01 02 01 03 02 02 |................|
+00000110 02 04 02 05 02 06 02 |.......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 37 02 00 00 33 03 03 00 00 00 00 00 |....7...3.......|
+00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 00 2f 00 00 |...DOWNGRD.../..|
-00000030 0b ff 01 00 01 00 00 0b 00 02 01 00 16 03 03 02 |................|
-00000040 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 4b 30 |Y...U..R..O0..K0|
-00000050 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d 3f e2 |..............?.|
-00000060 5b ea a6 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b |[..0...*.H......|
-00000070 05 00 30 1f 31 0b 30 09 06 03 55 04 0a 13 02 47 |..0.1.0...U....G|
-00000080 6f 31 10 30 0e 06 03 55 04 03 13 07 47 6f 20 52 |o1.0...U....Go R|
-00000090 6f 6f 74 30 1e 17 0d 31 36 30 31 30 31 30 30 30 |oot0...160101000|
-000000a0 30 30 30 5a 17 0d 32 35 30 31 30 31 30 30 30 30 |000Z..2501010000|
-000000b0 30 30 5a 30 1a 31 0b 30 09 06 03 55 04 0a 13 02 |00Z0.1.0...U....|
-000000c0 47 6f 31 0b 30 09 06 03 55 04 03 13 02 47 6f 30 |Go1.0...U....Go0|
-000000d0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|
-000000e0 00 03 81 8d 00 30 81 89 02 81 81 00 db 46 7d 93 |.....0.......F}.|
-000000f0 2e 12 27 06 48 bc 06 28 21 ab 7e c4 b6 a2 5d fe |..'.H..(!.~...].|
-00000100 1e 52 45 88 7a 36 47 a5 08 0d 92 42 5b c2 81 c0 |.RE.z6G....B[...|
-00000110 be 97 79 98 40 fb 4f 6d 14 fd 2b 13 8b c2 a5 2e |..y.@.Om..+.....|
-00000120 67 d8 d4 09 9e d6 22 38 b7 4a 0b 74 73 2b c2 34 |g....."8.J.ts+.4|
-00000130 f1 d1 93 e5 96 d9 74 7b f3 58 9f 6c 61 3c c0 b0 |......t{.X.la<..|
-00000140 41 d4 d9 2b 2b 24 23 77 5b 1c 3b bd 75 5d ce 20 |A..++$#w[.;.u]. |
-00000150 54 cf a1 63 87 1d 1e 24 c4 f3 1d 1a 50 8b aa b6 |T..c...$....P...|
-00000160 14 43 ed 97 a7 75 62 f4 14 c8 52 d7 02 03 01 00 |.C...ub...R.....|
-00000170 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f 01 01 |....0..0...U....|
-00000180 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 04 16 |.......0...U.%..|
-00000190 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 2b 06 |0...+.........+.|
-000001a0 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 01 ff |......0...U.....|
-000001b0 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 10 9f |..0.0...U.......|
-000001c0 91 16 1f 43 43 3e 49 a6 de 6d b6 80 d7 9f 60 30 |...CC>I..m....`0|
-000001d0 1b 06 03 55 1d 23 04 14 30 12 80 10 48 13 49 4d |...U.#..0...H.IM|
-000001e0 13 7e 16 31 bb a3 01 d5 ac ab 6e 7b 30 19 06 03 |.~.1......n{0...|
-000001f0 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 6c 65 |U....0...example|
-00000200 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 86 f7 |.golang0...*.H..|
-00000210 0d 01 01 0b 05 00 03 81 81 00 9d 30 cc 40 2b 5b |...........0.@+[|
-00000220 50 a0 61 cb ba e5 53 58 e1 ed 83 28 a9 58 1a a9 |P.a...SX...(.X..|
-00000230 38 a4 95 a1 ac 31 5a 1a 84 66 3d 43 d3 2d d9 0b |8....1Z..f=C.-..|
-00000240 f2 97 df d3 20 64 38 92 24 3a 00 bc cf 9c 7d b7 |.... d8.$:....}.|
-00000250 40 20 01 5f aa d3 16 61 09 a2 76 fd 13 c3 cc e1 |@ ._...a..v.....|
-00000260 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 77 8d |.\.....l..s..Cw.|
-00000270 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d ae db |......@.a.Lr+...|
-00000280 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db fe 3d |F..M...>...B...=|
-00000290 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 04 0e |.`.\!.;.........|
-000002a0 00 00 00 |...|
+00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.|
+00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......|
+00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.|
+00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..|
+00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..|
+000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1|
+000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.|
+000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...|
+000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0|
+000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.|
+000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6|
+00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.|
+00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....|
+00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......|
+00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$|
+00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..|
+00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u|
+00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.|
+00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........|
+00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.|
+00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......|
+000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.|
+000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>|
+000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#|
+000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..|
+000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0|
+000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan|
+00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........|
+00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...|
+00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1|
+00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d|
+00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..|
+00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....|
+00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......|
+00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..|
+00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.|
+00000290 3b e9 fa e7 16 03 03 00 04 0e 00 00 00 |;............|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 70 09 52 14 dc |...........p.R..|
-00000010 cd 33 63 59 1e 37 b2 30 ce 49 02 81 54 0e 94 ba |.3cY.7.0.I..T...|
-00000020 9f a3 72 48 48 9d 52 65 a6 31 88 59 7d 23 26 78 |..rHH.Re.1.Y}#&x|
-00000030 91 25 f7 35 81 b0 9f 7a 4f 3e df 6d f9 be 25 f2 |.%.5...zO>.m..%.|
-00000040 05 ce d7 72 0c 2f b8 84 7f 05 ec 40 ba 06 b8 b2 |...r./.....@....|
-00000050 a3 eb 3d 50 7d e0 23 c7 3e 4f cb 93 93 46 97 ee |..=P}.#.>O...F..|
-00000060 ca 63 21 79 83 c6 24 6d 44 5c f5 a3 f0 5e 2c f5 |.c!y..$mD\...^,.|
-00000070 33 f3 06 a9 9a 1a f9 b0 8a f1 21 38 2c 9e cd ba |3.........!8,...|
-00000080 3c 63 07 76 dd 9c e7 19 a0 97 2a 14 03 03 00 01 |>> Flow 4 (server to client)
00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
-00000010 00 00 00 00 00 00 00 00 00 00 00 e2 e1 27 2b 83 |.............'+.|
-00000020 17 2e 96 bc 84 93 99 10 b3 98 cc 1b 8e 2b 08 29 |.............+.)|
-00000030 b1 fc 2d e6 33 78 11 82 a5 c7 e5 7d 28 8a e4 e3 |..-.3x.....}(...|
-00000040 8a 5b 37 21 49 1b 45 b8 24 3a 24 17 03 03 00 40 |.[7!I.E.$:$....@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 67 e1 22 17 24 |...........g.".$|
+00000020 95 b4 e5 62 59 15 56 4a af e4 82 76 ad b7 48 81 |...bY.VJ...v..H.|
+00000030 cf 55 d1 75 cd 36 86 0d 9d 15 24 4b 84 23 bc 98 |.U.u.6....$K.#..|
+00000040 8e c4 62 57 ab 96 0c 27 5d 1c 07 17 03 03 00 40 |..bW...']......@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 e8 cd 9a 90 f9 0c c7 cb 89 83 2c 0c fa 5b 02 d2 |..........,..[..|
-00000070 d9 d3 0d a8 e8 60 ca 53 bd 8a d9 fb 70 6e a2 71 |.....`.S....pn.q|
-00000080 46 b3 18 21 60 2d 4a 4a ee 14 40 99 3d 6f f6 bc |F..!`-JJ..@.=o..|
+00000060 c9 b2 0e 04 40 43 26 92 91 45 e3 63 d7 49 09 3e |....@C&..E.c.I.>|
+00000070 03 45 e3 d6 af a2 d8 d9 61 36 e5 95 83 75 66 fa |.E......a6...uf.|
+00000080 90 c2 80 53 a2 d5 31 aa b1 2a da 45 a9 b3 aa 1f |...S..1..*.E....|
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 85 19 88 1d 3b 91 b4 ed 20 6c 24 |.........;... l$|
-000000b0 de a3 ce 3f d6 3c 1a 8c db 28 56 6b df 55 ca 38 |...?.<...(Vk.U.8|
-000000c0 61 7b 44 33 b1 |a{D3.|
+000000a0 00 00 00 00 00 c4 52 cf b9 f6 0f e2 30 ba 90 18 |......R.....0...|
+000000b0 0c 76 c2 ee 4c 78 fb c2 cb 34 7f cb 35 15 5e b0 |.v..Lx...4..5.^.|
+000000c0 17 70 cb 76 8a |.p.v.|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-ALPN b/src/crypto/tls/testdata/Server-TLSv13-ALPN
index 4ac9f1d7d4..df8dd4508a 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-ALPN
+++ b/src/crypto/tls/testdata/Server-TLSv13-ALPN
@@ -1,104 +1,100 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 f8 01 00 00 f4 03 03 65 16 78 26 cc |...........e.x&.|
-00000010 27 bc 06 a0 4c f5 a3 e3 cd c2 f0 42 8c 61 0e e9 |'...L......B.a..|
-00000020 8b 2b 52 ca a3 07 d6 58 96 4f f1 20 c3 7f e3 22 |.+R....X.O. ..."|
-00000030 2c 27 94 91 ab cc e5 56 b1 31 fb eb ed b4 84 3e |,'.....V.1.....>|
-00000040 ae 93 6e 6e a9 5c d2 47 6e 5b 0c 43 00 08 13 02 |..nn.\.Gn[.C....|
-00000050 13 03 13 01 00 ff 01 00 00 a3 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 23 00 00 00 10 00 10 00 0e 06 70 |.....#.........p|
-00000090 72 6f 74 6f 32 06 70 72 6f 74 6f 31 00 16 00 00 |roto2.proto1....|
-000000a0 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 06 03 |................|
-000000b0 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 |................|
-000000c0 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 2d 00 |.......+......-.|
-000000d0 02 01 01 00 33 00 26 00 24 00 1d 00 20 76 1d a9 |....3.&.$... v..|
-000000e0 43 43 a4 98 96 39 59 80 b0 7e 13 29 2a ea 53 e7 |CC...9Y..~.)*.S.|
-000000f0 34 73 7a 10 0c f5 b0 92 b1 ab e2 26 17 |4sz........&.|
+00000000 16 03 01 00 e2 01 00 00 de 03 03 8e d2 a1 8f ea |................|
+00000010 e3 7d 5f 7c 70 74 c3 7e 5f 06 bb 21 35 28 38 7a |.}_|pt.~_..!5(8z|
+00000020 7f 00 11 86 6e ac 19 38 7f d4 88 20 33 3a b2 14 |....n..8... 3:..|
+00000030 c2 4e 6a 39 71 24 81 21 27 21 2d b7 3d bc 5e 97 |.Nj9q$.!'!-.=.^.|
+00000040 f8 ed 55 83 be 9a d3 27 b5 e0 0e bd 00 04 13 03 |..U....'........|
+00000050 00 ff 01 00 00 91 00 0b 00 04 03 00 01 02 00 0a |................|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000070 00 00 00 10 00 10 00 0e 06 70 72 6f 74 6f 32 06 |.........proto2.|
+00000080 70 72 6f 74 6f 31 00 16 00 00 00 17 00 00 00 0d |proto1..........|
+00000090 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 |................|
+000000a0 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+000000b0 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 |.+......-.....3.|
+000000c0 26 00 24 00 1d 00 20 89 4d b8 22 62 39 22 e6 5a |&.$... .M."b9".Z|
+000000d0 b1 86 ea c9 d9 d1 77 c9 12 c3 62 e1 8e 17 cb ab |......w...b.....|
+000000e0 91 83 d8 af 9b be 0a |.......|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 c3 7f e3 22 |........... ..."|
-00000030 2c 27 94 91 ab cc e5 56 b1 31 fb eb ed b4 84 3e |,'.....V.1.....>|
-00000040 ae 93 6e 6e a9 5c d2 47 6e 5b 0c 43 13 02 00 00 |..nn.\.Gn[.C....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 33 3a b2 14 |........... 3:..|
+00000030 c2 4e 6a 39 71 24 81 21 27 21 2d b7 3d bc 5e 97 |.Nj9q$.!'!-.=.^.|
+00000040 f8 ed 55 83 be 9a d3 27 b5 e0 0e bd 13 03 00 00 |..U....'........|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 24 1a dd ed 59 79 84 |.........$...Yy.|
-00000090 d6 2e 17 81 75 e0 ee b3 98 8c 04 a3 ea 7c 46 f0 |....u........|F.|
-000000a0 76 58 78 5a 37 99 a6 32 ad c6 5a 5a 3a ce 17 03 |vXxZ7..2..ZZ:...|
-000000b0 03 02 6d 31 3b 00 34 ef 22 53 8a 31 f5 88 fb 3f |..m1;.4."S.1...?|
-000000c0 e4 72 a8 20 65 ef be c6 78 84 4e 93 6a 8a fa 01 |.r. e...x.N.j...|
-000000d0 10 b0 dd 0e 7d 8f 07 b8 da 29 4b 0a 5b 32 de cf |....}....)K.[2..|
-000000e0 31 66 04 9c c6 d8 ab f0 07 f0 aa c3 b6 3e bf d4 |1f...........>..|
-000000f0 0e 53 5d a4 4f aa 19 cf f4 3d 60 5b 19 ec e3 e2 |.S].O....=`[....|
-00000100 71 1b 54 20 48 41 68 32 f5 28 06 e2 b7 29 89 c3 |q.T HAh2.(...)..|
-00000110 d5 eb 07 f3 49 fb 0b f5 81 0a f2 65 70 24 a9 bc |....I......ep$..|
-00000120 6b e7 70 58 7c f2 0a 91 3e f4 26 ea 1a 22 15 24 |k.pX|...>.&..".$|
-00000130 5a 28 43 89 ac 1c 9b 39 1a 93 ec 32 5e ba cb f4 |Z(C....9...2^...|
-00000140 57 a1 ca 03 8e 2e 0b 96 e7 7f e5 c5 30 22 ec fd |W...........0"..|
-00000150 fe 6d 5f 01 e9 7a 5e b3 68 67 ee e9 23 d5 72 46 |.m_..z^.hg..#.rF|
-00000160 77 05 b7 27 26 78 fe f9 cc c8 c2 fe a8 4e 93 04 |w..'&x.......N..|
-00000170 56 bc 64 f1 55 ff 92 8d cb 81 46 cb 2d db 9b 41 |V.d.U.....F.-..A|
-00000180 59 76 0c b5 65 7a e1 09 2f b6 3b d4 92 87 7c a6 |Yv..ez../.;...|.|
-00000190 06 d7 37 aa db bc 07 12 a4 2e 38 be 97 83 80 80 |..7.......8.....|
-000001a0 86 05 3a 4b 89 25 7f ef 5e 54 42 4a 89 99 f2 95 |..:K.%..^TBJ....|
-000001b0 70 92 fb ac 2f ae b4 1f a0 5c 8c bf 45 2d 54 91 |p.../....\..E-T.|
-000001c0 01 88 d5 9b a3 da af 67 1c ce 2e 9c 05 4c 68 d8 |.......g.....Lh.|
-000001d0 b5 ee 98 06 a4 18 c8 c0 2d 7c bf 6e e2 eb 0d aa |........-|.n....|
-000001e0 5b c6 f8 27 ad 3a 1a cf ac 35 f4 55 41 3c e0 8c |[..'.:...5.UA<..|
-000001f0 3e 26 56 95 33 c4 f1 05 5a e7 9d 6e 33 90 d1 37 |>&V.3...Z..n3..7|
-00000200 03 77 1f 76 1a 35 43 c1 a4 8c 5a 68 f5 bc 6c 7a |.w.v.5C...Zh..lz|
-00000210 43 27 37 cd d9 55 76 69 bd 78 47 4e 2e 25 96 e6 |C'7..Uvi.xGN.%..|
-00000220 8f 46 a3 70 ff b8 55 f2 66 46 2c 59 ad b9 b7 9a |.F.p..U.fF,Y....|
-00000230 a1 dc a4 8b 2b fa 14 17 dd bf 46 c6 9a ef 50 54 |....+.....F...PT|
-00000240 6e b8 d3 d7 13 d4 74 dd a5 ef 16 5f 2a fa ea 9b |n.....t...._*...|
-00000250 59 7c 41 f8 6d 00 b5 01 9d c8 35 34 1e 1c 3f 64 |Y|A.m.....54..?d|
-00000260 6a da 1e c4 64 4d e5 2e c7 28 f8 14 70 e6 72 4b |j...dM...(..p.rK|
-00000270 ab 8a 22 5e 2b 5c aa b3 02 72 80 0c 80 11 cd 18 |.."^+\...r......|
-00000280 b8 e1 8c 54 54 72 fd 68 71 66 ef bc 3e 03 ca a4 |...TTr.hqf..>...|
-00000290 ae f4 ad 7b 29 08 ff 49 07 09 bc a1 cd e3 14 69 |...{)..I.......i|
-000002a0 47 0e b0 c0 a8 89 3a 7b 71 e5 ba 32 36 e8 b5 0a |G.....:{q..26...|
-000002b0 9e f6 9f 6f 12 89 f5 36 5c 96 28 e1 2d 6b b3 06 |...o...6\.(.-k..|
-000002c0 d6 68 d3 99 f4 3d 27 b2 61 df 75 29 a0 24 8a ba |.h...='.a.u).$..|
-000002d0 48 c4 5c 8c 36 21 3a 3e bf 92 4f 73 cc bd a1 b1 |H.\.6!:>..Os....|
-000002e0 e7 00 c6 05 94 1e 8e 73 d3 52 aa 4d 02 40 3b 50 |.......s.R.M.@;P|
-000002f0 5f f0 37 b6 61 43 9f 39 63 64 ad 37 12 97 2a 0c |_.7.aC.9cd.7..*.|
-00000300 5e d9 20 e0 78 da f3 80 d8 29 ea b3 c5 52 55 cc |^. .x....)...RU.|
-00000310 3d e0 91 b7 f8 f9 b0 29 5a b3 e9 65 04 31 5c 6c |=......)Z..e.1\l|
-00000320 17 03 03 00 99 7d d6 2e 45 d8 e2 5b f8 c1 21 86 |.....}..E..[..!.|
-00000330 8a 31 78 88 5d 61 ca 8c e5 23 07 d7 85 da cb 04 |.1x.]a...#......|
-00000340 be c3 24 2b 27 42 bb a1 1e 4f 8b bb a2 5d 3b 1e |..$+'B...O...];.|
-00000350 8a 64 f0 2a 2f 79 51 cc 1b 34 99 b6 33 75 31 c9 |.d.*/yQ..4..3u1.|
-00000360 2e ea 70 ef 97 c4 bb 4c ec aa cf 11 6c 88 96 c4 |..p....L....l...|
-00000370 9b b9 df b9 ef 10 bb 36 65 1f 8d 7e 22 e8 67 80 |.......6e..~".g.|
-00000380 80 6e 2b 34 94 a4 5f b1 5d 88 11 2e bf 22 f9 fe |.n+4.._.]...."..|
-00000390 be 76 e8 86 da 40 76 8c 9c 40 b6 b4 50 41 92 f5 |.v...@v..@..PA..|
-000003a0 ce 8c bd 13 ea f0 6f 56 c2 1c c6 ed 08 33 71 36 |......oV.....3q6|
-000003b0 a4 16 b6 ca bf ba 0e 65 b0 a2 2b 35 39 c7 17 03 |.......e..+59...|
-000003c0 03 00 45 3b 7a 67 26 15 b4 9b 0f ba 61 5d d0 4c |..E;zg&.....a].L|
-000003d0 60 27 29 03 fb da 90 ea 0c 64 22 24 ac 60 74 02 |`')......d"$.`t.|
-000003e0 0e 99 e0 e1 55 35 da c2 75 19 82 0c fa f8 f0 09 |....U5..u.......|
-000003f0 35 1e ca de d1 e1 17 8e d2 f7 fb f9 94 d1 03 fb |5...............|
-00000400 b5 8a 32 f6 8f 02 5f fa 17 03 03 00 a3 21 96 04 |..2..._......!..|
-00000410 46 58 eb 83 db 06 a7 ba f2 9e 5c 8a 35 0d 87 78 |FX........\.5..x|
-00000420 29 17 4f 7a 95 21 1f b4 f3 fa bb de 93 b7 e7 1c |).Oz.!..........|
-00000430 24 40 06 6b 9f b5 12 49 36 39 01 b9 17 cb 5c 99 |$@.k...I69....\.|
-00000440 93 71 dc 8f c5 54 c0 dd ff 36 92 24 cd b3 ac 40 |.q...T...6.$...@|
-00000450 c0 57 76 c3 2a a0 d3 07 af 00 4b df c5 f9 34 77 |.Wv.*.....K...4w|
-00000460 ed cc 14 e1 50 bf 41 1e b5 39 5d 92 a8 e4 f5 a6 |....P.A..9].....|
-00000470 b2 12 08 56 b6 43 cf dc eb a9 0e 9e 0e 8a 97 63 |...V.C.........c|
-00000480 f8 92 a8 1b 74 f3 65 60 6a f3 f0 e7 54 fd d3 08 |....t.e`j...T...|
-00000490 20 ce b4 16 ab c9 e1 7a 49 9c bf d6 3a a7 2b 5c | ......zI...:.+\|
-000004a0 1b 1c a7 89 f3 6a 6d 3d 0a 07 16 b4 c1 c2 4b 2e |.....jm=......K.|
+00000080 03 03 00 01 01 17 03 03 00 24 60 9e a3 43 47 75 |.........$`..CGu|
+00000090 d2 38 11 fd 9d da a5 f6 65 de 3c 2a 3d a9 46 7e |.8......e.<*=.F~|
+000000a0 50 c8 52 a1 7d e6 95 a7 4b 48 b7 35 e7 a7 17 03 |P.R.}...KH.5....|
+000000b0 03 02 6d b8 30 43 88 03 d4 6c cf c6 45 80 b2 6c |..m.0C...l..E..l|
+000000c0 52 d7 1e 08 de 0b 6e 7a 27 c8 2c 59 d4 03 41 24 |R.....nz'.,Y..A$|
+000000d0 e3 4a e1 d3 85 68 de 23 f6 c4 3a bb 45 ae b1 ac |.J...h.#..:.E...|
+000000e0 8b b3 22 7d e7 a6 7c e3 07 68 b1 9c 97 6a d3 e4 |.."}..|..h...j..|
+000000f0 5d 0a 73 a3 16 ad e4 7f b9 d7 0a b7 7c 48 bb f2 |].s.........|H..|
+00000100 ed 49 61 f7 cb 5e ea d2 d9 a3 73 ea a7 4f a3 10 |.Ia..^....s..O..|
+00000110 f7 3e 8f ce b9 56 a0 88 54 52 59 1f f3 55 2b 15 |.>...V..TRY..U+.|
+00000120 df fd fa 85 9e 20 ff 72 f3 26 6a 2c 1f 11 a8 3d |..... .r.&j,...=|
+00000130 8e 66 75 aa 90 fc 9f 9f a7 67 8f ac 98 54 19 04 |.fu......g...T..|
+00000140 c9 1f 48 f7 ed 8f 13 0a f9 6c 9b f8 e9 0a c5 a9 |..H......l......|
+00000150 f2 ef 5b 65 a1 ad 40 e4 e7 ff c1 ff e9 d6 ab 5c |..[e..@........\|
+00000160 f8 f1 7b 4d 39 33 1d 68 d3 38 20 10 c4 3b 7a 9f |..{M93.h.8 ..;z.|
+00000170 fe 55 1d 83 5c 8f 67 d0 bb 5f 32 80 b2 91 38 0a |.U..\.g.._2...8.|
+00000180 71 bb b4 3a 10 1c 98 f9 d4 19 7c 7d d5 f7 4b 0a |q..:......|}..K.|
+00000190 02 2f bd 0b f9 ff 28 b2 2d ba dd 7f 0d 51 a2 4c |./....(.-....Q.L|
+000001a0 51 92 1e e9 47 51 ae 1a d0 66 9c ef 0a 02 dc 69 |Q...GQ...f.....i|
+000001b0 95 79 2b b0 8f 7b a2 3d 57 cf 5c 7e b4 0a 91 34 |.y+..{.=W.\~...4|
+000001c0 e6 d0 0d 93 1b 6c 61 9e 58 12 47 5f 3a ec 67 19 |.....la.X.G_:.g.|
+000001d0 d8 fb 44 43 4d cd 4e ad 1d bc f2 05 66 42 3f 3f |..DCM.N.....fB??|
+000001e0 85 5d 93 56 8e ca 62 47 38 ee d2 0e 81 8b 71 7d |.].V..bG8.....q}|
+000001f0 d8 cf 6e 4b 61 80 fe 28 34 f4 f1 58 06 36 2a 40 |..nKa..(4..X.6*@|
+00000200 93 98 3d d0 9c 69 6f 6a 3a 40 b9 8c 2e 71 5d 52 |..=..ioj:@...q]R|
+00000210 66 5d 55 45 e7 38 b7 ce 74 c2 1c ae 2e 4a 03 86 |f]UE.8..t....J..|
+00000220 d4 15 c3 40 d9 58 b7 ba ed 84 fd 20 35 a4 1c c6 |...@.X..... 5...|
+00000230 8a 50 7a 0c 87 53 d7 2d 4b 5b 7d 23 79 8f 66 f8 |.Pz..S.-K[}#y.f.|
+00000240 72 05 72 7b 7d 7a 64 97 8d da c9 dd 23 6a 44 b6 |r.r{}zd.....#jD.|
+00000250 e1 99 e4 45 76 a5 53 d8 1b 54 a0 b9 9e ec 0e d3 |...Ev.S..T......|
+00000260 91 1b 5e c0 a7 c8 3a 34 22 f9 58 7d da 2b f4 fd |..^...:4".X}.+..|
+00000270 2b 9a 9e 26 20 6f d3 9d e9 48 a1 62 70 fe 06 04 |+..& o...H.bp...|
+00000280 c2 63 f7 c4 a2 b9 74 28 a8 b3 f9 f0 a1 2a 46 0c |.c....t(.....*F.|
+00000290 f5 6b cc 7e b4 c0 47 eb 00 96 6a 3d 32 58 e0 0a |.k.~..G...j=2X..|
+000002a0 59 01 3c 42 45 a7 76 6d 78 05 1f 2c db a4 08 5b |Y....c...f/|
+00000470 24 2a 06 1b f3 91 a7 7c dd d9 b5 1f b3 9e 7f ce |$*.....|........|
+00000480 db 96 cd 2e 36 69 f0 94 0c 5f e8 0b 15 6a 38 40 |....6i..._...j8@|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 90 6e 35 6d 4e |..........E.n5mN|
-00000010 3b 8a 39 88 85 99 ac 05 fe 2c e3 a8 31 46 4e c2 |;.9......,..1FN.|
-00000020 ea fe a2 ff 41 5b 64 77 bc 0c 6d 72 f7 c8 f3 07 |....A[dw..mr....|
-00000030 ce 29 c2 6e 7c b5 88 13 35 f8 c0 90 98 ab 0f f9 |.).n|...5.......|
-00000040 e2 8e 57 7e 23 7b 57 17 b6 13 11 9e 52 67 44 26 |..W~#{W.....RgD&|
+00000000 14 03 03 00 01 01 17 03 03 00 35 32 39 09 c6 64 |..........529..d|
+00000010 aa 86 b7 a7 37 6c fa ef 66 01 d4 de e6 35 8d 31 |....7l..f....5.1|
+00000020 68 71 f3 27 56 fd 7f 7b cf c8 3c d1 44 ff e0 c7 |hq.'V..{..<.D...|
+00000030 78 b7 6c c8 ac 01 0e ee e1 78 b9 dd 1a e1 a9 b6 |x.l......x......|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 98 55 d6 42 d5 d4 01 c9 be 70 27 |......U.B.....p'|
-00000010 9e 5a d5 7d fc 41 1e ec fe fd d5 0f 01 16 56 82 |.Z.}.A........V.|
-00000020 13 13 c7 17 03 03 00 13 bb 71 20 65 f8 af 42 ea |.........q e..B.|
-00000030 42 73 b8 24 d8 dc 79 7c 71 32 35 |Bs.$..y|q25|
+00000000 17 03 03 00 1e da e7 79 04 f5 65 2e f6 c3 c3 b9 |.......y..e.....|
+00000010 34 37 14 8f c2 32 cb 81 58 bc cf d0 3b 08 f0 61 |47...2..X...;..a|
+00000020 b3 ae b4 17 03 03 00 13 e3 32 09 02 e0 29 5e 4a |.........2...)^J|
+00000030 9b 36 a9 b0 65 e9 2c 1d fb ad 50 |.6..e.,...P|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-ALPN-NoMatch b/src/crypto/tls/testdata/Server-TLSv13-ALPN-NoMatch
index 84c38acbeb..0b5dc9b1c6 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-ALPN-NoMatch
+++ b/src/crypto/tls/testdata/Server-TLSv13-ALPN-NoMatch
@@ -1,104 +1,100 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 f8 01 00 00 f4 03 03 b6 62 6e 7c 66 |............bn|f|
-00000010 e0 73 6f bc ce d7 e3 5c 3a 39 c5 c9 5e f3 8f 76 |.so....\:9..^..v|
-00000020 f0 ed 0e 30 fd 80 a0 79 74 fd d4 20 6b 6e f8 9d |...0...yt.. kn..|
-00000030 30 1b ee fa 7c 5f 64 e0 da 81 26 7a 85 d2 f9 79 |0...|_d...&z...y|
-00000040 e7 09 71 f8 2a 4c 41 74 02 a9 0c d2 00 08 13 02 |..q.*LAt........|
-00000050 13 03 13 01 00 ff 01 00 00 a3 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 23 00 00 00 10 00 10 00 0e 06 70 |.....#.........p|
-00000090 72 6f 74 6f 32 06 70 72 6f 74 6f 31 00 16 00 00 |roto2.proto1....|
-000000a0 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 06 03 |................|
-000000b0 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 |................|
-000000c0 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 2d 00 |.......+......-.|
-000000d0 02 01 01 00 33 00 26 00 24 00 1d 00 20 8d 7d e2 |....3.&.$... .}.|
-000000e0 55 da a7 1b 29 fc a4 d3 b0 62 51 43 d9 d6 cd 79 |U...)....bQC...y|
-000000f0 a4 f9 3c f2 4e 03 87 1f 38 29 35 c3 36 |..<.N...8)5.6|
+00000000 16 03 01 00 e2 01 00 00 de 03 03 ea ab 77 e1 48 |.............w.H|
+00000010 64 70 23 5c af b3 a7 3d 60 93 a0 30 0a 8c 98 61 |dp#\...=`..0...a|
+00000020 3a ab bc a9 11 c1 2f f5 ed d7 63 20 d4 29 26 9d |:...../...c .)&.|
+00000030 64 37 72 d1 2c 7d 09 3b 94 67 f9 1c 19 c3 7e 17 |d7r.,}.;.g....~.|
+00000040 ec 80 5f 09 38 c1 15 4d 59 45 5c c3 00 04 13 03 |.._.8..MYE\.....|
+00000050 00 ff 01 00 00 91 00 0b 00 04 03 00 01 02 00 0a |................|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000070 00 00 00 10 00 10 00 0e 06 70 72 6f 74 6f 32 06 |.........proto2.|
+00000080 70 72 6f 74 6f 31 00 16 00 00 00 17 00 00 00 0d |proto1..........|
+00000090 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 |................|
+000000a0 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+000000b0 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 |.+......-.....3.|
+000000c0 26 00 24 00 1d 00 20 68 64 e8 c1 4a c5 d5 b8 91 |&.$... hd..J....|
+000000d0 a0 20 c7 aa 8a 41 90 d6 d0 5e ed 6c ed e4 77 aa |. ...A...^.l..w.|
+000000e0 ec 33 93 e3 d5 b7 55 |.3....U|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 6b 6e f8 9d |........... kn..|
-00000030 30 1b ee fa 7c 5f 64 e0 da 81 26 7a 85 d2 f9 79 |0...|_d...&z...y|
-00000040 e7 09 71 f8 2a 4c 41 74 02 a9 0c d2 13 02 00 00 |..q.*LAt........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 d4 29 26 9d |........... .)&.|
+00000030 64 37 72 d1 2c 7d 09 3b 94 67 f9 1c 19 c3 7e 17 |d7r.,}.;.g....~.|
+00000040 ec 80 5f 09 38 c1 15 4d 59 45 5c c3 13 03 00 00 |.._.8..MYE\.....|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 4c a1 99 6c 86 b8 |..........L..l..|
-00000090 1a 1a eb ec 89 37 bf 5a ae 87 3c 81 ce cf b2 49 |.....7.Z..<....I|
-000000a0 66 17 03 03 02 6d 40 06 a4 17 6a 48 78 76 a5 63 |f....m@...jHxv.c|
-000000b0 82 c4 5b e9 6e dc 54 de 95 12 15 a7 3d 83 94 4d |..[.n.T.....=..M|
-000000c0 57 26 82 ea f3 d5 e1 4a d7 6e dc 27 f6 02 1c 16 |W&.....J.n.'....|
-000000d0 21 68 c5 32 ff 02 e9 b5 44 2c f4 e9 4d b2 9d 3d |!h.2....D,..M..=|
-000000e0 34 e1 6a db 73 61 eb 5c 00 e9 e8 00 bc 82 2a 17 |4.j.sa.\......*.|
-000000f0 25 f7 c4 09 2f 6c 3e c6 09 5a 33 61 49 df 4d 47 |%.../l>..Z3aI.MG|
-00000100 95 16 c5 6e a4 b3 94 44 4c 8b 5d d6 2c c9 26 a1 |...n...DL.].,.&.|
-00000110 01 e8 cc 20 9c 19 d3 3e eb d5 7c 97 4e 1e af 7b |... ...>..|.N..{|
-00000120 68 0e 7b eb bb 91 81 60 a2 c8 37 96 84 f2 cd fe |h.{....`..7.....|
-00000130 7f 22 7f 7f 22 6a c7 23 68 79 48 ae 35 47 27 4b |.".."j.#hyH.5G'K|
-00000140 c0 ce e7 9c 7f 23 fd 44 e1 a5 da 9f 61 94 46 1f |.....#.D....a.F.|
-00000150 6c ea b9 50 53 c2 35 70 d4 77 d7 2d d5 54 fb d7 |l..PS.5p.w.-.T..|
-00000160 90 4b f9 bb 98 67 cc 5b 97 56 ef ff 5d c9 08 9c |.K...g.[.V..]...|
-00000170 26 cd cf ba 51 6f a5 f4 20 34 83 85 ef 71 98 1b |&...Qo.. 4...q..|
-00000180 dd 41 f9 51 f3 59 77 d7 b5 f5 98 40 fd 78 ef b6 |.A.Q.Yw....@.x..|
-00000190 47 8c 27 e3 c8 ae 9d c3 47 92 dc 97 23 82 2f 80 |G.'.....G...#./.|
-000001a0 2f 0f 17 17 17 f1 49 ec c3 1c 73 02 38 b3 a6 6d |/.....I...s.8..m|
-000001b0 89 5f 55 30 ea 10 5d fe a7 6e 88 fb cc fd 9a 01 |._U0..]..n......|
-000001c0 10 f8 4e 6a 7f ba 62 ab 15 85 7a 8d fc de 92 f7 |..Nj..b...z.....|
-000001d0 91 9a d8 dc f3 de 3e 36 19 45 44 8c d7 03 67 c8 |......>6.ED...g.|
-000001e0 14 24 09 33 1b f3 2f 2d a6 a5 9a 6c e2 04 da 4b |.$.3../-...l...K|
-000001f0 18 13 57 12 83 86 46 8f af 35 f4 0a 1b 09 1c 25 |..W...F..5.....%|
-00000200 bb 1e 22 fb 71 48 3f 34 47 d4 52 ec 3c 81 dd 5b |..".qH?4G.R.<..[|
-00000210 0d a0 b4 74 a7 60 5f 60 14 ee d3 08 54 92 45 42 |...t.`_`....T.EB|
-00000220 52 82 8d 54 84 ee c0 1d a7 a9 b4 a0 13 82 75 cd |R..T..........u.|
-00000230 f6 a7 bc aa 0a e9 0a c5 36 ea 6f c1 8b 56 22 81 |........6.o..V".|
-00000240 0a 8e 81 3d bf 34 f4 cc 80 02 d2 01 b5 2c b8 6b |...=.4.......,.k|
-00000250 4b e8 06 06 cf e1 69 50 59 ea b2 a5 b0 06 96 02 |K.....iPY.......|
-00000260 0e 45 8c 8c 46 ae 24 a0 80 92 75 46 7b cd 9e de |.E..F.$...uF{...|
-00000270 a2 a0 d5 f4 68 ef 34 82 37 08 64 62 e8 eb 41 a4 |....h.4.7.db..A.|
-00000280 32 a8 d4 c3 ee 16 67 2c 47 08 ef 23 c7 27 4a 21 |2.....g,G..#.'J!|
-00000290 5c 66 36 93 6c 8c 8c fd 04 9a d9 84 e0 be 45 50 |\f6.l.........EP|
-000002a0 0c 42 a2 d3 ba 5a 92 14 86 75 d2 33 6f 8b 69 a3 |.B...Z...u.3o.i.|
-000002b0 b2 da 7e 19 e0 a6 0d 8e cb 21 bf f6 fa 5c 41 de |..~......!...\A.|
-000002c0 d8 56 f7 d0 53 66 54 d2 5c e7 b5 20 af 0d 01 5a |.V..SfT.\.. ...Z|
-000002d0 09 d0 ed 7f f1 1d d7 32 55 a8 c2 5a ba d8 e1 46 |.......2U..Z...F|
-000002e0 fb 32 39 8b 8c 94 73 44 85 64 d6 c7 9f 6a d5 4e |.29...sD.d...j.N|
-000002f0 fc 16 a2 10 cb 06 43 10 da a5 b2 71 e7 04 a6 3f |......C....q...?|
-00000300 83 79 2c cb 2e 40 ab c8 53 18 11 95 3a f5 b9 b7 |.y,..@..S...:...|
-00000310 df 99 d7 17 03 03 00 99 c0 29 f3 15 df b1 dc 36 |.........).....6|
-00000320 a9 78 21 ed ba 5a 85 11 51 23 3f e9 b4 b3 bb b3 |.x!..Z..Q#?.....|
-00000330 27 92 8e 9c a0 f8 b3 38 35 ef 9f bf 2b 31 82 cd |'......85...+1..|
-00000340 de 3a 0c 0c b1 09 65 77 00 4c af 8c fe ff 2c 75 |.:....ew.L....,u|
-00000350 62 48 13 96 63 5c 73 00 13 1f ef 27 f5 b2 4c fe |bH..c\s....'..L.|
-00000360 8e 2a ff ab 94 68 5e 7c 02 19 d5 f3 68 07 b8 a1 |.*...h^|....h...|
-00000370 2a 48 fc 4e ad b9 1c 95 13 d9 19 9d 47 7f 07 4d |*H.N........G..M|
-00000380 b8 75 79 e7 da 6f 46 3e eb 27 c4 6f da ab bb fd |.uy..oF>.'.o....|
-00000390 0a 04 08 15 c4 45 c4 1a 09 db 48 ca 3d 8e 63 af |.....E....H.=.c.|
-000003a0 d8 0d 6b a2 04 22 eb 6d ed bf b6 45 d2 c8 b9 ee |..k..".m...E....|
-000003b0 02 17 03 03 00 45 5c ef 9a 1c 12 95 25 da 79 21 |.....E\.....%.y!|
-000003c0 6c 74 a2 64 cf bf aa cd 53 a4 43 48 d7 f3 b2 35 |lt.d....S.CH...5|
-000003d0 da f2 0e d4 1c 14 23 63 8f 7a e5 5a 98 46 71 ad |......#c.z.Z.Fq.|
-000003e0 19 a2 8f 22 b1 c5 93 89 0b 7f cd 38 09 9a ea f1 |...".......8....|
-000003f0 51 6b 46 0f 8b 00 8d c2 1a 97 de 17 03 03 00 a3 |QkF.............|
-00000400 32 88 68 5e f9 90 07 5d 4d 04 3d 1d 26 ac a2 1b |2.h^...]M.=.&...|
-00000410 54 d0 37 7c 9f e7 8f ee c5 a6 bc b6 a9 78 08 40 |T.7|.........x.@|
-00000420 f3 07 2f f5 b4 1f 08 c6 af 2d 4f 2e 87 4e 5f 95 |../......-O..N_.|
-00000430 c9 b7 42 3a b5 ef ff 43 41 05 7c 7d 64 3f 56 ec |..B:...CA.|}d?V.|
-00000440 ee b6 04 61 0a 56 79 77 5f 1c be e2 24 a2 cb 81 |...a.Vyw_...$...|
-00000450 96 6f 95 6e a7 5a 2c 9e a0 e6 30 e5 f7 02 ff 10 |.o.n.Z,...0.....|
-00000460 33 28 6e d7 ec 34 98 bf 26 2e 56 1d 99 e9 50 94 |3(n..4..&.V...P.|
-00000470 71 be 0e 05 d3 86 95 db b9 4f 42 80 8a 12 2e ff |q........OB.....|
-00000480 b6 be 81 f2 6f 4c 6a 00 a0 b8 53 c7 d7 fa 94 c6 |....oLj...S.....|
-00000490 b2 b5 80 4b 3e e9 88 42 36 52 23 ca e4 48 b6 03 |...K>..B6R#..H..|
-000004a0 13 7d 69 |.}i|
+00000080 03 03 00 01 01 17 03 03 00 17 c0 d3 a2 c3 42 b4 |..............B.|
+00000090 39 f1 b6 f1 0a ac f3 76 dd 36 15 eb d7 3b 3f 63 |9......v.6...;?c|
+000000a0 0b 17 03 03 02 6d f2 02 6d 15 de 46 b3 30 ef 57 |.....m..m..F.0.W|
+000000b0 e5 a3 35 11 5c c3 b4 2e ad 74 ca db d2 90 eb b4 |..5.\....t......|
+000000c0 ba 14 7e b0 65 68 e8 31 76 2a 28 e4 be bb d1 c3 |..~.eh.1v*(.....|
+000000d0 45 cb ba 07 eb 27 d9 5e 4a 45 52 10 62 f0 8f b2 |E....'.^JER.b...|
+000000e0 7c ad 0f 63 5c 39 f7 6e f2 68 3e bc fd ec fe fa ||..c\9.n.h>.....|
+000000f0 9b ba 45 96 2b 94 27 34 2c 78 c8 5f 40 e3 f9 20 |..E.+.'4,x._@.. |
+00000100 51 15 3d dc 70 d1 50 7c 26 6b 51 3f 47 61 0b e6 |Q.=.p.P|&kQ?Ga..|
+00000110 04 ee 49 19 27 f0 91 c5 0f 15 0a 90 a6 0c 14 f2 |..I.'...........|
+00000120 2f f1 42 28 be a0 7a ce 16 14 bf ff 34 34 a8 d8 |/.B(..z.....44..|
+00000130 61 e6 26 6a 00 62 a0 82 53 c6 27 30 89 81 8d fb |a.&j.b..S.'0....|
+00000140 9e 97 bc a0 ce 2f a1 e2 bf 9e fe d2 cc 11 4e 00 |...../........N.|
+00000150 89 d1 e8 3b ab 58 e4 66 0a 87 00 b1 c1 a0 2d b0 |...;.X.f......-.|
+00000160 96 b3 13 9b d3 c0 16 6b 87 e8 e3 9e 6c 30 1b 67 |.......k....l0.g|
+00000170 c1 53 a5 4b 55 44 4e 27 6e ea 7c 7d 9f 44 b4 ca |.S.KUDN'n.|}.D..|
+00000180 15 6f e5 d1 7f 18 e4 12 66 2d d5 a2 47 0c 73 26 |.o......f-..G.s&|
+00000190 b0 bf 93 5b 46 9c 3f 78 69 05 a1 38 0f 61 ea d6 |...[F.?xi..8.a..|
+000001a0 61 97 80 c5 72 be 6d be 2d e5 a2 9e d8 b3 bf 8d |a...r.m.-.......|
+000001b0 a4 53 ba 6d fe c8 8d ac c1 4a 6e 76 bf 72 1e 5a |.S.m.....Jnv.r.Z|
+000001c0 0a 51 f3 c8 1f 11 91 36 f0 f5 ba 68 e8 69 c3 77 |.Q.....6...h.i.w|
+000001d0 52 63 dc b3 93 80 0d fd 9a 7d 7f f8 47 f8 62 2a |Rc.......}..G.b*|
+000001e0 3d 4f 1b 46 9f cb 07 b6 96 00 b1 08 e7 32 50 41 |=O.F.........2PA|
+000001f0 83 da 20 c2 b0 c0 33 33 3f f2 f9 84 f0 64 9f 37 |.. ...33?....d.7|
+00000200 4b b6 7b ab 2e e9 50 8b 6a 61 da 12 51 54 13 25 |K.{...P.ja..QT.%|
+00000210 46 5d 90 06 ef 88 4e be 64 67 80 02 1f 25 9c 28 |F]....N.dg...%.(|
+00000220 07 b3 24 2b 10 81 c1 72 7c 94 97 b3 5a 16 bc cf |..$+...r|...Z...|
+00000230 52 44 41 2c d7 ba e9 9f 4c d7 28 e6 b7 bb b0 fd |RDA,....L.(.....|
+00000240 17 b2 0b 83 33 ed 2f c7 2d 42 37 fd 0a d0 4b c7 |....3./.-B7...K.|
+00000250 97 61 17 d6 cd cd 0f e0 0d dd ab 40 fb 00 4d 81 |.a.........@..M.|
+00000260 da 7d 1d 0e 48 d9 a7 6c ba 2a 21 49 18 0f a4 7c |.}..H..l.*!I...||
+00000270 af 0d 1b ca 94 f1 6c 78 59 ad 50 e4 1c 7b 37 45 |......lxY.P..{7E|
+00000280 e8 1b 73 ad 96 8d 98 d6 07 26 07 fd a8 e6 8c 39 |..s......&.....9|
+00000290 f1 5a 10 ef 04 97 fe d3 be cb f2 c1 5b 27 e8 d0 |.Z..........['..|
+000002a0 f9 b3 16 b9 82 6d e8 be 54 c7 cf 44 a4 8a fd 75 |.....m..T..D...u|
+000002b0 96 2a f1 65 2b d3 8f f5 86 a3 bf 12 74 c1 e4 d8 |.*.e+.......t...|
+000002c0 a9 db c9 43 05 07 b1 51 dc 20 29 d0 c0 9a 6d 10 |...C...Q. )...m.|
+000002d0 83 5f 87 a6 ab 03 58 43 1f 35 1c af dd 37 10 1b |._....XC.5...7..|
+000002e0 16 50 52 e5 3c f5 3c ae 4f 92 7e dc 47 2e b3 9c |.PR.<.<.O.~.G...|
+000002f0 1f d2 a0 31 8b 32 21 35 52 af bd f1 0b 2c 4e 6f |...1.2!5R....,No|
+00000300 59 32 d8 db d6 9f b8 bd bc a0 3b 77 41 43 46 fb |Y2........;wACF.|
+00000310 2b 0e 82 17 03 03 00 99 0a 63 cd 1f fa 90 4d 95 |+........c....M.|
+00000320 17 d8 81 36 5c 62 17 33 6c 8d 9d 9f 26 3e 3a 2f |...6\b.3l...&>:/|
+00000330 65 84 23 56 46 25 f6 1c dd ea 6f 21 b4 05 d8 19 |e.#VF%....o!....|
+00000340 a3 c9 4b b1 03 78 39 32 00 97 6c d5 6e e3 ff 45 |..K..x92..l.n..E|
+00000350 ac 2a 10 71 21 ad d3 b9 73 b7 77 0e a8 79 fd 50 |.*.q!...s.w..y.P|
+00000360 a9 f1 41 39 2d 05 3d 92 3c 69 0a d7 7d 11 da f0 |..A9-.=...&..K|
+00000450 a6 ce 93 36 ea a1 fd d9 78 61 a3 0e 08 72 da 03 |...6....xa...r..|
+00000460 5d 0c 27 48 75 61 25 ef 77 39 39 e5 8e 87 2e 86 |].'Hua%.w99.....|
+00000470 d5 70 d3 3b f4 b4 75 b1 44 d1 5f fe 9c d8 18 7d |.p.;..u.D._....}|
+00000480 f9 89 20 |.. |
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 1d 07 22 a7 34 |..........E..".4|
-00000010 0d a7 a0 e5 8c ed 58 d4 5c 39 d2 96 43 73 eb 8c |......X.\9..Cs..|
-00000020 5f c1 0c 90 67 6f ae b1 ae ee 6c dd cd 47 31 83 |_...go....l..G1.|
-00000030 be b1 f2 50 ec 31 54 ba 21 82 c4 bd aa 51 0a 7a |...P.1T.!....Q.z|
-00000040 0d 25 18 68 00 18 8b 51 c3 ca ae b1 fa 20 e0 0b |.%.h...Q..... ..|
+00000000 14 03 03 00 01 01 17 03 03 00 35 a8 ab 13 71 ec |..........5...q.|
+00000010 af a7 4a 48 65 6d 02 ea 8a 0f d1 4d 2a 97 b6 11 |..JHem.....M*...|
+00000020 6d 53 5f be a4 b3 a7 20 d4 d3 aa 90 62 30 26 3f |mS_.... ....b0&?|
+00000030 be c8 ed fc 6f 44 cc a5 3a 7f 4d 95 51 ed dc 80 |....oD..:.M.Q...|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 1a 08 af cf 27 80 23 d8 94 0a fe |.........'.#....|
-00000010 44 1c 78 f2 76 ac 9b 90 db 5c b6 8d c0 73 36 62 |D.x.v....\...s6b|
-00000020 82 5d 8a 17 03 03 00 13 1a 2b 70 c9 14 dc c8 df |.].......+p.....|
-00000030 e2 01 4e 69 e8 d7 13 0c 94 96 75 |..Ni......u|
+00000000 17 03 03 00 1e 6a f5 e4 df 1b 2a 5a 87 68 b1 a7 |.....j....*Z.h..|
+00000010 1d b8 ef 04 b4 ac b9 50 b3 95 1c 12 d7 44 ca 46 |.......P.....D.F|
+00000020 ea 26 2a 17 03 03 00 13 a4 6b 4d 27 81 62 b0 3c |.&*......kM'.b.<|
+00000030 d0 be d1 34 46 4c 7b 6c 71 24 d8 |...4FL{lq$.|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndECDSAGiven b/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndECDSAGiven
index 214ae5eed8..0b6eaf4381 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndECDSAGiven
+++ b/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndECDSAGiven
@@ -1,184 +1,179 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 e0 01 00 00 dc 03 03 1f e8 63 15 2c |.............c.,|
-00000010 85 dc 46 b7 52 88 cf 82 24 70 b9 7b 22 01 51 ee |..F.R...$p.{".Q.|
-00000020 2a ff db 20 62 ba e2 18 4e 86 3f 20 d3 f9 0f d8 |*.. b...N.? ....|
-00000030 85 5c 17 5e 95 e9 7a 7e cb 56 ac 85 3e 75 8f d8 |.\.^..z~.V..>u..|
-00000040 8f 25 be 59 be a7 18 db b7 5e 19 23 00 08 13 02 |.%.Y.....^.#....|
-00000050 13 03 13 01 00 ff 01 00 00 8b 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 1e |................|
-00000090 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................|
-000000a0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 00 2b |...............+|
-000000b0 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 |......-.....3.&.|
-000000c0 24 00 1d 00 20 8d 8e c0 53 e4 17 29 9f 59 9e 80 |$... ...S..).Y..|
-000000d0 1f 4a 99 4b 9d 59 3f 84 93 06 68 6e 45 86 2f 4d |.J.K.Y?...hnE./M|
-000000e0 04 f5 ba 3e 42 |...>B|
+00000000 16 03 01 00 ca 01 00 00 c6 03 03 54 78 64 8e b6 |...........Txd..|
+00000010 69 c6 1c 8a 69 eb 09 ef 32 59 f9 9f 63 ac 6e 66 |i...i...2Y..c.nf|
+00000020 97 b4 bb b7 71 27 60 52 af c4 64 20 26 de 8d 3e |....q'`R..d &..>|
+00000030 90 5b c8 96 b5 10 a3 e4 67 f3 39 fb f5 b7 df 50 |.[......g.9....P|
+00000040 2b 8f 2d cb a5 c4 0a c9 28 1b c3 21 00 04 13 01 |+.-.....(..!....|
+00000050 00 ff 01 00 00 79 00 0b 00 04 03 00 01 02 00 0a |.....y..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000070 00 00 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 |................|
+00000080 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
+00000090 08 06 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 |.........+......|
+000000a0 2d 00 02 01 01 00 33 00 26 00 24 00 1d 00 20 65 |-.....3.&.$... e|
+000000b0 42 a2 bd 1e e0 0a 52 2d 7a 1e f0 37 86 db 9e c6 |B.....R-z..7....|
+000000c0 d6 cd ff 7b 71 f3 4c a3 23 44 2d 94 60 93 0b |...{q.L.#D-.`..|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 d3 f9 0f d8 |........... ....|
-00000030 85 5c 17 5e 95 e9 7a 7e cb 56 ac 85 3e 75 8f d8 |.\.^..z~.V..>u..|
-00000040 8f 25 be 59 be a7 18 db b7 5e 19 23 13 02 00 00 |.%.Y.....^.#....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 26 de 8d 3e |........... &..>|
+00000030 90 5b c8 96 b5 10 a3 e4 67 f3 39 fb f5 b7 df 50 |.[......g.9....P|
+00000040 2b 8f 2d cb a5 c4 0a c9 28 1b c3 21 13 01 00 00 |+.-.....(..!....|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 cb a2 26 d8 e7 e0 |............&...|
-00000090 72 cd 3d 39 f6 67 25 78 a3 ce bf 0e 62 bf 2e 2a |r.=9.g%x....b..*|
-000000a0 b5 17 03 03 00 3e 3e b3 0c 6d 79 88 e8 74 87 a5 |.....>>..my..t..|
-000000b0 ab a1 db 4b 11 d9 15 16 49 a7 ef a5 69 f0 8e 2e |...K....I...i...|
-000000c0 a3 6c 38 f0 ea 6d 0b fd 4c 78 ea 55 ec e7 48 de |.l8..m..Lx.U..H.|
-000000d0 87 01 3d de 13 5b 59 7f b3 15 4a 7d 40 30 d8 9c |..=..[Y...J}@0..|
-000000e0 55 06 54 2d 17 03 03 02 6d 28 a4 e3 bf 71 d5 93 |U.T-....m(...q..|
-000000f0 50 e1 e7 96 02 28 f1 2f 6d 78 1f b9 7f 1a 8c a4 |P....(./mx......|
-00000100 65 03 15 fb a7 ef f5 91 66 44 00 28 6a 17 46 9c |e.......fD.(j.F.|
-00000110 e7 90 f9 d5 78 f1 a4 fd 9b 54 09 dc 6e 83 0f 65 |....x....T..n..e|
-00000120 96 51 e1 69 e0 05 7f d4 d6 04 03 fd b8 6b 9c 12 |.Q.i.........k..|
-00000130 02 af 03 9b 02 42 7b ce e0 81 51 91 3a 01 be a4 |.....B{...Q.:...|
-00000140 72 ef 27 c3 3e f1 8e 5d 3a 9e 46 4c 25 13 98 c2 |r.'.>..]:.FL%...|
-00000150 5c 75 3f b2 30 7c de da b6 56 4e 7a 2c c3 1d 6f |\u?.0|...VNz,..o|
-00000160 7a 6e 0d da d2 df a6 df 47 12 6d af 3f d7 66 ad |zn......G.m.?.f.|
-00000170 54 19 b3 7f 1b 92 5c e6 79 36 ab d9 99 db 1d f9 |T.....\.y6......|
-00000180 e8 13 b4 e9 85 fb ba 9a 7b f3 eb 28 e5 e3 f1 0e |........{..(....|
-00000190 dc 95 b2 db f3 e4 77 6d a5 43 14 4c f4 af 0a e4 |......wm.C.L....|
-000001a0 5d bf 1d f4 ef 72 9f c0 74 55 e5 93 e0 7c f0 9a |]....r..tU...|..|
-000001b0 01 1d e8 43 5d c1 24 6f 75 46 44 f0 bc 15 b6 6b |...C].$ouFD....k|
-000001c0 7b cd 6d cc 38 06 10 34 ae be 7c b1 24 da 71 58 |{.m.8..4..|.$.qX|
-000001d0 b2 81 1f ea 28 18 73 75 79 d5 eb ef 0c 33 b8 1c |....(.suy....3..|
-000001e0 14 e9 00 b8 12 f7 b2 9f b1 f3 a8 23 63 b3 29 49 |...........#c.)I|
-000001f0 0e 84 b8 60 1c c2 32 c5 fd 59 de 88 e2 55 93 0f |...`..2..Y...U..|
-00000200 63 e6 a7 02 3e 01 0e 5f df b4 03 f8 a9 d0 96 03 |c...>.._........|
-00000210 5c ea e0 6f 5d 1d 30 41 c7 ec 6a 94 d3 6c ff b7 |\..o].0A..j..l..|
-00000220 1b eb b8 0d 2f df 90 2e f8 f5 d2 3a c6 8c 47 98 |..../......:..G.|
-00000230 ad 39 13 f2 4d 2f a5 9d 4b 58 f7 bc 92 d6 b1 ca |.9..M/..KX......|
-00000240 6a a5 c5 64 62 1c 76 21 be b5 ca 25 04 e4 16 b3 |j..db.v!...%....|
-00000250 26 90 42 b8 b8 61 4a da a3 12 5d f7 74 e6 f1 95 |&.B..aJ...].t...|
-00000260 5d d4 3a 17 fc 33 b1 2a 35 eb 69 16 7e d0 8f 66 |].:..3.*5.i.~..f|
-00000270 ca b1 62 0f 85 d1 b3 f9 b6 cf dc 86 61 0e 34 8a |..b.........a.4.|
-00000280 a0 69 fc 59 6b fc 3d 6d 7a 19 46 6f 8a 3d 16 56 |.i.Yk.=mz.Fo.=.V|
-00000290 ac 5d ed 05 57 25 2d 85 78 67 bc 50 a3 34 87 3f |.]..W%-.xg.P.4.?|
-000002a0 e7 ae 0d f0 17 67 2a 08 42 92 1f 25 0e 9c 22 e3 |.....g*.B..%..".|
-000002b0 3f 7f dc 91 52 9e d3 01 39 0f 47 55 26 f3 f2 ce |?...R...9.GU&...|
-000002c0 75 7d 33 f2 a2 9a 03 70 c0 e7 32 90 a7 50 8c b0 |u}3....p..2..P..|
-000002d0 ab fa b5 ef 25 ae e3 7e 94 99 a9 3f 83 a7 16 5e |....%..~...?...^|
-000002e0 67 b4 a0 1e 5b f7 10 49 cb 33 73 4d 92 26 49 8d |g...[..I.3sM.&I.|
-000002f0 63 fc 5b b5 1b a4 1a 97 10 09 5f e0 75 73 50 be |c.[......._.usP.|
-00000300 d5 6a 62 80 3a 3f c7 94 89 51 f0 c6 fa 38 2e 79 |.jb.:?...Q...8.y|
-00000310 3c 0b 63 bc 7e 6e 2a ed c6 c5 d5 bc bc 00 31 e3 |<.c.~n*.......1.|
-00000320 5c 2b b7 88 ff 8f ef a7 34 7e c7 3e 3f 16 e6 75 |\+......4~.>?..u|
-00000330 c8 1b 70 4a 2f 18 81 c3 d3 81 63 e8 31 f4 42 f8 |..pJ/.....c.1.B.|
-00000340 02 2d 2e fb d5 65 60 93 df b5 d4 c8 8e 55 29 b3 |.-...e`......U).|
-00000350 72 01 86 19 10 3d 17 03 03 00 99 e9 b1 32 d5 5f |r....=.......2._|
-00000360 59 fb 7f 80 0e 70 2e 1a 76 ae dd 7f 84 ee 86 69 |Y....p..v......i|
-00000370 37 a6 31 f2 83 78 8d 90 98 eb 43 96 22 9f ba 34 |7.1..x....C."..4|
-00000380 09 e3 78 c9 5f 5a f0 0b 51 58 c9 8e 63 b7 04 88 |..x._Z..QX..c...|
-00000390 74 a2 1c c9 da f3 9e 30 c0 c7 a9 da f4 43 d5 a2 |t......0.....C..|
-000003a0 b7 c4 aa 33 5f be f9 e2 68 d6 73 f2 3d ae 1b e5 |...3_...h.s.=...|
-000003b0 5b b5 7d ce cb 9d 72 a2 2d bc 30 35 43 a1 3f 53 |[.}...r.-.05C.?S|
-000003c0 43 61 a3 4e 6e 90 8c 8a 78 b5 35 74 98 51 d2 33 |Ca.Nn...x.5t.Q.3|
-000003d0 3a 9f c5 39 79 6d 5d fe ce 5e e2 dc 12 56 ac 56 |:..9ym]..^...V.V|
-000003e0 0b 6c 86 3c 85 cb 12 18 46 dd ed 53 04 9a 88 34 |.l.<....F..S...4|
-000003f0 84 df b0 cf 17 03 03 00 45 f6 a8 20 67 5a d1 87 |........E.. gZ..|
-00000400 ac e4 d7 95 d0 8b 8f 96 cd b6 12 7d eb 3c 28 21 |...........}.<(!|
-00000410 5a 7d 53 86 9e 55 cd 9b 24 1a c3 c7 6a 30 84 6f |Z}S..U..$...j0.o|
-00000420 f7 96 ac 29 b5 ee 5d 66 32 c6 52 13 79 32 67 27 |...)..]f2.R.y2g'|
-00000430 6b 5b bc 54 1e 28 b2 73 5f 5d 4d 6f 11 fc |k[.T.(.s_]Mo..|
+00000080 03 03 00 01 01 17 03 03 00 17 f1 7c 16 5a 86 b4 |...........|.Z..|
+00000090 13 82 93 fa ba 07 35 24 03 f5 24 25 cc 2d c8 e5 |......5$..$%.-..|
+000000a0 6c 17 03 03 00 3e cb 02 08 06 a3 75 03 c6 5d d9 |l....>.....u..].|
+000000b0 9c 66 ad db 29 6d 93 a6 53 c6 38 7f 9c 56 1e b1 |.f..)m..S.8..V..|
+000000c0 f5 a8 77 19 43 c3 93 5e 67 dc 80 db 1b c8 30 b2 |..w.C..^g.....0.|
+000000d0 04 85 6e 5c 8f 3a 4a f2 d2 aa 17 c7 d3 ea 29 f2 |..n\.:J.......).|
+000000e0 09 08 49 90 17 03 03 02 6d dd 26 0f f5 1b 6b 11 |..I.....m.&...k.|
+000000f0 1c c7 e9 87 bf de 58 08 e4 bc a6 49 98 fd bf 87 |......X....I....|
+00000100 31 35 59 c1 88 5a 8c 0d e7 42 47 b6 cb ec 3c 6f |15Y..Z...BG...|
+00000160 16 e6 ff be 29 a3 60 13 f8 8c 82 6c 84 dd c1 c8 |....).`....l....|
+00000170 8b a2 bf e5 70 03 c3 a4 92 3d 99 a8 fc 92 15 e4 |....p....=......|
+00000180 1d 13 7d b5 1f d3 a6 76 1c 8c 9f 9f e7 87 b4 fb |..}....v........|
+00000190 25 b8 cf 83 0a 3b bd c7 e8 30 d4 15 6f ae d5 b9 |%....;...0..o...|
+000001a0 da 3b c6 3f 0c 06 7a 78 e6 ac ca 64 cb 34 cc 7b |.;.?..zx...d.4.{|
+000001b0 46 78 ec e2 22 9e 31 39 63 a7 7b 1d d6 c2 4b 91 |Fx..".19c.{...K.|
+000001c0 45 fa 95 54 ef 9b b3 2e 55 83 77 c8 cf 15 b5 34 |E..T....U.w....4|
+000001d0 11 4c 92 36 22 54 3d 2f b0 cb 28 7f 2b 1e b1 3f |.L.6"T=/..(.+..?|
+000001e0 38 4a 4a d6 e8 a1 e6 e0 4f 20 ab 04 6f 6b 00 5e |8JJ.....O ..ok.^|
+000001f0 d4 16 42 ab a5 04 67 9b 89 45 78 8b ea 0e 7d c8 |..B...g..Ex...}.|
+00000200 24 d5 fb 83 c7 13 25 b7 1b 6f 3f 2a 2e cf bb 71 |$.....%..o?*...q|
+00000210 11 48 5d e6 98 5e ca dd f7 6d dc 93 b1 51 1e 99 |.H]..^...m...Q..|
+00000220 b9 e0 4c 39 c8 82 d8 9f 8d 70 25 78 5b b1 85 1d |..L9.....p%x[...|
+00000230 cb 75 31 61 c3 ad d5 c1 d5 1f 26 06 60 5f cd eb |.u1a......&.`_..|
+00000240 ee 4c 99 43 02 b9 e5 f5 99 98 94 cf 14 1c ad 54 |.L.C...........T|
+00000250 20 a9 d3 73 f2 3f bc a1 25 39 8b ff c4 e0 ee 8b | ..s.?..%9......|
+00000260 ba ec fc b0 c2 42 4c 5a 30 9c 26 1b f0 f2 da 94 |.....BLZ0.&.....|
+00000270 26 69 55 0e fb 84 a0 58 95 43 08 6c 87 82 93 02 |&iU....X.C.l....|
+00000280 cf 27 99 94 a3 ae 9f 08 d0 6e f2 a8 e8 29 fc a8 |.'.......n...)..|
+00000290 67 d3 20 37 83 5d 8a 12 0a 57 10 bf 30 5a e1 05 |g. 7.]...W..0Z..|
+000002a0 30 e0 b7 7b 47 7e a6 07 cc 9a dd 6d e8 11 89 c7 |0..{G~.....m....|
+000002b0 7d 98 c3 6d 83 9f 1b f4 ff ca 31 c8 39 7b c2 fb |}..m......1.9{..|
+000002c0 69 dc ee eb ab e2 39 72 35 6b 22 e4 84 2f 1d 58 |i.....9r5k"../.X|
+000002d0 07 b0 9e 3e 69 ca ff 17 44 d6 e4 a8 56 6a 24 35 |...>i...D...Vj$5|
+000002e0 08 39 42 41 da 76 4b 4f 00 ce 41 58 4e 70 d5 b6 |.9BA.vKO..AXNp..|
+000002f0 50 b4 88 91 47 4a 89 04 ef e8 14 2e cf e3 9d 36 |P...GJ.........6|
+00000300 c0 b5 2b 8e 42 2f 4b 95 39 55 6f 5a 23 5b 5e 05 |..+.B/K.9UoZ#[^.|
+00000310 f0 34 70 c0 f7 92 54 e2 5c 52 20 b0 c1 2a 9a cb |.4p...T.\R ..*..|
+00000320 3a 32 0e 93 77 96 f2 6a d8 f7 bc 7c d8 40 4e 5e |:2..w..j...|.@N^|
+00000330 37 1c 8b aa 75 89 94 51 da 19 72 80 86 c8 3d bd |7...u..Q..r...=.|
+00000340 fd 7d 06 13 bb 54 a1 0b 46 58 07 e5 35 b3 f3 ff |.}...T..FX..5...|
+00000350 8a 98 9d e6 e8 05 17 03 03 00 99 5a 63 3c ff cc |...........Zc<..|
+00000360 a0 ec 5f 52 4d 28 96 80 22 f7 8c a7 ad b7 1f 4a |.._RM(.."......J|
+00000370 8c 46 79 06 31 96 46 f9 f0 57 8c c4 5b f9 71 61 |.Fy.1.F..W..[.qa|
+00000380 34 0d 3e 78 67 05 1c 93 a7 a2 cd ea ce e5 a2 6e |4.>xg..........n|
+00000390 37 4f 16 a4 e4 4c 60 d5 5a 37 f1 2a bf ce 2f 80 |7O...L`.Z7.*../.|
+000003a0 ea 65 e6 25 03 fc 2b 17 3f a4 71 3f 04 46 2b f7 |.e.%..+.?.q?.F+.|
+000003b0 12 b0 a6 f3 fc 8d cf 5e 95 85 84 88 e4 db 46 a4 |.......^......F.|
+000003c0 f2 3a a5 27 44 3d a2 03 b3 65 af 1f e3 44 aa 02 |.:.'D=...e...D..|
+000003d0 0f 39 eb 3d 0e 2a ae 0c 1b ed 84 df 8d e3 a2 1d |.9.=.*..........|
+000003e0 6d 55 bf d6 13 f6 00 da 93 a7 fc b1 50 79 2c a9 |mU..........Py,.|
+000003f0 93 cb 7d 70 17 03 03 00 35 9e b7 c2 c6 29 a9 43 |..}p....5....).C|
+00000400 3f df 06 80 31 ac d9 f7 3b cd 14 16 a0 85 ca e6 |?...1...;.......|
+00000410 34 70 e3 fc af 1c 94 9b 87 b3 17 6c a4 83 64 2c |4p.........l..d,|
+00000420 6e 26 4c e9 ab 79 a9 c8 1d d4 1c 96 2c f2 |n&L..y......,.|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 02 1e 60 1c a1 8d ec |...........`....|
-00000010 40 73 af df e0 a2 e8 c7 0d f5 f3 8c 5b 9e 58 f0 |@s..........[.X.|
-00000020 5d 77 d8 d1 42 bd 30 e4 0d f5 5f b6 68 89 0f bb |]w..B.0..._.h...|
-00000030 73 ff dc 9b 77 b6 c9 f2 3c a8 5a 95 43 f6 53 22 |s...w...<.Z.C.S"|
-00000040 f3 96 7c 48 b6 df d2 ed a1 39 00 f1 c5 20 5d bd |..|H.....9... ].|
-00000050 bd 27 4b d7 5f d7 7e 57 3c 22 84 cf 6f 2c 85 4f |.'K._.~W<"..o,.O|
-00000060 50 8e 71 0c 70 cb e9 3b 52 31 12 ac 0e 1c d0 0c |P.q.p..;R1......|
-00000070 a5 c7 20 83 77 95 b5 0d 2f b8 f9 51 83 17 d1 9b |.. .w.../..Q....|
-00000080 69 ca 0a 9c e1 8e 1d 3d 95 2b 10 56 24 47 e0 6e |i......=.+.V$G.n|
-00000090 ba 56 94 c9 a8 b5 62 b4 4d da 70 73 e0 a0 0b 15 |.V....b.M.ps....|
-000000a0 60 22 f4 3f a3 e4 c6 86 a9 a3 dd db 5b 69 5c ce |`".?........[i\.|
-000000b0 99 14 6a 93 8e c7 21 ff 99 4d da 25 3b 87 3a ae |..j...!..M.%;.:.|
-000000c0 7d 9b 9a 06 6f e4 36 02 64 07 d4 43 84 5b 6f 98 |}...o.6.d..C.[o.|
-000000d0 6c ec 6b 77 92 17 75 2e ea c5 02 ab ce 8c c2 9a |l.kw..u.........|
-000000e0 18 e7 90 05 da 68 5a c9 d8 22 8c d2 de 17 b5 87 |.....hZ.."......|
-000000f0 a1 74 e9 bc 54 07 36 ef 61 1f 3a 43 51 15 2a 98 |.t..T.6.a.:CQ.*.|
-00000100 53 84 89 d4 90 a7 f0 a6 e4 35 6c 70 9b f5 a4 51 |S........5lp...Q|
-00000110 b4 69 9c 58 10 df cc 50 04 46 43 0a c5 9d ca f1 |.i.X...P.FC.....|
-00000120 23 2c a5 1e 6c d6 36 82 21 1f db 9a ae 55 f2 77 |#,..l.6.!....U.w|
-00000130 ad 13 e8 97 24 3c c9 c1 a5 b2 18 3c a6 cf ab c6 |....$<.....<....|
-00000140 05 88 06 e1 23 fb b7 85 a6 e8 57 38 6d 58 22 b8 |....#.....W8mX".|
-00000150 02 c6 0d 40 22 10 cd da dc 21 ef 6b ae 6c 5d c5 |...@"....!.k.l].|
-00000160 8e 62 a7 21 be 7c b7 47 60 af 55 e7 db 6f 47 59 |.b.!.|.G`.U..oGY|
-00000170 62 dd f2 f6 62 9b cd 2c 46 ec b8 05 47 d4 f9 8d |b...b..,F...G...|
-00000180 ee 89 09 f6 d0 ac 8d 4f 27 d1 f7 4e cb aa 55 0b |.......O'..N..U.|
-00000190 be 64 ed 69 45 7c 0a b5 95 5c b3 63 c4 1c ff 12 |.d.iE|...\.c....|
-000001a0 de ad 11 f9 d4 de d4 94 d7 cb 31 55 21 51 09 12 |..........1U!Q..|
-000001b0 33 20 df 64 4f 57 f3 da 68 24 20 f7 df 9d b3 4c |3 .dOW..h$ ....L|
-000001c0 7f b1 c4 5a 85 d2 95 bd 98 e8 05 7b 20 f1 34 97 |...Z.......{ .4.|
-000001d0 6e 73 ed 5d 5f 97 56 a6 9a 6f e7 91 27 be b2 d9 |ns.]_.V..o..'...|
-000001e0 ef 48 9b 3d d8 80 e1 e1 d5 46 de 6c 83 7d 16 24 |.H.=.....F.l.}.$|
-000001f0 03 f0 a1 29 fd 8e a7 db 63 88 51 e3 ac 5d a6 c9 |...)....c.Q..]..|
-00000200 19 e4 a4 40 0f 92 1b 4c 3b 9d 4a fc b2 cf c5 62 |...@...L;.J....b|
-00000210 db 72 d2 9e f8 c0 00 ab fe af ac 66 46 8d b7 8e |.r.........fF...|
-00000220 dc ab 07 c4 87 09 0e 9b 04 17 03 03 00 a4 7b 67 |..............{g|
-00000230 11 bf bb 27 7d c0 ab f4 14 a8 44 a1 e1 b1 ba 0c |...'}.....D.....|
-00000240 4c d0 4e 9d 74 5f dd 60 bb c9 33 ad 29 91 a7 a0 |L.N.t_.`..3.)...|
-00000250 18 61 44 25 bf a1 45 e2 9b 24 93 20 45 0b 2a 09 |.aD%..E..$. E.*.|
-00000260 07 75 4d ad 1a 04 34 df 7b 1b c8 f7 e7 fc 4e 99 |.uM...4.{.....N.|
-00000270 27 97 d5 9a 7f 63 39 00 5c ed ba a4 5b 9b 44 72 |'....c9.\...[.Dr|
-00000280 cb 3e 80 68 9a 78 e9 bc 12 35 94 9d b2 1c 34 f6 |.>.h.x...5....4.|
-00000290 ce c7 cf 61 5e a9 c2 21 79 e9 e3 4c e8 e5 dc fe |...a^..!y..L....|
-000002a0 e2 1d 7a 2b c3 dd 15 f8 e5 0e 20 6f 99 fd ea ef |..z+...... o....|
-000002b0 a1 a4 be a9 28 1a d0 f8 3e 0a c2 76 6b 24 b1 56 |....(...>..vk$.V|
-000002c0 0f 52 25 f6 56 65 96 92 4f 07 71 9d 25 25 99 2c |.R%.Ve..O.q.%%.,|
-000002d0 dc 04 17 03 03 00 45 c5 e8 b3 d0 ca 89 02 da 08 |......E.........|
-000002e0 73 57 9c a6 49 de da b3 e7 92 59 8e 25 29 45 8b |sW..I.....Y.%)E.|
-000002f0 fb 56 b6 53 dd d1 59 6c 5f 39 7a d4 d8 e6 db e3 |.V.S..Yl_9z.....|
-00000300 60 8c a4 8a 81 2b a5 26 a7 21 89 e9 8a f7 fe 39 |`....+.&.!.....9|
-00000310 44 a2 bd 1c 49 18 47 b9 69 ef 1c 74 |D...I.G.i..t|
+00000000 14 03 03 00 01 01 17 03 03 02 1e 08 6d ee 1c 88 |............m...|
+00000010 63 86 93 3e 73 8e 87 6f 51 8b d3 d2 91 c5 cb 55 |c..>s..oQ......U|
+00000020 2d 7c 9f 32 d8 0a ab e5 53 95 4b 0c 22 12 23 56 |-|.2....S.K.".#V|
+00000030 07 ce 1b e1 46 f7 46 84 cb 47 83 62 4a 16 39 44 |....F.F..G.bJ.9D|
+00000040 bf 58 25 6e f1 22 d0 ea 06 d8 da 44 91 bb 27 41 |.X%n.".....D..'A|
+00000050 1f 6e 46 89 88 93 a7 0a 60 8f 1a e5 31 19 5c 27 |.nF.....`...1.\'|
+00000060 a3 f6 8c 1b ee 5b 2b 21 c4 64 c7 d9 92 7b e9 ca |.....[+!.d...{..|
+00000070 e0 16 29 d0 64 32 95 a8 8f a8 24 cc 56 c6 3e 7d |..).d2....$.V.>}|
+00000080 1b f6 06 a6 fa d6 dc 79 38 60 4f 6f b7 e1 10 ab |.......y8`Oo....|
+00000090 21 14 8e e1 90 95 6d b6 f3 ca 86 1a dd 32 c5 33 |!.....m......2.3|
+000000a0 e1 fc 8c da 77 02 54 88 73 f3 72 71 c6 58 ad 1a |....w.T.s.rq.X..|
+000000b0 10 b8 15 c3 69 f1 cc 71 b6 ea 7e b7 81 4b de 7b |....i..q..~..K.{|
+000000c0 77 87 24 e0 c0 39 5c 5b 17 ad 7c 59 53 43 cf 7e |w.$..9\[..|YSC.~|
+000000d0 cb 70 4d 51 f1 7e 8c 2b 19 61 13 75 bf 25 df 80 |.pMQ.~.+.a.u.%..|
+000000e0 f2 fa cd 70 8d db eb bc 38 ae 6a 0c ad ef d2 e2 |...p....8.j.....|
+000000f0 f0 f1 02 97 ce 37 8b 8f 9e bd 4f 92 40 e7 8f 9f |.....7....O.@...|
+00000100 26 b7 cd ef cf 57 28 2f 12 cc 69 e1 be f2 59 c6 |&....W(/..i...Y.|
+00000110 be dc 51 9a 67 be 4a f1 97 f9 7a d9 01 05 1f d0 |..Q.g.J...z.....|
+00000120 2b 96 5b b5 4d 1d c1 2e 99 7e eb e3 20 92 b0 f8 |+.[.M....~.. ...|
+00000130 ac 9f c1 e3 10 cd b1 e9 05 46 15 3c c2 fb ce 27 |.........F.<...'|
+00000140 5e f1 47 e7 d8 ca 89 0e 77 37 86 6c c9 d4 e3 ae |^.G.....w7.l....|
+00000150 1e 6e 63 4f 5c 2d aa a0 88 7c 35 47 87 e8 40 22 |.ncO\-...|5G..@"|
+00000160 f8 45 2f 57 b4 e8 e1 95 45 58 02 53 3c 19 b5 92 |.E/W....EX.S<...|
+00000170 73 55 fd 49 31 ec db dc 4c 6f 6f a7 9a 90 89 83 |sU.I1...Loo.....|
+00000180 08 97 53 5a c6 6c 23 75 cd 68 37 54 2c 00 d3 56 |..SZ.l#u.h7T,..V|
+00000190 5e 24 87 7b 92 a9 61 73 1e 84 31 0e ff d7 f2 fb |^$.{..as..1.....|
+000001a0 62 5e f9 27 35 18 bb ca b2 c2 d7 5c bf 7f 6d 36 |b^.'5......\..m6|
+000001b0 fa e6 02 4a d0 fa bd b8 c0 d0 2f 0c 27 6b 49 92 |...J....../.'kI.|
+000001c0 20 54 01 ea 3c d2 07 f1 2e d6 e3 a3 a3 bd 1d 33 | T..<..........3|
+000001d0 90 ee 26 ad a6 5c ee c7 de 4d e8 fc d2 b5 5a b5 |..&..\...M....Z.|
+000001e0 7c 6f c5 61 23 11 20 eb 0f 7c b7 0a cc 8c 65 b7 ||o.a#. ..|....e.|
+000001f0 e2 87 16 10 b0 fd 40 75 78 d1 3c 70 54 66 b8 cb |......@ux.>> Flow 4 (server to client)
-00000000 17 03 03 02 a8 a1 f1 48 20 d7 51 ae a0 ec 04 30 |.......H .Q....0|
-00000010 d3 98 bc b4 87 14 5a 73 c1 57 d9 9b b8 54 c0 cc |......Zs.W...T..|
-00000020 e9 25 20 5a 1a 49 2c 3c 5d 0b a5 47 8e 58 df 3e |.% Z.I,<]..G.X.>|
-00000030 44 d8 c7 68 5e e6 cd 78 41 ad 8b e2 83 5e fa 1b |D..h^..xA....^..|
-00000040 05 93 18 fa c1 df 18 d0 b1 52 bc db ee f7 49 a8 |.........R....I.|
-00000050 d8 fd 9c a9 f7 cd a2 b8 61 2b 09 f0 7e 03 e6 18 |........a+..~...|
-00000060 7f 6b fc c8 5f 01 50 21 c9 99 94 7f 31 a8 0e 60 |.k.._.P!....1..`|
-00000070 ec 21 63 b0 e7 90 0b ca 27 55 80 e2 6f 1d 6e e2 |.!c.....'U..o.n.|
-00000080 47 54 a5 81 fd 65 da 31 7c 70 bf 8b 37 b7 53 fc |GT...e.1|p..7.S.|
-00000090 fd 2d 46 79 69 7b aa a5 29 a2 11 ac 3c ab 20 29 |.-Fyi{..)...<. )|
-000000a0 51 8d 30 da 9a 1d 0f 32 d8 3d 2a 06 0c 59 b9 5e |Q.0....2.=*..Y.^|
-000000b0 fe 28 09 d6 49 7f 7c 9c 33 66 91 8e a9 b0 9c 38 |.(..I.|.3f.....8|
-000000c0 94 db 68 f0 a1 60 ce 3d 95 49 3f 0a ba b1 15 f2 |..h..`.=.I?.....|
-000000d0 61 e5 a0 91 72 71 28 af 43 54 0d 75 71 f9 6e 2f |a...rq(.CT.uq.n/|
-000000e0 3c 6a fd 2f 96 5d a1 bc 5f 88 9f 3f 9f e3 80 94 |4..I..|
-000002a0 b4 6e 11 4f 41 14 ee d8 2a 55 d9 88 1c 17 03 03 |.n.OA...*U......|
-000002b0 00 1e 0b 7a 66 33 ad ae 08 ab 8e 75 dd e8 4b a1 |...zf3.....u..K.|
-000002c0 ff 16 5d 43 c6 24 cc d9 0b 6e 71 a3 5e 18 03 94 |..]C.$...nq.^...|
-000002d0 17 03 03 00 13 7c 2a ec 24 22 fd 49 16 b6 4f a1 |.....|*.$".I..O.|
-000002e0 84 54 bf 3e a8 78 af 64 |.T.>.x.d|
+00000000 17 03 03 02 98 07 3b b6 4e c1 7e 84 44 a0 5d 3c |......;.N.~.D.]<|
+00000010 b8 45 37 1e bf 0f 43 cf d6 11 c7 0d d9 a4 25 7b |.E7...C.......%{|
+00000020 27 fa 6e e1 9c 24 5f e5 f9 12 e8 a1 33 2e cc 24 |'.n..$_.....3..$|
+00000030 43 3b ac e3 bd f2 7b 1d 66 70 eb 31 21 7f 3e 5e |C;....{.fp.1!.>^|
+00000040 09 7a 29 8f 43 43 cb c4 6d 70 a7 51 1c 0f dc 21 |.z).CC..mp.Q...!|
+00000050 e9 4c f5 16 8f 35 e8 5b ae 7f e0 47 e7 d4 53 66 |.L...5.[...G..Sf|
+00000060 b2 cc ef 44 b7 3e 34 2b 32 a9 e6 89 b9 c6 f6 56 |...D.>4+2......V|
+00000070 97 b3 78 37 3c 89 2f 35 8e a5 c7 ae c4 92 91 69 |..x7<./5.......i|
+00000080 50 ae ee c9 7b 7a 3a 10 ce 1c 68 fd 09 57 3d 92 |P...{z:...h..W=.|
+00000090 52 42 0e 4e 91 12 b4 fd e4 59 d4 1e 5a c7 25 b3 |RB.N.....Y..Z.%.|
+000000a0 dd a1 dd 7d 7d 92 08 52 ec 85 15 c7 b6 60 70 fb |...}}..R.....`p.|
+000000b0 76 6b 42 da 84 8e e5 a9 cb a4 b1 76 89 51 93 55 |vkB........v.Q.U|
+000000c0 f3 92 aa cc 04 3b 78 97 ed 10 88 d8 77 d1 32 35 |.....;x.....w.25|
+000000d0 93 82 a4 1d ca 47 df c8 72 93 10 90 e0 75 2d 3f |.....G..r....u-?|
+000000e0 b0 6a 3d 9e b6 20 1d 0a 2a 03 66 be 18 18 d3 25 |.j=.. ..*.f....%|
+000000f0 47 a2 ab 67 08 44 24 cb 94 29 8a f7 8b 8e ca a0 |G..g.D$..)......|
+00000100 20 71 d0 af 87 5b e1 d9 5d e0 0c 70 13 3d 82 42 | q...[..]..p.=.B|
+00000110 b3 b8 fb 5e 1d f1 58 88 ea 11 67 28 49 11 d4 27 |...^..X...g(I..'|
+00000120 05 87 e4 b1 21 15 d1 3a 6a df ee 6d 40 7c 3f 8c |....!..:j..m@|?.|
+00000130 7e cd 7b 0c 0e ef fd 17 29 29 f8 03 98 8e 76 ac |~.{.....))....v.|
+00000140 23 e2 81 30 8b c7 7b 9b 5a 78 f7 6a 53 32 5c bd |#..0..{.Zx.jS2\.|
+00000150 d7 42 cb 77 f5 1d ea 03 74 9f ec 1d 1b 68 72 aa |.B.w....t....hr.|
+00000160 9f e0 7d 58 2f 26 47 6b 2d e4 1f 78 f4 ab d3 ae |..}X/&Gk-..x....|
+00000170 51 6c 2a 35 0a 6f 9a c8 2b 75 ff 69 3e 4b 61 bc |Ql*5.o..+u.i>Ka.|
+00000180 03 29 60 04 8b 53 9f ae e4 00 7f 88 7a d4 70 b8 |.)`..S......z.p.|
+00000190 65 83 87 96 5d ef f1 b2 e8 7e 0e af 0b 2c 07 dd |e...]....~...,..|
+000001a0 a9 0e f8 c3 9b 59 aa cf 74 02 5e 46 8c cb 3d ee |.....Y..t.^F..=.|
+000001b0 72 67 7c 46 37 29 78 d8 80 6e 42 16 b7 a8 59 35 |rg|F7)x..nB...Y5|
+000001c0 cb 36 ce 73 50 80 d2 35 7a 69 b9 f3 14 73 04 e7 |.6.sP..5zi...s..|
+000001d0 ec dd 92 80 b0 f6 b7 51 28 15 56 c4 bb 83 00 86 |.......Q(.V.....|
+000001e0 9e 21 e7 bd 91 33 15 d4 aa da 8a 07 eb 2e d9 48 |.!...3.........H|
+000001f0 c3 71 1a da be 6f 00 45 bd 08 a3 70 17 d5 c0 1a |.q...o.E...p....|
+00000200 74 87 5a 95 60 aa 1d ce 0e e1 46 57 85 8c e0 ae |t.Z.`.....FW....|
+00000210 98 1a f9 83 7f ec 04 bd 90 dc 51 4f 7e d2 52 28 |..........QO~.R(|
+00000220 ca 33 f6 60 4a 0c e4 7d b3 93 4f 70 7a ce d3 3e |.3.`J..}..Opz..>|
+00000230 0a dd 50 b0 17 0a 2e db 2c ad 3d 86 d3 e6 60 07 |..P.....,.=...`.|
+00000240 43 61 9c a0 ff 45 37 9a 60 3d c5 f7 4d 27 fc b4 |Ca...E7.`=..M'..|
+00000250 9a 05 1c 0a ae 08 9d d9 5c 15 09 c9 8e 24 bb e2 |........\....$..|
+00000260 ec a1 a7 27 f0 42 97 a9 af ed 25 fd 5f f1 2a 4d |...'.B....%._.*M|
+00000270 ac ab 9c a5 7d 28 6b c8 36 ec 0c 12 5b eb fa 64 |....}(k.6...[..d|
+00000280 83 74 13 6e 44 5a 23 38 f0 a6 22 3e f9 88 f1 0d |.t.nDZ#8..">....|
+00000290 2a 55 b8 bf aa 87 de a4 7f 8b ba 52 23 17 03 03 |*U.........R#...|
+000002a0 00 1e fb 80 15 2b ff db 63 29 a7 77 ef 1e 82 28 |.....+..c).w...(|
+000002b0 8d d5 f0 5b 5d 42 8e 34 f9 64 5c 47 eb c3 10 4c |...[]B.4.d\G...L|
+000002c0 17 03 03 00 13 a1 8b 9e d8 57 0e 04 96 7c b4 83 |.........W...|..|
+000002d0 70 a2 20 03 ee 28 23 c7 |p. ..(#.|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndEd25519Given b/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndEd25519Given
index 7a8d6d0307..d80b76fc6c 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndEd25519Given
+++ b/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndEd25519Given
@@ -1,154 +1,149 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 e0 01 00 00 dc 03 03 f4 33 e3 f1 5d |............3..]|
-00000010 94 d0 5e 26 62 41 72 76 29 ff 09 d9 ba 11 e0 f1 |..^&bArv).......|
-00000020 cb 58 56 ba 7d 37 44 09 31 86 b4 20 88 9f f1 76 |.XV.}7D.1.. ...v|
-00000030 f4 fe 3c 7b 4e 77 fb bb 58 76 90 f2 d7 32 21 07 |..<{Nw..Xv...2!.|
-00000040 d8 bf da 67 93 ba 8f e8 e4 e2 48 c3 00 08 13 02 |...g......H.....|
-00000050 13 03 13 01 00 ff 01 00 00 8b 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 1e |................|
-00000090 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................|
-000000a0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 00 2b |...............+|
-000000b0 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 |......-.....3.&.|
-000000c0 24 00 1d 00 20 72 9a 7f b9 89 71 2f ab 7d 09 a7 |$... r....q/.}..|
-000000d0 8e eb 17 07 21 41 01 3f d0 3e eb ae 5e 6a 05 4c |....!A.?.>..^j.L|
-000000e0 74 c3 bb a2 35 |t...5|
+00000000 16 03 01 00 ca 01 00 00 c6 03 03 3d 6d 5a b0 92 |...........=mZ..|
+00000010 7b 62 6d 14 22 f5 08 70 77 4a 80 fa 69 1a 1c 92 |{bm."..pwJ..i...|
+00000020 4c d3 e5 ca 3a d0 ee 33 40 c8 64 20 e5 a7 f1 57 |L...:..3@.d ...W|
+00000030 39 32 e3 9f 7c 33 58 16 61 58 29 44 aa e4 50 b1 |92..|3X.aX)D..P.|
+00000040 37 c5 59 27 f2 d5 b8 6e 01 24 c2 6b 00 04 13 01 |7.Y'...n.$.k....|
+00000050 00 ff 01 00 00 79 00 0b 00 04 03 00 01 02 00 0a |.....y..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000070 00 00 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 |................|
+00000080 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
+00000090 08 06 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 |.........+......|
+000000a0 2d 00 02 01 01 00 33 00 26 00 24 00 1d 00 20 cb |-.....3.&.$... .|
+000000b0 da f4 03 da e7 6f e5 2b 25 c0 cb cf 52 0a fb af |.....o.+%...R...|
+000000c0 8a 87 4c 2b 88 e4 1a b3 a0 34 30 fb 9d 4e 0e |..L+.....40..N.|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 88 9f f1 76 |........... ...v|
-00000030 f4 fe 3c 7b 4e 77 fb bb 58 76 90 f2 d7 32 21 07 |..<{Nw..Xv...2!.|
-00000040 d8 bf da 67 93 ba 8f e8 e4 e2 48 c3 13 02 00 00 |...g......H.....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 e5 a7 f1 57 |........... ...W|
+00000030 39 32 e3 9f 7c 33 58 16 61 58 29 44 aa e4 50 b1 |92..|3X.aX)D..P.|
+00000040 37 c5 59 27 f2 d5 b8 6e 01 24 c2 6b 13 01 00 00 |7.Y'...n.$.k....|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 5c 89 3f 32 3d 88 |..........\.?2=.|
-00000090 9e 8a a3 d1 ae 90 75 c1 20 15 cf 41 9d 95 94 76 |......u. ..A...v|
-000000a0 08 17 03 03 00 3e 7c a9 ca b7 2f 71 e0 4c b9 0d |.....>|.../q.L..|
-000000b0 82 cd be 73 2f fe d2 21 d9 b3 63 fc 53 e0 ff 13 |...s/..!..c.S...|
-000000c0 39 40 98 a5 7a ee ae 0b c2 bc 90 ca b6 69 8f 48 |9@..z........i.H|
-000000d0 b8 5d 8f 41 62 d6 ad 92 c5 cd 40 bd 77 1c 6c 23 |.].Ab.....@.w.l#|
-000000e0 5d 20 ce 87 17 03 03 02 6d cc 94 31 f8 57 e9 18 |] ......m..1.W..|
-000000f0 04 31 82 f4 53 17 8d 2d 1d f9 58 15 ad 1b 5c bd |.1..S..-..X...\.|
-00000100 39 85 02 37 87 c7 00 5f 0f df fd 2c cc b3 be ce |9..7..._...,....|
-00000110 d1 4d 08 7f a7 5c 12 3f e7 99 67 48 0f c4 11 9e |.M...\.?..gH....|
-00000120 52 06 a1 ae 8e 6c 9a 80 02 9e 88 1c 70 59 19 40 |R....l......pY.@|
-00000130 d8 9b 01 35 76 f1 2f cf ba 2a ba 8c 56 90 d2 98 |...5v./..*..V...|
-00000140 e9 f2 53 60 71 55 ef ca 96 8a 45 ee 6f 6e 99 e6 |..S`qU....E.on..|
-00000150 57 a4 9e c4 b6 fa c4 41 fe 72 b0 2b 69 8c f0 d7 |W......A.r.+i...|
-00000160 ea 27 73 b6 a6 8a bc 3c 5f c9 a3 e3 78 ae 04 4c |.'s....<_...x..L|
-00000170 a5 2f b5 ac 58 63 06 a2 c5 44 99 2f 97 d7 c5 d7 |./..Xc...D./....|
-00000180 4c ea 01 cb c7 f9 11 0e 6d 27 33 13 57 97 b1 7b |L.......m'3.W..{|
-00000190 50 48 b2 89 f6 ee 67 36 87 22 3e cb 61 2e d7 ff |PH....g6.">.a...|
-000001a0 99 c7 19 79 ff d8 af 66 95 f3 19 01 f7 67 67 47 |...y...f.....ggG|
-000001b0 a8 c1 c5 56 78 4f 7d 54 63 53 7f ad 2d 35 57 91 |...VxO}TcS..-5W.|
-000001c0 17 3f b3 b4 ce 69 9f d3 8e 50 eb 2d f4 dc c8 87 |.?...i...P.-....|
-000001d0 49 4a 45 88 55 ab e3 8b 75 ac d2 7d 39 d0 ea a9 |IJE.U...u..}9...|
-000001e0 32 9c 44 9e 81 2c 9e fc 2c 4f 2d b2 b1 30 de 2a |2.D..,..,O-..0.*|
-000001f0 40 22 da d0 f3 3f d6 9e 51 14 d2 84 41 20 d3 f0 |@"...?..Q...A ..|
-00000200 58 b5 ba 68 62 12 d1 4a ab 37 72 4e 56 8e 80 0f |X..hb..J.7rNV...|
-00000210 0d 85 e7 1c 91 d3 1e ee 73 d0 9e 1b 6f 1b 53 1b |........s...o.S.|
-00000220 c2 28 5b 9b ef 20 e3 c2 aa 4b 87 26 d9 5e 52 ef |.([.. ...K.&.^R.|
-00000230 79 9d c8 4b b1 38 eb 46 73 85 ac 0b 96 34 22 61 |y..K.8.Fs....4"a|
-00000240 cc cd 11 9e fb 30 b9 b7 4f 09 17 79 98 83 09 65 |.....0..O..y...e|
-00000250 81 de af b1 2e f1 15 0c 4a bd fd 65 da 7b 7c 00 |........J..e.{|.|
-00000260 98 fd 2f 97 de 1c e9 05 16 de b2 50 d2 5c e1 cd |../........P.\..|
-00000270 19 ef d3 48 5c 03 dd ca b5 62 ce 17 b4 3c 2d e9 |...H\....b...<-.|
-00000280 a8 78 6c b9 10 9c d9 2f 89 b1 7e 32 05 f7 6d d3 |.xl..../..~2..m.|
-00000290 1c 30 10 1b 30 dc 17 7c c7 52 cf 93 18 b9 4f b1 |.0..0..|.R....O.|
-000002a0 cd 05 e5 73 e6 00 b5 d0 42 98 cd cd 14 54 b0 01 |...s....B....T..|
-000002b0 92 49 a9 e4 12 27 f9 67 df 3b b3 e9 08 d3 f6 53 |.I...'.g.;.....S|
-000002c0 a7 5b 71 9f 96 3b 7e ca ac c6 81 a2 14 66 64 bf |.[q..;~......fd.|
-000002d0 ff 0f 8d 5f 23 63 6e 39 7e 9c 83 3f e8 4c db d6 |..._#cn9~..?.L..|
-000002e0 91 6d 47 8d 54 f3 bd 44 de e8 13 9b fd 84 5c 97 |.mG.T..D......\.|
-000002f0 81 a2 c6 33 d8 d9 4e ce 8d b6 35 2f e3 a2 3a 52 |...3..N...5/..:R|
-00000300 2f 6a fa 1a 22 42 07 19 41 55 5a 20 ac 12 d8 13 |/j.."B..AUZ ....|
-00000310 4c 2e 41 34 81 c7 0d 83 d1 5d 3f f9 02 e6 43 69 |L.A4.....]?...Ci|
-00000320 b6 08 95 fb 8a fc 27 cc d7 61 52 82 89 a3 bb 84 |......'..aR.....|
-00000330 e4 53 a4 b8 96 cb 8c 53 c0 4d 16 95 a9 d1 70 23 |.S.....S.M....p#|
-00000340 52 5e 7e f6 01 a3 1e 45 28 53 18 23 a0 df ab ee |R^~....E(S.#....|
-00000350 2f 09 4c 02 8e dc 17 03 03 00 99 b4 38 62 ca 65 |/.L.........8b.e|
-00000360 1c cf 0a ed d7 d9 65 f4 db d2 53 7b f2 bf 2a 98 |......e...S{..*.|
-00000370 72 e8 2d 51 41 c2 b7 af 5e 84 40 23 64 51 16 bc |r.-QA...^.@#dQ..|
-00000380 cd 3a f4 78 c2 01 c1 4f ba 6f 4a 60 c4 06 76 df |.:.x...O.oJ`..v.|
-00000390 f7 19 7a aa b0 22 91 95 11 b0 07 32 50 30 be 6a |..z..".....2P0.j|
-000003a0 ec 6b 94 49 8b b7 04 35 32 8f b2 71 42 9e d8 e3 |.k.I...52..qB...|
-000003b0 c8 33 32 27 63 d1 fb 6f 21 9b f6 08 aa 6f be 56 |.32'c..o!....o.V|
-000003c0 3c a0 77 af 7c b9 e2 a6 51 27 12 fc b3 81 c0 d7 |<.w.|...Q'......|
-000003d0 53 58 94 b5 2b 34 ff 06 59 42 2e c4 aa 44 07 46 |SX..+4..YB...D.F|
-000003e0 8e af 4d d8 11 d8 56 f1 4c cb 2f aa 87 99 2e 08 |..M...V.L./.....|
-000003f0 9a 4a e5 11 17 03 03 00 45 a6 e5 85 12 20 f0 6d |.J......E.... .m|
-00000400 2a d0 45 c0 8a f2 12 f9 61 20 ed 30 91 2d a1 a9 |*.E.....a .0.-..|
-00000410 33 6f 2a 70 46 64 b0 2c 79 19 f4 11 0b 7e 3b c0 |3o*pFd.,y....~;.|
-00000420 bb e8 21 bc f6 ab 09 de ef 16 17 65 32 0a 80 47 |..!........e2..G|
-00000430 25 cd 0b 93 8c 14 e2 1e 1e ff 24 61 6d 4a |%.........$amJ|
+00000080 03 03 00 01 01 17 03 03 00 17 2d 8b 08 3c eb 5e |..........-..<.^|
+00000090 e6 d7 8e 9a 11 d0 e1 a3 3f 88 cc 83 49 e3 af 50 |........?...I..P|
+000000a0 66 17 03 03 00 3e 24 ba 0e 2f d7 51 a9 52 5d 51 |f....>$../.Q.R]Q|
+000000b0 a4 7d b6 dc 5c 43 2e d8 58 5e 72 f1 86 98 15 b8 |.}..\C..X^r.....|
+000000c0 db 0a 48 0a 06 c4 ad 36 41 84 f1 89 36 e9 24 da |..H....6A...6.$.|
+000000d0 05 5a dc 82 02 a1 3d 39 ae 4c 7e d9 7b 43 1f 2c |.Z....=9.L~.{C.,|
+000000e0 06 71 a0 2f 17 03 03 02 6d 48 44 6b d1 65 fb e1 |.q./....mHDk.e..|
+000000f0 fb 96 00 e5 ad c6 60 e2 b5 f6 bf 7c b7 f4 6f 0e |......`....|..o.|
+00000100 db a2 4b f7 cd d7 73 29 f8 af 23 5d d4 55 df 37 |..K...s)..#].U.7|
+00000110 b7 62 38 d0 95 5c f1 48 32 5f cb fa 67 18 20 7f |.b8..\.H2_..g. .|
+00000120 b7 0f ac fc 64 b7 b0 7b 4b 1f 65 1d 2a 94 8d 76 |....d..{K.e.*..v|
+00000130 b4 30 3b ee 44 a5 f6 74 5b 7e bd a7 bb b2 d8 d6 |.0;.D..t[~......|
+00000140 ac c6 1f b4 88 34 85 7e 89 2c 2e 0d bf 6c 16 0c |.....4.~.,...l..|
+00000150 ce 35 57 13 29 55 60 20 86 21 20 c0 46 bc 9e dd |.5W.)U` .! .F...|
+00000160 8a a0 41 60 b5 a9 16 cc 66 cb 4a ba 58 e0 70 d1 |..A`....f.J.X.p.|
+00000170 a5 b4 eb ac 54 7e 95 11 00 f0 70 63 af 56 57 99 |....T~....pc.VW.|
+00000180 68 57 b4 5b aa db f1 08 2e c0 fb df 93 b8 4a f8 |hW.[..........J.|
+00000190 2e 04 b3 2c 2b f9 47 09 a1 5f a3 3e 97 eb d4 d5 |...,+.G.._.>....|
+000001a0 df ec d1 9e 05 5e 10 b0 2b 7e 0e b4 c8 e1 e3 50 |.....^..+~.....P|
+000001b0 29 19 8b 3c f7 d0 95 30 ae 4c e4 60 c8 13 09 15 |)..<...0.L.`....|
+000001c0 b7 80 f3 ad a0 06 6b a7 b7 4a c4 6d 65 09 21 d3 |......k..J.me.!.|
+000001d0 3b 56 dc ce f5 d3 fa 93 e9 03 8e 0c c9 47 21 89 |;V...........G!.|
+000001e0 7f 39 23 f8 aa 68 f6 b4 82 50 1f b8 46 5d 26 dc |.9#..h...P..F]&.|
+000001f0 b1 1f e5 e5 6b ad ad 0d d8 55 b7 8b 7a f8 5d fc |....k....U..z.].|
+00000200 bd 74 a4 15 72 33 1b a7 3b 8c 09 55 d9 fd 21 bf |.t..r3..;..U..!.|
+00000210 cd dd 67 d2 0c d0 bd 9b de 52 e3 5f 4d 54 c0 6c |..g......R._MT.l|
+00000220 bd 93 ae 66 55 4b e9 75 6b db cd 6b 80 33 f4 b7 |...fUK.uk..k.3..|
+00000230 61 9e e4 5d 75 b5 44 26 79 b5 da bf af 54 8c 40 |a..]u.D&y....T.@|
+00000240 23 99 32 60 2a 76 b3 0a 46 37 c9 85 1c fe e9 a1 |#.2`*v..F7......|
+00000250 a3 e8 61 67 04 eb 3e e8 2b d3 12 75 87 04 67 40 |..ag..>.+..u..g@|
+00000260 19 63 c5 ef 75 d0 39 63 a0 c3 ae 3c b1 88 34 db |.c..u.9c...<..4.|
+00000270 c7 29 0c 33 c8 40 c0 b0 e6 76 44 cc 99 4f 2b a6 |.).3.@...vD..O+.|
+00000280 b3 e1 28 69 6c 41 74 55 53 a9 87 06 9a cb 14 5d |..(ilAtUS......]|
+00000290 ec 74 77 e2 a0 ce 54 02 ba f8 04 2c 84 9a de 2b |.tw...T....,...+|
+000002a0 dc 02 32 01 ad 96 5c a0 87 3c 55 dd ee 4d cb fd |..2...\..>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 01 50 ff 2c 08 a6 b9 |..........P.,...|
-00000010 a0 6d 5f 39 45 8f 85 d5 95 80 60 2c 9c 13 3f f3 |.m_9E.....`,..?.|
-00000020 e4 e8 c4 34 4d 2f 58 78 a6 51 57 5b 12 85 95 57 |...4M/Xx.QW[...W|
-00000030 a3 04 01 5c f1 01 a0 ae 4f 46 1d c9 ab 92 c3 43 |...\....OF.....C|
-00000040 89 a9 e8 8a 5b e4 eb d9 29 4a bd 80 4a b7 bb 63 |....[...)J..J..c|
-00000050 07 ca 14 47 af 5f 21 dc 85 6b 04 64 aa d3 61 4b |...G._!..k.d..aK|
-00000060 5b 76 c9 ec 37 71 d8 fe 86 5a 12 a7 0d c3 a3 98 |[v..7q...Z......|
-00000070 09 a9 6f 03 2b a1 e2 43 35 be 9c 34 b5 4e 0c 05 |..o.+..C5..4.N..|
-00000080 fa 64 d8 9e 37 36 83 08 be ba 4d 30 2a d5 9f 43 |.d..76....M0*..C|
-00000090 38 92 af 63 56 1e df 03 51 86 e9 26 5e 28 97 ff |8..cV...Q..&^(..|
-000000a0 cf 91 6d fe cc a1 02 1a 34 a7 5d d2 25 20 5b ae |..m.....4.].% [.|
-000000b0 ef 9e fe 0f ef 5d 74 f4 f5 14 54 47 33 f9 15 5d |.....]t...TG3..]|
-000000c0 6f 85 d8 16 ed 3b 1e 3e c5 72 2f 17 65 98 5c 4c |o....;.>.r/.e.\L|
-000000d0 84 c2 f4 44 6b c2 3d 04 5c 81 ef ec b8 40 e6 cb |...Dk.=.\....@..|
-000000e0 20 87 3c 3b b9 38 92 5e 48 dd 20 fe e9 a8 e6 9b | .<;.8.^H. .....|
-000000f0 14 2b e7 d3 77 b7 44 ed c7 eb cb 0c c8 d6 db 06 |.+..w.D.........|
-00000100 3c c7 7f a3 09 b4 00 5c 93 10 79 76 0e 45 f6 d2 |<......\..yv.E..|
-00000110 8b c0 91 91 7a 2d 17 e6 10 95 a2 9a df c4 da 85 |....z-..........|
-00000120 88 66 f4 bb 9b d5 0f 32 f2 f2 dc a6 16 b5 e9 4d |.f.....2.......M|
-00000130 f3 43 17 77 f5 51 ca 57 b8 db d1 f4 8a 22 b2 ec |.C.w.Q.W....."..|
-00000140 22 27 cb 22 b8 c1 9a 17 63 01 e7 5d 2a 2b ad 03 |"'."....c..]*+..|
-00000150 65 be 0d 55 c5 aa 46 31 95 df 47 17 03 03 00 59 |e..U..F1..G....Y|
-00000160 d1 98 94 ed e8 1e fb 74 04 5c 11 9b eb 11 29 20 |.......t.\....) |
-00000170 05 39 94 9f c8 e1 2f a5 2d 91 23 69 ca 15 34 8b |.9..../.-.#i..4.|
-00000180 d7 3c 60 62 3e ae 7f fc 15 14 f1 51 a0 0d 06 30 |.<`b>......Q...0|
-00000190 e7 09 8a ca 60 51 77 6d 31 b5 ac fe a1 40 ca 0c |....`Qwm1....@..|
-000001a0 78 13 69 18 eb 65 41 72 c1 e9 7c dd 31 db fd 53 |x.i..eAr..|.1..S|
-000001b0 16 b8 82 9e 9f b9 46 68 1c 17 03 03 00 45 46 f7 |......Fh.....EF.|
-000001c0 f1 53 9c 4b 79 76 09 10 00 b6 c0 4c c4 b2 cc 4a |.S.Kyv.....L...J|
-000001d0 55 41 29 28 bd b6 54 1c 56 ec 85 75 c0 52 11 ce |UA)(..T.V..u.R..|
-000001e0 93 67 61 a8 52 2c 77 5d b0 b1 6b e2 02 93 65 f4 |.ga.R,w]..k...e.|
-000001f0 3b d9 65 c5 5f 2b 13 c2 09 c1 c1 5d 83 8a cb 6b |;.e._+.....]...k|
-00000200 db 40 e3 |.@.|
+00000000 14 03 03 00 01 01 17 03 03 01 50 d8 03 a6 37 13 |..........P...7.|
+00000010 5f fb 65 9f 33 33 79 ae 89 c3 de ea 4b 55 e2 b3 |_.e.33y.....KU..|
+00000020 13 07 0d 95 c6 f7 79 74 ad 8a 42 dd 78 55 a5 01 |......yt..B.xU..|
+00000030 69 f2 11 cf 72 de 85 04 56 78 9c ba 21 77 b8 76 |i...r...Vx..!w.v|
+00000040 e3 58 23 3d 2b 8a ee a4 5c 52 60 4b 50 0d c4 83 |.X#=+...\R`KP...|
+00000050 a1 8d 06 82 68 99 34 65 7a 7b 55 8e 46 04 47 55 |....h.4ez{U.F.GU|
+00000060 4d 42 02 41 b6 e4 dd a4 33 6a 04 97 e6 4a 80 3a |MB.A....3j...J.:|
+00000070 e1 7e 0a a5 4f 0c f9 de 7a 91 96 4f 6a 6a 8a 4b |.~..O...z..Ojj.K|
+00000080 fd 24 b9 bf e7 d5 5a 27 17 18 45 77 1d e2 c9 ea |.$....Z'..Ew....|
+00000090 23 57 c4 e1 30 9e de d2 bd 0c 28 59 dc a1 12 d9 |#W..0.....(Y....|
+000000a0 ee 2e 43 4b 83 fc d7 6c a4 e7 47 c4 14 c1 1f ee |..CK...l..G.....|
+000000b0 79 60 26 86 73 5c ec c9 c0 ec f9 c9 38 98 2d ba |y`&.s\......8.-.|
+000000c0 10 83 1b fe 8f cf 59 77 f0 60 fe c0 d0 7e 0f 2d |......Yw.`...~.-|
+000000d0 69 04 dd 79 49 c5 b1 d9 9b 48 ad de 55 cf d3 47 |i..yI....H..U..G|
+000000e0 9b eb 64 ae ed cb b0 48 78 a9 27 24 b8 8d 53 36 |..d....Hx.'$..S6|
+000000f0 b7 0f 82 1c ee 11 4b 5a 98 1d 21 73 b4 f4 06 ce |......KZ..!s....|
+00000100 50 bc 36 27 e1 87 70 04 68 1b 30 3a 86 68 b3 71 |P.6'..p.h.0:.h.q|
+00000110 8c 57 69 60 d6 a8 bd fa 13 46 2b 52 00 dc 45 53 |.Wi`.....F+R..ES|
+00000120 06 79 5b 96 78 69 d0 a8 cd 2d 39 8c 11 12 9f 65 |.y[.xi...-9....e|
+00000130 72 01 5e b4 c5 df bc 9d a2 7f 00 a7 cc 95 3b 0b |r.^...........;.|
+00000140 09 05 19 9f a5 b7 dd 48 3f ab f1 aa 36 da 70 96 |.......H?...6.p.|
+00000150 0f f9 f3 bc 80 84 09 a3 76 92 56 17 03 03 00 59 |........v.V....Y|
+00000160 4a ba a9 1c c7 f6 ef 77 8e cc 9a 8c 51 9f 43 1e |J......w....Q.C.|
+00000170 ec 8f f3 33 93 eb 81 db 06 03 97 fd 3f b2 e0 e5 |...3........?...|
+00000180 e7 73 b2 2c 2c f0 c0 a4 51 18 10 79 4e 30 96 3a |.s.,,...Q..yN0.:|
+00000190 d8 26 b1 a0 f4 1b e6 12 fe 74 58 68 97 45 1e 85 |.&.......tXh.E..|
+000001a0 3a db 04 a6 12 5d ba 19 e4 f6 b1 17 f3 04 75 f2 |:....]........u.|
+000001b0 ea 04 db 6c d4 d8 d5 cc fb 17 03 03 00 35 1d c5 |...l.........5..|
+000001c0 cd 92 9c 80 3a ec 3c 06 3e 12 ed 7a 82 23 ab 18 |....:.<.>..z.#..|
+000001d0 67 4a 92 7d 30 e4 57 7b 25 34 a1 54 46 41 b7 60 |gJ.}0.W{%4.TFA.`|
+000001e0 69 cf a2 61 7a 59 6f b3 78 6f 41 0f 7d 9b 4f 00 |i..azYo.xoA.}.O.|
+000001f0 91 c7 93 |...|
>>> Flow 4 (server to client)
-00000000 17 03 03 01 da 0d f9 80 98 7a 44 ce b5 d0 2d 10 |.........zD...-.|
-00000010 54 40 c8 5a e4 28 ba df 18 61 f5 d7 84 a5 38 d2 |T@.Z.(...a....8.|
-00000020 d5 81 76 0e 81 d1 da 9e 99 24 81 7b 5a d0 d5 44 |..v......$.{Z..D|
-00000030 df db 71 ee 84 67 f8 74 db 60 77 17 41 1f 90 1e |..q..g.t.`w.A...|
-00000040 53 1c e2 bf dc d1 b9 4e 50 5b 13 76 93 e5 9b 7a |S......NP[.v...z|
-00000050 98 48 36 7d fa a8 76 69 49 e4 e9 c4 00 ad 85 c3 |.H6}..viI.......|
-00000060 cf 02 3e 57 90 9b 38 e0 d8 0e 23 c9 f9 34 15 6f |..>W..8...#..4.o|
-00000070 9f b5 fe 5b 08 f9 87 11 36 7e d6 29 f0 99 ee e0 |...[....6~.)....|
-00000080 4a ec 6a ff 6d 57 26 6d 8c 73 3f f6 1e 25 49 38 |J.j.mW&m.s?..%I8|
-00000090 0c f1 dd 6a 32 90 2f 72 74 fd 33 6e 6a cb f3 b4 |...j2./rt.3nj...|
-000000a0 35 ed 54 44 10 8c 2e 4d 9a 9d 83 e9 27 3e 03 d4 |5.TD...M....'>..|
-000000b0 8c 10 c2 54 99 5c ab 59 ab b6 cd 39 10 4e 74 ba |...T.\.Y...9.Nt.|
-000000c0 84 96 6f be 53 44 27 16 9f 64 36 63 61 75 ab 56 |..o.SD'..d6cau.V|
-000000d0 c8 27 4c 31 ed cb 46 32 f6 50 f0 00 1c e3 57 40 |.'L1..F2.P....W@|
-000000e0 d5 68 6e 4a 4b 9b 8e 57 ab d3 a4 c5 f5 f5 92 7e |.hnJK..W.......~|
-000000f0 ac 67 a7 67 e9 e0 74 66 d9 00 53 0f 4f 96 73 4d |.g.g..tf..S.O.sM|
-00000100 74 7e 47 9b fa 17 72 55 7e f3 a2 88 ad 07 dc 18 |t~G...rU~.......|
-00000110 b2 26 29 6f 70 cc 35 72 af 81 c2 65 5c 88 3a c7 |.&)op.5r...e\.:.|
-00000120 d1 45 73 91 9d 1f f8 85 ee 89 dc af 6e 80 97 a0 |.Es.........n...|
-00000130 d9 32 19 dc 15 2a d5 86 46 ae 7d ba b3 e6 3d 81 |.2...*..F.}...=.|
-00000140 65 b4 69 82 a8 9c 0f 26 63 a6 9c f2 3d ce 0f 79 |e.i....&c...=..y|
-00000150 a8 08 d3 2b c0 e1 9e c7 ef 1a ca 98 95 d6 c3 d5 |...+............|
-00000160 9c d6 ee 0b 12 98 4f 82 2f 98 df 47 6e 7a 04 94 |......O./..Gnz..|
-00000170 5d ae c5 51 a5 d5 21 d4 a6 f7 e7 3a bd 51 53 24 |]..Q..!....:.QS$|
-00000180 b8 a6 ed 5b 34 30 1d 4a 19 40 c1 cf 5f 21 3a 95 |...[40.J.@.._!:.|
-00000190 ee 82 db 5f c8 54 87 da 45 df ff f3 51 b5 43 03 |..._.T..E...Q.C.|
-000001a0 ee c5 84 27 c2 51 1c 23 8c 87 c4 d3 79 e7 5b 44 |...'.Q.#....y.[D|
-000001b0 8f 2e be 2a 86 22 9a 7c 50 c4 09 c7 2f d6 cd d8 |...*.".|P.../...|
-000001c0 b3 d5 d2 e3 33 89 89 04 5f f3 46 34 40 60 91 c2 |....3..._.F4@`..|
-000001d0 35 e1 3c 39 17 62 fb 99 32 b9 9a be 66 3a 36 17 |5.<9.b..2...f:6.|
-000001e0 03 03 00 1e 2a 22 40 15 e6 80 93 5f 27 1a a1 39 |....*"@...._'..9|
-000001f0 d4 b1 a0 b0 e8 d6 46 1d d7 91 06 67 2a 81 a8 65 |......F....g*..e|
-00000200 57 ad 17 03 03 00 13 11 e9 c2 d1 66 5e 3f 41 14 |W..........f^?A.|
-00000210 82 14 88 58 57 82 2d 0e ba 8b |...XW.-...|
+00000000 17 03 03 01 ca 52 99 bb 74 e8 8e ab 48 c6 03 1d |.....R..t...H...|
+00000010 f9 9a a8 be e4 b1 dc b9 8d e5 a8 11 2b d6 54 63 |............+.Tc|
+00000020 6f 0d dc 6e d7 55 c8 af 3c 88 c4 3e ab 30 ab b9 |o..n.U..<..>.0..|
+00000030 69 94 75 60 0f 75 77 e1 b1 29 09 9f db c1 74 43 |i.u`.uw..)....tC|
+00000040 92 2a 55 b9 ae 71 12 79 b9 4d ba 82 84 96 b1 01 |.*U..q.y.M......|
+00000050 14 b5 9c 5d 0c fe eb cc a6 44 e5 0b 93 1c 8d 45 |...].....D.....E|
+00000060 d8 aa 7c 1b d1 47 5a 36 46 f8 f5 82 c7 fe 2b f3 |..|..GZ6F.....+.|
+00000070 46 17 9f 0c 03 df cd dd 0a 38 77 28 45 45 f2 3c |F........8w(EE.<|
+00000080 06 1d 88 1b 55 d8 8f 70 9b a8 bb 37 a8 41 81 a6 |....U..p...7.A..|
+00000090 a7 f4 28 c1 f1 d2 8b ba 98 0e 35 92 88 ac cb b6 |..(.......5.....|
+000000a0 25 dd 5e 62 d5 e7 e9 da 4f 0e 55 b4 36 4d 09 20 |%.^b....O.U.6M. |
+000000b0 73 ef b3 6c 4c 6d c6 6a e9 f3 f8 28 74 0d 50 b0 |s..lLm.j...(t.P.|
+000000c0 ad 75 f7 c5 fb eb bc 06 6b 07 23 80 70 87 8e a8 |.u......k.#.p...|
+000000d0 3e 66 87 07 53 8e 19 bb 3f 94 f1 9e 4b 05 f6 55 |>f..S...?...K..U|
+000000e0 34 3b d0 14 36 32 66 6a 62 8a ec 22 a1 82 0a 95 |4;..62fjb.."....|
+000000f0 95 b6 85 0c 2c c4 b4 3e 00 59 2a 1e c6 03 4b 2a |....,..>.Y*...K*|
+00000100 e4 06 d5 29 e5 a1 e1 57 b0 a1 45 1b b7 0c 12 3f |...)...W..E....?|
+00000110 0d 31 1a b2 ef 3d 90 73 3a 39 28 00 8a 0d e0 20 |.1...=.s:9(.... |
+00000120 83 a7 32 b8 02 d0 9f 90 f3 b3 ca df 36 ae d4 f8 |..2.........6...|
+00000130 c4 4b 82 06 13 04 66 e7 01 63 4e e8 80 b8 52 c0 |.K....f..cN...R.|
+00000140 8c a4 5b 3f b9 85 48 ac 01 f0 b6 ee db 73 d0 62 |..[?..H......s.b|
+00000150 e2 05 e7 71 7e 87 4b 7b cf d0 a1 77 eb 38 64 85 |...q~.K{...w.8d.|
+00000160 5c 3d af fc e3 17 46 e7 c5 71 c9 63 bf 03 ae 35 |\=....F..q.c...5|
+00000170 7b 60 61 5d 5a 7b 57 88 79 82 55 68 45 a1 59 bc |{`a]Z{W.y.UhE.Y.|
+00000180 e5 3b 5a 31 32 5c 24 13 e3 fc b7 53 41 76 1d 24 |.;Z12\$....SAv.$|
+00000190 7f 08 89 c6 f0 b9 57 3a 4d 91 66 66 e4 57 33 51 |......W:M.ff.W3Q|
+000001a0 1d b9 1e c5 68 9a 6a 74 1e c3 16 de 15 92 e3 d0 |....h.jt........|
+000001b0 0a 64 a4 64 e8 c4 a5 9c 55 30 a9 c3 b0 53 72 54 |.d.d....U0...SrT|
+000001c0 75 d7 a0 7a 54 85 6e 9a 4d ff 9f 13 3c b9 42 17 |u..zT.n.M...<.B.|
+000001d0 03 03 00 1e 6f 06 3f 1c da f6 55 50 05 de 38 9d |....o.?...UP..8.|
+000001e0 07 00 bb 28 32 a5 3f 04 22 4c 6e f2 ea 3a e0 cc |...(2.?."Ln..:..|
+000001f0 5d 5b 17 03 03 00 13 3b b8 7c df 14 b4 ba fa 6e |][.....;.|.....n|
+00000200 2e 61 d6 6b bf b5 ad c2 35 73 |.a.k....5s|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven b/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven
index 97fd482c32..800f99916c 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven
+++ b/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven
@@ -1,180 +1,177 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 c6 01 00 00 c2 03 03 51 9e 53 ed 5f |...........Q.S._|
-00000010 cd 05 55 f2 c7 47 8c e9 90 25 c7 71 4f 73 45 3b |..U..G...%.qOsE;|
-00000020 03 bf 42 bd 5a 4a b9 56 ef ba e0 20 04 08 64 e1 |..B.ZJ.V... ..d.|
-00000030 9d db 92 a5 4e 0c 6e 90 71 c3 ed 51 c6 23 f5 6e |....N.n.q..Q.#.n|
-00000040 64 55 94 28 37 54 58 00 23 a0 53 56 00 08 13 02 |dU.(7TX.#.SV....|
-00000050 13 03 13 01 00 ff 01 00 00 71 00 00 00 0e 00 0c |.........q......|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 04 |................|
-00000090 00 02 08 04 00 2b 00 03 02 03 04 00 2d 00 02 01 |.....+......-...|
-000000a0 01 00 33 00 26 00 24 00 1d 00 20 2b 33 eb 7b ec |..3.&.$... +3.{.|
-000000b0 b5 04 57 a0 f4 f8 3c 19 f2 8f 81 11 b0 2e 91 88 |..W...<.........|
-000000c0 d8 be ba f3 6f 5a 80 db a3 e6 1e |....oZ.....|
+00000000 16 03 01 00 ca 01 00 00 c6 03 03 c8 2f b4 54 5b |............/.T[|
+00000010 11 8a 88 a9 a2 9b bf 66 f2 b4 e5 fb 32 af d6 dd |.......f....2...|
+00000020 6c 6c 99 4f d6 48 cd eb 63 6e 1d 20 bb 0a 48 2e |ll.O.H..cn. ..H.|
+00000030 45 4e 86 2d ae d6 fb 3e 0c 3e 9f a3 17 4a e3 39 |EN.-...>.>...J.9|
+00000040 58 a7 92 92 cb 30 03 0d be b5 79 a5 00 04 13 01 |X....0....y.....|
+00000050 00 ff 01 00 00 79 00 0b 00 04 03 00 01 02 00 0a |.....y..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000070 00 00 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 |................|
+00000080 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
+00000090 08 06 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 |.........+......|
+000000a0 2d 00 02 01 01 00 33 00 26 00 24 00 1d 00 20 f0 |-.....3.&.$... .|
+000000b0 8e 19 a6 04 b7 f1 b0 cd a1 28 bb 10 60 30 92 dc |.........(..`0..|
+000000c0 bc 7a 1c fc a7 f4 dc 01 2e 88 f3 0e 80 82 71 |.z............q|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 04 08 64 e1 |........... ..d.|
-00000030 9d db 92 a5 4e 0c 6e 90 71 c3 ed 51 c6 23 f5 6e |....N.n.q..Q.#.n|
-00000040 64 55 94 28 37 54 58 00 23 a0 53 56 13 02 00 00 |dU.(7TX.#.SV....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 bb 0a 48 2e |........... ..H.|
+00000030 45 4e 86 2d ae d6 fb 3e 0c 3e 9f a3 17 4a e3 39 |EN.-...>.>...J.9|
+00000040 58 a7 92 92 cb 30 03 0d be b5 79 a5 13 01 00 00 |X....0....y.....|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 69 01 91 62 e2 e7 |..........i..b..|
-00000090 ee 89 ea b5 55 95 a2 3e 69 09 0a 11 85 42 e8 fd |....U..>i....B..|
-000000a0 c5 17 03 03 00 3e 2d 4a 1f 1b 45 7a f5 bf f8 50 |.....>-J..Ez...P|
-000000b0 b7 90 b7 19 24 8c c6 da 49 79 83 f4 52 10 ed 5d |....$...Iy..R..]|
-000000c0 fa 26 91 28 13 bc a9 c2 f9 6b 4c e9 f7 79 cb 87 |.&.(.....kL..y..|
-000000d0 1d ac a4 7a d9 84 25 e8 68 27 67 7f 85 f9 e1 3e |...z..%.h'g....>|
-000000e0 04 2c fe aa 17 03 03 02 6d ca f8 97 e5 6f f8 f7 |.,......m....o..|
-000000f0 1a 8b a1 c2 81 b5 a4 f3 6d d9 83 30 00 6b 4a 92 |........m..0.kJ.|
-00000100 99 0c c1 71 69 c6 57 0b c6 09 8c dd 17 19 14 4f |...qi.W........O|
-00000110 7f 22 f1 d1 28 13 6c b7 e7 89 d7 4b b2 cd 56 e4 |."..(.l....K..V.|
-00000120 b6 b8 7c ca 18 41 43 e7 74 ef 39 c6 b9 dd 3f 23 |..|..AC.t.9...?#|
-00000130 62 fa 59 70 1c 7c ff e9 41 d0 04 fe ae f4 25 75 |b.Yp.|..A.....%u|
-00000140 0f b1 cf b9 b0 bb 95 50 be 9a be 9a 7a 1c 03 3b |.......P....z..;|
-00000150 ae 01 ee 91 aa f6 7a 47 40 67 f4 1b 5b 86 36 58 |......zG@g..[.6X|
-00000160 88 0f 68 1a 9d cd 1a e1 aa 3e 61 77 67 fd 5a aa |..h......>awg.Z.|
-00000170 96 b9 8f cd fe 28 68 ed 25 0f 7f 8a a1 31 24 44 |.....(h.%....1$D|
-00000180 bd 4a 03 e8 f8 cc 63 d1 fc 12 eb c0 47 4c 30 1e |.J....c.....GL0.|
-00000190 82 77 4d 45 50 03 d4 2c 0b a3 d7 af 0c 7e 61 68 |.wMEP..,.....~ah|
-000001a0 98 c0 5f cf b9 54 75 be 76 08 9e 68 07 62 96 8c |.._..Tu.v..h.b..|
-000001b0 b8 24 0e b9 c4 2a 27 72 72 de 00 d1 38 a5 42 8b |.$...*'rr...8.B.|
-000001c0 38 23 78 9e 68 c2 d6 62 db 82 5a 46 5b 57 19 a4 |8#x.h..b..ZF[W..|
-000001d0 11 00 7c e9 14 56 79 ea ac 24 26 c0 d4 16 45 8c |..|..Vy..$&...E.|
-000001e0 28 ca 88 6f 72 f3 f8 18 26 3f 00 e5 62 c2 9f 67 |(..or...&?..b..g|
-000001f0 46 9f 99 f1 61 af b7 b0 05 42 59 13 5b 0f 0d a7 |F...a....BY.[...|
-00000200 bc 9e 7e 3f 6e 24 74 bf 93 a0 9d 09 89 a8 a6 4d |..~?n$t........M|
-00000210 07 5d aa 24 2c 86 e5 80 7f 4b a3 c3 02 41 8b e5 |.].$,....K...A..|
-00000220 56 7a be 9f 5f b0 9d 41 51 e6 b8 d8 67 66 df 89 |Vz.._..AQ...gf..|
-00000230 00 07 83 06 8b 5b 84 e6 8a 92 3c de 1f 4c 2b bc |.....[....<..L+.|
-00000240 9d 7f ec e8 c3 0e ee 4a 80 2c e4 f0 d7 84 b3 a8 |.......J.,......|
-00000250 7d c7 f5 91 b9 91 43 14 45 77 a4 84 f7 a6 72 f0 |}.....C.Ew....r.|
-00000260 cd a2 7f 12 b6 e2 6f d3 93 5a d9 c8 39 4b 95 29 |......o..Z..9K.)|
-00000270 2a be 4c dd a5 82 ec da ee 98 c9 0f 10 18 e4 da |*.L.............|
-00000280 f4 3f 33 86 11 e4 5c 36 05 07 02 d1 21 5d 48 5f |.?3...\6....!]H_|
-00000290 8b ec b1 33 25 65 ef 33 d4 87 6e f9 cf f8 e4 79 |...3%e.3..n....y|
-000002a0 f8 23 82 10 1e 5e c5 e7 60 82 6d b5 57 3c 54 f3 |.#...^..`.m.W.Oq.n|
-00000370 b0 04 89 76 d0 4e be 85 cc b1 dc c6 f0 ba 0c a8 |...v.N..........|
-00000380 81 86 0d 8d bf d0 93 c5 3a 28 a8 ac df f9 7c eb |........:(....|.|
-00000390 10 4b bc dc 1b a7 4d f9 25 b3 09 9a 80 6f 83 0e |.K....M.%....o..|
-000003a0 9d 62 a9 6e 33 d8 85 96 78 3d f1 1f b7 6b 87 f7 |.b.n3...x=...k..|
-000003b0 30 dd 09 ea 06 f3 cc 7a 82 96 e8 f7 cd f2 99 7f |0......z........|
-000003c0 53 da dd ab b6 f2 da 94 94 cf b1 6f 21 e2 7b 9f |S..........o!.{.|
-000003d0 90 ab 18 fc 61 84 d6 97 87 a0 14 2e cf 02 42 74 |....a.........Bt|
-000003e0 68 a0 5b cc 1a 63 fc 4e e0 a9 ca 59 89 ae fc ef |h.[..c.N...Y....|
-000003f0 41 54 65 cf 17 03 03 00 45 ba bb ae e4 a3 04 5c |ATe.....E......\|
-00000400 30 19 79 ff 6a b5 0c dc ab c8 cd e5 bf 2d 9c 3e |0.y.j........-.>|
-00000410 44 98 1b cd bb 2a 08 10 75 ab b9 d1 62 a5 e1 21 |D....*..u...b..!|
-00000420 51 32 75 38 89 67 83 3b 3f f5 e7 71 53 8f 2f d0 |Q2u8.g.;?..qS./.|
-00000430 81 98 cb 75 b2 99 40 bf 01 a0 bb 0b b0 0e |...u..@.......|
+00000080 03 03 00 01 01 17 03 03 00 17 1a 9d c2 a8 12 c1 |................|
+00000090 c3 97 41 bd 1f 6e 48 98 36 4b 13 cd b9 9f 70 34 |..A..nH.6K....p4|
+000000a0 60 17 03 03 00 3e f8 19 ab 88 f7 15 07 97 72 ec |`....>........r.|
+000000b0 41 6c 0a 64 b3 26 4a 56 21 20 d7 9c a2 84 06 ab |Al.d.&JV! ......|
+000000c0 cb e6 99 1b 45 ce ca e7 c6 57 04 c9 3a 76 84 97 |....E....W..:v..|
+000000d0 fe a3 be 60 b2 2c 53 31 ab cd 49 d5 fc 59 80 69 |...`.,S1..I..Y.i|
+000000e0 38 d3 66 32 17 03 03 02 6d 8f 8b 7a 7d 78 d3 4b |8.f2....m..z}x.K|
+000000f0 98 1e 0b 05 38 60 58 d0 0a 7a f8 a7 70 53 67 ce |....8`X..z..pSg.|
+00000100 ea ed 86 3e 79 9d 37 66 b2 61 be 34 bf 15 5a d8 |...>y.7f.a.4..Z.|
+00000110 4e fb 52 62 8d e2 ae e9 58 b9 bc f9 e9 75 81 16 |N.Rb....X....u..|
+00000120 af fa 92 c3 aa ac d2 2c 7b c2 21 2f b0 0d e9 53 |.......,{.!/...S|
+00000130 d3 e3 ec d5 e7 95 23 83 d9 b1 ff 25 55 47 6a 1c |......#....%UGj.|
+00000140 97 37 84 9a ce 67 15 63 0f ff 24 63 af 43 8a 7d |.7...g.c..$c.C.}|
+00000150 46 63 bb 33 67 7a de 86 b4 6a 70 2d 6a 7f 82 c2 |Fc.3gz...jp-j...|
+00000160 24 3c e1 0f a9 7f 93 76 d2 c9 e2 56 d3 cb b9 17 |$<.....v...V....|
+00000170 97 2f 8a 25 40 dc 35 e4 00 3a 3f 2b 1e 09 1b f2 |./.%@.5..:?+....|
+00000180 12 2a 76 c0 2e cd 17 06 32 a9 f8 08 70 3f 06 fa |.*v.....2...p?..|
+00000190 c7 1b c4 50 4f b8 1e 0f 6f 6a 3a ba f6 28 1b d0 |...PO...oj:..(..|
+000001a0 a7 34 a5 8c 02 fe 35 4f b4 97 45 96 48 bc b9 0d |.4....5O..E.H...|
+000001b0 c9 2f df bd c1 8b 19 44 33 12 90 2c d2 99 09 36 |./.....D3..,...6|
+000001c0 97 3f 29 56 30 77 15 df 15 c9 b1 26 9c f4 6a 59 |.?)V0w.....&..jY|
+000001d0 00 3e d8 28 74 19 6c 38 6c 68 63 16 ab cb f0 3d |.>.(t.l8lhc....=|
+000001e0 ce 30 f6 9c 06 00 06 cc 5a 8e 78 73 af 53 a4 e6 |.0......Z.xs.S..|
+000001f0 49 10 5b 9d 4d f3 7d 48 f0 5d 87 27 d8 7e 58 a6 |I.[.M.}H.].'.~X.|
+00000200 86 51 a0 d6 e8 82 20 6b d3 f9 99 4d 11 b7 49 ad |.Q.... k...M..I.|
+00000210 f9 1a 1b f5 cd 81 81 bd 51 76 a4 5a 5f 35 7a 52 |........Qv.Z_5zR|
+00000220 12 1b 73 f6 f3 1d cf 93 7a 8e a0 1d 4c f3 b2 f5 |..s.....z...L...|
+00000230 16 00 57 21 2f c6 85 af 8c 8b f9 bd 2a f1 ee 15 |..W!/.......*...|
+00000240 ec ee 80 b9 8b 0a 50 36 cb 53 fd ca 53 b4 0e 96 |......P6.S..S...|
+00000250 7b db e6 93 f7 9e 8d e4 6a d5 ff e3 74 31 76 3a |{.......j...t1v:|
+00000260 a8 de ce 06 97 3d 4e 91 c5 cd 85 06 c9 a6 02 91 |.....=N.........|
+00000270 f9 36 33 8d 28 23 54 f5 c3 f0 b2 1a a1 6b b7 c6 |.63.(#T......k..|
+00000280 d1 c3 31 ad d6 6f 0c 44 e4 34 d8 26 b6 ff 06 6f |..1..o.D.4.&...o|
+00000290 f3 56 19 46 8d f3 75 c2 d9 69 4a 5b ff 3a b8 1d |.V.F..u..iJ[.:..|
+000002a0 86 a9 6f 45 dc 3a e4 aa 9b 7d 3a 5a 50 ad c6 f6 |..oE.:...}:ZP...|
+000002b0 8c e3 0e ca b6 7a 99 e7 4b 58 26 c2 18 95 14 a4 |.....z..KX&.....|
+000002c0 f9 ae 79 4f f6 c0 f8 0e d4 52 fb 3c 5d a2 30 9c |..yO.....R.<].0.|
+000002d0 ea d9 8d f4 27 4c 6f 7a 02 45 8f ca 8c b1 bc d2 |....'Loz.E......|
+000002e0 c5 dc 8b 09 d7 c4 0f ea f6 51 be f7 cd 01 1e 78 |.........Q.....x|
+000002f0 a1 37 4a 88 ae 5f c5 79 9c e2 4d c9 74 e7 2e 18 |.7J.._.y..M.t...|
+00000300 86 e8 62 3f 6c 39 73 eb c2 e2 54 0c 13 ca f6 57 |..b?l9s...T....W|
+00000310 20 92 6a 1d 03 28 d0 53 6f 6e cb 57 da 33 20 1a | .j..(.Son.W.3 .|
+00000320 c8 3d 09 73 5f 28 14 6f 4c 16 8c 41 cd 44 ad df |.=.s_(.oL..A.D..|
+00000330 77 08 0f f1 3c 4c 2b 37 03 60 9d 07 85 e7 66 f7 |w........55.BL...|
+00000400 3e 26 15 0a f1 c3 a6 ab 94 a3 72 bd c7 04 22 bc |>&........r...".|
+00000410 67 32 15 16 23 f5 50 97 bc 7f ab f8 ef f0 02 7d |g2..#.P........}|
+00000420 2d 76 01 18 72 18 77 c1 f5 9b e9 e9 97 8d |-v..r.w.......|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 02 11 25 5d 22 6c 20 |...........%]"l |
-00000010 8a 8e d3 aa 97 5a 96 46 a0 69 a3 5c 0f d4 ad c0 |.....Z.F.i.\....|
-00000020 6f e4 6f df 99 28 d3 e1 bd ce a5 8c 69 6a c4 9b |o.o..(......ij..|
-00000030 a5 eb e2 d8 db a4 1d ea 55 ff be c2 14 dc 63 74 |........U.....ct|
-00000040 b8 4d 44 aa 87 65 5c 1e a2 10 8c 0f ae 0c 0e 76 |.MD..e\........v|
-00000050 89 4c 05 65 c5 19 e3 d4 d1 eb 9e e5 2d 8a 62 ae |.L.e........-.b.|
-00000060 55 d6 a3 37 46 9b 3c 4c ad d0 82 7e 0a 36 48 38 |U..7F.4a.|
-00000130 a6 1e 18 45 1a c5 1c 8a aa ad cd 67 bf 37 30 46 |...E.......g.70F|
-00000140 37 eb 13 1f c2 6a 7f 39 47 b8 91 a4 c9 9e 70 7c |7....j.9G.....p||
-00000150 73 62 69 7b c1 30 99 97 d3 34 2f 83 84 3d de a8 |sbi{.0...4/..=..|
-00000160 dc b5 ce d4 69 ff 5e a8 b8 31 05 e0 6b 3b 14 93 |....i.^..1..k;..|
-00000170 10 11 51 ae e6 29 df 54 34 30 01 6c 46 24 76 3a |..Q..).T40.lF$v:|
-00000180 dd 24 f1 84 d3 27 a7 45 9a 19 4a 09 63 7b 00 6d |.$...'.E..J.c{.m|
-00000190 b8 11 72 06 e4 8a aa b2 3b 08 eb 17 ae 88 18 18 |..r.....;.......|
-000001a0 51 8f fb 80 5f 01 2a 2c bc 47 10 cf da d1 ec 11 |Q..._.*,.G......|
-000001b0 34 6d fd d0 c1 c0 a7 26 f3 3a 2e 43 7f 3a 63 eb |4m.....&.:.C.:c.|
-000001c0 7b e4 a5 c8 23 ff 6b 7a e9 8e 70 c4 9d 39 b4 3c |{...#.kz..p..9.<|
-000001d0 4d 40 bc 1e ff e4 7d 47 13 54 64 e7 98 7f cd df |M@....}G.Td.....|
-000001e0 90 89 19 89 92 8c 39 1b 5c 53 4b c2 7b 38 5c 5a |......9.\SK.{8\Z|
-000001f0 01 e3 2f f9 a3 f5 a2 c0 79 ff 99 a9 89 40 91 40 |../.....y....@.@|
-00000200 4e 96 73 15 f5 16 bd ac be e3 ef fa 8a b8 df bf |N.s.............|
-00000210 ec 86 3b 67 93 59 45 6a b8 ce a1 04 17 03 03 00 |..;g.YEj........|
-00000220 99 21 d2 f9 b5 d7 ca 07 c4 b9 f7 80 87 c4 ce 95 |.!..............|
-00000230 8f fa f0 a9 c6 99 89 93 18 50 b6 1b 4c ae ff e7 |.........P..L...|
-00000240 2b 29 81 14 20 6a 13 bc 7f 6c b2 6f e4 09 b7 96 |+).. j...l.o....|
-00000250 49 93 37 2b 1d 7e 16 3f b0 bd 22 dd 0f 04 71 29 |I.7+.~.?.."...q)|
-00000260 38 eb dc a8 85 48 68 17 59 72 0b f2 4f 78 4c 30 |8....Hh.Yr..OxL0|
-00000270 db bf 60 a0 56 80 be aa 80 fd ab 87 55 2e 49 6d |..`.V.......U.Im|
-00000280 47 38 b9 b1 b4 c2 05 09 16 28 e5 89 dd f1 3d 32 |G8.......(....=2|
-00000290 83 66 fb ca de 37 9c ed 74 2a 7b a1 3a 50 0c 4d |.f...7..t*{.:P.M|
-000002a0 4c 44 bd 3b 3a 76 33 1c e1 46 91 95 02 a7 b7 a3 |LD.;:v3..F......|
-000002b0 9b 3b 9c 19 0a b5 5d 81 32 66 17 03 03 00 45 b6 |.;....].2f....E.|
-000002c0 a2 53 eb aa 3c 74 29 1c 36 1e 9f fb 30 c9 48 5c |.S...||
+00000000 14 03 03 00 01 01 17 03 03 02 11 4b 29 10 c9 7b |...........K)..{|
+00000010 98 9a fa ce 7a 17 a4 7d 15 5f 97 4f 40 67 37 f0 |....z..}._.O@g7.|
+00000020 0b 2d ca 62 77 23 ab 78 d7 9f b6 1d 5c 64 fb 68 |.-.bw#.x....\d.h|
+00000030 70 5f 21 df e1 55 3b e3 bb 8e 61 31 11 ba 2b eb |p_!..U;...a1..+.|
+00000040 de 78 39 5c 31 62 a3 fb 9a 57 a4 50 34 43 76 55 |.x9\1b...W.P4CvU|
+00000050 ae f9 36 b1 35 ee 2b 8d ab c2 70 52 b0 8c d6 1b |..6.5.+...pR....|
+00000060 fe 0f fc 5e 79 c3 cf ab d3 9a 81 af 63 2c b3 f7 |...^y.......c,..|
+00000070 a6 b7 13 c4 70 22 fa 56 6d 77 cb d1 bf a5 9e c8 |....p".Vmw......|
+00000080 74 83 80 f9 9a 19 f3 a3 94 15 72 7c 55 0e 21 47 |t.........r|U.!G|
+00000090 2b a2 d3 b8 74 e1 07 37 7f 12 f6 ad ba 71 e5 ca |+...t..7.....q..|
+000000a0 17 42 2b 78 9e 90 7d 28 b1 f4 dd 7d b8 69 dd c6 |.B+x..}(...}.i..|
+000000b0 eb 3d 93 45 06 ac 5d fe 02 18 b8 f3 8c e4 4e 97 |.=.E..].......N.|
+000000c0 05 8b 36 94 cb 0f 66 64 ed a8 50 22 ba c8 a7 23 |..6...fd..P"...#|
+000000d0 7d f9 d5 4f d5 27 83 f3 b6 09 3f 4f 69 92 6d be |}..O.'....?Oi.m.|
+000000e0 4a 30 02 d2 d5 e6 14 d4 21 e2 c8 5b cb 08 1e 9a |J0......!..[....|
+000000f0 28 f7 f4 13 8c 58 9b 69 2c 55 3d 78 f2 ce 93 89 |(....X.i,U=x....|
+00000100 2f 62 56 ea a3 21 96 f6 e7 ee a4 3d d8 7d 86 4d |/bV..!.....=.}.M|
+00000110 79 c9 3b c8 cf ea a0 6b 5f 29 8c ed c2 d6 73 27 |y.;....k_)....s'|
+00000120 a0 35 bb 2b 8b 6c 4e 59 74 e5 84 c4 d2 1a f1 0d |.5.+.lNYt.......|
+00000130 5c 36 33 f7 42 d6 08 c3 f8 5b ea 27 a1 cc b9 72 |\63.B....[.'...r|
+00000140 d5 b9 4e 17 36 b3 05 29 50 da 52 bc 23 f7 82 82 |..N.6..)P.R.#...|
+00000150 c0 67 2b 80 a2 7f e2 ec b9 12 bb dc b6 04 b6 4f |.g+............O|
+00000160 87 15 16 13 de c4 1c 04 71 33 ba d7 a7 da f1 f5 |........q3......|
+00000170 77 c6 4e 8e b2 65 a1 6c a8 c2 5b a1 f5 da 49 6c |w.N..e.l..[...Il|
+00000180 85 ee 21 8d 10 6b 82 bf 0c 0f 7e 33 8b 5e 44 5b |..!..k....~3.^D[|
+00000190 70 db bc 76 40 a0 5c 02 f6 8a 9b de aa a4 b2 94 |p..v@.\.........|
+000001a0 d0 e0 b7 60 af df ad 3d e3 17 a9 60 e0 d9 a8 3e |...`...=...`...>|
+000001b0 c6 06 9b ad 97 0b dc 21 16 9d 42 29 74 a1 f5 03 |.......!..B)t...|
+000001c0 d4 15 0d ee fd fa 6b 85 12 2f 8c 26 fd 96 ce 85 |......k../.&....|
+000001d0 a5 b7 ba bb ac 8a 6d 54 f5 fd e6 6c 32 24 a9 e7 |......mT...l2$..|
+000001e0 1a 11 bf 4d cb f9 18 9a b8 1e a6 e4 1f 61 b1 ce |...M.........a..|
+000001f0 1c ca 5d 81 e7 84 e0 a9 4e c7 f9 5d 71 72 76 4b |..].....N..]qrvK|
+00000200 65 ca 3a a4 4d d8 ec 82 aa 33 80 bb 15 48 2d 7c |e.:.M....3...H-||
+00000210 4e 5e d2 ec 13 1a e7 03 d5 29 95 80 17 03 03 00 |N^.......)......|
+00000220 99 60 a2 43 34 23 c0 a4 4c 0a 18 c5 27 96 2f 7c |.`.C4#..L...'./||
+00000230 af 2b 2c 36 f2 9b cf 93 e7 3e 79 3b 20 d4 3b 60 |.+,6.....>y; .;`|
+00000240 a2 ef af 36 d5 45 d4 20 89 be 80 1d 1e ca f7 19 |...6.E. ........|
+00000250 35 8f 26 3f be c0 a2 f6 c6 85 a3 88 76 cd 06 f9 |5.&?........v...|
+00000260 4f ff 54 79 6c ac 33 71 31 90 70 36 eb 9c c1 b4 |O.Tyl.3q1.p6....|
+00000270 4a c8 3a 52 85 2b be 4a 19 8a 24 fd 6f 08 47 19 |J.:R.+.J..$.o.G.|
+00000280 84 88 a0 48 f6 17 80 f8 fe 9e 21 68 e1 75 17 14 |...H......!h.u..|
+00000290 d4 e2 3a e2 de 9d 19 56 ad cc 33 13 f3 52 b2 1b |..:....V..3..R..|
+000002a0 f4 65 04 05 79 9f 3e 14 fb 1f 9c d1 c4 53 c0 93 |.e..y.>......S..|
+000002b0 49 ad 3c 2e de c1 b4 fe be b3 17 03 03 00 35 32 |I.<...........52|
+000002c0 81 98 1a 6c 38 ca 67 64 c5 30 0b 81 7d fd a1 b9 |...l8.gd.0..}...|
+000002d0 2e af 41 1d e9 b7 31 17 d8 08 ce d5 f6 12 4d da |..A...1.......M.|
+000002e0 fc db fb e1 fa 5b cd 70 12 e7 bb 26 dd 53 9c 43 |.....[.p...&.S.C|
+000002f0 02 06 1f 70 |...p|
>>> Flow 4 (server to client)
-00000000 17 03 03 02 9b fe 23 52 d0 ff dd ef e2 10 c1 70 |......#R.......p|
-00000010 a1 c1 ac d6 e7 30 63 41 07 d5 04 ef 11 ee e7 57 |.....0cA.......W|
-00000020 81 14 5b 81 9d 35 3f 73 be 44 15 6b ed 8c b7 e0 |..[..5?s.D.k....|
-00000030 59 2c d7 0b 0c aa 7a 18 6a da d6 90 19 64 54 d5 |Y,....z.j....dT.|
-00000040 30 73 cf 0e c8 d1 8a 69 a6 68 a4 ce 61 2f c8 4a |0s.....i.h..a/.J|
-00000050 58 81 42 1c 5f ee b3 fc 05 66 bf d0 14 45 8f ab |X.B._....f...E..|
-00000060 da 82 fe 86 da 1f b0 f6 d5 12 14 1e 78 d0 1c e8 |............x...|
-00000070 e7 a3 5e af e6 71 42 45 70 4c 95 4a 16 a0 0e a4 |..^..qBEpL.J....|
-00000080 27 6b c4 53 35 63 2a 19 76 d7 e0 7c 92 a2 89 df |'k.S5c*.v..|....|
-00000090 be 1f 5d 03 24 06 de 3e d9 c0 12 91 d4 3d 86 a7 |..].$..>.....=..|
-000000a0 b6 8b ed 31 e5 81 cc 5e 76 72 25 15 ba 78 54 ab |...1...^vr%..xT.|
-000000b0 5b a1 a7 68 e6 44 3f a3 f5 e9 3d 10 ed b5 21 f5 |[..h.D?...=...!.|
-000000c0 02 fd 48 cc 9f 1a 2c 4e 47 4b 37 39 5a 8b 42 32 |..H...,NGK79Z.B2|
-000000d0 69 52 e6 ae ba 80 80 af 8d 67 d1 38 bb bb 97 55 |iR.......g.8...U|
-000000e0 2a 69 28 ef c5 8e 49 fc 87 7a 45 64 57 cf 76 01 |*i(...I..zEdW.v.|
-000000f0 94 57 a2 11 13 5e 99 05 6c 7c 52 97 fb 4c 81 09 |.W...^..l|R..L..|
-00000100 68 5d c6 91 ef cc 0f 77 71 ac 55 53 d8 2d cb 26 |h].....wq.US.-.&|
-00000110 d5 0e c9 36 70 83 85 dd 7d 7e 0d 22 24 26 91 ec |...6p...}~."$&..|
-00000120 3d b0 e1 c3 62 22 a9 09 a2 e4 ba e4 4d 53 ec c1 |=...b"......MS..|
-00000130 56 c5 b5 92 9a 33 00 f6 21 2c a3 9e 78 85 8e 65 |V....3..!,..x..e|
-00000140 24 e5 ad b6 02 26 4d 03 8d 02 62 3c b0 16 3c 2e |$....&M...b<..<.|
-00000150 c2 4a 10 11 45 93 2b 96 87 d0 8e 22 43 ca ad 7f |.J..E.+...."C...|
-00000160 fe ac db 12 e1 9d e0 ff 03 93 d1 90 cc 9c 27 19 |..............'.|
-00000170 1b c5 ba 62 39 55 38 17 44 76 d4 2a 63 54 47 c9 |...b9U8.Dv.*cTG.|
-00000180 de db f0 59 ee 6e ed 26 11 93 07 15 eb 03 98 87 |...Y.n.&........|
-00000190 bd 15 98 29 14 8b 7a 6c b2 08 6d 86 35 64 0f 4e |...)..zl..m.5d.N|
-000001a0 73 e3 60 86 8a 3a 68 0f e8 74 07 78 1d c2 96 fe |s.`..:h..t.x....|
-000001b0 b9 0c 4b 0b 31 39 8b 9e 9d 86 57 5e 5c f6 fc 7b |..K.19....W^\..{|
-000001c0 fc bd 9b 01 6e a2 33 c4 0a 00 89 22 13 45 2b e2 |....n.3....".E+.|
-000001d0 6b 9c 1e 35 b7 df 9e 27 3b 38 26 e4 60 c7 ee a5 |k..5...';8&.`...|
-000001e0 9e c2 24 38 ee 3d 44 79 07 77 bc a9 bc 4a 4c 7d |..$8.=Dy.w...JL}|
-000001f0 9f d9 e8 9c 91 88 75 92 98 74 a0 e1 ef be 66 3c |......u..t....f<|
-00000200 77 be 3f 1c 24 4d 96 49 23 a3 cd 80 60 9a b0 5b |w.?.$M.I#...`..[|
-00000210 fa f2 79 54 0d cb 08 7b 52 93 1c 8d ba 18 f3 ce |..yT...{R.......|
-00000220 5b 3f c8 c4 4c 12 00 9f 1f 9c 57 d9 16 d5 a2 05 |[?..L.....W.....|
-00000230 c3 fa 4e 6d 7e 78 d5 99 33 0f 07 60 1a e9 58 aa |..Nm~x..3..`..X.|
-00000240 37 57 4b a4 1c 20 99 29 4c 52 af 1f 02 64 01 87 |7WK.. .)LR...d..|
-00000250 a1 fe 73 09 fa ff 04 f6 91 23 0c 56 16 08 16 ba |..s......#.V....|
-00000260 3c bb a9 c4 b2 a1 f6 93 45 c0 1a b7 43 9d e2 d5 |<.......E...C...|
-00000270 ea dc d1 03 ec 32 83 55 00 59 40 2e 41 8f 52 0e |.....2.U.Y@.A.R.|
-00000280 51 22 e9 39 07 04 40 82 ee e8 f9 4a a3 83 63 b6 |Q".9..@....J..c.|
-00000290 2e 9a e8 d2 21 04 dd c0 8f a0 e8 33 55 87 3c f3 |....!......3U.<.|
-000002a0 17 03 03 00 1e 17 c1 06 2e 7b c7 3e a7 12 4f e2 |.........{.>..O.|
-000002b0 96 ac 58 bc 0b 22 95 47 19 5e e0 35 f2 53 0f 78 |..X..".G.^.5.S.x|
-000002c0 1d db 93 17 03 03 00 13 9a da 86 87 00 57 0a a0 |.............W..|
-000002d0 e6 4f 26 1a e8 9c 5a 5d 89 19 9a |.O&...Z]...|
+00000000 17 03 03 02 8b 8e b1 29 40 b6 53 bc 89 c7 87 69 |.......)@.S....i|
+00000010 4c 6d 5b 61 d9 ba 5b 96 22 ac 57 71 58 f8 0e ea |Lm[a..[.".WqX...|
+00000020 81 ea bf f9 34 6d a0 ce 1f d2 97 52 62 2b 9e f7 |....4m.....Rb+..|
+00000030 03 28 96 56 c0 a1 0e 69 7c 98 13 e5 91 8c 48 5f |.(.V...i|.....H_|
+00000040 4e 78 87 14 38 f8 fa 3c 17 97 f9 de 38 3b cf 0f |Nx..8..<....8;..|
+00000050 d9 dd 41 0a bb 65 ca a7 0b fd a5 11 c2 c3 6a b8 |..A..e........j.|
+00000060 5a e1 68 a1 8d f8 35 9d c6 e1 3e e1 03 a9 06 ee |Z.h...5...>.....|
+00000070 1f 92 ca b5 f4 df 3e e5 69 63 9e a2 ea 5e b8 d9 |......>.ic...^..|
+00000080 26 31 9e 25 de a8 ea 44 1a c0 86 0b 38 75 04 dc |&1.%...D....8u..|
+00000090 2d 37 ad 40 e3 2f d1 b0 9e 9e 64 57 8b 31 20 d6 |-7.@./....dW.1 .|
+000000a0 16 64 fd 1b c1 01 58 af 4b 88 49 23 7a f6 a2 15 |.d....X.K.I#z...|
+000000b0 ca 02 4b d6 6d 7c f8 7a c9 c0 0d 32 6e 1d 83 ca |..K.m|.z...2n...|
+000000c0 47 e5 6f 86 a0 f7 8b 50 1d 91 ec fa 2b 4a 72 f7 |G.o....P....+Jr.|
+000000d0 a0 09 f1 65 fb 81 32 d2 a0 be 18 07 9f 5d 89 98 |...e..2......]..|
+000000e0 08 09 a6 1d 9a 5a 10 67 81 58 82 00 9d 01 48 a8 |.....Z.g.X....H.|
+000000f0 5b df 54 b3 cd 84 87 e0 41 e6 1e 47 46 33 56 0c |[.T.....A..GF3V.|
+00000100 67 82 b9 bc 28 68 f3 5b 51 a8 c0 0e 43 14 62 bb |g...(h.[Q...C.b.|
+00000110 8a bd 3f 4d d6 33 c4 76 4f c1 06 f8 9b bf 64 41 |..?M.3.vO.....dA|
+00000120 6c e5 40 8d 93 4a 6b 6f fe 72 6b db ac 35 b4 fc |l.@..Jko.rk..5..|
+00000130 84 13 fa 8a 7d 35 e3 73 12 eb 1a 5f a9 e2 28 53 |....}5.s..._..(S|
+00000140 0c 6d 41 ec 4b 76 f5 d9 48 2a c2 85 2a 1f 7d 61 |.mA.Kv..H*..*.}a|
+00000150 f6 1f 27 ef 47 c9 c7 b3 19 5c 07 d5 18 ec fd 3e |..'.G....\.....>|
+00000160 78 41 cb a4 3a 47 22 cf 7e 7e 17 be 27 c4 90 ce |xA..:G".~~..'...|
+00000170 2a cb cd ed 0f a3 bf 1e 4c 62 7a 80 ff 21 38 c5 |*.......Lbz..!8.|
+00000180 c2 37 9f 62 4b d8 c0 9e df ae 3c 69 cd 25 f5 65 |.7.bK.....>> Flow 1 (client to server)
-00000000 16 03 01 00 e0 01 00 00 dc 03 03 a7 91 25 cb c3 |.............%..|
-00000010 c2 53 ec 92 0f e7 4c 06 3a 35 ee c9 09 f1 6a 94 |.S....L.:5....j.|
-00000020 27 bf 12 7d f8 e5 c3 1a 45 dc a0 20 c8 75 ac df |'..}....E.. .u..|
-00000030 fc 9f f5 43 eb ee 5a d8 94 3a f8 10 2d 42 d4 fd |...C..Z..:..-B..|
-00000040 2c 80 9f 13 73 c9 02 77 32 c0 50 59 00 08 13 02 |,...s..w2.PY....|
-00000050 13 03 13 01 00 ff 01 00 00 8b 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 1e |................|
-00000090 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................|
-000000a0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 00 2b |...............+|
-000000b0 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 |......-.....3.&.|
-000000c0 24 00 1d 00 20 ab 7a fe 9c a7 15 e8 53 6d 6e be |$... .z.....Smn.|
-000000d0 8b 1f 25 bb f9 6c 15 4c ca 78 c0 b6 b1 20 ab 03 |..%..l.L.x... ..|
-000000e0 3d 09 06 cc 49 |=...I|
+00000000 16 03 01 00 ca 01 00 00 c6 03 03 15 b6 db 09 24 |...............$|
+00000010 50 ea d6 f7 ae d7 32 2f 72 25 23 db 11 ad 6f c1 |P.....2/r%#...o.|
+00000020 5d 62 af e7 93 63 1a 8b f3 82 80 20 5f 15 2e 86 |]b...c..... _...|
+00000030 86 2c 2e 2f 82 11 3c d2 9f 00 32 d4 3d 05 04 fa |.,./..<...2.=...|
+00000040 36 41 8d dc 30 ce a6 2b 6e d4 3c 9c 00 04 13 01 |6A..0..+n.<.....|
+00000050 00 ff 01 00 00 79 00 0b 00 04 03 00 01 02 00 0a |.....y..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000070 00 00 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 |................|
+00000080 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
+00000090 08 06 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 |.........+......|
+000000a0 2d 00 02 01 01 00 33 00 26 00 24 00 1d 00 20 98 |-.....3.&.$... .|
+000000b0 b7 40 03 d8 a3 4c 9e 16 82 77 16 9b c1 17 3a 2a |.@...L...w....:*|
+000000c0 fc 25 73 5d 2d 5c dc 15 78 36 12 7a 28 f2 0e |.%s]-\..x6.z(..|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 c8 75 ac df |........... .u..|
-00000030 fc 9f f5 43 eb ee 5a d8 94 3a f8 10 2d 42 d4 fd |...C..Z..:..-B..|
-00000040 2c 80 9f 13 73 c9 02 77 32 c0 50 59 13 02 00 00 |,...s..w2.PY....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 5f 15 2e 86 |........... _...|
+00000030 86 2c 2e 2f 82 11 3c d2 9f 00 32 d4 3d 05 04 fa |.,./..<...2.=...|
+00000040 36 41 8d dc 30 ce a6 2b 6e d4 3c 9c 13 01 00 00 |6A..0..+n.<.....|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 c2 3f e2 45 30 ec |...........?.E0.|
-00000090 10 bf f7 4e 69 42 22 e6 80 64 0a a2 29 07 c6 92 |...NiB"..d..)...|
-000000a0 4c 17 03 03 00 3e d1 75 9b 8c a1 3f 5d b3 11 da |L....>.u...?]...|
-000000b0 27 79 d3 9c 7f 54 9b 37 ce 02 b4 60 f6 44 0e cb |'y...T.7...`.D..|
-000000c0 c3 07 b9 bf 4e 77 7c 4b ba f7 2c e3 4c 43 a4 f1 |....Nw|K..,.LC..|
-000000d0 ba ec 0f 7b e5 7a 59 ef 8e e6 68 1e 1c ce d3 11 |...{.zY...h.....|
-000000e0 f9 b1 69 32 17 03 03 02 6d aa e1 b7 df 0e 6a 54 |..i2....m.....jT|
-000000f0 41 c5 aa 05 24 fd 4a 1b 8a 05 4f e7 48 29 48 35 |A...$.J...O.H)H5|
-00000100 66 42 f8 1d 23 9b 68 f4 b6 cf 94 16 af e1 82 93 |fB..#.h.........|
-00000110 30 d5 02 3b e4 aa a9 d7 b2 9c 7f 7f 3c a2 be 0d |0..;........<...|
-00000120 85 96 14 64 1a 6d ff 95 ab 36 1c d1 2b ed a9 89 |...d.m...6..+...|
-00000130 c8 b8 a3 e5 45 e7 18 5a 18 00 c4 d8 96 64 d1 74 |....E..Z.....d.t|
-00000140 1a cb ba ec 9a f4 2d 81 8b 3a 77 e6 57 cc 3a 2b |......-..:w.W.:+|
-00000150 b8 05 82 bf 59 92 3b 92 04 e8 a6 f2 6a 94 c1 46 |....Y.;.....j..F|
-00000160 bd 79 2e 99 7f 7b ea 32 f9 ac b6 90 78 b9 db c8 |.y...{.2....x...|
-00000170 ce 9a e4 88 65 11 8a 03 79 43 d2 81 ce d0 f8 0d |....e...yC......|
-00000180 64 8e 8b ef bc 2f 34 87 cf 4e e5 22 44 1f 55 82 |d..../4..N."D.U.|
-00000190 ab 25 61 df 0f bd e2 ad 73 06 ae e6 08 8d f3 23 |.%a.....s......#|
-000001a0 d6 c6 d4 ea e2 22 b9 eb 75 bd 49 58 8f f4 f6 3b |....."..u.IX...;|
-000001b0 92 e6 a4 18 ba 6d 50 77 65 69 27 ee 82 0f ca 57 |.....mPwei'....W|
-000001c0 db c7 69 e9 7d 6a ff 30 66 e9 8b 6f 10 20 05 fb |..i.}j.0f..o. ..|
-000001d0 53 a7 01 5f d9 8d 11 e5 c2 cb 37 6a 93 a5 26 a3 |S.._......7j..&.|
-000001e0 e2 1b 45 b3 7f 6f e5 32 52 8e 26 f7 88 d6 de b6 |..E..o.2R.&.....|
-000001f0 75 32 a1 95 54 e8 65 38 9d ee 80 e7 7f 6f d8 2d |u2..T.e8.....o.-|
-00000200 5f 29 60 c8 89 00 e6 05 06 b4 c0 b0 e5 ad ed 74 |_)`............t|
-00000210 77 93 30 92 82 06 45 b9 0e e3 1e 09 12 bb f8 16 |w.0...E.........|
-00000220 59 31 a8 51 17 e7 a8 d8 82 44 a0 d6 31 d2 a7 d1 |Y1.Q.....D..1...|
-00000230 54 97 c0 49 62 60 82 79 6a 3c 5a b5 92 aa aa f0 |T..Ib`.yj...v.#.A|
-000002d0 0f 9e 99 7d eb 73 a2 4d 46 49 71 8e fe ab 5c 3d |...}.s.MFIq...\=|
-000002e0 ae fb 1d c8 f0 d1 fc 93 99 96 35 f8 7c 8e ab ea |..........5.|...|
-000002f0 96 eb ea ab f1 e5 71 4e ce fc 4d 38 23 31 86 57 |......qN..M8#1.W|
-00000300 ac e6 31 55 97 f5 57 b3 58 e9 5a 62 d6 5a 61 a0 |..1U..W.X.Zb.Za.|
-00000310 3b a8 0c a5 66 df dc 62 27 e1 5b 10 80 5a 6a 39 |;...f..b'.[..Zj9|
-00000320 7f 83 5c 27 84 6e 95 d4 b6 c4 3e aa 06 a5 bf 81 |..\'.n....>.....|
-00000330 9d 69 05 c1 c0 e6 b4 e1 81 ff 0d 30 9a 7a 00 a3 |.i.........0.z..|
-00000340 ac a0 e8 f0 54 1d bf 53 9c 4b 10 50 0a 6f c9 a1 |....T..S.K.P.o..|
-00000350 9b e2 15 e4 e8 3a 17 03 03 00 99 8a 93 9f 65 05 |.....:........e.|
-00000360 9d e6 76 d8 25 0d 1a 6f bc 4c 9f f3 97 23 f3 5b |..v.%..o.L...#.[|
-00000370 bf 18 13 35 75 de a6 84 d4 d8 b1 ef 5c d4 f0 17 |...5u.......\...|
-00000380 8a 3c c7 f4 00 67 ae ec 65 fa 63 4d 23 86 bf ee |.<...g..e.cM#...|
-00000390 73 0a 84 d8 32 d6 cd 6d da 02 64 77 16 f8 96 4b |s...2..m..dw...K|
-000003a0 ab a8 9f cd 0d ad be de 66 bf 24 24 26 47 38 d3 |........f.$$&G8.|
-000003b0 7e 28 1c 87 98 26 ca d3 ec e6 3a a8 0c 89 19 b5 |~(...&....:.....|
-000003c0 71 8d f3 f8 d5 07 c5 f4 75 f2 c5 17 11 3d d3 d6 |q.......u....=..|
-000003d0 16 e2 ee e9 c9 4c 43 c0 bf 10 fa a2 ff a1 fa 07 |.....LC.........|
-000003e0 db 17 d2 d0 6f 56 cf 67 6c 20 32 42 43 ad 18 a2 |....oV.gl 2BC...|
-000003f0 9d 39 d9 e2 17 03 03 00 45 ba 62 93 44 21 7f 7b |.9......E.b.D!.{|
-00000400 8c 16 13 4a fe b3 e8 dc 13 70 d7 b4 36 8d 2d e1 |...J.....p..6.-.|
-00000410 aa 64 37 b9 8c 15 b4 f4 e7 00 12 94 f1 11 a5 04 |.d7.............|
-00000420 71 5c d6 ec ab e3 62 15 53 95 8e da f1 a1 c8 22 |q\....b.S......"|
-00000430 cf 02 e5 15 85 b2 35 48 a1 11 67 aa 70 1a |......5H..g.p.|
+00000080 03 03 00 01 01 17 03 03 00 17 14 12 e8 30 75 5a |.............0uZ|
+00000090 a4 27 7d 83 2e 51 0e 48 14 7b 53 0c 65 24 71 c5 |.'}..Q.H.{S.e$q.|
+000000a0 44 17 03 03 00 3e 34 38 ac c0 b5 05 e1 03 e1 a3 |D....>48........|
+000000b0 d3 42 ec e3 94 96 e7 a3 05 d8 44 ca 1d 89 b6 6f |.B........D....o|
+000000c0 52 ce 3c 7d 61 f1 b4 a2 83 31 ab cf e7 ca 53 57 |R.<}a....1....SW|
+000000d0 b8 eb f4 7a 8a 7c ce 31 fe a4 b6 c7 a5 ed f2 2d |...z.|.1.......-|
+000000e0 da 36 d6 49 17 03 03 02 6d 2c b4 e1 f3 87 4e c7 |.6.I....m,....N.|
+000000f0 ab db ea fa 0d 31 20 f2 1e 63 1d 10 bd 61 98 a2 |.....1 ..c...a..|
+00000100 50 8d 12 0d c8 5c f8 e4 97 9c 5f f3 47 f4 60 a5 |P....\...._.G.`.|
+00000110 59 16 a2 27 06 94 80 93 af 1e 9d c0 9a 23 20 bf |Y..'.........# .|
+00000120 a4 5a 26 2c 37 86 d8 8a b7 e2 bd e2 4f ab 53 65 |.Z&,7.......O.Se|
+00000130 bd 34 2c 1a 88 72 bf 8f 20 0c e2 51 0f ea 3f 47 |.4,..r.. ..Q..?G|
+00000140 dc 0e cd 21 3c d0 cc 7d 38 b8 b9 1b 20 67 83 a9 |...!<..}8... g..|
+00000150 af 4c f7 7b c0 d9 00 5c 66 e3 d7 2e 3b 6a b5 9c |.L.{...\f...;j..|
+00000160 6e f6 ed 96 25 3c ce ea db fa 85 ba e2 d8 4c 95 |n...%<........L.|
+00000170 92 06 0a 38 19 7f 52 30 2b ef fc 23 c6 b3 e5 d1 |...8..R0+..#....|
+00000180 83 2e 56 65 d6 ef 06 3a 71 d6 39 e9 16 62 65 78 |..Ve...:q.9..bex|
+00000190 59 c1 9f 7f 99 be c2 b9 0b 56 0a db 26 ec 16 15 |Y........V..&...|
+000001a0 be 27 cb bb cf 4a 9c a1 fd 5c 7d 5d c6 df a2 ed |.'...J...\}]....|
+000001b0 f1 70 74 03 40 7c 8f af ea 3c 6a c7 c6 30 98 4c |.pt.@|...>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 19 44 2e d9 de 51 |...........D...Q|
-00000010 eb 6f 4d a5 6e f7 ca 7e e2 54 88 5c 10 82 95 25 |.oM.n..~.T.\...%|
-00000020 ef 79 ab ae 17 03 03 00 45 a6 6e 3e 2c b9 c6 97 |.y......E.n>,...|
-00000030 6d 91 e5 a9 05 d8 d9 aa 69 b9 26 8c 51 24 37 4a |m.......i.&.Q$7J|
-00000040 b7 80 c5 4f 8f bc f5 34 c2 e6 e0 e6 56 c7 af 0a |...O...4....V...|
-00000050 4a d0 6d 98 76 c3 92 02 c3 82 58 44 fb f8 91 76 |J.m.v.....XD...v|
-00000060 df 57 6f 28 3e 84 6e 61 be 74 53 2c 9a 8e |.Wo(>.na.tS,..|
+00000000 14 03 03 00 01 01 17 03 03 00 19 83 88 d2 c3 d4 |................|
+00000010 a8 98 6c 8f fa 1b 52 a5 83 58 e3 62 89 3e 22 a3 |..l...R..X.b.>".|
+00000020 37 b8 ee 13 17 03 03 00 35 b5 5f aa fd ca 85 74 |7.......5._....t|
+00000030 ee c6 06 d9 2e d8 4f 7d 87 a2 b7 20 80 a5 3b 97 |......O}... ..;.|
+00000040 41 bc 80 20 af b5 c4 66 26 2e 39 fd 81 e0 1a a0 |A.. ...f&.9.....|
+00000050 6f c3 08 d0 23 c2 27 49 91 58 77 15 2d 49 |o...#.'I.Xw.-I|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 a3 5e 44 99 71 b2 70 5b 36 d3 17 a9 |.....^D.q.p[6...|
-00000010 eb 0b 02 b2 28 54 9d f7 3d f2 c4 d0 18 e1 fb 62 |....(T..=......b|
-00000020 e2 8a 37 b7 98 2a 98 39 c0 9d 5a 3c 53 99 31 79 |..7..*.9..Z>> Flow 1 (client to server)
-00000000 16 03 01 00 e0 01 00 00 dc 03 03 d8 00 36 18 75 |.............6.u|
-00000010 c8 be 9e c0 c2 8c 7d 8b b5 e7 f3 ab 31 0f 5e af |......}.....1.^.|
-00000020 f2 3c d6 e5 93 26 78 2f 94 19 23 20 8e b2 d2 08 |.<...&x/..# ....|
-00000030 7e 69 f5 38 73 13 2f 6d ba ec ea 29 54 64 32 a0 |~i.8s./m...)Td2.|
-00000040 42 b8 d8 d4 2f 34 db 2f 55 25 54 3f 00 08 13 02 |B.../4./U%T?....|
-00000050 13 03 13 01 00 ff 01 00 00 8b 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 1e |................|
-00000090 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................|
-000000a0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 00 2b |...............+|
-000000b0 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 |......-.....3.&.|
-000000c0 24 00 1d 00 20 39 4b 85 87 27 a7 4c f3 5d 60 0e |$... 9K..'.L.]`.|
-000000d0 27 d9 31 11 0f 9a fc a8 66 14 e5 57 72 3c c5 2b |'.1.....f..Wr<.+|
-000000e0 01 e0 bb 26 29 |...&)|
+00000000 16 03 01 00 ca 01 00 00 c6 03 03 a1 5b 14 56 ac |............[.V.|
+00000010 3f 2b b0 8e e9 0b ae 7e f7 3b 3b 20 90 b6 e4 06 |?+.....~.;; ....|
+00000020 c2 b9 71 88 e4 4c 01 28 41 b3 e8 20 49 01 f7 fc |..q..L.(A.. I...|
+00000030 ce 52 3e f4 58 60 56 7d 36 21 ba 23 87 21 f7 36 |.R>.X`V}6!.#.!.6|
+00000040 48 88 22 78 26 37 27 a4 fc 7a 8b ea 00 04 13 03 |H."x&7'..z......|
+00000050 00 ff 01 00 00 79 00 0b 00 04 03 00 01 02 00 0a |.....y..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000070 00 00 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 |................|
+00000080 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
+00000090 08 06 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 |.........+......|
+000000a0 2d 00 02 01 01 00 33 00 26 00 24 00 1d 00 20 f4 |-.....3.&.$... .|
+000000b0 2c db e8 c0 9e 7d 52 f6 fa 33 fe f7 9a 66 ca 5f |,....}R..3...f._|
+000000c0 a3 28 e9 80 21 28 b8 ef e9 9f 1e 26 9c cf 0f |.(..!(.....&...|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 8e b2 d2 08 |........... ....|
-00000030 7e 69 f5 38 73 13 2f 6d ba ec ea 29 54 64 32 a0 |~i.8s./m...)Td2.|
-00000040 42 b8 d8 d4 2f 34 db 2f 55 25 54 3f 13 02 00 00 |B.../4./U%T?....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 49 01 f7 fc |........... I...|
+00000030 ce 52 3e f4 58 60 56 7d 36 21 ba 23 87 21 f7 36 |.R>.X`V}6!.#.!.6|
+00000040 48 88 22 78 26 37 27 a4 fc 7a 8b ea 13 03 00 00 |H."x&7'..z......|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 34 9b a4 9b 55 78 |..........4...Ux|
-00000090 ad 94 a9 7b 1b 4a 5f 40 23 34 5d 98 87 74 f7 b3 |...{.J_@#4]..t..|
-000000a0 6d 17 03 03 01 50 8d 3f 8c 8d 12 99 a9 bd 78 42 |m....P.?......xB|
-000000b0 cc 8f 26 bf e2 55 12 32 8f 2b 0c c1 e1 13 e4 c0 |..&..U.2.+......|
-000000c0 20 06 4a ce c9 e5 3d 3a ce d8 86 fc 9a 6d 47 59 | .J...=:.....mGY|
-000000d0 ba 11 70 08 1d f5 3f f4 5d 15 66 7e 8c ea 73 12 |..p...?.].f~..s.|
-000000e0 19 4f 65 29 10 f7 d2 da b7 7d c5 bd a2 ec 2c 19 |.Oe).....}....,.|
-000000f0 fb a9 c5 d3 eb b2 bc 73 f6 73 e3 ae 95 4f 77 3c |.......s.s...Ow<|
-00000100 62 e6 4b 46 a9 d3 36 0c 8a 6e a6 e6 a5 1c 8d 9d |b.KF..6..n......|
-00000110 2c a0 76 c1 f6 ed bf 99 64 fe bc 03 62 8e 89 ac |,.v.....d...b...|
-00000120 0c 74 56 f4 09 aa 4e f5 fd 89 8f 68 9e ac b2 c8 |.tV...N....h....|
-00000130 e1 d4 e0 cd 9c a8 0a 2b 11 61 fc fc 16 fd cf 09 |.......+.a......|
-00000140 cd 7c bc cd 3f ce 60 f8 7a 71 f1 1b b9 2b a1 93 |.|..?.`.zq...+..|
-00000150 60 1b d1 90 5b 5f bc 57 26 17 c6 e1 a4 6b 4f a4 |`...[_.W&....kO.|
-00000160 4e b2 58 57 c0 f2 61 1c c9 5c 72 57 3d b2 03 07 |N.XW..a..\rW=...|
-00000170 22 a7 25 d2 2f 06 4d 55 18 26 06 bb 26 5e 58 a6 |".%./.MU.&..&^X.|
-00000180 e1 91 86 bd 02 22 f5 e7 af 6d c1 06 19 a6 fc 0d |....."...m......|
-00000190 20 68 0e 05 ba 09 56 8d 43 33 9b 04 79 62 66 f0 | h....V.C3..ybf.|
-000001a0 7c 01 4d 74 86 23 64 e7 c5 6b 10 f5 61 6c c1 83 ||.Mt.#d..k..al..|
-000001b0 7a 02 f8 1e 4c 11 e3 81 90 75 a1 ff dd 63 af 07 |z...L....u...c..|
-000001c0 c6 c2 54 22 79 61 1f 2d 01 84 76 38 ee 5b dd 93 |..T"ya.-..v8.[..|
-000001d0 34 4d 06 dc 6f d1 5d cd c7 31 e0 56 37 06 ea f3 |4M..o.]..1.V7...|
-000001e0 ca e2 00 86 17 73 58 b1 63 f0 91 03 a3 f7 b4 21 |.....sX.c......!|
-000001f0 ca 31 60 c4 a6 b6 17 03 03 00 59 25 ed f6 65 f5 |.1`.......Y%..e.|
-00000200 19 ba 78 3d 2d fb 86 3a 22 8b 9a 00 c1 3b ac 38 |..x=-..:"....;.8|
-00000210 cd ad c1 b7 14 91 fc e0 84 c0 ed 4a 86 ca 49 eb |...........J..I.|
-00000220 a9 f2 9f dd a3 74 aa f0 a9 e4 fb 18 38 51 0a 10 |.....t......8Q..|
-00000230 13 8e ff a9 d2 3e 68 05 8f 82 5a c7 30 a5 02 f6 |.....>h...Z.0...|
-00000240 d3 38 6e e3 e4 b3 4d ca c1 83 b2 e3 19 26 3a c2 |.8n...M......&:.|
-00000250 26 5f 38 d1 17 03 03 00 45 df 7e cc 71 f0 9e ca |&_8.....E.~.q...|
-00000260 00 9a 64 b4 ab 3a b8 50 b9 cd e9 eb 5b be 88 3b |..d..:.P....[..;|
-00000270 66 cf 15 98 5e 63 0c ad e3 0c 40 83 87 6e 3e 01 |f...^c....@..n>.|
-00000280 a3 78 03 75 cd 93 0e 7d d3 dc f2 f0 ed 3f 12 8d |.x.u...}.....?..|
-00000290 fc c5 c3 c8 36 f2 82 fe dc 69 02 26 84 8b 17 03 |....6....i.&....|
-000002a0 03 00 a3 d7 77 67 0e 4c d9 19 f8 bd 86 6e 1c aa |....wg.L.....n..|
-000002b0 16 ab 1b 48 21 f2 85 3e c9 22 4b fd 21 8e b5 fa |...H!..>."K.!...|
-000002c0 43 34 85 86 56 38 d3 4f ec 9f 25 79 eb bb fe d0 |C4..V8.O..%y....|
-000002d0 69 98 05 1c c8 37 51 cf cc 77 bc f1 e7 dc 9c c3 |i....7Q..w......|
-000002e0 d9 0b 3f 74 27 46 1e f3 7c 26 7e a4 6b ef c2 40 |..?t'F..|&~.k..@|
-000002f0 5b 23 de b6 ec 80 79 3b 8f d5 56 d4 ea 44 30 7e |[#....y;..V..D0~|
-00000300 73 2b 09 44 32 5c b9 2c 04 6e 94 50 32 61 80 93 |s+.D2\.,.n.P2a..|
-00000310 41 b6 83 73 19 a0 b4 ee b1 8b 23 a1 36 9c 5c 33 |A..s......#.6.\3|
-00000320 89 87 cd ef 8a 58 c7 51 a5 31 9c 8e 60 7a 6a ce |.....X.Q.1..`zj.|
-00000330 5f 7e 13 43 ee 44 8d b7 2c 81 da 3d c6 c6 d2 18 |_~.C.D..,..=....|
-00000340 aa 85 22 63 d7 bd |.."c..|
+00000080 03 03 00 01 01 17 03 03 00 17 f9 df 7b 4f f9 a1 |............{O..|
+00000090 f7 78 eb 10 59 5c 4f ed 42 09 08 10 0f c7 a4 81 |.x..Y\O.B.......|
+000000a0 8b 17 03 03 01 50 38 d7 96 35 05 7d 3d 3a 60 02 |.....P8..5.}=:`.|
+000000b0 bf 93 37 f2 60 3e 64 cb 1a 6f 9c 69 af 06 ca 70 |..7.`>d..o.i...p|
+000000c0 94 e2 d1 7f 4a 5d c7 57 0e 11 c7 4e 24 c6 ba 57 |....J].W...N$..W|
+000000d0 9f d7 67 3a 0a 8b 93 08 d4 de c5 be 62 79 61 2a |..g:........bya*|
+000000e0 3d 4e 57 f9 98 e5 4f 5e 5a 74 52 5b a4 d0 07 ae |=NW...O^ZtR[....|
+000000f0 8c 2a cb 50 dd b3 76 ab 3a 61 5b 55 83 8e 37 8d |.*.P..v.:a[U..7.|
+00000100 39 e5 4f 58 7e 7a bc 80 26 f6 0f 47 8f 11 55 77 |9.OX~z..&..G..Uw|
+00000110 24 b1 a7 06 d8 d2 30 82 0d 99 39 04 5f 97 d8 1d |$.....0...9._...|
+00000120 99 67 99 89 f0 ee 4f 18 8b 49 24 d3 6a d0 65 c9 |.g....O..I$.j.e.|
+00000130 01 a2 48 54 8b d2 bb 56 d4 0a 73 62 88 fa 70 4e |..HT...V..sb..pN|
+00000140 7f dd 59 5b 14 7b 28 02 07 75 01 4d 41 ab 1d 7e |..Y[.{(..u.MA..~|
+00000150 ef 24 42 ee 85 7f fa 5f 9e f0 9f f2 7f 92 00 52 |.$B...._.......R|
+00000160 ca 73 8a 73 c6 d7 13 f5 9d 31 6f 76 75 db e7 53 |.s.s.....1ovu..S|
+00000170 4d 44 40 8f 47 be bd 0e 71 13 d0 f7 f2 72 67 3a |MD@.G...q....rg:|
+00000180 de b8 da b0 1d 84 85 d0 c2 c4 8d 16 87 68 c7 98 |.............h..|
+00000190 40 0a 92 c8 fb 8a 3a e4 7b 34 43 47 b7 4f 28 8e |@.....:.{4CG.O(.|
+000001a0 11 01 98 88 b6 cd ca aa d4 dc 52 5d f9 cf 55 bb |..........R]..U.|
+000001b0 f3 13 f2 ce dc 67 74 a7 4d 5e 65 6f 18 cd 82 4e |.....gt.M^eo...N|
+000001c0 fc 80 2c 14 17 99 08 6d 59 b3 3f 38 00 52 a2 a3 |..,....mY.?8.R..|
+000001d0 c1 98 84 15 91 82 3f e9 47 82 12 a0 94 dc 19 9e |......?.G.......|
+000001e0 2e b7 25 79 30 b9 81 d6 9f 33 8e 49 80 7a 4c a2 |..%y0....3.I.zL.|
+000001f0 b7 9a e6 17 2c 06 17 03 03 00 59 97 c7 4b ac c3 |....,.....Y..K..|
+00000200 ed b3 bd 82 7a c2 45 a0 18 70 7b 88 fe 8b fd 6b |....z.E..p{....k|
+00000210 83 f2 dd 77 15 74 9c f0 a6 27 22 bf ee 25 53 07 |...w.t...'"..%S.|
+00000220 81 95 3c 91 b3 89 3c ca f9 5b c7 cf bb 32 55 f8 |..<...<..[...2U.|
+00000230 3c 76 70 f6 11 ca 5d 92 aa 78 9e 8a 2f ab e0 6f |>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 03 21 4e 7f 71 |..........E.!N.q|
-00000010 cf b4 fa 18 34 06 57 62 51 99 3d 4a da 52 36 54 |....4.WbQ.=J.R6T|
-00000020 5b 22 2b 66 90 c1 8a 21 ec 5e 8b 3c 40 7a 18 0e |["+f...!.^.<@z..|
-00000030 b5 82 c1 14 e5 9e 15 72 16 f2 fc 15 cb dd f1 e8 |.......r........|
-00000040 7c 03 5e ba c9 96 86 11 ec 88 44 97 24 a5 b2 5a ||.^.......D.$..Z|
+00000000 14 03 03 00 01 01 17 03 03 00 35 19 fa 19 c0 ce |..........5.....|
+00000010 09 87 c2 06 69 56 2a 0a a7 9c 79 76 03 1b 70 5e |....iV*...yv..p^|
+00000020 56 2d d4 a1 09 e3 99 f7 a9 7a e5 ba 3e 17 8b b2 |V-.......z..>...|
+00000030 fe da 70 81 d9 30 83 27 b1 da 2e df da 94 75 72 |..p..0.'......ur|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 4b 9e 56 c2 1a a7 67 94 04 eb b0 |.....K.V...g....|
-00000010 48 87 44 38 7d f2 c7 b7 6c 1b a5 40 bb 1a 94 22 |H.D8}...l..@..."|
-00000020 a2 f0 9e 17 03 03 00 13 64 42 12 84 e4 d8 64 fd |........dB....d.|
-00000030 8c 70 ff f5 43 4d 57 39 b2 d3 1e |.p..CMW9...|
+00000000 17 03 03 00 1e 83 53 ed 09 07 d3 87 ab 37 a2 08 |......S......7..|
+00000010 a8 50 66 87 97 54 04 38 4b a6 25 f8 ab 75 ac 39 |.Pf..T.8K.%..u.9|
+00000020 52 e2 8d 17 03 03 00 13 86 58 ef 44 c1 59 5e 2e |R........X.D.Y^.|
+00000030 e4 2e df 93 6e 52 76 58 c1 9d 2a |....nRvX..*|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-ExportKeyingMaterial b/src/crypto/tls/testdata/Server-TLSv13-ExportKeyingMaterial
index 078739c750..8267ca0f9e 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-ExportKeyingMaterial
+++ b/src/crypto/tls/testdata/Server-TLSv13-ExportKeyingMaterial
@@ -1,103 +1,99 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 e4 01 00 00 e0 03 03 40 53 50 a3 f5 |...........@SP..|
-00000010 3a 20 4f 16 ef 9c a4 1c a3 10 1d 93 cb ea 1f 69 |: O............i|
-00000020 6b aa 50 ae a8 01 7e 65 d9 7b 5c 20 8c 9b cc d4 |k.P...~e.{\ ....|
-00000030 6b 07 4d 1e d9 69 d2 d8 a0 a0 d5 b7 75 d8 e3 d8 |k.M..i......u...|
-00000040 c4 ac f7 d2 6f e5 f5 8f 46 9a bf 85 00 08 13 02 |....o...F.......|
-00000050 13 03 13 01 00 ff 01 00 00 8f 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 23 00 00 00 16 00 00 00 17 00 00 |.....#..........|
-00000090 00 0d 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 |................|
-000000a0 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 |................|
-000000b0 06 01 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 |...+......-.....|
-000000c0 33 00 26 00 24 00 1d 00 20 81 67 45 ec b4 08 4d |3.&.$... .gE...M|
-000000d0 a6 50 79 b4 d4 a9 d1 35 51 2b db 8d b7 e7 7c 3c |.Py....5Q+....|<|
-000000e0 fd 0f 4b 47 87 e1 bb fb 2d |..KG....-|
+00000000 16 03 01 00 ce 01 00 00 ca 03 03 26 86 8d 61 97 |...........&..a.|
+00000010 6c da 93 d7 43 5c b3 0c 06 5c c2 cb e0 89 46 9f |l...C\...\....F.|
+00000020 cc b0 a3 cf 41 3d cf 7a 9e 02 bc 20 a6 33 fe 0b |....A=.z... .3..|
+00000030 90 24 8b ed 69 48 86 9b d2 1a 5c 04 66 52 4f 5d |.$..iH....\.fRO]|
+00000040 a4 24 6b d2 84 08 c0 48 a9 55 ef 0c 00 04 13 03 |.$k....H.U......|
+00000050 00 ff 01 00 00 7d 00 0b 00 04 03 00 01 02 00 0a |.....}..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000070 00 00 00 16 00 00 00 17 00 00 00 0d 00 1e 00 1c |................|
+00000080 04 03 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b |................|
+00000090 08 04 08 05 08 06 04 01 05 01 06 01 00 2b 00 03 |.............+..|
+000000a0 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 24 00 |....-.....3.&.$.|
+000000b0 1d 00 20 b9 ab 39 93 6b 9f aa 46 0a 61 c6 f8 58 |.. ..9.k..F.a..X|
+000000c0 45 26 16 6f b6 cb 42 52 e8 24 ab cc a4 2d b6 7a |E&.o..BR.$...-.z|
+000000d0 a5 90 67 |..g|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 8c 9b cc d4 |........... ....|
-00000030 6b 07 4d 1e d9 69 d2 d8 a0 a0 d5 b7 75 d8 e3 d8 |k.M..i......u...|
-00000040 c4 ac f7 d2 6f e5 f5 8f 46 9a bf 85 13 02 00 00 |....o...F.......|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 a6 33 fe 0b |........... .3..|
+00000030 90 24 8b ed 69 48 86 9b d2 1a 5c 04 66 52 4f 5d |.$..iH....\.fRO]|
+00000040 a4 24 6b d2 84 08 c0 48 a9 55 ef 0c 13 03 00 00 |.$k....H.U......|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 d2 bf e0 2f ba e9 |............./..|
-00000090 84 f5 8b 96 93 ac de 94 3b 92 03 ca db 43 f4 55 |........;....C.U|
-000000a0 12 17 03 03 02 6d 54 36 b6 78 fb bf 9f 36 02 78 |.....mT6.x...6.x|
-000000b0 b3 92 50 c9 ab 85 b6 57 69 18 10 c1 fe da d4 05 |..P....Wi.......|
-000000c0 89 db 62 bd 83 b0 82 38 29 5f ce 53 88 2d f2 cd |..b....8)_.S.-..|
-000000d0 6a d7 1d c0 c5 03 e7 e4 4b ec eb bf 95 8e d5 9b |j.......K.......|
-000000e0 65 45 09 52 ef 29 60 7b 22 61 6f ca 1b 3d 30 a4 |eE.R.)`{"ao..=0.|
-000000f0 c4 c4 06 55 39 5e 3a ef a2 62 61 35 6c c4 fc 8b |...U9^:..ba5l...|
-00000100 19 dc c1 b0 8d dd ba d0 9e 87 65 1c 8d 73 6c 82 |..........e..sl.|
-00000110 e4 45 e9 a9 53 94 20 ba 19 7e 4e 7e fb 14 dc 5d |.E..S. ..~N~...]|
-00000120 86 19 0b fe f8 9c 7e 61 8e 17 e6 59 12 c2 e0 6a |......~a...Y...j|
-00000130 52 c0 25 05 30 c8 f7 d6 54 69 15 ca c9 8e 96 1d |R.%.0...Ti......|
-00000140 42 55 1f 9a 9b 03 95 af 74 05 be 5e 51 35 8b 1f |BU......t..^Q5..|
-00000150 24 0a 13 03 90 fc c0 c4 22 c3 f0 8a f2 60 a8 ff |$......."....`..|
-00000160 7b 04 48 10 3e 42 da e5 c2 7b 72 9c e1 d6 b5 56 |{.H.>B...{r....V|
-00000170 f7 69 ce 46 67 33 e4 d3 e5 61 43 b2 57 e8 b2 43 |.i.Fg3...aC.W..C|
-00000180 84 ac 75 15 d1 cb 70 53 99 1c 29 9a 21 bb c0 d3 |..u...pS..).!...|
-00000190 66 8a be 16 b1 67 1b 60 d3 2f c6 a3 7e f3 3b 4f |f....g.`./..~.;O|
-000001a0 78 4d ec 1f 9f 6d 46 1c 43 2f 50 ad 44 75 93 49 |xM...mF.C/P.Du.I|
-000001b0 e2 29 c4 be aa 22 51 f1 17 1a 20 97 8a 23 06 2c |.)..."Q... ..#.,|
-000001c0 93 b6 9d 11 5a 55 34 d9 f1 a4 c6 5b 84 f6 bb 0c |....ZU4....[....|
-000001d0 a0 7c a2 25 47 df a6 22 c8 df e5 ae 74 1c f3 db |.|.%G.."....t...|
-000001e0 3c 04 6f fa 86 76 c9 be ae 2a e0 64 65 d2 8f 9a |<.o..v...*.de...|
-000001f0 7b a2 38 4d 74 8d 44 ad ef c1 12 0b ca 64 6c b5 |{.8Mt.D......dl.|
-00000200 13 03 2c b4 6a e8 78 ba 57 d5 ef 9a d1 1d 7e 92 |..,.j.x.W.....~.|
-00000210 58 52 78 c2 c5 e2 f8 e9 2d 06 28 88 19 d4 19 7b |XRx.....-.(....{|
-00000220 7f 41 ea ed f9 9e 14 f1 9b 3f dc f7 bc 35 20 ca |.A.......?...5 .|
-00000230 fc 8f b8 df ee ef 83 50 c4 41 91 ae 83 4b bd d1 |.......P.A...K..|
-00000240 00 e1 3f 70 5d cb 40 a6 77 70 cd 9a 09 5b 05 14 |..?p].@.wp...[..|
-00000250 83 b9 7c 8d 1c e1 7f 6e 41 1a b9 8c 70 2a 95 01 |..|....nA...p*..|
-00000260 ef 19 0c 59 7d 47 b4 64 7b 91 5e 9b 02 c5 ed ee |...Y}G.d{.^.....|
-00000270 d4 9b ad 12 70 d1 d9 6b 02 26 b5 48 4e 23 bb 61 |....p..k.&.HN#.a|
-00000280 ae c7 82 74 a9 68 59 b1 66 07 b8 e3 93 0f 2c 9f |...t.hY.f.....,.|
-00000290 8d 8d f1 e8 3f b7 2c 64 90 4f 88 7f 41 78 66 ba |....?.,d.O..Axf.|
-000002a0 26 eb 1c 8b 70 47 f5 78 cb fe 66 34 6f 74 b1 98 |&...pG.x..f4ot..|
-000002b0 ca 12 f5 91 8c cb 15 85 eb 77 ad af 76 f8 3f 3f |.........w..v.??|
-000002c0 cb 86 82 fe 1e 78 1e d3 16 c2 b7 e6 a6 2b a0 6c |.....x.......+.l|
-000002d0 da 99 3f dd 3b 0b 10 3b 16 bd d9 4f 45 c3 12 b5 |..?.;..;...OE...|
-000002e0 14 1b 53 33 56 c1 f4 7c 4a 47 b9 c2 b0 bd 4e 78 |..S3V..|JG....Nx|
-000002f0 e1 6f 76 05 d1 e3 af 01 f8 b4 e6 23 12 11 cf 43 |.ov........#...C|
-00000300 91 9d eb be d8 6b 9c d2 fd 3b b5 3b 8c 52 4e 12 |.....k...;.;.RN.|
-00000310 df 26 42 17 03 03 00 99 fc fb 50 ba e0 83 07 bb |.&B.......P.....|
-00000320 13 4f 7c 1e 5f 35 e5 2f b9 c0 40 cb 51 9a 38 a6 |.O|._5./..@.Q.8.|
-00000330 bf 1a 22 e3 ea 8b 5e 30 e0 b2 2b 40 aa 76 62 bc |.."...^0..+@.vb.|
-00000340 c5 e3 3c f3 2a 10 2e 35 58 2b 5e c1 56 da 78 a9 |..<.*..5X+^.V.x.|
-00000350 57 b5 46 1f d8 ad 59 3c 5a b8 37 be 66 86 d0 ad |W.F...Y..]_V|
-000003b0 05 17 03 03 00 45 81 1e e7 bb e8 81 f4 41 12 af |.....E.......A..|
-000003c0 fb f0 8f bd d0 d6 b3 10 a5 1e d6 0c f7 aa 01 15 |................|
-000003d0 9d 30 5b 65 e1 fd 3e 72 3d 43 62 21 02 0e ec da |.0[e..>r=Cb!....|
-000003e0 ec 74 2c e2 22 84 c9 90 18 71 f8 ef db 3f 05 d6 |.t,."....q...?..|
-000003f0 91 09 46 c2 5c 2b f7 03 39 2b 3e 17 03 03 00 a3 |..F.\+..9+>.....|
-00000400 53 cc 75 04 8c c5 25 70 1f 4b 9c 04 92 af 1a 3f |S.u...%p.K.....?|
-00000410 26 1e 00 98 fa e3 c2 25 63 ca d4 03 fd 6c 94 a0 |&......%c....l..|
-00000420 0a 87 5f 68 63 52 72 25 69 3f 21 66 f6 a6 00 2a |.._hcRr%i?!f...*|
-00000430 25 e3 1e 95 f3 bd a8 22 bc 9a 74 f0 41 5d b1 30 |%......"..t.A].0|
-00000440 36 ff 13 09 d9 69 7f 16 35 11 34 0e 65 2e e7 52 |6....i..5.4.e..R|
-00000450 b4 6e a1 dc 06 fe a3 3e 3b eb 79 fe d0 e1 e8 76 |.n.....>;.y....v|
-00000460 e2 0e 49 78 c3 cf c5 31 ce 7f 9b d6 c5 6d 3f 7b |..Ix...1.....m?{|
-00000470 79 9a 5d a7 c3 3b 58 eb a2 43 55 c6 42 7a a8 34 |y.]..;X..CU.Bz.4|
-00000480 6e c9 47 aa 5e 44 4a bd 4b 89 28 ab ac 5a 95 dc |n.G.^DJ.K.(..Z..|
-00000490 96 99 28 dc 29 04 10 f3 8c 49 45 b7 29 69 3d 9e |..(.)....IE.)i=.|
-000004a0 dd fe 4a |..J|
+00000080 03 03 00 01 01 17 03 03 00 17 e9 4c 8a ed 0c af |...........L....|
+00000090 04 d2 18 14 38 48 c1 71 da 59 db 46 f4 00 0d 19 |....8H.q.Y.F....|
+000000a0 1e 17 03 03 02 6d e0 d2 7b bf 0a 51 48 a9 67 46 |.....m..{..QH.gF|
+000000b0 25 3b 07 e9 68 da 4d cf 47 31 0f 7d ad 4e 0d 6d |%;..h.M.G1.}.N.m|
+000000c0 c3 ad 03 61 4a c0 ae 06 4d b7 84 29 1b 44 49 26 |...aJ...M..).DI&|
+000000d0 f4 99 fc 58 1e 5b f0 15 ee be 19 c3 b3 23 20 f0 |...X.[.......# .|
+000000e0 7a 10 e4 ab c8 00 f6 e4 93 d6 b3 2a fd 14 10 c9 |z..........*....|
+000000f0 72 b2 21 ba 93 50 08 4e d2 1f 3f 64 68 73 3c c7 |r.!..P.N..?dhs<.|
+00000100 11 3c f5 84 61 b0 2c 84 42 0c ef a9 03 a2 74 aa |.<..a.,.B.....t.|
+00000110 3b 07 e0 d5 f5 c4 d1 a8 8e f5 64 0e 52 41 b1 4d |;.........d.RA.M|
+00000120 aa 43 0d f3 6b 0c 19 36 66 fe 4c 73 cd 52 03 2f |.C..k..6f.Ls.R./|
+00000130 61 f1 9d 23 12 e2 b9 69 d9 48 92 07 1b 5d 6f 28 |a..#...i.H...]o(|
+00000140 e1 96 39 d8 59 19 9d 9c bf 99 3a af 03 68 bd 34 |..9.Y.....:..h.4|
+00000150 38 04 9d 8c 9a bf 75 67 74 dd 9c eb 89 13 6d 55 |8.....ugt.....mU|
+00000160 b4 c4 17 11 05 54 d7 f9 d7 5a ed ec d5 15 31 5e |.....T...Z....1^|
+00000170 2f ed 69 fa 99 23 57 e3 62 98 35 27 17 34 e1 c4 |/.i..#W.b.5'.4..|
+00000180 3c 95 3f 69 de 01 aa a9 66 55 4a 40 3a f1 4f 19 |<.?i....fUJ@:.O.|
+00000190 02 2f df 51 0c 69 ec 48 7a 60 f7 72 5e f6 f0 4d |./.Q.i.Hz`.r^..M|
+000001a0 a1 b2 7a 06 df 69 a1 19 42 29 56 5c 67 99 3d 0e |..z..i..B)V\g.=.|
+000001b0 5d da df 7b 93 8e 9a 26 6e 2e 09 c4 30 40 ad a9 |]..{...&n...0@..|
+000001c0 ee 4b bd 21 41 b6 cb fc 97 0f fc a2 cf 26 31 d6 |.K.!A........&1.|
+000001d0 d6 77 96 4e c6 a2 fd 5a 0e cb d5 31 a6 21 e8 76 |.w.N...Z...1.!.v|
+000001e0 a2 48 4d 43 d4 c9 18 b2 21 cc 13 13 84 f2 c2 cf |.HMC....!.......|
+000001f0 60 8f 2e 36 39 8a a8 26 03 1d 51 24 b4 08 c5 5d |`..69..&..Q$...]|
+00000200 96 b9 4a 46 02 41 1f 59 ea 47 a9 37 bc a0 c4 70 |..JF.A.Y.G.7...p|
+00000210 26 d6 8c 11 62 45 1d 92 5d ea 39 cd af af 13 38 |&...bE..].9....8|
+00000220 85 ca a8 74 1a 09 07 f2 7c d6 49 0d 2d ad 1c 9f |...t....|.I.-...|
+00000230 db 8b 56 91 45 51 32 db ca 9c f4 d2 72 09 8a fe |..V.EQ2.....r...|
+00000240 98 9e a8 b5 b2 49 9c 0b e9 3a 42 d0 53 e0 20 6c |.....I...:B.S. l|
+00000250 e3 07 36 ef cc 85 56 fd b4 6e ff d2 7c 96 52 27 |..6...V..n..|.R'|
+00000260 46 c9 3c b3 bf fb 16 0b 61 54 09 9c ac 3b 18 5f |F.<.....aT...;._|
+00000270 5a 01 4b 25 67 22 ef 19 86 a3 3a 80 f0 12 f5 60 |Z.K%g"....:....`|
+00000280 4c 77 cf bd a9 e8 a1 19 d4 8c e1 a8 b2 b8 19 b8 |Lw..............|
+00000290 98 85 c3 da 1a b8 4d 6e 1f 35 73 28 32 3c a0 44 |......Mn.5s(2<.D|
+000002a0 c9 77 46 b8 c6 54 4d 80 67 72 58 c4 e3 0b f3 6c |.wF..TM.grX....l|
+000002b0 43 eb e2 89 f1 30 cc 90 b4 e9 b8 ec e2 5f c1 31 |C....0......._.1|
+000002c0 a2 de 9d e9 fe 9c fe b0 83 b7 aa e9 2e 62 35 89 |.............b5.|
+000002d0 90 0d 36 79 8f 23 bb 7a ae dc db db 1c c3 96 5d |..6y.#.z.......]|
+000002e0 7c 06 e9 1c ee 82 58 46 7c 1b 90 9d cf 2d 31 54 ||.....XF|....-1T|
+000002f0 96 94 58 dc 95 26 85 c7 f4 c9 9c 2b 8a 2f ae b3 |..X..&.....+./..|
+00000300 70 10 bf f1 0e 66 ef f1 1c 66 da 6c 52 d8 6e aa |p....f...f.lR.n.|
+00000310 3a 14 d8 17 03 03 00 99 69 45 ee c3 c9 b3 4d 9a |:.......iE....M.|
+00000320 01 00 70 27 54 8c 12 bb 74 67 e8 88 07 ac 4e ab |..p'T...tg....N.|
+00000330 b1 41 f4 65 ee 3b 06 87 79 5d 9b 1d 70 df 2f f7 |.A.e.;..y]..p./.|
+00000340 e0 88 45 2b a1 b9 ca 67 88 65 65 33 51 41 c0 b2 |..E+...g.ee3QA..|
+00000350 da 6a 7a 7c bf 42 58 8d ae 7b 24 d0 8a f7 47 c0 |.jz|.BX..{$...G.|
+00000360 a9 45 da 24 82 03 a1 65 03 7c 3c 2a bf 48 e2 0d |.E.$...e.|<*.H..|
+00000370 fa cc 3f 00 53 63 5d f9 b4 a1 00 d2 a7 3c 81 64 |..?.Sc]......<.d|
+00000380 8a d5 90 4f b9 58 2b 1e 1d a7 7e ad 3e 8f d4 4a |...O.X+...~.>..J|
+00000390 7b 66 b7 4e 68 04 ac 66 24 6e 76 ed f4 5c aa 52 |{f.Nh..f$nv..\.R|
+000003a0 3d f8 f5 ea d0 0a 74 ba 39 da 21 e0 f1 03 80 cd |=.....t.9.!.....|
+000003b0 5b 17 03 03 00 35 7b 1f 6e 37 6c 15 5b 1b f7 ea |[....5{.n7l.[...|
+000003c0 bf 03 68 5f 15 1f e7 99 a8 64 f1 60 3d e0 b6 5e |..h_.....d.`=..^|
+000003d0 c1 60 18 61 e5 ea dc ab b5 d3 5f 10 1b 5c 3a 1b |.`.a......_..\:.|
+000003e0 c5 fe a6 d3 fc 45 6b db b1 27 60 17 03 03 00 93 |.....Ek..'`.....|
+000003f0 e3 f1 5f f1 18 a6 ab 67 88 e4 5a f9 fd 71 77 4b |.._....g..Z..qwK|
+00000400 6c 0d 98 ef 71 72 2a aa d2 0a 2d 72 ac 40 57 2d |l...qr*...-r.@W-|
+00000410 73 ad 77 cd 01 19 19 be e7 49 d4 6a aa 97 f9 40 |s.w......I.j...@|
+00000420 b1 85 cc bb 5c 57 1a 17 a8 48 65 d3 4d e9 a9 29 |....\W...He.M..)|
+00000430 4b 08 6b b3 33 2c 97 d0 89 0a 50 e2 66 06 c6 63 |K.k.3,....P.f..c|
+00000440 c3 6f 8d 5e ab a4 af 7a 6a 5e 25 8d 4a 17 ea aa |.o.^...zj^%.J...|
+00000450 67 8a ad af c3 1e d6 47 db a5 b5 db 32 1b 83 f8 |g......G....2...|
+00000460 2d f9 bc 99 28 07 0d d0 fe 34 bf 52 ae 59 27 40 |-...(....4.R.Y'@|
+00000470 cd 0e 4d 4d 12 28 21 01 30 38 b1 c3 df 63 e9 9e |..MM.(!.08...c..|
+00000480 34 91 84 |4..|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 3f e6 f9 73 13 |..........E?..s.|
-00000010 98 fa c1 e1 84 7a 0c 10 eb 9a bf 2b df c1 44 26 |.....z.....+..D&|
-00000020 36 1a 95 02 b4 12 67 7c e2 7d f3 1e 54 79 7b 51 |6.....g|.}..Ty{Q|
-00000030 e6 13 94 cb 00 cc 25 fb 6e 8a 35 4e f0 f0 95 34 |......%.n.5N...4|
-00000040 53 fd 7e 37 d2 a8 0a 71 a7 2d 8d 58 2e ae 27 34 |S.~7...q.-.X..'4|
+00000000 14 03 03 00 01 01 17 03 03 00 35 1d d8 d0 a8 ec |..........5.....|
+00000010 04 45 13 43 a1 72 38 4e 54 85 7a a2 17 dc eb 39 |.E.C.r8NT.z....9|
+00000020 36 7d 50 25 5f d3 0d 7f c3 a7 75 93 e9 1e 17 0a |6}P%_.....u.....|
+00000030 a3 d7 a8 74 23 98 5e 3a 3a 4c 2c d3 78 b4 04 48 |...t#.^::L,.x..H|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 07 34 2c 55 6a c5 14 e7 0a 51 94 |......4,Uj....Q.|
-00000010 74 ad e1 c0 4d e8 1c 3e ad 3e 8e 71 e5 60 9c d8 |t...M..>.>.q.`..|
-00000020 6a 44 ac 17 03 03 00 13 09 9e 97 ff 3d b8 f1 a6 |jD..........=...|
-00000030 5d f9 8f b0 65 93 31 6b 9d 81 76 |]...e.1k..v|
+00000000 17 03 03 00 1e 53 e2 0d f2 62 e8 be 84 e0 33 1a |.....S...b....3.|
+00000010 56 bc 45 f9 0b 69 63 72 03 f3 34 c6 72 d8 f9 c4 |V.E..icr..4.r...|
+00000020 ba 53 3d 17 03 03 00 13 11 b5 0d 7f d4 e7 51 90 |.S=...........Q.|
+00000030 39 be 2b d8 d6 7c e8 12 ea 61 83 |9.+..|...a.|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-HelloRetryRequest b/src/crypto/tls/testdata/Server-TLSv13-HelloRetryRequest
index 96a5488c73..95eefd29be 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-HelloRetryRequest
+++ b/src/crypto/tls/testdata/Server-TLSv13-HelloRetryRequest
@@ -1,129 +1,123 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 da 01 00 00 d6 03 03 ab e7 6d 22 09 |.............m".|
-00000010 bf 08 ef a1 7e 7c 8d ea fd a5 39 43 62 84 67 a8 |....~|....9Cb.g.|
-00000020 df b1 a1 3a d7 37 dc 0d ef 27 54 20 20 f3 5b 41 |...:.7...'T .[A|
-00000030 67 3e 30 d8 8e 2d 0f a1 c2 df 86 48 8c 05 bb d7 |g>0..-.....H....|
-00000040 73 30 80 86 cf 2c 85 d1 2a fe 21 36 00 08 13 02 |s0...,..*.!6....|
-00000050 13 03 13 01 00 ff 01 00 00 85 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 06 00 04 00 1d 00 17 00 16 |................|
-00000080 00 00 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 |................|
-00000090 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
-000000a0 08 06 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 |.........+......|
-000000b0 2d 00 02 01 01 00 33 00 26 00 24 00 1d 00 20 1a |-.....3.&.$... .|
-000000c0 ae 88 dd 6c 7c 4c fb e5 65 ca 8e 63 a1 97 4c d3 |...l|L..e..c..L.|
-000000d0 33 ff 00 95 db 0b ce 67 62 26 78 27 52 f0 5c |3......gb&x'R.\|
+00000000 16 03 01 00 c4 01 00 00 c0 03 03 16 5e f5 e2 4e |............^..N|
+00000010 27 ce 8e 88 0b e9 13 6d 12 a6 6d 27 c9 ab 95 47 |'......m..m'...G|
+00000020 6f 9d 5d a0 92 64 35 c1 b6 70 90 20 ff 47 6f 67 |o.]..d5..p. .Gog|
+00000030 69 49 88 2a 84 69 79 48 fe cc 92 db 6e 9e ab 47 |iI.*.iyH....n..G|
+00000040 8e 47 10 58 db ad 22 8e da bb 86 e6 00 04 13 03 |.G.X..".........|
+00000050 00 ff 01 00 00 73 00 0b 00 04 03 00 01 02 00 0a |.....s..........|
+00000060 00 06 00 04 00 1d 00 17 00 16 00 00 00 17 00 00 |................|
+00000070 00 0d 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 |................|
+00000080 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 |................|
+00000090 06 01 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 |...+......-.....|
+000000a0 33 00 26 00 24 00 1d 00 20 7e a4 de 34 df 01 99 |3.&.$... ~..4...|
+000000b0 37 77 f7 de 6a e2 79 e7 63 eb 86 6c 62 61 fd b0 |7w..j.y.c..lba..|
+000000c0 c6 95 04 c8 63 29 cd 32 00 |....c).2.|
>>> Flow 2 (server to client)
00000000 16 03 03 00 58 02 00 00 54 03 03 cf 21 ad 74 e5 |....X...T...!.t.|
00000010 9a 61 11 be 1d 8c 02 1e 65 b8 91 c2 a2 11 16 7a |.a......e......z|
-00000020 bb 8c 5e 07 9e 09 e2 c8 a8 33 9c 20 20 f3 5b 41 |..^......3. .[A|
-00000030 67 3e 30 d8 8e 2d 0f a1 c2 df 86 48 8c 05 bb d7 |g>0..-.....H....|
-00000040 73 30 80 86 cf 2c 85 d1 2a fe 21 36 13 02 00 00 |s0...,..*.!6....|
+00000020 bb 8c 5e 07 9e 09 e2 c8 a8 33 9c 20 ff 47 6f 67 |..^......3. .Gog|
+00000030 69 49 88 2a 84 69 79 48 fe cc 92 db 6e 9e ab 47 |iI.*.iyH....n..G|
+00000040 8e 47 10 58 db ad 22 8e da bb 86 e6 13 03 00 00 |.G.X..".........|
00000050 0c 00 2b 00 02 03 04 00 33 00 02 00 17 14 03 03 |..+.....3.......|
00000060 00 01 01 |...|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 16 03 03 00 fb 01 00 00 f7 03 |................|
-00000010 03 ab e7 6d 22 09 bf 08 ef a1 7e 7c 8d ea fd a5 |...m".....~|....|
-00000020 39 43 62 84 67 a8 df b1 a1 3a d7 37 dc 0d ef 27 |9Cb.g....:.7...'|
-00000030 54 20 20 f3 5b 41 67 3e 30 d8 8e 2d 0f a1 c2 df |T .[Ag>0..-....|
-00000040 86 48 8c 05 bb d7 73 30 80 86 cf 2c 85 d1 2a fe |.H....s0...,..*.|
-00000050 21 36 00 08 13 02 13 03 13 01 00 ff 01 00 00 a6 |!6..............|
-00000060 00 00 00 0e 00 0c 00 00 09 31 32 37 2e 30 2e 30 |.........127.0.0|
-00000070 2e 31 00 0b 00 04 03 00 01 02 00 0a 00 06 00 04 |.1..............|
-00000080 00 1d 00 17 00 16 00 00 00 17 00 00 00 0d 00 1e |................|
-00000090 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................|
-000000a0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 00 2b |...............+|
-000000b0 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 47 00 |......-.....3.G.|
-000000c0 45 00 17 00 41 04 22 3e 1f 4b 0f 2e f4 af bf 6c |E...A.">.K.....l|
-000000d0 d7 35 69 72 23 00 3f 16 6a 8e 00 3e 2b 8f f8 60 |.5ir#.?.j..>+..`|
-000000e0 17 e8 e8 80 f3 28 5d cd 1f f7 99 88 59 01 a5 d7 |.....(].....Y...|
-000000f0 34 d0 d9 38 5b 73 3e d6 3c c8 9e 39 8f 45 d0 37 |4..8[s>.<..9.E.7|
-00000100 aa 5b 8e 59 2f 0c |.[.Y/.|
+00000000 14 03 03 00 01 01 16 03 03 00 e5 01 00 00 e1 03 |................|
+00000010 03 16 5e f5 e2 4e 27 ce 8e 88 0b e9 13 6d 12 a6 |..^..N'......m..|
+00000020 6d 27 c9 ab 95 47 6f 9d 5d a0 92 64 35 c1 b6 70 |m'...Go.]..d5..p|
+00000030 90 20 ff 47 6f 67 69 49 88 2a 84 69 79 48 fe cc |. .GogiI.*.iyH..|
+00000040 92 db 6e 9e ab 47 8e 47 10 58 db ad 22 8e da bb |..n..G.G.X.."...|
+00000050 86 e6 00 04 13 03 00 ff 01 00 00 94 00 0b 00 04 |................|
+00000060 03 00 01 02 00 0a 00 06 00 04 00 1d 00 17 00 16 |................|
+00000070 00 00 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 |................|
+00000080 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
+00000090 08 06 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 |.........+......|
+000000a0 2d 00 02 01 01 00 33 00 47 00 45 00 17 00 41 04 |-.....3.G.E...A.|
+000000b0 ca c3 69 88 b3 ed f4 ad 7f 9c 03 6c 7a 44 55 d6 |..i........lzDU.|
+000000c0 68 1d a4 27 67 57 d7 27 08 27 e8 b9 c9 32 49 a2 |h..'gW.'.'...2I.|
+000000d0 e4 f6 c2 f2 62 bd 74 67 77 f9 26 27 ee d7 a7 f0 |....b.tgw.&'....|
+000000e0 9c 9a 41 cd 8b bf 76 25 df ff 5a 9f 4e f5 41 95 |..A...v%..Z.N.A.|
>>> Flow 4 (server to client)
00000000 16 03 03 00 9b 02 00 00 97 03 03 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 20 f3 5b 41 |........... .[A|
-00000030 67 3e 30 d8 8e 2d 0f a1 c2 df 86 48 8c 05 bb d7 |g>0..-.....H....|
-00000040 73 30 80 86 cf 2c 85 d1 2a fe 21 36 13 02 00 00 |s0...,..*.!6....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 ff 47 6f 67 |........... .Gog|
+00000030 69 49 88 2a 84 69 79 48 fe cc 92 db 6e 9e ab 47 |iI.*.iyH....n..G|
+00000040 8e 47 10 58 db ad 22 8e da bb 86 e6 13 03 00 00 |.G.X..".........|
00000050 4f 00 2b 00 02 03 04 00 33 00 45 00 17 00 41 04 |O.+.....3.E...A.|
00000060 1e 18 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 |..7...Q.5uq..T[.|
00000070 2e 8f 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e |...g..$ >.V...(^|
00000080 f8 2b 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 |.+-O....lK[.V.2B|
00000090 e9 58 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 |.X..I..h.A.Vk.Z.|
-000000a0 17 03 03 00 17 4c 08 ad d8 7f 86 a1 1f b2 dc 89 |.....L..........|
-000000b0 38 bf d4 75 ff 9e db 74 59 3c 86 5c 17 03 03 02 |8..u...tY<.\....|
-000000c0 6d f3 65 9c 3b 80 4f c0 c4 a6 e5 e1 32 49 06 13 |m.e.;.O.....2I..|
-000000d0 b8 60 18 50 c4 1c 38 f7 1a 42 89 49 14 40 4c fc |.`.P..8..B.I.@L.|
-000000e0 7c 3c 2b 70 2d 8b e7 99 f8 2e 1d 50 c8 b3 8b cd ||<+p-......P....|
-000000f0 59 a8 f7 89 4d 93 c6 1e f9 94 e3 69 25 92 48 61 |Y...M......i%.Ha|
-00000100 06 4a 89 f5 4b 57 93 a7 20 23 0b bb e5 00 8a 43 |.J..KW.. #.....C|
-00000110 fb 98 29 08 df 32 89 1a d6 87 f0 97 dc 8b f5 3f |..)..2.........?|
-00000120 e2 54 32 2e 23 04 c4 87 0a 0f 99 ef c5 28 64 13 |.T2.#........(d.|
-00000130 6c 62 29 e1 3a 21 84 bb 56 f9 92 24 58 75 48 8b |lb).:!..V..$XuH.|
-00000140 25 59 9f e1 a5 aa ee 44 3e 64 e5 af ac 0e 6e 18 |%Y.....D>d....n.|
-00000150 6e dc 43 87 4d bd 26 1e c1 0a 5f 8b a7 2d 8c cc |n.C.M.&..._..-..|
-00000160 94 25 60 59 33 ef 38 93 a3 d1 63 5b 9b ae 10 2f |.%`Y3.8...c[.../|
-00000170 63 af 27 32 35 b8 db 75 e8 e6 19 09 8e f3 b1 4d |c.'25..u.......M|
-00000180 b6 8a 83 6c 88 41 3a d9 1e da ad b3 06 3b ba 41 |...l.A:......;.A|
-00000190 f9 fd 23 46 a5 9e 8a 11 31 d9 f6 8c 56 32 eb a8 |..#F....1...V2..|
-000001a0 7f c1 0a d1 78 c7 46 cb b5 f7 3f 7e 56 39 75 45 |....x.F...?~V9uE|
-000001b0 5b fb 84 b4 16 28 14 4c 45 9d f4 8d 65 38 5d 93 |[....(.LE...e8].|
-000001c0 53 ab 5e ae bc 9c 73 4b cb d2 85 cd d8 a7 00 67 |S.^...sK.......g|
-000001d0 f8 0c c3 81 0b fc 5b f8 74 4f 6a 2f 3c 57 68 22 |......[.tOj/......,b..x.L|
-00000450 99 cb 38 ad ef a4 00 42 51 04 3b b8 4b 06 89 ee |..8....BQ.;.K...|
-00000460 33 48 3e c7 72 9c de f2 e4 23 5f 76 33 db cb 92 |3H>.r....#_v3...|
-00000470 92 b0 90 ea 25 4f 05 68 b3 8e 59 9c 36 8b 1b b0 |....%O.h..Y.6...|
-00000480 02 73 96 bf e6 fe 80 2c 32 26 ac 91 33 af cd 86 |.s.....,2&..3...|
-00000490 57 cc de d3 a2 eb 9e 43 ea 5b d4 56 f0 1b 95 3b |W......C.[.V...;|
-000004a0 a1 da 33 21 cb 0b 48 92 35 73 0c 33 01 c4 6d 79 |..3!..H.5s.3..my|
-000004b0 7a bb 39 a1 32 3a 85 18 9f 91 a7 e1 42 0a |z.9.2:......B.|
+000000a0 17 03 03 00 17 c0 07 64 56 b1 bb f8 bf 36 6b df |.......dV....6k.|
+000000b0 e9 ee 72 cc 79 45 f5 8c b8 0c b3 5d 17 03 03 02 |..r.yE.....]....|
+000000c0 6d 2e ab b5 84 4f d7 9e 4e 0d 6e a0 42 c1 f0 a6 |m....O..N.n.B...|
+000000d0 62 a3 26 eb 9d 9a 42 a5 5d 1f 59 ad 37 a9 8a af |b.&...B.].Y.7...|
+000000e0 0d 7b 8f 5a d1 d5 d8 bc 15 5b 0d 0e d2 a9 bb 14 |.{.Z.....[......|
+000000f0 56 ed 30 4e 9b aa f9 5a 66 7d 4c 41 8e 6d 58 90 |V.0N...Zf}LA.mX.|
+00000100 52 4a f2 78 72 59 34 aa 58 7e 0c 44 1e bc 84 d8 |RJ.xrY4.X~.D....|
+00000110 50 17 bd aa 8c 4c d0 c5 e7 69 32 b8 c3 d6 e6 f9 |P....L...i2.....|
+00000120 70 93 99 1c 75 1b 13 f2 85 e0 b5 07 1b d8 5a 31 |p...u.........Z1|
+00000130 0a 1a 2e 97 86 ff 75 a1 db 45 b2 47 68 ed 88 d9 |......u..E.Gh...|
+00000140 fe 31 c9 c0 5e 37 f2 62 37 f7 01 81 11 07 a7 0f |.1..^7.b7.......|
+00000150 44 ec 17 3a 4a 38 b3 91 9f 77 6f f9 58 9e 9c 12 |D..:J8...wo.X...|
+00000160 6e 54 4c de 43 58 46 a5 f6 c7 58 7e df 33 d7 91 |nTL.CXF...X~.3..|
+00000170 e5 cb 9e 28 9d 7f a7 8a bd be 01 48 b7 b1 1e e2 |...(.......H....|
+00000180 7a 80 aa f9 cd 3f 62 0d a0 a0 63 0c ca 4b 5f a8 |z....?b...c..K_.|
+00000190 a9 5f 42 ac 44 57 67 b2 0f 5a b5 bb 59 a9 56 bd |._B.DWg..Z..Y.V.|
+000001a0 28 3c fb 5e 43 33 61 43 7b 60 48 7d 27 67 6a 06 |(<.^C3aC{`H}'gj.|
+000001b0 ac 0d db e4 d2 d4 b8 fa fb e8 32 f3 22 83 3a 63 |..........2.".:c|
+000001c0 f6 73 02 62 e0 d5 8a d2 61 a5 bf e1 2d 10 59 93 |.s.b....a...-.Y.|
+000001d0 55 60 be 32 ce 5c d5 5a f0 54 21 7d 8a 02 23 cf |U`.2.\.Z.T!}..#.|
+000001e0 38 2b 2b 67 50 22 72 f7 f7 bf 20 c2 34 df ae 3a |8++gP"r... .4..:|
+000001f0 44 b0 a6 2a 51 79 6f b1 7b ff d7 77 45 83 a9 fa |D..*Qyo.{..wE...|
+00000200 bf 3c de 34 e8 6a 33 74 6c 24 0b 85 39 ea 7c 13 |.<.4.j3tl$..9.|.|
+00000210 43 26 13 1b 61 56 85 0a 08 83 04 45 5f 5a 36 df |C&..aV.....E_Z6.|
+00000220 17 c0 59 e9 92 d8 6b 78 66 1f 43 a0 99 f8 4b b1 |..Y...kxf.C...K.|
+00000230 f0 8d 25 6f 0f 2e c7 f9 4d bb 79 74 b8 95 e6 b7 |..%o....M.yt....|
+00000240 41 0c de 2a d3 7e fc 0f 18 87 2d 21 dd 8d 5f 20 |A..*.~....-!.._ |
+00000250 4c 88 cb 63 f4 9c 07 64 14 02 0c 19 46 32 e5 1e |L..c...d....F2..|
+00000260 85 84 4a 71 b8 a5 50 92 ca 72 fe f4 9c 69 05 d4 |..Jq..P..r...i..|
+00000270 93 22 38 c1 09 e2 da 49 17 e8 e1 b3 f9 42 ee bf |."8....I.....B..|
+00000280 ea 40 b2 00 af b9 a8 f9 97 8e ef de 41 de 01 87 |.@..........A...|
+00000290 cc 13 23 64 8c a1 10 9a 91 38 9b cb fb 0b 04 66 |..#d.....8.....f|
+000002a0 fb 4b e3 77 e7 da 7a 75 5c 66 20 7e dc 22 a9 e6 |.K.w..zu\f ~."..|
+000002b0 6a 27 06 ed 3c fc 4c 30 ed f0 31 92 b2 eb a1 f3 |j'..<.L0..1.....|
+000002c0 a4 fd 83 20 37 62 71 95 ff 7c 65 e8 88 aa e7 c7 |... 7bq..|e.....|
+000002d0 3f 17 9c 94 6f 1a d9 c8 ac 00 8d ec 30 22 98 85 |?...o.......0"..|
+000002e0 da cc 69 41 f4 3a 66 1b e6 4c 38 62 8d 37 dc a1 |..iA.:f..L8b.7..|
+000002f0 08 cf 88 d4 26 7f 47 33 54 d8 aa d6 c5 02 fc 72 |....&.G3T......r|
+00000300 ff 50 19 9f 4a 0e 8b c8 32 6d 8e 15 e4 f1 ed 2e |.P..J...2m......|
+00000310 43 cb 9f 8c 7a 0e e1 a2 79 e2 f9 52 12 e4 2f a9 |C...z...y..R../.|
+00000320 c1 c5 0b 1f c2 21 c5 2e 21 de 3e 76 29 db 17 03 |.....!..!.>v)...|
+00000330 03 00 99 8a ee 54 88 93 d0 4b a0 31 18 ed 83 ff |.....T...K.1....|
+00000340 2c 44 78 ab 88 ea 72 d2 2a 27 71 a9 a1 ba 26 a5 |,Dx...r.*'q...&.|
+00000350 9a 9b 64 92 e8 c9 f8 02 47 b9 9f 53 95 a8 ad 5b |..d.....G..S...[|
+00000360 bd 81 17 87 69 0c 77 c1 0e d7 cb 5b 9f 2d 36 86 |....i.w....[.-6.|
+00000370 f5 fc 6d ba d8 f5 63 dd e4 f5 0a 61 8d b2 a9 bb |..m...c....a....|
+00000380 a5 a5 d6 41 d4 aa db 46 79 56 02 51 f4 ac d3 57 |...A...FyV.Q...W|
+00000390 57 b4 53 71 9f fe ea a6 76 f3 0f ca 39 93 f3 34 |W.Sq....v...9..4|
+000003a0 c6 96 96 09 8e 12 04 cc 1e 82 9f 78 6b 1c a2 fc |...........xk...|
+000003b0 0c 9d c6 00 3c 33 3a 92 c5 ce 96 15 50 1a 75 6d |....<3:.....P.um|
+000003c0 85 ec b6 64 12 2b eb 3a 52 8f 6d 35 17 03 03 00 |...d.+.:R.m5....|
+000003d0 35 7f 2b 30 fa e0 92 25 a2 1b 11 f8 cd 04 0d 57 |5.+0...%.......W|
+000003e0 01 42 cf e9 0c 92 7f d1 fd fa 26 61 0d 85 d7 d5 |.B........&a....|
+000003f0 3c fd cf 73 98 dc 88 a2 76 63 59 82 45 2d e3 bc |<..s....vcY.E-..|
+00000400 a2 c0 0b 83 41 75 17 03 03 00 93 f3 17 09 b2 e8 |....Au..........|
+00000410 53 11 9b 3e 3a 10 a0 e6 58 04 81 82 cb eb a5 19 |S..>:...X.......|
+00000420 0f a3 25 e2 eb ab 7c 07 2b e6 22 19 30 aa fc a6 |..%...|.+.".0...|
+00000430 bd c4 7d 69 33 38 2b 58 55 5b a7 27 29 86 af d5 |..}i38+XU[.')...|
+00000440 f9 5a b4 85 ad a0 73 ab f7 61 3f 2e 66 53 f5 8f |.Z....s..a?.fS..|
+00000450 c7 09 4b 01 99 d0 68 93 32 d1 2e 8f 89 e5 e1 ea |..K...h.2.......|
+00000460 ba f2 fb 07 ee 58 7c 28 ff 59 1d d7 f7 b3 e2 56 |.....X|(.Y.....V|
+00000470 98 56 cd 9d d1 4f 26 7e 77 0d a0 c1 92 c5 a0 83 |.V...O&~w.......|
+00000480 c9 7c d8 7d a8 91 d3 ae 71 41 1d 06 33 68 b8 52 |.|.}....qA..3h.R|
+00000490 ad 84 a7 21 80 8f e5 c6 37 11 da 6c 5a 3a |...!....7..lZ:|
>>> Flow 5 (client to server)
-00000000 17 03 03 00 45 b7 e2 1a d9 6a aa c1 54 e3 9a 42 |....E....j..T..B|
-00000010 11 cd 13 c2 dc 5a b0 fa e3 62 09 a1 4b 9a a1 b3 |.....Z...b..K...|
-00000020 84 7b 63 29 69 47 5c bf ca c6 36 2f ae e0 2f 6e |.{c)iG\...6/../n|
-00000030 1b 42 c4 c9 65 17 e8 bd c4 97 5b e4 5f 27 86 d2 |.B..e.....[._'..|
-00000040 1f 97 1f 68 9a 1f ee 09 04 82 |...h......|
+00000000 17 03 03 00 35 28 34 b9 16 07 9a c1 82 ad 9f b7 |....5(4.........|
+00000010 78 fa 1a d0 1f 57 98 95 37 86 cf 1d 67 19 47 48 |x....W..7...g.GH|
+00000020 e9 ab fe 0c ff 26 c6 78 88 1a ad 75 48 63 4b 6e |.....&.x...uHcKn|
+00000030 72 4a 44 4f 27 b6 9d 56 b6 43 |rJDO'..V.C|
>>> Flow 6 (server to client)
-00000000 17 03 03 00 1e ed fb 39 62 34 b9 5d a3 db 30 fe |.......9b4.]..0.|
-00000010 ed 5e 92 77 44 7e fb 77 84 5e 54 6b 11 7c 27 99 |.^.wD~.w.^Tk.|'.|
-00000020 80 66 a5 17 03 03 00 13 9b 78 92 3b 84 3d cb 69 |.f.......x.;.=.i|
-00000030 86 2b d1 db cc 91 d3 00 55 43 2f |.+......UC/|
+00000000 17 03 03 00 1e d9 1f 35 86 22 7e 10 f1 8d e5 82 |.......5."~.....|
+00000010 f2 f6 88 81 a3 66 da 6a 1e 2f 94 94 16 02 2a 52 |.....f.j./....*R|
+00000020 69 8b bb 17 03 03 00 13 3c 87 88 8c c0 78 64 18 |i.......<....xd.|
+00000030 9a 9e 07 fd ac d7 2d 5d ab bf a8 |......-]...|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-IssueTicket b/src/crypto/tls/testdata/Server-TLSv13-IssueTicket
index 1a8b384699..fa1f80181a 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-IssueTicket
+++ b/src/crypto/tls/testdata/Server-TLSv13-IssueTicket
@@ -1,103 +1,99 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 e4 01 00 00 e0 03 03 26 46 4d 2d 7d |...........&FM-}|
-00000010 5c dc ef fb 2b 8b f7 15 4b ba 8b 1a 26 da f6 9b |\...+...K...&...|
-00000020 e6 3c c6 8c a0 f9 6c 60 f6 11 81 20 53 f8 00 fb |.<....l`... S...|
-00000030 8b be ff 98 74 c9 d9 3d aa 40 4d 0e 05 96 f9 30 |....t..=.@M....0|
-00000040 d6 f5 7b f1 bc 31 18 30 5f 24 03 a8 00 08 13 02 |..{..1.0_$......|
-00000050 13 03 13 01 00 ff 01 00 00 8f 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 23 00 00 00 16 00 00 00 17 00 00 |.....#..........|
-00000090 00 0d 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 |................|
-000000a0 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 |................|
-000000b0 06 01 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 |...+......-.....|
-000000c0 33 00 26 00 24 00 1d 00 20 b6 ad 52 4d 37 b1 eb |3.&.$... ..RM7..|
-000000d0 1e 57 2b a8 5d e7 43 b9 a0 98 47 8b ff 40 a9 14 |.W+.].C...G..@..|
-000000e0 9e 23 26 c7 47 a7 cb f6 47 |.#&.G...G|
+00000000 16 03 01 00 ce 01 00 00 ca 03 03 bb e2 a4 a5 7e |...............~|
+00000010 63 65 5c a5 7f 3f 13 a1 9d 5f 53 3c d2 b1 84 bd |ce\..?..._S<....|
+00000020 51 0c 9a 14 e8 8a 5a 53 b8 27 88 20 e7 04 4d dc |Q.....ZS.'. ..M.|
+00000030 76 f3 7f bd 00 ce 46 d2 a6 58 26 99 02 91 88 bf |v.....F..X&.....|
+00000040 b5 6b 56 2b b6 bc 51 b2 e4 cd 82 8d 00 04 13 01 |.kV+..Q.........|
+00000050 00 ff 01 00 00 7d 00 0b 00 04 03 00 01 02 00 0a |.....}..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000070 00 00 00 16 00 00 00 17 00 00 00 0d 00 1e 00 1c |................|
+00000080 04 03 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b |................|
+00000090 08 04 08 05 08 06 04 01 05 01 06 01 00 2b 00 03 |.............+..|
+000000a0 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 24 00 |....-.....3.&.$.|
+000000b0 1d 00 20 b2 99 9c bb d1 4c c7 61 5f aa bf 2f 06 |.. .....L.a_../.|
+000000c0 a3 50 e7 49 7d 11 ae 68 9b b0 be be 82 6d 27 29 |.P.I}..h.....m')|
+000000d0 89 4c 4a |.LJ|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 53 f8 00 fb |........... S...|
-00000030 8b be ff 98 74 c9 d9 3d aa 40 4d 0e 05 96 f9 30 |....t..=.@M....0|
-00000040 d6 f5 7b f1 bc 31 18 30 5f 24 03 a8 13 02 00 00 |..{..1.0_$......|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 e7 04 4d dc |........... ..M.|
+00000030 76 f3 7f bd 00 ce 46 d2 a6 58 26 99 02 91 88 bf |v.....F..X&.....|
+00000040 b5 6b 56 2b b6 bc 51 b2 e4 cd 82 8d 13 01 00 00 |.kV+..Q.........|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 b9 4a b7 2a b5 48 |...........J.*.H|
-00000090 bc ba 18 3e 1a 99 bd fa 0d fc 2a 5d 52 93 b5 97 |...>......*]R...|
-000000a0 5c 17 03 03 02 6d 30 8f 19 00 1c fa 90 a7 6c 08 |\....m0.......l.|
-000000b0 6f 5a e8 d8 e0 3e 81 30 f1 11 85 7e 35 47 b3 d0 |oZ...>.0...~5G..|
-000000c0 48 95 ce af e6 2f fc 22 0a 5f 56 bd 1c 7d 8c 48 |H..../."._V..}.H|
-000000d0 f3 ad b7 5b 2e 4b d8 d1 16 46 7a ba c3 71 02 3c |...[.K...Fz..q.<|
-000000e0 54 75 b8 92 02 b1 b9 cc 15 c4 fa d1 2d ba 0d 9f |Tu..........-...|
-000000f0 65 a1 78 0d 8f d6 1c be fa 42 1f d7 48 1a 8e 11 |e.x......B..H...|
-00000100 64 4c 12 ef bd 65 9d b4 31 18 4f 2a 77 c4 1f 1b |dL...e..1.O*w...|
-00000110 90 90 37 ea 59 aa 05 bf 45 04 fb e8 a9 3f f9 11 |..7.Y...E....?..|
-00000120 f9 25 95 fc d4 8e 5c 84 19 f3 4c e4 05 c3 db 8c |.%....\...L.....|
-00000130 07 f9 b3 b0 6d ce d3 14 aa 78 17 f9 2f 14 1b bc |....m....x../...|
-00000140 4b 23 29 f1 2e 7c 3b 71 9b cf 0b d5 02 48 5e ce |K#)..|;q.....H^.|
-00000150 9c 43 dd 29 17 42 0b 9d 0e a7 a7 93 e1 37 cc 97 |.C.).B.......7..|
-00000160 df 0f 2d d3 f7 01 08 34 5f bd ad 12 12 6f 87 56 |..-....4_....o.V|
-00000170 4e 99 16 f6 6e 61 5c f0 0e 30 0b d5 38 37 70 97 |N...na\..0..87p.|
-00000180 ed e1 79 74 00 cc 55 be a9 32 7d 72 50 27 42 c9 |..yt..U..2}rP'B.|
-00000190 99 64 ea bd 3e c8 4f b0 cc 31 ef 10 57 9f c1 02 |.d..>.O..1..W...|
-000001a0 ca db f6 d6 53 94 d2 83 57 71 e9 06 7a dd 46 3b |....S...Wq..z.F;|
-000001b0 b1 2c f8 87 1c 8b 8a 04 05 2f d0 32 54 9a 80 33 |.,......./.2T..3|
-000001c0 b2 95 e5 62 71 e9 1a 3b ea 64 ee 81 29 c4 ea 53 |...bq..;.d..)..S|
-000001d0 de 6b 27 b1 04 48 27 ba 7f 28 aa 9e 15 82 49 a9 |.k'..H'..(....I.|
-000001e0 43 3d d3 33 82 50 a9 4e 38 ed 8d f8 e8 0e 11 ab |C=.3.P.N8.......|
-000001f0 8b 6e 63 e9 c1 cf ee 45 4f a0 62 e7 2e 00 b8 61 |.nc....EO.b....a|
-00000200 2a 29 5e 04 e2 81 11 b3 64 f3 b5 b0 ec ae 63 6c |*)^.....d.....cl|
-00000210 27 56 ac f2 09 d3 a4 c8 18 4a 55 c8 ff fd 8b 42 |'V.......JU....B|
-00000220 63 00 3a c9 25 40 b7 8d 17 f3 95 76 7b 01 cf bc |c.:.%@.....v{...|
-00000230 9b a7 4c 03 4a 7d 3c 54 16 8f 84 ca 2f 1a f5 12 |..L.J}.|
-00000330 f1 1e 11 c7 72 f5 65 b4 03 38 f2 48 16 a9 20 31 |....r.e..8.H.. 1|
-00000340 c2 52 4c 33 92 70 45 91 19 f4 5c 08 77 49 af 25 |.RL3.pE...\.wI.%|
-00000350 8e b5 bd 3f e3 93 dc e6 26 b0 8a 30 69 f1 86 17 |...?....&..0i...|
-00000360 72 31 66 87 2f d4 42 70 4c e0 58 61 6e b2 38 0b |r1f./.BpL.Xan.8.|
-00000370 13 ad 32 83 14 81 d4 af dd 9f 17 09 af 3b 64 78 |..2..........;dx|
-00000380 c8 63 da 05 70 47 54 f9 c6 f5 f8 e6 97 e1 d0 87 |.c..pGT.........|
-00000390 aa 5a e7 5b d3 a3 b3 ce be 56 30 e7 4d ad 43 bd |.Z.[.....V0.M.C.|
-000003a0 5e 88 9a ef 34 78 06 eb 6f 8f 04 39 47 6a c2 3d |^...4x..o..9Gj.=|
-000003b0 ba 17 03 03 00 45 89 37 db 55 b2 9e 6e 31 a0 9b |.....E.7.U..n1..|
-000003c0 97 51 27 13 b0 7e 2e 85 4a 9b 72 b0 fe c5 e4 12 |.Q'..~..J.r.....|
-000003d0 fd ea 29 d5 bb ae a2 24 e2 0d b4 cd 28 92 5c 88 |..)....$....(.\.|
-000003e0 98 b4 e4 8e a8 46 c6 a0 0e c0 73 ba f7 62 3a 43 |.....F....s..b:C|
-000003f0 1a c7 d3 4b 5b 47 7b 44 8b bb 7b 17 03 03 00 a3 |...K[G{D..{.....|
-00000400 f1 5f 26 2b 1c 99 6d 1d 55 bc a7 2f ae c8 3a ed |._&+..m.U../..:.|
-00000410 5a 16 3c 83 e8 d4 18 7e 84 fa ba 21 0f 30 b0 05 |Z.<....~...!.0..|
-00000420 ec 45 92 53 80 7a 78 d4 9e e0 02 e9 11 74 a6 e2 |.E.S.zx......t..|
-00000430 87 7e 43 26 c0 18 46 6b 28 e5 f4 92 89 5c 0d b5 |.~C&..Fk(....\..|
-00000440 8d 90 55 4f 3b 0a f4 ba 1b fb 60 54 46 23 03 28 |..UO;.....`TF#.(|
-00000450 6e c3 3b 4d 69 62 65 d5 4e 95 46 c9 f2 8d ae f9 |n.;Mibe.N.F.....|
-00000460 53 a6 65 da ca 1e b7 f7 80 a8 97 97 ca 38 14 a5 |S.e..........8..|
-00000470 34 81 e2 68 12 fb 45 90 c2 f9 c9 70 fe 28 b8 b5 |4..h..E....p.(..|
-00000480 6c 1d 2c d4 07 69 1d eb 1f 4b df ba ca 5e e0 65 |l.,..i...K...^.e|
-00000490 ad ee be 41 02 78 23 19 b9 ea 1d 65 20 43 0e 3d |...A.x#....e C.=|
-000004a0 11 03 b3 |...|
+00000080 03 03 00 01 01 17 03 03 00 17 c6 67 93 be 69 04 |...........g..i.|
+00000090 58 4f 1d 93 b6 5c 1c 10 8a 91 d0 c0 db 0b d1 0a |XO...\..........|
+000000a0 d1 17 03 03 02 6d da d6 28 74 c7 60 d6 02 3e 28 |.....m..(t.`..>(|
+000000b0 29 17 50 b9 01 4b 9b 93 07 9d 09 f0 17 05 e0 88 |).P..K..........|
+000000c0 53 ec c3 28 f7 a6 4e 9b 80 a3 fd 20 db 97 51 6a |S..(..N.... ..Qj|
+000000d0 b1 7a 6d 93 26 61 c8 9c 6d 37 65 94 b4 74 a0 60 |.zm.&a..m7e..t.`|
+000000e0 b1 a1 38 4c eb 5e a9 c4 bd d4 29 ee e9 e3 ab 56 |..8L.^....)....V|
+000000f0 68 67 57 da b3 3d 85 bd 26 67 e1 52 83 a6 69 14 |hgW..=..&g.R..i.|
+00000100 3b 30 31 c7 71 83 fa 62 13 ea a3 a5 de 4b 32 3f |;01.q..b.....K2?|
+00000110 c6 48 0b 96 cd 4b da 96 6d e2 31 88 ca 96 5f 63 |.H...K..m.1..._c|
+00000120 cb 39 37 d8 fa 8f 1f b9 e2 c5 6b ae 60 05 5b ed |.97.......k.`.[.|
+00000130 e0 5d 83 fa 2b 22 f4 e8 33 27 48 e7 c4 3d 54 22 |.]..+"..3'H..=T"|
+00000140 5a 60 a9 7a 0d 9b 42 e2 50 28 0e 6c 13 16 a1 51 |Z`.z..B.P(.l...Q|
+00000150 60 81 8f 80 e2 1b 53 24 62 78 b7 0a 4a 9b 2f a7 |`.....S$bx..J./.|
+00000160 97 b3 ba e5 34 0d 76 a6 0e ea ec 91 f0 9c a9 6d |....4.v........m|
+00000170 57 47 ef a3 c4 7a 62 a8 1f c0 1a d7 ea 31 90 20 |WG...zb......1. |
+00000180 76 13 ae f1 24 9d 60 9f 30 9f 2b 2a 2f 0a 39 6c |v...$.`.0.+*/.9l|
+00000190 7a 47 fe 11 1c 78 42 a1 1c ed c3 cd d2 6a cd 4f |zG...xB......j.O|
+000001a0 66 1b 51 d4 43 4e 45 23 15 48 e4 84 3e 89 a3 55 |f.Q.CNE#.H..>..U|
+000001b0 7e b0 a6 c2 1c cd eb cf 88 6b e7 d2 07 25 ef 37 |~........k...%.7|
+000001c0 e1 8a a5 b9 03 7e 70 73 9c 23 1a 62 07 56 db ed |.....~ps.#.b.V..|
+000001d0 93 e3 8a 91 8b 90 74 14 14 cc ff 9e ea e5 45 dd |......t.......E.|
+000001e0 a6 2d dc e6 cb 8c 59 33 91 da e6 5c b4 73 4f 36 |.-....Y3...\.sO6|
+000001f0 f1 3c d9 6e ba 2c c4 51 de 4f 8a 69 62 c4 db b1 |.<.n.,.Q.O.ib...|
+00000200 9e 67 7a 5f 01 7b b7 b2 55 b1 14 c0 46 d1 43 16 |.gz_.{..U...F.C.|
+00000210 a0 70 84 7e b8 a3 04 ce e3 e0 0e 5e 5f 3f 95 7a |.p.~.......^_?.z|
+00000220 ef 79 8d 50 84 cd 02 f1 e0 e5 f9 26 cf 7a f9 da |.y.P.......&.z..|
+00000230 a3 7d 22 31 4d 61 82 f6 ff fd 69 23 07 53 07 df |.}"1Ma....i#.S..|
+00000240 5a eb 50 86 28 44 24 06 9b 21 ef ef 78 bc 67 13 |Z.P.(D$..!..x.g.|
+00000250 c5 27 d8 18 db c7 fa d5 a6 0c 40 09 e3 e5 17 0c |.'........@.....|
+00000260 61 ae bc 48 98 ab 7b 57 82 f7 87 a5 4b 96 25 77 |a..H..{W....K.%w|
+00000270 e4 59 53 d1 d3 7b 55 08 e0 1a 5d 9b 0f 2e 6f cd |.YS..{U...]...o.|
+00000280 96 9d 19 09 07 84 08 c1 cf bd 99 af 80 52 c0 f7 |.............R..|
+00000290 0c 50 85 14 7c fd cb 61 01 05 ee 92 60 bb ac 4c |.P..|..a....`..L|
+000002a0 b4 37 48 dc b1 34 9d 26 3a fd dc ae 21 2f d3 51 |.7H..4.&:...!/.Q|
+000002b0 84 c3 0e 8f e1 b4 fb 0b 2e 3b 51 a9 e8 c2 d9 d9 |.........;Q.....|
+000002c0 6b a5 af 90 30 97 a2 32 9a a3 9d 5d b3 75 c6 48 |k...0..2...].u.H|
+000002d0 4b ee a3 23 85 98 a5 b5 00 fd c5 3a 27 65 9e d0 |K..#.......:'e..|
+000002e0 19 a8 5a 8c 8b eb 49 c6 58 16 9a 88 67 54 82 a9 |..Z...I.X...gT..|
+000002f0 29 0a 98 82 e4 f8 f0 c9 17 a6 81 91 1b c1 2a b7 |).............*.|
+00000300 de c3 8b 2d a6 55 1f 61 89 90 84 15 c8 33 6e cb |...-.U.a.....3n.|
+00000310 5c f4 e2 17 03 03 00 99 49 e0 38 43 34 61 b9 37 |\.......I.8C4a.7|
+00000320 2c 3e d5 c7 8c d7 9b a6 6c 8e ef a6 28 13 3c 79 |,>......l...(..p[Nk..R...h.|
+00000340 a0 07 ac c1 17 6e d1 11 76 1d d7 1e e2 26 3e 76 |.....n..v....&>v|
+00000350 2b f9 a4 55 67 0b 9c cd db ab 71 1a 84 33 74 eb |+..Ug.....q..3t.|
+00000360 b1 4b 26 d8 e8 1c 84 2b 62 c7 70 27 16 fb 16 ae |.K&....+b.p'....|
+00000370 9d 72 3a 42 c1 cb cd c8 d0 dd 9c f0 51 2e 33 c1 |.r:B........Q.3.|
+00000380 46 35 56 ad 3b ea be 6e 14 4d 05 d1 6d 85 93 86 |F5V.;..n.M..m...|
+00000390 cc 6a 1c bf 03 cf 8f 92 c9 18 74 e0 66 0a b6 9a |.j........t.f...|
+000003a0 38 ac 1a 73 f4 e0 70 ec 93 61 67 9f b8 12 6f 1f |8..s..p..ag...o.|
+000003b0 17 17 03 03 00 35 59 6b 86 a8 cc 89 c6 fa 4f 95 |.....5Yk......O.|
+000003c0 25 b6 90 08 ac bf 9f d5 c9 3c 6c e5 cd 0d 14 00 |%........>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 88 0d 45 f0 61 |..........E..E.a|
-00000010 a3 d0 7b 33 9e 17 c5 c3 6f 8f f6 67 b8 03 65 5f |..{3....o..g..e_|
-00000020 bf 94 e9 1d 58 eb 4d 12 68 8a 96 42 6f 08 08 b8 |....X.M.h..Bo...|
-00000030 be ce 2c f0 c4 00 d4 22 e6 94 09 05 f2 a7 77 0f |..,...."......w.|
-00000040 48 e9 5c 6c e9 b2 9a d6 ff 48 2b 08 9a ea 23 1a |H.\l.....H+...#.|
+00000000 14 03 03 00 01 01 17 03 03 00 35 74 1e 4a 56 2c |..........5t.JV,|
+00000010 fc 14 0b 66 ab 2f 56 5b fd 33 fe c2 a4 df 0b 62 |...f./V[.3.....b|
+00000020 63 11 40 67 d2 11 1b 53 c5 b9 1e 0e 20 83 85 b0 |c.@g...S.... ...|
+00000030 3a 81 79 bc a7 9f 49 ab 22 bd 10 8d 3e c9 95 79 |:.y...I."...>..y|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 2a f5 09 7f 7b 5f 8a ff d3 cc 16 |.....*...{_.....|
-00000010 d1 d3 38 76 5c f7 e3 ee f3 72 b5 92 8e f9 bf 37 |..8v\....r.....7|
-00000020 7e dc 61 17 03 03 00 13 66 ba 9e ff 3a 9f 25 74 |~.a.....f...:.%t|
-00000030 44 35 70 f4 cf ae dc b0 3c 28 44 |D5p.....<(D|
+00000000 17 03 03 00 1e a4 83 3b 61 a1 00 d5 56 84 4c 83 |.......;a...V.L.|
+00000010 0a 8c 86 13 0c e7 95 71 aa 48 e0 d2 5f 11 5f 45 |.......q.H.._._E|
+00000020 41 7a 10 17 03 03 00 13 ca 8b f5 38 e5 5f e0 8a |Az.........8._..|
+00000030 e3 08 ba 7d 06 f6 b3 b4 6f e9 2b |...}....o.+|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-IssueTicketPreDisable b/src/crypto/tls/testdata/Server-TLSv13-IssueTicketPreDisable
index ed3f55ad37..a939822efc 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-IssueTicketPreDisable
+++ b/src/crypto/tls/testdata/Server-TLSv13-IssueTicketPreDisable
@@ -1,103 +1,99 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 e4 01 00 00 e0 03 03 4a ec fd a5 c5 |...........J....|
-00000010 ef 77 88 18 25 40 50 c8 24 60 45 85 e6 3e 55 86 |.w..%@P.$`E..>U.|
-00000020 d1 ea 0e 5f 0b d1 66 7a 1c 90 ad 20 a3 63 23 52 |..._..fz... .c#R|
-00000030 d8 c8 f6 79 20 04 8d 07 eb 2f 78 a3 1a 0d 58 af |...y ..../x...X.|
-00000040 70 3c ef 4b 90 43 42 67 57 39 bf fa 00 08 13 02 |p<.K.CBgW9......|
-00000050 13 03 13 01 00 ff 01 00 00 8f 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 23 00 00 00 16 00 00 00 17 00 00 |.....#..........|
-00000090 00 0d 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 |................|
-000000a0 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 |................|
-000000b0 06 01 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 |...+......-.....|
-000000c0 33 00 26 00 24 00 1d 00 20 23 61 a3 8f f6 41 bc |3.&.$... #a...A.|
-000000d0 08 52 ef 97 01 0e ba 95 f4 33 b6 8d 15 d0 ff ed |.R.......3......|
-000000e0 a4 d1 84 23 3b f3 ef 3a 2d |...#;..:-|
+00000000 16 03 01 00 ce 01 00 00 ca 03 03 cd 51 e4 0b ee |............Q...|
+00000010 9c 83 0f a1 bd 1a c8 b4 94 17 5e 17 fb 63 43 31 |..........^..cC1|
+00000020 89 86 03 fa 82 d4 bb c5 ba 9d 60 20 a1 0b c7 9c |..........` ....|
+00000030 b0 3f d9 7a 52 bd c0 3f cd c5 21 54 40 a5 60 73 |.?.zR..?..!T@.`s|
+00000040 fd ff 07 99 75 59 0d f3 bd 57 f6 81 00 04 13 01 |....uY...W......|
+00000050 00 ff 01 00 00 7d 00 0b 00 04 03 00 01 02 00 0a |.....}..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000070 00 00 00 16 00 00 00 17 00 00 00 0d 00 1e 00 1c |................|
+00000080 04 03 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b |................|
+00000090 08 04 08 05 08 06 04 01 05 01 06 01 00 2b 00 03 |.............+..|
+000000a0 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 24 00 |....-.....3.&.$.|
+000000b0 1d 00 20 04 16 08 0b 67 76 58 60 4a 32 c2 ea 1b |.. ....gvX`J2...|
+000000c0 4a 54 fa 55 9b 39 d8 80 c4 eb 42 cc 1a 84 fe d7 |JT.U.9....B.....|
+000000d0 0a 0d 43 |..C|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 a3 63 23 52 |........... .c#R|
-00000030 d8 c8 f6 79 20 04 8d 07 eb 2f 78 a3 1a 0d 58 af |...y ..../x...X.|
-00000040 70 3c ef 4b 90 43 42 67 57 39 bf fa 13 02 00 00 |p<.K.CBgW9......|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 a1 0b c7 9c |........... ....|
+00000030 b0 3f d9 7a 52 bd c0 3f cd c5 21 54 40 a5 60 73 |.?.zR..?..!T@.`s|
+00000040 fd ff 07 99 75 59 0d f3 bd 57 f6 81 13 01 00 00 |....uY...W......|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 80 72 6f c7 2d 22 |...........ro.-"|
-00000090 40 51 35 22 9b 97 51 33 60 fa c1 2c d3 0f 25 6a |@Q5"..Q3`..,..%j|
-000000a0 4d 17 03 03 02 6d f3 3a 89 a6 9a 1f 2b f4 1a 48 |M....m.:....+..H|
-000000b0 e9 bd ef da 9d 7b f0 6c 61 ca 21 82 1b 30 6f 60 |.....{.la.!..0o`|
-000000c0 01 72 24 4f ea 66 ef 3b 35 b7 ae d9 45 c9 2a 00 |.r$O.f.;5...E.*.|
-000000d0 99 da 50 ae ac 8f 77 a4 e7 b4 de f6 c8 dd b8 f3 |..P...w.........|
-000000e0 bc cb 7c c8 cf 2f 63 61 66 16 7f 7f 61 2c 52 c9 |..|../caf...a,R.|
-000000f0 8f af 0d e2 55 d7 a4 ed 7e 12 b0 0d ec e9 a4 47 |....U...~......G|
-00000100 03 e6 fa d1 6b 2f e3 22 a8 f5 c5 e6 e6 78 63 a1 |....k/.".....xc.|
-00000110 b7 00 98 04 e8 fd ff 67 62 dc 89 f4 0d 97 93 4e |.......gb......N|
-00000120 85 ec e0 68 f0 04 94 02 49 95 f9 08 99 30 37 d8 |...h....I....07.|
-00000130 ad 31 52 1d 1d 23 09 9e 7a 97 45 d3 95 2f 03 2d |.1R..#..z.E../.-|
-00000140 64 f7 5b cb 53 f5 89 ef 45 90 72 38 33 aa 62 1e |d.[.S...E.r83.b.|
-00000150 b8 3e 00 b2 7f 89 0b 3a e6 17 93 ac 19 7d 09 bd |.>.....:.....}..|
-00000160 ca ca 83 87 33 f9 f0 63 f3 4e 7b 47 56 0d cb b5 |....3..c.N{GV...|
-00000170 90 81 88 cd 02 78 bf 96 64 c0 ba 58 b5 06 18 04 |.....x..d..X....|
-00000180 d9 14 8b 92 74 81 76 b3 23 d9 ad 4c 8b 73 61 36 |....t.v.#..L.sa6|
-00000190 64 d9 b6 2e 98 7e 7f d4 14 6e 4c a4 b4 71 35 5b |d....~...nL..q5[|
-000001a0 4d e7 10 a8 b3 bb 40 5d 9f de 67 bb ae 0c 97 8b |M.....@]..g.....|
-000001b0 25 cf cb aa 13 44 9f cb ff 2e 1c 54 ca de cb 13 |%....D.....T....|
-000001c0 f9 c7 0e 49 9d d0 b3 d5 0e 29 3c 50 b9 2b 56 1f |...I.....).1{........|
-00000430 06 d6 19 09 44 c2 8f 7c ef bd ea 06 a6 8f 38 42 |....D..|......8B|
-00000440 1b a1 be 12 1f 72 38 49 96 e4 74 2f 42 19 2c 55 |.....r8I..t/B.,U|
-00000450 16 45 a9 e0 a8 76 6d 36 68 84 fd 0e 40 44 df 93 |.E...vm6h...@D..|
-00000460 ae 12 79 78 4c ec 72 16 fe 54 c0 14 ac 47 ed 88 |..yxL.r..T...G..|
-00000470 78 98 c8 cb ca 49 de fd 12 e1 96 d0 c7 89 ee 89 |x....I..........|
-00000480 df d5 71 98 8a 42 7e 3e 24 5a 64 44 19 96 cc e4 |..q..B~>$ZdD....|
-00000490 9c f2 8e 52 8b 1d 39 15 af c7 cd 54 d9 84 01 ef |...R..9....T....|
-000004a0 fc ac 54 |..T|
+00000080 03 03 00 01 01 17 03 03 00 17 ec 4d 41 82 de 4f |...........MA..O|
+00000090 c6 cf 1e 56 06 65 0e a4 e7 66 34 1d 89 59 b3 c2 |...V.e...f4..Y..|
+000000a0 0a 17 03 03 02 6d 00 e1 17 f1 b3 5e a7 14 b3 f8 |.....m.....^....|
+000000b0 3a ab 85 d4 80 75 69 01 6c 91 3f 79 ab 8f 51 e0 |:....ui.l.?y..Q.|
+000000c0 f6 a5 65 ab 7e 72 e5 83 99 b2 cb cd f9 5f 27 db |..e.~r......._'.|
+000000d0 90 70 9c c1 e5 6d 80 3e 59 7c 4d fa f1 23 8a a7 |.p...m.>Y|M..#..|
+000000e0 f4 81 22 32 5b e2 4e d0 eb ab bd 96 05 42 05 5c |.."2[.N......B.\|
+000000f0 20 5c 8a 3e ca fd b8 aa dd f2 c4 3e dc 7e a5 ab | \.>.......>.~..|
+00000100 95 a4 20 03 0e 41 9b 14 55 91 1b 9c 3b 17 bc 2a |.. ..A..U...;..*|
+00000110 60 c0 ee b1 78 e9 37 c4 65 ef 8c 29 ec d9 10 81 |`...x.7.e..)....|
+00000120 a0 1d c9 ac cf e5 36 90 88 d3 70 6d 59 66 61 a8 |......6...pmYfa.|
+00000130 18 79 ad d8 c7 3e 1f a5 db dc b5 21 83 b0 ae 16 |.y...>.....!....|
+00000140 ce 8e 98 d4 8e 28 c1 d3 d2 ef 51 35 45 41 a7 b4 |.....(....Q5EA..|
+00000150 e1 15 bb 32 10 aa b1 27 be 53 5e 96 ef 0b bd 2f |...2...'.S^..../|
+00000160 81 66 18 f4 8b 9a cc be 67 c1 32 e3 c0 ea e5 c0 |.f......g.2.....|
+00000170 76 2c 36 7f 91 11 13 c1 a4 04 7e 8e 7b 60 a5 3d |v,6.......~.{`.=|
+00000180 fa 3c d8 68 9a 7e 4b 23 3d 18 1b a3 34 a9 81 a4 |.<.h.~K#=...4...|
+00000190 00 09 cd 56 eb f2 29 9f 17 8d 48 4d 21 a2 4e ec |...V..)...HM!.N.|
+000001a0 f0 a0 8d b1 ed d6 c7 01 d0 8e 2f 25 65 9f ac eb |........../%e...|
+000001b0 44 09 f2 75 db 37 a3 94 cb 70 29 59 37 97 71 63 |D..u.7...p)Y7.qc|
+000001c0 9b fa 0f 0f 33 75 0a 60 4f 78 97 9e 6a 2c 4b df |....3u.`Ox..j,K.|
+000001d0 54 cc c0 ac 57 4c f3 3a e3 79 01 b9 c3 8c 37 d2 |T...WL.:.y....7.|
+000001e0 8f d9 e7 cd 33 5a 0c bb 43 7e 39 5f 63 9f a5 11 |....3Z..C~9_c...|
+000001f0 f5 6e e0 95 1f 09 03 56 0f ec b9 7d 08 31 c5 57 |.n.....V...}.1.W|
+00000200 fa a6 57 15 6c 6b 91 d4 9f 5d c2 40 8b 3d 3a 57 |..W.lk...].@.=:W|
+00000210 c2 64 55 bd 88 bb 5e 24 7f fe 79 0c 88 f3 a7 1c |.dU...^$..y.....|
+00000220 f8 20 6f ba d6 ec fc b2 04 2a d7 b7 17 5e 4c 2e |. o......*...^L.|
+00000230 24 cd 1b 8a 04 fe 21 e0 5b 90 ec f4 30 df bf fe |$.....!.[...0...|
+00000240 a8 f9 2b 40 c1 23 15 f2 44 87 9a aa 30 80 70 27 |..+@.#..D...0.p'|
+00000250 80 6f 90 08 b5 47 2e 01 ea 77 3a ba a4 4b 77 8a |.o...G...w:..Kw.|
+00000260 12 b4 4e e1 a6 04 8a 01 31 60 27 35 bf 76 de 09 |..N.....1`'5.v..|
+00000270 aa 8a c4 c4 21 31 9f eb c2 92 05 be a1 b5 24 eb |....!1........$.|
+00000280 71 24 55 f9 aa 5c 62 59 49 bf 42 4c 69 01 4f f7 |q$U..\bYI.BLi.O.|
+00000290 b6 27 14 d4 cc 40 80 13 9b 8b 30 55 1f 32 c1 ee |.'...@....0U.2..|
+000002a0 51 bd 71 f7 63 3f c2 00 90 60 dc 13 0f 62 c3 06 |Q.q.c?...`...b..|
+000002b0 80 f6 4f cc 44 71 d7 5c 2e 18 82 45 ca 80 b7 0e |..O.Dq.\...E....|
+000002c0 0c 6f 75 1b 23 cb 86 c1 2d 1e 1b 02 2a 15 fa c7 |.ou.#...-...*...|
+000002d0 b2 af 80 5c 48 c2 b7 12 59 a3 e4 3c ed df 26 d0 |...\H...Y..<..&.|
+000002e0 85 9b 5a 2d 7b 66 e6 c4 b3 fe cd 4d 72 4d fb da |..Z-{f.....MrM..|
+000002f0 1c 0d 5c fb 2f 8a e3 70 98 ee 95 9c 12 1a fa c7 |..\./..p........|
+00000300 94 7a 8e ca 4d a4 bb 2f 70 3b 67 95 fb 23 fb 8f |.z..M../p;g..#..|
+00000310 8c 77 4c 17 03 03 00 99 8a 72 14 c7 82 18 d7 ed |.wL......r......|
+00000320 c7 5d 32 df 44 91 6b 40 3e 0b eb a1 74 da d9 3a |.]2.D.k@>...t..:|
+00000330 3c 7a 2e 7a 73 3b 63 72 33 c4 c5 27 29 33 f5 30 |..~b`|
+00000480 5d 0a 82 |]..|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 a6 fe 34 ee 91 |..........E..4..|
-00000010 b0 c5 35 55 cf 70 3f d4 5d 06 76 28 c3 b5 a9 26 |..5U.p?.].v(...&|
-00000020 38 18 ed bb bb bb be e7 4b 6d 61 3e 8f 65 e9 e3 |8.......Kma>.e..|
-00000030 b6 4f 5d 50 46 2c 81 a8 fd 47 aa c8 c4 e8 f9 a4 |.O]PF,...G......|
-00000040 e7 c7 f0 c5 fa e3 9c b7 be 09 c9 37 c1 7f 1c ff |...........7....|
+00000000 14 03 03 00 01 01 17 03 03 00 35 35 fd 9a 7d 02 |..........55..}.|
+00000010 fb b2 eb fa 51 27 3e 80 ab 60 f6 a1 54 31 13 2f |....Q'>..`..T1./|
+00000020 02 b9 19 ac 68 be 25 69 b3 c4 48 87 42 75 b0 93 |....h.%i..H.Bu..|
+00000030 66 3e 2e 0b 79 4f 0b 3a 59 ef 89 83 65 c9 10 9b |f>..yO.:Y...e...|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 1b 5e f2 20 7a 1c 27 36 12 e7 9a |......^. z.'6...|
-00000010 05 9f fb 12 38 df 1d a0 3e 90 9a 42 4d ca 3a 54 |....8...>..BM.:T|
-00000020 db 2c f0 17 03 03 00 13 b1 e4 a6 eb ad 47 ba 4c |.,...........G.L|
-00000030 38 2c ee ee f9 a5 8a 41 2f ce 3d |8,.....A/.=|
+00000000 17 03 03 00 1e 58 0f 73 e3 ba ff d3 19 0d 89 c9 |.....X.s........|
+00000010 94 8a fb 24 02 58 2a 2c eb 69 29 4e 57 d3 d2 5e |...$.X*,.i)NW..^|
+00000020 ba b2 75 17 03 03 00 13 9c 5c 46 44 71 dc 68 b8 |..u......\FDq.h.|
+00000030 39 cc e1 fd 2d 2a a1 a9 50 6c af |9...-*..Pl.|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-P256 b/src/crypto/tls/testdata/Server-TLSv13-P256
index 86085b0561..dd8e0f49ce 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-P256
+++ b/src/crypto/tls/testdata/Server-TLSv13-P256
@@ -1,106 +1,102 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 f9 01 00 00 f5 03 03 3f 2f 76 da 5e |...........?/v.^|
-00000010 bc ca 96 5b e3 c5 ff 45 18 e9 dc 7e b3 e8 97 f5 |...[...E...~....|
-00000020 d1 d5 19 c0 4d a4 5d ce 34 1b e4 20 5f fe 5f 0c |....M.].4.. _._.|
-00000030 88 92 65 b9 c6 ac 7f 3e dc a3 f7 ad e2 21 08 41 |..e....>.....!.A|
-00000040 f8 36 e4 61 67 71 69 56 7f 6b d1 fc 00 08 13 02 |.6.agqiV.k......|
-00000050 13 03 13 01 00 ff 01 00 00 a4 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 04 00 02 00 17 00 16 00 00 |................|
-00000080 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 06 03 |................|
-00000090 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 |................|
-000000a0 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 2d 00 |.......+......-.|
-000000b0 02 01 01 00 33 00 47 00 45 00 17 00 41 04 d3 57 |....3.G.E...A..W|
-000000c0 de 53 6a 81 d5 e8 c2 68 cd 05 90 9b 0e b2 7e 5d |.Sj....h......~]|
-000000d0 43 4c 66 f1 28 53 53 00 1a a5 9b b3 ae e0 3e b7 |CLf.(SS.......>.|
-000000e0 72 4b 29 c6 2d 96 39 3a 1c a2 ef 04 96 22 df ea |rK).-.9:....."..|
-000000f0 15 f5 ff bb 36 ed 3a 3f 67 55 ba 48 10 45 |....6.:?gU.H.E|
+00000000 16 03 01 00 e3 01 00 00 df 03 03 c8 5f 11 a2 29 |............_..)|
+00000010 7b c3 b7 72 5e ba e1 c5 83 45 c8 87 e1 51 27 d9 |{..r^....E...Q'.|
+00000020 33 0e 68 e0 71 76 9e 8f 4e f4 da 20 da fd c6 1d |3.h.qv..N.. ....|
+00000030 46 55 42 89 0a 80 e0 d3 e4 dd db 7d b1 3a 76 a3 |FUB........}.:v.|
+00000040 5b d9 2a c7 f1 1a 3b 0b 8c 24 dd 4d 00 04 13 03 |[.*...;..$.M....|
+00000050 00 ff 01 00 00 92 00 0b 00 04 03 00 01 02 00 0a |................|
+00000060 00 04 00 02 00 17 00 16 00 00 00 17 00 00 00 0d |................|
+00000070 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 |................|
+00000080 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000090 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 |.+......-.....3.|
+000000a0 47 00 45 00 17 00 41 04 04 48 71 9f a6 06 17 16 |G.E...A..Hq.....|
+000000b0 04 d2 b4 e7 6b 5c cf d8 9f ca 64 a7 39 9e 1a 22 |....k\....d.9.."|
+000000c0 aa fc b5 4c d9 d3 b3 37 e3 d4 e1 3b 5b 00 74 df |...L...7...;[.t.|
+000000d0 df e5 29 8f 7c f7 6b 02 f0 e7 fb 9b 43 6a 41 fb |..).|.k.....CjA.|
+000000e0 77 5b c2 6e 99 48 69 78 |w[.n.Hix|
>>> Flow 2 (server to client)
00000000 16 03 03 00 9b 02 00 00 97 03 03 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 5f fe 5f 0c |........... _._.|
-00000030 88 92 65 b9 c6 ac 7f 3e dc a3 f7 ad e2 21 08 41 |..e....>.....!.A|
-00000040 f8 36 e4 61 67 71 69 56 7f 6b d1 fc 13 02 00 00 |.6.agqiV.k......|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 da fd c6 1d |........... ....|
+00000030 46 55 42 89 0a 80 e0 d3 e4 dd db 7d b1 3a 76 a3 |FUB........}.:v.|
+00000040 5b d9 2a c7 f1 1a 3b 0b 8c 24 dd 4d 13 03 00 00 |[.*...;..$.M....|
00000050 4f 00 2b 00 02 03 04 00 33 00 45 00 17 00 41 04 |O.+.....3.E...A.|
00000060 1e 18 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 |..7...Q.5uq..T[.|
00000070 2e 8f 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e |...g..$ >.V...(^|
00000080 f8 2b 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 |.+-O....lK[.V.2B|
00000090 e9 58 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 |.X..I..h.A.Vk.Z.|
-000000a0 14 03 03 00 01 01 17 03 03 00 17 e2 0e 2c fc 9b |.............,..|
-000000b0 61 70 e2 5f b9 e5 a5 ad ce fb df fa be ae 9a 5b |ap._...........[|
-000000c0 cc 99 17 03 03 02 6d 87 74 85 83 f2 51 98 a5 75 |......m.t...Q..u|
-000000d0 09 f0 6d 0f dd 16 a7 12 12 fb ec 98 6e 56 a4 ed |..m.........nV..|
-000000e0 94 18 6b 28 6b ef 80 bd 28 3b f4 ee 05 80 d2 ff |..k(k...(;......|
-000000f0 2f d4 6b b5 d3 b6 91 61 b7 8e 1b db 60 cf f5 4b |/.k....a....`..K|
-00000100 3b 68 78 4a 09 2d a3 49 c0 8a 06 e5 2c 62 08 5d |;hxJ.-.I....,b.]|
-00000110 c4 5d 03 04 5e 3e 25 9d 30 24 af b0 a3 2e 8c 65 |.]..^>%.0$.....e|
-00000120 fb 6f 34 94 e9 d9 d6 34 0e a9 44 8a 9e b7 1a 13 |.o4....4..D.....|
-00000130 26 b7 b2 16 c2 79 05 e8 0e 99 bd 7a cc c8 83 a4 |&....y.....z....|
-00000140 60 1d cb 5c 02 8a 1f b7 4f c4 2d cd 96 e4 7b 39 |`..\....O.-...{9|
-00000150 5a 45 60 30 82 9f 8f 30 56 11 7b 0d 6e 7e 95 54 |ZE`0...0V.{.n~.T|
-00000160 d0 ac 09 8e 3b 49 14 de d3 8b a1 e4 4d f7 65 8d |....;I......M.e.|
-00000170 88 46 71 7a 29 ea 05 b4 66 e6 76 db b7 7d 56 ce |.Fqz)...f.v..}V.|
-00000180 e0 ba 47 b5 75 c1 14 42 7e af 87 f3 94 bf 75 e3 |..G.u..B~.....u.|
-00000190 ee 54 ea 4c 8c 69 fd 63 01 1c 0e 38 84 e6 04 c3 |.T.L.i.c...8....|
-000001a0 a8 3d 42 18 87 a2 f0 b4 4d ef 29 8d 48 01 b9 f4 |.=B.....M.).H...|
-000001b0 8b 1e b1 72 bf e4 9a 6d 80 d7 c2 e0 a7 a7 0a 3f |...r...m.......?|
-000001c0 45 f4 72 94 56 19 6b f3 4c 3e a6 1e 87 cd d3 a2 |E.r.V.k.L>......|
-000001d0 49 b6 e7 56 b9 dd 2b f6 66 0a 6a 55 75 63 f9 c3 |I..V..+.f.jUuc..|
-000001e0 d2 a6 ea a0 04 09 6b 75 eb 77 6b 9e 4b a4 6d f5 |......ku.wk.K.m.|
-000001f0 44 01 37 ee 21 15 f7 3e 6e 6f fc dc be 44 43 26 |D.7.!..>no...DC&|
-00000200 dd 7a ab 13 67 58 8d cb 02 78 b9 71 07 22 12 d2 |.z..gX...x.q."..|
-00000210 cf 87 50 ff 04 d9 7a f2 73 8c 77 9e 5b 17 b2 aa |..P...z.s.w.[...|
-00000220 2a db b2 a2 f4 5b c4 0d e2 84 a3 fe 4d b1 02 26 |*....[......M..&|
-00000230 7d ba 76 2a 0e d1 87 52 c7 5f 97 07 fd b7 25 1b |}.v*...R._....%.|
-00000240 2a 52 0d 30 59 84 73 a0 d7 db 75 6d 74 05 a2 3b |*R.0Y.s...umt..;|
-00000250 91 69 f3 a3 43 bc 44 f9 ce f4 85 a1 38 5a e2 55 |.i..C.D.....8Z.U|
-00000260 f6 e8 e2 ca 3b c2 fd 39 0f f4 ae 86 08 24 d4 c7 |....;..9.....$..|
-00000270 10 44 c0 bf 9b 47 d9 da 07 52 4d 88 71 d4 14 69 |.D...G...RM.q..i|
-00000280 66 8b cc 44 09 1b 90 b0 a5 7c 96 3c 94 99 cd c2 |f..D.....|.<....|
-00000290 ca 0b af 53 c0 31 a2 5a df 54 76 e4 af 66 5d ff |...S.1.Z.Tv..f].|
-000002a0 7c 21 c9 06 b8 d9 7e 1f 46 97 c8 ea e0 90 f2 db ||!....~.F.......|
-000002b0 9b 52 04 a8 91 20 15 c8 fc 24 09 d7 f9 48 20 dc |.R... ...$...H .|
-000002c0 18 22 d1 e2 19 3d 53 dd e4 21 db 8c 87 7d d7 bf |."...=S..!...}..|
-000002d0 f7 93 a6 a5 81 b5 53 59 15 a8 80 2e 3b 4f b0 d4 |......SY....;O..|
-000002e0 f3 66 56 14 6e a1 6b 3e 75 b1 8e fa 0d 52 96 b1 |.fV.n.k>u....R..|
-000002f0 08 b1 b0 ce 0c c6 0a 5e 54 0f a3 5a cd 6c db 6a |.......^T..Z.l.j|
-00000300 0a 6a 52 11 b5 97 7b 67 e3 3e 84 22 76 3a f1 96 |.jR...{g.>."v:..|
-00000310 70 bf 9c a6 62 03 30 a7 69 46 ec 9a 61 1e 37 6f |p...b.0.iF..a.7o|
-00000320 7d 24 d6 6c 8a e5 72 3a 0a ef e8 d3 d6 fe 28 c8 |}$.l..r:......(.|
-00000330 60 ff d7 2e 17 03 03 00 99 ca f3 5e cb 8c b2 0b |`..........^....|
-00000340 87 4e 59 89 38 f5 f1 3c c4 e1 6a 11 2d f3 ef 7d |.NY.8..<..j.-..}|
-00000350 b6 85 ff bb 84 8f cb db 7f 02 50 23 93 db b3 0a |..........P#....|
-00000360 2c 32 cb ed 08 ae 6a 3e 30 b8 a5 c2 9c 85 0c 87 |,2....j>0.......|
-00000370 44 68 8b 47 31 75 a0 c3 2c 32 2e 61 40 da 4b 0a |Dh.G1u..,2.a@.K.|
-00000380 07 ef 2b 6b fa 2f 66 87 ff f1 0e 5e b0 db 44 3d |..+k./f....^..D=|
-00000390 3c fc a7 94 17 f3 0b a5 50 68 7b 65 48 8e 78 ce |<.......Ph{eH.x.|
-000003a0 d7 71 fa ae 58 50 62 33 98 b2 a2 27 b1 e0 66 fb |.q..XPb3...'..f.|
-000003b0 65 6a 94 21 38 e8 40 aa 4f d7 02 31 45 e8 d3 e0 |ej.!8.@.O..1E...|
-000003c0 5f 66 d4 2f 26 9f b2 72 b7 bc 43 ce f1 2a 0e 61 |_f./&..r..C..*.a|
-000003d0 f1 91 17 03 03 00 45 c0 25 ac 1e 0b 4e 2c 61 9c |......E.%...N,a.|
-000003e0 c7 80 f1 f7 bf d4 c6 a9 29 3f 0c 08 8d f0 70 7c |........)?....p||
-000003f0 6f 96 2c 3e 32 7f a6 10 17 19 81 49 2d a7 f7 3f |o.,>2......I-..?|
-00000400 04 20 7d 52 c2 e8 cc 61 b2 16 5b 8b 3e 1a a9 2f |. }R...a..[.>../|
-00000410 9c 5e a7 74 88 3d 8a c8 90 df 9a 17 17 03 03 00 |.^.t.=..........|
-00000420 a3 cf b5 d2 52 49 27 95 5f dd 9b 37 ed 74 7b 17 |....RI'._..7.t{.|
-00000430 8b 7f f3 67 3c 91 2f 1e b6 17 4f ba a7 b1 92 99 |...g<./...O.....|
-00000440 32 32 7e 72 95 90 a0 92 08 c3 da 30 31 85 ee bb |22~r.......01...|
-00000450 8f 8d d4 d8 c5 28 19 10 71 f0 b3 15 45 86 e0 09 |.....(..q...E...|
-00000460 ee e4 96 a0 90 c5 df 81 8f d1 38 b2 e0 33 95 3b |..........8..3.;|
-00000470 33 9d e0 3e 93 3d 6a 12 60 44 43 9e b0 5c 16 82 |3..>.=j.`DC..\..|
-00000480 92 b8 84 0e 56 19 b9 b6 eb 3c 37 3e 9b ee 2a 6a |....V....<7>..*j|
-00000490 13 4a bb 3d 78 21 79 0e 6f cc 34 89 91 95 03 a6 |.J.=x!y.o.4.....|
-000004a0 19 e2 81 37 a6 9d 30 28 42 da f4 69 4e 42 4b e4 |...7..0(B..iNBK.|
-000004b0 ca 23 c5 1e 56 24 cc ba b0 85 21 ef 44 04 cb d8 |.#..V$....!.D...|
-000004c0 aa cd 5d 55 |..]U|
+000000a0 14 03 03 00 01 01 17 03 03 00 17 81 b8 e3 25 04 |..............%.|
+000000b0 6c d8 f6 7c 04 a1 2c 8b 1f 0d cb de 29 1b e1 a3 |l..|..,.....)...|
+000000c0 6f 8c 17 03 03 02 6d 81 db bc b4 f8 02 f3 c5 4e |o.....m........N|
+000000d0 9e f7 5f 55 54 3e 25 a9 2f 03 06 62 2f 1e 7e d4 |.._UT>%./..b/.~.|
+000000e0 19 27 88 1e ac f2 44 87 29 84 08 69 2f 5d a3 ca |.'....D.)..i/]..|
+000000f0 de 8f 98 ad 25 6b c5 94 62 34 44 95 bc 17 ed e6 |....%k..b4D.....|
+00000100 fe 89 9c ef 46 c9 cb ee 16 d4 42 b6 d3 50 7b 3a |....F.....B..P{:|
+00000110 51 d8 20 23 02 3e 69 a8 1a 80 eb bf 7c 82 2b 1f |Q. #.>i.....|.+.|
+00000120 10 5a 30 85 dd bc ff 65 4d c6 4f 7b bc 3d 64 e2 |.Z0....eM.O{.=d.|
+00000130 93 2a 05 a0 af de b1 41 48 85 db 98 c9 a9 96 5c |.*.....AH......\|
+00000140 64 a4 70 2e f9 4e de 38 9f 48 f7 eb 6e 14 42 3f |d.p..N.8.H..n.B?|
+00000150 9f 86 0f 2d 70 6a 30 96 1c dd c6 11 28 6f 86 b6 |...-pj0.....(o..|
+00000160 da bb 5b 76 c8 56 18 4a 67 bf 59 db 56 46 f0 c7 |..[v.V.Jg.Y.VF..|
+00000170 80 2b 0f 0c 8a 02 58 a1 13 aa 2e 5d 61 e2 d5 23 |.+....X....]a..#|
+00000180 3c 1c 75 06 e4 e4 e1 39 eb 65 6a ff 38 21 28 c9 |<.u....9.ej.8!(.|
+00000190 c5 8b a5 12 21 18 2a 59 e7 4e 66 53 be d3 49 97 |....!.*Y.NfS..I.|
+000001a0 f9 b1 7d e2 75 44 37 38 36 35 af 78 27 f4 74 e0 |..}.uD7865.x'.t.|
+000001b0 45 ca fd 79 3c 39 65 00 46 58 4b 8b db f9 6e c0 |E..y<9e.FXK...n.|
+000001c0 69 ec 1e 25 87 66 e1 b8 d8 cc 16 5b 16 9e 90 2e |i..%.f.....[....|
+000001d0 16 0c 8f 25 04 cf 40 c8 50 dd c4 63 19 8f f1 76 |...%..@.P..c...v|
+000001e0 5e fa 24 1d 8a d2 c1 d4 98 49 48 f0 e6 fa f3 6e |^.$......IH....n|
+000001f0 63 0b a5 7a 2f f2 f0 47 0b c0 89 9f 7b 9f ef 48 |c..z/..G....{..H|
+00000200 df fd 38 5d a9 71 ce 0c 3c 6f 88 0b 1b d3 93 8c |..8].q....|
+00000250 96 5a 3c 97 8e 7b 47 b8 f0 58 16 12 05 69 69 a1 |.Z<..{G..X...ii.|
+00000260 36 7b ff dd 92 60 26 e2 f9 53 4c 3a 25 ac 88 dd |6{...`&..SL:%...|
+00000270 9a 81 7c 1f 58 27 33 14 68 44 06 e2 01 14 94 99 |..|.X'3.hD......|
+00000280 00 05 8f 64 47 ca 95 fa 92 57 a9 1a 53 d5 47 52 |...dG....W..S.GR|
+00000290 e8 c4 aa eb 0a f5 1b a9 09 72 92 37 f5 8d 90 b8 |.........r.7....|
+000002a0 4b 08 7f 55 19 2d a7 d8 7b d9 ba 7f 5e 56 bb 80 |K..U.-..{...^V..|
+000002b0 c7 d0 49 99 ae ce 2f a4 f0 ab d1 bd ba f3 0f 85 |..I.../.........|
+000002c0 f1 68 c1 9d 2a 37 ff de a4 0a 6f 58 27 1d 1d 2b |.h..*7....oX'..+|
+000002d0 87 9d 52 d3 70 37 a6 03 cd 77 61 9b 56 64 49 62 |..R.p7...wa.VdIb|
+000002e0 ef a1 ed fe 75 1a 61 4a 58 01 d6 80 2f ab ab fc |....u.aJX.../...|
+000002f0 b2 49 1f 51 b7 51 29 c1 a1 39 fc f4 0a 9b 0d 76 |.I.Q.Q)..9.....v|
+00000300 c6 d0 89 c9 8f 88 e9 ec 13 90 78 4f 0c f5 c9 7e |..........xO...~|
+00000310 d5 b3 13 ad 35 6d 53 d0 88 50 e8 47 15 a0 ca fc |....5mS..P.G....|
+00000320 5f 6e 98 23 46 6a 69 84 3c a9 3f eb d1 05 f5 97 |_n.#Fji.<.?.....|
+00000330 11 39 7f 39 17 03 03 00 99 84 8e 37 a9 57 78 12 |.9.9.......7.Wx.|
+00000340 8e 9a e7 8e 45 ee 55 61 66 24 ed 5a 36 19 e3 1c |....E.Uaf$.Z6...|
+00000350 22 3b 8b c0 4b c9 cd 2c 4c 17 d2 a9 40 2c 02 40 |";..K..,L...@,.@|
+00000360 74 ba 11 de a5 d4 01 11 ae 9d 71 76 4c f0 87 0f |t.........qvL...|
+00000370 5e 75 c0 67 c0 33 e7 3e 9b d3 a4 21 e8 40 a6 9f |^u.g.3.>...!.@..|
+00000380 d8 24 a7 d7 c1 99 cc 8d 33 10 91 0a 41 a6 05 1c |.$......3...A...|
+00000390 85 4c c5 a8 c9 dd 74 d0 5c 67 2e 2a 50 4e 30 c7 |.L....t.\g.*PN0.|
+000003a0 bb fa f8 65 ee 48 23 f5 c5 d3 a1 ec 4d 3f ac 4b |...e.H#.....M?.K|
+000003b0 ef 1e 8d 84 07 b9 69 2a 34 51 73 ba fb b5 7d 64 |......i*4Qs...}d|
+000003c0 1f fc 0e c8 33 d9 77 5e 41 00 65 25 ea 75 75 c9 |....3.w^A.e%.uu.|
+000003d0 2b 03 17 03 03 00 35 54 c2 06 55 7c 6f 92 8a d2 |+.....5T..U|o...|
+000003e0 d5 35 0c 4b 0d df cb d7 6e 5d 64 e1 2e cf 50 b8 |.5.K....n]d...P.|
+000003f0 d8 04 9a f4 ce 69 d3 ac bb 47 cd 57 ac 07 aa 40 |.....i...G.W...@|
+00000400 e3 fc 01 bc d6 a1 0e 16 4e 6b 04 cc 17 03 03 00 |........Nk......|
+00000410 93 b2 c3 64 29 13 07 75 b4 c4 84 f7 0e 99 d9 9f |...d)..u........|
+00000420 8d 5b fd 26 07 42 48 33 3a ab 6f 7d 07 8b f6 8a |.[.&.BH3:.o}....|
+00000430 22 a4 ce 64 0f 69 ea 61 95 70 6d d3 f8 5f 8b ad |"..d.i.a.pm.._..|
+00000440 02 43 94 41 51 f4 f8 0b 52 fc 58 c1 23 5e 22 a7 |.C.AQ...R.X.#^".|
+00000450 74 49 a1 46 e8 29 ab d6 ae 02 a4 7b e4 23 f1 89 |tI.F.).....{.#..|
+00000460 1c b1 74 86 92 1b 6a 7c 2f 55 2b 89 f6 01 fc e2 |..t...j|/U+.....|
+00000470 d6 15 b9 b1 64 1c 4a af f8 fe 3e e0 76 0f cf 08 |....d.J...>.v...|
+00000480 e1 2c db f6 1c 77 6f e4 a4 80 ad 13 74 3d 02 52 |.,...wo.....t=.R|
+00000490 a1 ff 3e 85 1d d3 77 bc f2 48 73 1c 45 09 62 34 |..>...w..Hs.E.b4|
+000004a0 80 09 21 41 |..!A|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 43 65 76 31 fa |..........ECev1.|
-00000010 2c a7 2e 96 92 82 cf eb 91 3d 8b eb 01 d3 af da |,........=......|
-00000020 67 ea 4d 75 47 8f 42 34 7a 2d 0a b0 d1 4c 08 c0 |g.MuG.B4z-...L..|
-00000030 c7 76 7e 99 93 4a 06 b2 d9 95 df f9 c1 29 25 e6 |.v~..J.......)%.|
-00000040 24 6d ea 73 00 24 36 a9 62 30 9d a4 aa 6c 2f c8 |$m.s.$6.b0...l/.|
+00000000 14 03 03 00 01 01 17 03 03 00 35 ab dd 69 66 c8 |..........5..if.|
+00000010 f9 eb e6 e6 b0 a9 9b 10 1d fc ad 89 ad 4d f5 2b |.............M.+|
+00000020 e4 d7 12 5b 1c 1e 81 12 df 24 ba ea 6b 3e 6f 82 |...[.....$..k>o.|
+00000030 dd 2f 38 a1 65 07 55 6a 4f 8e 99 5d 4f 35 b8 5d |./8.e.UjO..]O5.]|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 6e bb 52 84 cf a6 71 d5 b9 ac c2 |.....n.R...q....|
-00000010 29 1a 0b db be a4 bb bd 6c f4 2e c8 eb f0 bb eb |).......l.......|
-00000020 d3 f8 69 17 03 03 00 13 19 ad 85 21 63 f6 38 df |..i........!c.8.|
-00000030 35 41 af 12 75 63 e8 fa 38 5e 50 |5A..uc..8^P|
+00000000 17 03 03 00 1e e5 f4 e6 14 79 8c b9 a9 77 6b c9 |.........y...wk.|
+00000010 ff ad 60 f3 03 cf 48 19 19 71 6c 85 da 92 cb 79 |..`...H..ql....y|
+00000020 2b 20 41 17 03 03 00 13 69 de ca 08 9c cf 70 37 |+ A.....i.....p7|
+00000030 5e fc 32 31 1c 93 d1 e4 01 f3 c6 |^.21.......|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS b/src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS
index 8151fd4d27..db53ebbc5f 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS
+++ b/src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS
@@ -1,16 +1,97 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 c6 01 00 00 c2 03 03 6b 64 fe be 82 |...........kd...|
-00000010 d3 c7 f8 26 35 c1 7c 50 d0 a9 19 a5 1d 6b d5 1b |...&5.|P.....k..|
-00000020 25 9b 47 fb 49 01 fc df 2e dc 8e 20 92 d0 73 81 |%.G.I...... ..s.|
-00000030 91 5a 8a f9 2a cf 29 c7 9d 43 b2 b0 7d b9 5a a3 |.Z..*.)..C..}.Z.|
-00000040 5f 74 53 a0 8e fe 4e 2e 83 0d 3b 0f 00 08 13 02 |_tS...N...;.....|
-00000050 13 03 13 01 00 ff 01 00 00 71 00 00 00 0e 00 0c |.........q......|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 04 |................|
-00000090 00 02 08 06 00 2b 00 03 02 03 04 00 2d 00 02 01 |.....+......-...|
-000000a0 01 00 33 00 26 00 24 00 1d 00 20 76 43 b3 ed 62 |..3.&.$... vC..b|
-000000b0 22 72 15 69 b5 5b fd 9c ac 4a bd 36 4a 8d 3a 08 |"r.i.[...J.6J.:.|
-000000c0 9d a0 5e 10 e6 13 87 2b 41 51 66 |..^....+AQf|
+00000000 16 03 01 00 b2 01 00 00 ae 03 03 4d a5 7b 2c da |...........M.{,.|
+00000010 67 11 9d 4d a0 92 2a 96 6c 85 ef 8c 52 0a 31 cf |g..M..*.l...R.1.|
+00000020 43 23 3e 8d 67 63 9b 7e 84 94 17 20 a2 a1 87 c6 |C#>.gc.~... ....|
+00000030 5e 64 34 75 da ac ee ba d4 d8 8f 2a a6 55 9f 4f |^d4u.......*.U.O|
+00000040 48 38 5a 29 61 a4 ef 7d 1d 74 a7 71 00 04 13 03 |H8Z)a..}.t.q....|
+00000050 00 ff 01 00 00 61 00 0b 00 04 03 00 01 02 00 0a |.....a..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000070 00 00 00 17 00 00 00 0d 00 06 00 04 08 06 08 04 |................|
+00000080 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 |.+......-.....3.|
+00000090 26 00 24 00 1d 00 20 16 5e 23 ca e7 24 31 81 c2 |&.$... .^#..$1..|
+000000a0 78 21 3a ee 8a f3 61 8a 46 a0 56 ee a9 ed 82 3a |x!:...a.F.V....:|
+000000b0 87 b7 4a 0a 03 fe 59 |..J...Y|
>>> Flow 2 (server to client)
-00000000 15 03 03 00 02 02 28 |......(|
+00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
+00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 a2 a1 87 c6 |........... ....|
+00000030 5e 64 34 75 da ac ee ba d4 d8 8f 2a a6 55 9f 4f |^d4u.......*.U.O|
+00000040 48 38 5a 29 61 a4 ef 7d 1d 74 a7 71 13 03 00 00 |H8Z)a..}.t.q....|
+00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
+00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
+00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
+00000080 03 03 00 01 01 17 03 03 00 17 f8 7a 9c bc 58 8d |...........z..X.|
+00000090 ce cd ff e6 ae 2d c2 e0 40 33 4e c4 ec f5 90 dd |.....-..@3N.....|
+000000a0 ba 17 03 03 02 6d f3 65 a1 b4 fe ef 40 37 72 fa |.....m.e....@7r.|
+000000b0 a5 b8 10 ad 32 e3 08 e1 ac bb 14 f2 34 bf 25 19 |....2.......4.%.|
+000000c0 aa 2d 1a 78 cc 26 2f 5c 0b 7e 13 73 36 85 92 96 |.-.x.&/\.~.s6...|
+000000d0 0a 7a 27 f5 35 86 f1 ea 1a 5f 5c 3a 90 28 63 6a |.z'.5...._\:.(cj|
+000000e0 b3 7c e0 56 32 10 55 67 59 e0 65 d6 11 ef 7c 50 |.|.V2.UgY.e...|P|
+000000f0 0b 9e 88 0a 61 96 93 cf 05 51 47 33 c3 5c e3 82 |....a....QG3.\..|
+00000100 01 6d f1 f7 5c dc df b2 61 7c d7 9f de b4 3e c0 |.m..\...a|....>.|
+00000110 6d b5 52 39 3b f6 33 c2 03 65 2b 66 39 ed d6 f0 |m.R9;.3..e+f9...|
+00000120 83 46 61 db fc 27 a5 8a 68 d6 8a 85 5d 3f b1 46 |.Fa..'..h...]?.F|
+00000130 a2 3a 32 37 1f e0 76 a6 79 7f eb b2 81 52 e7 e0 |.:27..v.y....R..|
+00000140 4f b2 db 48 7d 20 61 52 d4 22 2a b7 81 2f da 5b |O..H} aR."*../.[|
+00000150 f6 e8 0a a6 91 b5 d1 f5 6b 5e 2b ad fd 70 cd a1 |........k^+..p..|
+00000160 f8 4d 73 31 3d 2a 49 d3 2e 6b b3 31 95 61 09 08 |.Ms1=*I..k.1.a..|
+00000170 c5 f9 eb db 42 b0 e1 5d 47 00 3e 7e 80 31 c6 d2 |....B..]G.>~.1..|
+00000180 37 dc 68 d7 36 05 ad 8a a4 05 87 7a 1c 12 f6 ab |7.h.6......z....|
+00000190 0e e1 5b 29 b1 1c 16 20 29 75 5a b0 59 24 59 df |..[)... )uZ.Y$Y.|
+000001a0 62 fe f2 26 ad ab bf 2b 25 d7 9e db 04 f6 26 96 |b..&...+%.....&.|
+000001b0 f7 5f 2c ff 2e 6d 85 c7 58 c8 15 9c d0 7d dd 8e |._,..m..X....}..|
+000001c0 1a 39 fc 3d 62 58 47 ce 83 7a ff fc 45 98 02 3d |.9.=bXG..z..E..=|
+000001d0 aa 37 b7 5e a7 7b 8e fa f2 05 8b 61 7f 04 08 f5 |.7.^.{.....a....|
+000001e0 af 1d 6e 55 18 d2 12 2e bd 8a 80 3d cb e6 0f cd |..nU.......=....|
+000001f0 3c d8 a5 38 db ee 07 c6 3b 75 55 c2 ee 2e 6a a3 |<..8....;uU...j.|
+00000200 fa 54 ce e3 45 92 c0 b9 8c 10 3d 2f 86 cb a5 c9 |.T..E.....=/....|
+00000210 af 37 f7 f6 6c 3e 4b 15 04 bd 46 98 31 5a b9 8c |.7..l>K...F.1Z..|
+00000220 ec 67 0d 97 9d 26 56 65 9c a7 74 bb 88 45 dc 4e |.g...&Ve..t..E.N|
+00000230 ce 70 a1 fc ce fc a7 d4 e1 7d a7 43 82 a6 e2 30 |.p.......}.C...0|
+00000240 e2 94 88 e5 1a 05 c5 28 06 14 7b 29 75 f9 4d 2c |.......(..{)u.M,|
+00000250 bb 54 ee f5 17 4e 2a bf 04 e6 38 f2 cf ed ab a2 |.T...N*...8.....|
+00000260 ef ae ac 3d 80 5e 03 71 74 70 0c 68 93 ca ea 93 |...=.^.qtp.h....|
+00000270 e5 b1 d1 18 80 98 0e c6 e8 f5 65 87 e7 9a 33 1d |..........e...3.|
+00000280 e6 3d e2 28 82 19 2a 9d 5f 1a a2 74 fa 27 8b d0 |.=.(..*._..t.'..|
+00000290 09 9a ba 1b c5 a6 4c 3b c3 02 12 61 a1 8a 20 d3 |......L;...a.. .|
+000002a0 a4 3c 3b aa f2 08 de e0 de 07 9f a0 13 b4 e8 23 |.<;............#|
+000002b0 d3 a5 ff 12 74 55 29 3a 57 f5 14 b3 af e6 28 ed |....tU):W.....(.|
+000002c0 b1 60 9c 6b 7d 55 a1 58 50 ab 42 71 5d 0e dc 76 |.`.k}U.XP.Bq]..v|
+000002d0 87 cd a1 d3 e4 26 25 c4 c1 23 1e 3b 31 13 3d f8 |.....&%..#.;1.=.|
+000002e0 b2 1b a8 07 f6 68 83 b4 7e 94 ca 84 95 55 38 d1 |.....h..~....U8.|
+000002f0 eb af 19 83 90 4a ab 0a 8d f6 48 9a 25 fa 59 97 |.....J....H.%.Y.|
+00000300 3c 5f 6a 2d 68 ec 29 d5 53 b4 9a 97 ea 59 fe 74 |<_j-h.).S....Y.t|
+00000310 81 0e b9 17 03 03 00 99 12 25 df 91 85 91 ac c0 |.........%......|
+00000320 60 4e 6e ed c4 b2 f0 f3 8b 66 53 75 11 07 29 d6 |`Nn......fSu..).|
+00000330 1f 01 81 60 de 5f b7 6b 5e 39 c8 ea f1 f8 2a 94 |...`._.k^9....*.|
+00000340 dd b6 c5 a9 31 be 87 a7 aa a9 64 03 16 40 df ef |....1.....d..@..|
+00000350 37 ac 66 4c 19 f1 60 d5 b4 88 93 a7 42 ac e3 81 |7.fL..`.....B...|
+00000360 c8 88 3f e2 30 a0 ff b7 d5 19 fc f2 72 a7 97 a8 |..?.0.......r...|
+00000370 31 ce 20 be 90 bc f5 8a 24 31 b1 c6 2b 2a ad c5 |1. .....$1..+*..|
+00000380 7a 34 69 eb a7 86 53 61 a1 88 4f 58 2a 65 a2 18 |z4i...Sa..OX*e..|
+00000390 7a 93 81 c6 bd c7 bc 84 5b ff 85 aa ff fc 68 50 |z.......[.....hP|
+000003a0 cb 57 37 54 a7 0f 2e 64 82 53 b7 dc ea c2 e3 49 |.W7T...d.S.....I|
+000003b0 fd 17 03 03 00 35 da 2a 8c 37 83 a5 a0 d4 06 c4 |.....5.*.7......|
+000003c0 ff f3 85 6f e4 11 1f 37 0f 06 35 45 e9 51 43 6f |...o...7..5E.QCo|
+000003d0 d2 a4 cb b7 ad f0 66 1c 20 40 c3 14 32 c0 57 71 |......f. @..2.Wq|
+000003e0 d3 8c 9c 7f 5b e6 50 a1 c2 e5 62 17 03 03 00 93 |....[.P...b.....|
+000003f0 30 b8 ab dc 3b df 60 aa b1 d2 25 5a 60 da b6 c8 |0...;.`...%Z`...|
+00000400 22 88 93 79 25 44 56 aa ec 93 e8 01 11 bf 69 ad |"..y%DV.......i.|
+00000410 b2 c9 43 67 33 aa 6d ae 73 a3 95 2b f0 86 ed a2 |..Cg3.m.s..+....|
+00000420 db df e3 dc 9b 16 1d 8d fc 2f a5 c4 41 d0 86 2f |........./..A../|
+00000430 cc a1 a1 ce 9a e5 e6 c8 a2 d1 a8 b2 a4 15 9c 69 |...............i|
+00000440 38 5a fa fd de d4 02 95 24 67 1b 61 76 1f c4 65 |8Z......$g.av..e|
+00000450 01 fc 36 2d ef 2d 0f 8e f0 5a 6d 04 07 b8 26 18 |..6-.-...Zm...&.|
+00000460 90 fc 82 1b 99 68 b0 13 7f 6e a1 9b c4 2a f3 b8 |.....h...n...*..|
+00000470 0b 6a 44 cd 04 e8 20 96 6d f5 48 cb 71 8a 04 10 |.jD... .m.H.q...|
+00000480 b8 8d 56 |..V|
+>>> Flow 3 (client to server)
+00000000 14 03 03 00 01 01 17 03 03 00 35 54 e5 3f f8 77 |..........5T.?.w|
+00000010 59 e3 8b 02 0b 80 8d 59 12 22 23 09 cb d9 93 67 |Y......Y."#....g|
+00000020 c7 35 b4 45 a0 54 49 fd 65 b5 ff e6 3e 3c b9 bf |.5.E.TI.e...><..|
+00000030 26 ca df 86 db a4 66 b5 3e 1f 36 69 a5 99 2b ed |&.....f.>.6i..+.|
+>>> Flow 4 (server to client)
+00000000 17 03 03 00 1e e3 b4 3e 81 ff 1a 36 f8 11 53 64 |.......>...6..Sd|
+00000010 b9 28 4e 68 de ee 9c b6 4d 71 21 fa 85 56 30 ad |.(Nh....Mq!..V0.|
+00000020 e9 c2 27 17 03 03 00 13 3d b8 13 b0 5f df 5a 05 |..'.....=..._.Z.|
+00000030 85 cf eb 48 86 fb c5 a0 67 f7 ee |...H....g..|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS-TooSmall b/src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS-TooSmall
index 94f5818ce1..6d27e9074c 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS-TooSmall
+++ b/src/crypto/tls/testdata/Server-TLSv13-RSA-RSAPSS-TooSmall
@@ -1,16 +1,15 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 c6 01 00 00 c2 03 03 7c a4 3e 3b dd |...........|.>;.|
-00000010 d4 90 de 04 87 40 12 a6 f8 63 d9 9d b3 44 7b 52 |.....@...c...D{R|
-00000020 9b b2 2d e2 da 0a 6b 87 30 2e 1f 20 38 be 06 6e |..-...k.0.. 8..n|
-00000030 b8 2d 46 93 8d ed 31 ea 5c 44 5a 3a 6e 3a bd 3c |.-F...1.\DZ:n:.<|
-00000040 0d 69 99 2c 5d 59 30 85 1a bc ce 59 00 08 13 02 |.i.,]Y0....Y....|
-00000050 13 03 13 01 00 ff 01 00 00 71 00 00 00 0e 00 0c |.........q......|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 04 |................|
-00000090 00 02 08 06 00 2b 00 03 02 03 04 00 2d 00 02 01 |.....+......-...|
-000000a0 01 00 33 00 26 00 24 00 1d 00 20 d9 cb e9 03 27 |..3.&.$... ....'|
-000000b0 59 f0 bd 7a 1f 17 88 c7 35 2b 92 0c d9 0c 0f 9a |Y..z....5+......|
-000000c0 b5 47 c7 e2 97 aa 92 04 c6 63 2d |.G.......c-|
+00000000 16 03 01 00 b0 01 00 00 ac 03 03 15 df ef fb ff |................|
+00000010 00 89 4d bf 59 d2 30 f1 f3 e7 20 24 c6 06 ba a4 |..M.Y.0... $....|
+00000020 28 b4 ba 3d 00 f2 18 9b 98 a3 f2 20 7e d9 d0 58 |(..=....... ~..X|
+00000030 50 25 90 2d f0 af 72 66 fb f8 54 33 6e d4 2b f0 |P%.-..rf..T3n.+.|
+00000040 0f 1a ea dc 9e 08 34 ed 68 a8 d8 bd 00 04 13 03 |......4.h.......|
+00000050 00 ff 01 00 00 5f 00 0b 00 04 03 00 01 02 00 0a |....._..........|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 16 |................|
+00000070 00 00 00 17 00 00 00 0d 00 04 00 02 08 06 00 2b |...............+|
+00000080 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 |......-.....3.&.|
+00000090 24 00 1d 00 20 6e 42 98 d4 04 32 d1 21 0f 64 c9 |$... nB...2.!.d.|
+000000a0 b7 f2 b2 52 6f 2b b7 b1 95 4b 57 85 7b 69 d9 63 |...Ro+...KW.{i.c|
+000000b0 19 48 d2 1c 1e |.H...|
>>> Flow 2 (server to client)
00000000 15 03 03 00 02 02 28 |......(|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-Resume b/src/crypto/tls/testdata/Server-TLSv13-Resume
index fa10f3e0c4..091ffc3347 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-Resume
+++ b/src/crypto/tls/testdata/Server-TLSv13-Resume
@@ -1,66 +1,60 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 01 a4 01 00 01 a0 03 03 92 e8 fa 14 82 |................|
-00000010 03 7c cd fe 01 82 55 99 8b fd 04 ff 88 82 98 c9 |.|....U.........|
-00000020 72 18 3b 2e 0a de fc a4 44 9f 1d 20 c0 df df c9 |r.;.....D.. ....|
-00000030 1d ed 19 9e 2d ce 57 f6 95 54 67 76 77 64 c7 f4 |....-.W..Tgvwd..|
-00000040 ad 18 7d d8 58 6f 08 30 a5 a4 50 cd 00 08 13 02 |..}.Xo.0..P.....|
-00000050 13 03 13 01 00 ff 01 00 01 4f 00 00 00 0e 00 0c |.........O......|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 23 00 00 00 16 00 00 00 17 00 00 |.....#..........|
-00000090 00 0d 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 |................|
-000000a0 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 |................|
-000000b0 06 01 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 |...+......-.....|
-000000c0 33 00 26 00 24 00 1d 00 20 94 44 cd ce 27 a8 43 |3.&.$... .D..'.C|
-000000d0 8a ef cd ef d4 74 d4 e4 62 82 00 e6 46 96 e5 aa |.....t..b...F...|
-000000e0 d1 44 8a 55 6b d7 25 06 6f 00 29 00 bc 00 87 00 |.D.Uk.%.o.).....|
-000000f0 81 50 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 |.PF....8.{+....B|
-00000100 3e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |>...............|
-00000110 00 94 68 2c a3 81 51 ed 14 ef 68 ca 42 c5 4c 1f |..h,..Q...h.B.L.|
-00000120 90 bf 3c 07 2b e5 52 22 a0 c0 46 db cb f6 b9 a0 |..<.+.R"..F.....|
-00000130 b5 56 b0 d6 7f 03 b7 2d 9f a5 2a 25 8e 65 d2 b9 |.V.....-..*%.e..|
-00000140 6a f3 e4 7e 79 d7 3d cc b2 3d b6 24 a9 31 82 49 |j..~y.=..=.$.1.I|
-00000150 38 16 92 f0 49 97 e2 07 e2 cd 1c 77 d3 e0 00 de |8...I......w....|
-00000160 56 11 17 40 00 63 13 00 48 39 8e fd 09 96 08 f3 |V..@.c..H9......|
-00000170 81 7c 00 00 00 00 00 31 30 a4 22 35 6e 4a 09 af |.|.....10."5nJ..|
-00000180 08 22 97 92 e0 8a eb c0 e0 28 32 f4 8f ed 1e 02 |.".......(2.....|
-00000190 a9 b3 43 de f3 04 cb 7b db 01 51 88 46 02 c1 4b |..C....{..Q.F..K|
-000001a0 ec fa a8 05 42 a4 00 ae ed |....B....|
+00000000 16 03 01 01 6e 01 00 01 6a 03 03 b6 39 89 61 fd |....n...j...9.a.|
+00000010 11 84 b3 4b a9 18 23 b2 35 3d 82 85 75 5c e2 f3 |...K..#.5=..u\..|
+00000020 c9 f4 b0 2f 05 fb 5a 90 da 73 38 20 7f 06 81 e5 |.../..Z..s8 ....|
+00000030 d0 10 08 d1 b0 3c 3c 4b 28 39 34 9a 56 ca 47 4a |.....<.....|
+000000f0 00 00 00 00 00 00 00 00 00 00 00 94 68 2c a3 82 |............h,..|
+00000100 51 ed 14 ef 68 ca 42 c5 5c ab 26 c2 91 a9 01 83 |Q...h.B.\.&.....|
+00000110 13 26 8f 62 7c 89 c0 a2 b5 9b 6d 4f a4 c9 e2 49 |.&.b|.....mO...I|
+00000120 34 03 2c b2 7d d9 af eb 1a 99 76 3c a5 ef 70 78 |4.,.}.....v<..px|
+00000130 59 58 1c 45 80 c5 f1 b8 91 b2 54 71 3f bf 4f 2a |YX.E......Tq?.O*|
+00000140 b2 9d 9d 6f 6f 1c f1 3c 6c e6 a2 73 00 00 00 00 |...oo..>> Flow 2 (server to client)
00000000 16 03 03 00 80 02 00 00 7c 03 03 00 00 00 00 00 |........|.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 c0 df df c9 |........... ....|
-00000030 1d ed 19 9e 2d ce 57 f6 95 54 67 76 77 64 c7 f4 |....-.W..Tgvwd..|
-00000040 ad 18 7d d8 58 6f 08 30 a5 a4 50 cd 13 02 00 00 |..}.Xo.0..P.....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 7f 06 81 e5 |........... ....|
+00000030 d0 10 08 d1 b0 3c 3c 4b 28 39 34 9a 56 ca 47 4a |.....<%..v.|
-00000120 6e 92 0d 6b 88 c7 54 46 51 bf 86 a4 f4 11 d3 e8 |n..k..TFQ.......|
-00000130 29 54 16 31 b2 44 4b 45 5d 3f 97 d9 33 10 ef 92 |)T.1.DKE]?..3...|
-00000140 e5 aa 3b 2d 3d 36 ef 85 04 2d 17 66 2a 00 ea 87 |..;-=6...-.f*...|
-00000150 9a 95 5e 54 1b 01 f8 5d 34 96 83 cf 28 d4 24 ed |..^T...]4...(.$.|
-00000160 c6 9b da 7a 1c d4 a3 5a 53 bb 2f cf 56 f3 ef 99 |...z...ZS./.V...|
-00000170 40 e2 34 31 ca 55 c9 7a 02 47 14 8b 7e 04 5a ff |@.41.U.z.G..~.Z.|
-00000180 17 f7 95 f0 46 e0 ce cf 8f b0 9f 6b 51 96 d5 f7 |....F......kQ...|
-00000190 0b 33 e2 0a 62 4e 05 28 66 |.3..bN.(f|
+00000090 18 d7 0c 38 47 21 c2 8e 01 fe e7 1f 35 ee 7f 8f |...8G!......5...|
+000000a0 04 10 7a 06 61 1f 4d 17 03 03 00 35 b3 38 29 ce |..z.a.M....5.8).|
+000000b0 18 2b 22 5e 01 4d 07 04 87 65 68 85 9d 10 e9 9e |.+"^.M...eh.....|
+000000c0 5a a8 a5 cb 8d f9 48 fe 1b 17 30 04 be 55 92 ce |Z.....H...0..U..|
+000000d0 74 9b 8e 9c 6b 77 5d 09 ca 58 8e c0 ac 85 3b 4e |t...kw]..X....;N|
+000000e0 0b 17 03 03 00 93 90 64 70 a6 d7 20 8e 50 6d b7 |.......dp.. .Pm.|
+000000f0 53 3d ed eb 85 e0 2f fe a2 88 84 3d 26 8a 18 65 |S=..../....=&..e|
+00000100 d1 c0 d2 c4 66 2a 2e 8c 06 5f 46 ee fe 36 f7 00 |....f*..._F..6..|
+00000110 57 3f 95 b3 36 47 0c 1a 78 c4 e3 d6 c1 ae 2f 96 |W?..6G..x...../.|
+00000120 f0 e6 5e 61 86 d7 c1 d7 cc d2 a6 19 0c 29 f5 19 |..^a.........)..|
+00000130 d5 5e 75 6f 8b 49 4b 0b e9 c9 3c 69 87 ab b7 1d |.^uo.IK...>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 66 00 e2 3f 07 |..........Ef..?.|
-00000010 02 a4 1d 71 27 2a fe c7 00 1e 2d bc 50 b6 bc 35 |...q'*....-.P..5|
-00000020 22 c4 a4 d8 a1 5f fa 10 d7 48 c8 20 94 50 b1 ae |"...._...H. .P..|
-00000030 47 8c 62 26 15 79 33 6b 06 0d 19 67 7e 22 7c a5 |G.b&.y3k...g~"|.|
-00000040 ca 05 c9 ae c8 66 6b ca 8e f7 7c 35 de 5e c3 25 |.....fk...|5.^.%|
+00000000 14 03 03 00 01 01 17 03 03 00 35 69 08 b0 a0 71 |..........5i...q|
+00000010 1f 95 45 c4 b2 11 43 a9 b5 da ba 11 0a 2b 24 49 |..E...C......+$I|
+00000020 ac 3d 8e ec 32 c9 7f 3e cc 1b fc 9a 68 d0 22 cb |.=..2..>....h.".|
+00000030 37 0e 8f fe 4f 75 1a 62 44 20 60 c2 64 de 48 6d |7...Ou.bD `.d.Hm|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 6a 89 ce e3 1d 13 60 f3 8b 26 97 |.....j.....`..&.|
-00000010 3e 5d 9f a8 47 c9 74 f5 66 ad 75 87 57 ec ef b1 |>]..G.t.f.u.W...|
-00000020 66 da f0 17 03 03 00 13 95 bd 2d ef d5 30 c1 1b |f.........-..0..|
-00000030 bd 54 3d f6 16 02 28 78 a4 4a 24 |.T=...(x.J$|
+00000000 17 03 03 00 1e d5 71 aa 53 2d 55 b7 76 11 45 b0 |......q.S-U.v.E.|
+00000010 f3 de f7 f1 78 0b 10 3f 49 7f ea 83 17 2e b9 50 |....x..?I......P|
+00000020 ec d2 0f 17 03 03 00 13 0a 22 58 66 d8 f7 ad fc |........."Xf....|
+00000030 9c f2 da d1 ae 02 f8 99 d2 26 63 |.........&c|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-Resume-HelloRetryRequest b/src/crypto/tls/testdata/Server-TLSv13-Resume-HelloRetryRequest
index 2e1cbaf135..d0aa66a581 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-Resume-HelloRetryRequest
+++ b/src/crypto/tls/testdata/Server-TLSv13-Resume-HelloRetryRequest
@@ -1,106 +1,96 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 01 9e 01 00 01 9a 03 03 75 28 78 ec 6f |...........u(x.o|
-00000010 3d d0 60 09 8e 23 dd 91 67 4b e4 2f b0 b7 93 60 |=.`..#..gK./...`|
-00000020 3a 4f 92 38 6b 5e 67 ab 49 f4 b8 20 46 e8 0a c4 |:O.8k^g.I.. F...|
-00000030 bd 13 ce 09 13 27 a4 5d a4 3b e2 9b 9d ff 17 30 |.....'.].;.....0|
-00000040 96 e3 06 1a d6 c6 04 9c f3 9a 15 76 00 08 13 02 |...........v....|
-00000050 13 03 13 01 00 ff 01 00 01 49 00 00 00 0e 00 0c |.........I......|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 06 00 04 00 1d 00 17 00 23 |...............#|
-00000080 00 00 00 16 00 00 00 17 00 00 00 0d 00 1e 00 1c |................|
-00000090 04 03 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b |................|
-000000a0 08 04 08 05 08 06 04 01 05 01 06 01 00 2b 00 03 |.............+..|
-000000b0 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 24 00 |....-.....3.&.$.|
-000000c0 1d 00 20 a0 26 2f f2 a2 ca d0 ff 0d 5d 9e cc 84 |.. .&/......]...|
-000000d0 52 51 07 86 4c 28 44 4e 65 7e 0c a1 9d 50 9c 77 |RQ..L(DNe~...P.w|
-000000e0 8a 54 48 00 29 00 bc 00 87 00 81 50 46 ad c1 db |.TH.)......PF...|
-000000f0 a8 38 86 7b 2b bb fd d0 c3 42 3e 00 00 00 00 00 |.8.{+....B>.....|
-00000100 00 00 00 00 00 00 00 00 00 00 00 94 68 2c a3 81 |............h,..|
-00000110 51 ed 14 ef 68 ca 42 c5 4c 1f 90 bf 3c 07 2b e5 |Q...h.B.L...<.+.|
-00000120 52 22 a0 c0 46 db cb f6 b9 a0 b5 56 b0 d6 7f 03 |R"..F......V....|
-00000130 b7 2d 9f a5 2a 25 8e 65 d2 b9 6a f3 e4 7e 79 d7 |.-..*%.e..j..~y.|
-00000140 3d cc b2 3d b6 24 a9 31 82 49 38 16 92 f0 49 97 |=..=.$.1.I8...I.|
-00000150 e2 07 e2 cd 1c 77 d3 e0 00 de 56 11 17 40 00 63 |.....w....V..@.c|
-00000160 13 00 48 39 8e fd 09 96 08 f3 81 7c 00 00 00 00 |..H9.......|....|
-00000170 00 31 30 da 3c 92 3d 0f 55 c9 9e bb 99 c6 e0 ac |.10.<.=.U.......|
-00000180 fe 5a 3a 94 7e d6 2a 0a 81 c0 be 8a 4e 1d da 5e |.Z:.~.*.....N..^|
-00000190 31 80 97 2d 2a 6a fc 96 03 d2 aa 07 45 f1 78 33 |1..-*j......E.x3|
-000001a0 c4 1d 1c |...|
+00000000 16 03 01 01 68 01 00 01 64 03 03 a0 27 b0 af b0 |....h...d...'...|
+00000010 15 2c ed 88 b2 e8 c5 67 2e db 0d 29 13 64 bb 58 |.,.....g...).d.X|
+00000020 3b 71 67 a9 47 65 8a 3c 09 44 29 20 46 fe 89 4b |;qg.Ge.<.D) F..K|
+00000030 f3 1d ed 40 2d 5c 1b 23 26 f5 72 6f d1 b4 77 f5 |...@-\.#&.ro..w.|
+00000040 1a 9f d1 98 34 46 fe 89 0b 2d c1 f9 00 04 13 01 |....4F...-......|
+00000050 00 ff 01 00 01 17 00 0b 00 04 03 00 01 02 00 0a |................|
+00000060 00 06 00 04 00 1d 00 17 00 23 00 00 00 16 00 00 |.........#......|
+00000070 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 06 03 |................|
+00000080 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 |................|
+00000090 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 2d 00 |.......+......-.|
+000000a0 02 01 01 00 33 00 26 00 24 00 1d 00 20 8c 7b 61 |....3.&.$... .{a|
+000000b0 71 c8 0b 1a 17 14 d9 eb 21 38 e6 2f c0 40 e9 2d |q.......!8./.@.-|
+000000c0 3c 91 c5 4e 9d bb dd af 40 bc 91 38 74 00 29 00 |<..N....@..8t.).|
+000000d0 9c 00 77 00 71 50 46 ad c1 db a8 38 86 7b 2b bb |..w.qPF....8.{+.|
+000000e0 fd d0 c3 42 3e 00 00 00 00 00 00 00 00 00 00 00 |...B>...........|
+000000f0 00 00 00 00 00 94 68 2c a3 82 51 ed 14 ef 68 ca |......h,..Q...h.|
+00000100 42 c5 5c ab 26 c2 91 a9 01 83 13 26 8f 62 7c 89 |B.\.&......&.b|.|
+00000110 c0 a2 b5 9b 6d 4f a4 c9 e2 49 34 03 2c b2 7d d9 |....mO...I4.,.}.|
+00000120 af eb 1a 99 76 3c a5 ef 70 78 59 58 1c 45 80 c5 |....v<..pxYX.E..|
+00000130 f1 b8 91 b2 54 71 3f bf 4f 2a b2 9d 9d 6f 6f 1c |....Tq?.O*...oo.|
+00000140 f1 3c 6c e6 a2 73 00 00 00 00 00 21 20 7b 6e 44 |.>> Flow 2 (server to client)
00000000 16 03 03 00 58 02 00 00 54 03 03 cf 21 ad 74 e5 |....X...T...!.t.|
00000010 9a 61 11 be 1d 8c 02 1e 65 b8 91 c2 a2 11 16 7a |.a......e......z|
-00000020 bb 8c 5e 07 9e 09 e2 c8 a8 33 9c 20 46 e8 0a c4 |..^......3. F...|
-00000030 bd 13 ce 09 13 27 a4 5d a4 3b e2 9b 9d ff 17 30 |.....'.].;.....0|
-00000040 96 e3 06 1a d6 c6 04 9c f3 9a 15 76 13 02 00 00 |...........v....|
+00000020 bb 8c 5e 07 9e 09 e2 c8 a8 33 9c 20 46 fe 89 4b |..^......3. F..K|
+00000030 f3 1d ed 40 2d 5c 1b 23 26 f5 72 6f d1 b4 77 f5 |...@-\.#&.ro..w.|
+00000040 1a 9f d1 98 34 46 fe 89 0b 2d c1 f9 13 01 00 00 |....4F...-......|
00000050 0c 00 2b 00 02 03 04 00 33 00 02 00 17 14 03 03 |..+.....3.......|
00000060 00 01 01 |...|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 16 03 03 01 bf 01 00 01 bb 03 |................|
-00000010 03 75 28 78 ec 6f 3d d0 60 09 8e 23 dd 91 67 4b |.u(x.o=.`..#..gK|
-00000020 e4 2f b0 b7 93 60 3a 4f 92 38 6b 5e 67 ab 49 f4 |./...`:O.8k^g.I.|
-00000030 b8 20 46 e8 0a c4 bd 13 ce 09 13 27 a4 5d a4 3b |. F........'.].;|
-00000040 e2 9b 9d ff 17 30 96 e3 06 1a d6 c6 04 9c f3 9a |.....0..........|
-00000050 15 76 00 08 13 02 13 03 13 01 00 ff 01 00 01 6a |.v.............j|
-00000060 00 00 00 0e 00 0c 00 00 09 31 32 37 2e 30 2e 30 |.........127.0.0|
-00000070 2e 31 00 0b 00 04 03 00 01 02 00 0a 00 06 00 04 |.1..............|
-00000080 00 1d 00 17 00 23 00 00 00 16 00 00 00 17 00 00 |.....#..........|
-00000090 00 0d 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 |................|
-000000a0 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 |................|
-000000b0 06 01 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 |...+......-.....|
-000000c0 33 00 47 00 45 00 17 00 41 04 79 db 79 c8 0b 77 |3.G.E...A.y.y..w|
-000000d0 8b 37 30 65 85 ce 72 49 ab a1 cb 6a 06 00 a6 65 |.70e..rI...j...e|
-000000e0 22 51 63 63 16 45 7b 85 ee c3 2e 09 25 d9 a3 49 |"Qcc.E{.....%..I|
-000000f0 91 07 35 c4 b6 61 23 9c 91 c1 03 07 ad a2 77 02 |..5..a#.......w.|
-00000100 61 93 05 cf 74 36 7a 66 ad 24 00 29 00 bc 00 87 |a...t6zf.$.)....|
-00000110 00 81 50 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 |..PF....8.{+....|
-00000120 42 3e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |B>..............|
-00000130 00 00 94 68 2c a3 81 51 ed 14 ef 68 ca 42 c5 4c |...h,..Q...h.B.L|
-00000140 1f 90 bf 3c 07 2b e5 52 22 a0 c0 46 db cb f6 b9 |...<.+.R"..F....|
-00000150 a0 b5 56 b0 d6 7f 03 b7 2d 9f a5 2a 25 8e 65 d2 |..V.....-..*%.e.|
-00000160 b9 6a f3 e4 7e 79 d7 3d cc b2 3d b6 24 a9 31 82 |.j..~y.=..=.$.1.|
-00000170 49 38 16 92 f0 49 97 e2 07 e2 cd 1c 77 d3 e0 00 |I8...I......w...|
-00000180 de 56 11 17 40 00 63 13 00 48 39 8e fd 09 96 08 |.V..@.c..H9.....|
-00000190 f3 81 7c 00 00 00 00 00 31 30 e0 ac 7a 74 d9 50 |..|.....10..zt.P|
-000001a0 c1 3b 1b 67 7b 5a 74 b0 39 db dd 92 6f 75 38 31 |.;.g{Zt.9...ou81|
-000001b0 10 f4 98 dc ad af eb ac ef 11 0d 96 48 01 f8 10 |............H...|
-000001c0 d6 e1 68 bf 88 a3 33 b9 9a b9 |..h...3...|
+00000000 14 03 03 00 01 01 16 03 03 01 89 01 00 01 85 03 |................|
+00000010 03 a0 27 b0 af b0 15 2c ed 88 b2 e8 c5 67 2e db |..'....,.....g..|
+00000020 0d 29 13 64 bb 58 3b 71 67 a9 47 65 8a 3c 09 44 |.).d.X;qg.Ge.<.D|
+00000030 29 20 46 fe 89 4b f3 1d ed 40 2d 5c 1b 23 26 f5 |) F..K...@-\.#&.|
+00000040 72 6f d1 b4 77 f5 1a 9f d1 98 34 46 fe 89 0b 2d |ro..w.....4F...-|
+00000050 c1 f9 00 04 13 01 00 ff 01 00 01 38 00 0b 00 04 |...........8....|
+00000060 03 00 01 02 00 0a 00 06 00 04 00 1d 00 17 00 23 |...............#|
+00000070 00 00 00 16 00 00 00 17 00 00 00 0d 00 1e 00 1c |................|
+00000080 04 03 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b |................|
+00000090 08 04 08 05 08 06 04 01 05 01 06 01 00 2b 00 03 |.............+..|
+000000a0 02 03 04 00 2d 00 02 01 01 00 33 00 47 00 45 00 |....-.....3.G.E.|
+000000b0 17 00 41 04 6e 14 0d ac 3f 1a 2a 36 54 4f ec 9d |..A.n...?.*6TO..|
+000000c0 da 5b 93 12 42 eb 58 11 1b 4c 5c 39 a2 32 b8 5b |.[..B.X..L\9.2.[|
+000000d0 41 13 51 05 88 fe 45 d2 01 ef 8d 14 bc 96 de d3 |A.Q...E.........|
+000000e0 1c e3 eb 0c a0 a7 a3 7c 1c b1 9e 38 c2 dc f6 35 |.......|...8...5|
+000000f0 7b 5b 08 2e 00 29 00 9c 00 77 00 71 50 46 ad c1 |{[...)...w.qPF..|
+00000100 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 00 00 00 |..8.{+....B>....|
+00000110 00 00 00 00 00 00 00 00 00 00 00 00 94 68 2c a3 |.............h,.|
+00000120 82 51 ed 14 ef 68 ca 42 c5 5c ab 26 c2 91 a9 01 |.Q...h.B.\.&....|
+00000130 83 13 26 8f 62 7c 89 c0 a2 b5 9b 6d 4f a4 c9 e2 |..&.b|.....mO...|
+00000140 49 34 03 2c b2 7d d9 af eb 1a 99 76 3c a5 ef 70 |I4.,.}.....v<..p|
+00000150 78 59 58 1c 45 80 c5 f1 b8 91 b2 54 71 3f bf 4f |xYX.E......Tq?.O|
+00000160 2a b2 9d 9d 6f 6f 1c f1 3c 6c e6 a2 73 00 00 00 |*...oo..>> Flow 4 (server to client)
00000000 16 03 03 00 a1 02 00 00 9d 03 03 00 00 00 00 00 |................|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 46 e8 0a c4 |........... F...|
-00000030 bd 13 ce 09 13 27 a4 5d a4 3b e2 9b 9d ff 17 30 |.....'.].;.....0|
-00000040 96 e3 06 1a d6 c6 04 9c f3 9a 15 76 13 02 00 00 |...........v....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 46 fe 89 4b |........... F..K|
+00000030 f3 1d ed 40 2d 5c 1b 23 26 f5 72 6f d1 b4 77 f5 |...@-\.#&.ro..w.|
+00000040 1a 9f d1 98 34 46 fe 89 0b 2d c1 f9 13 01 00 00 |....4F...-......|
00000050 55 00 2b 00 02 03 04 00 33 00 45 00 17 00 41 04 |U.+.....3.E...A.|
00000060 1e 18 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 |..7...Q.5uq..T[.|
00000070 2e 8f 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e |...g..$ >.V...(^|
00000080 f8 2b 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 |.+-O....lK[.V.2B|
00000090 e9 58 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 |.X..I..h.A.Vk.Z.|
-000000a0 00 29 00 02 00 00 17 03 03 00 17 48 f2 b1 a7 11 |.).........H....|
-000000b0 68 36 e4 67 b8 e8 d0 6d b8 76 fa 4b 7e bc d0 63 |h6.g...m.v.K~..c|
-000000c0 6a 8c 17 03 03 00 45 49 37 80 89 e3 4d b5 60 4a |j.....EI7...M.`J|
-000000d0 7c 52 a0 f5 e9 32 85 ad 8a 59 0b 27 66 c7 2f ec ||R...2...Y.'f./.|
-000000e0 55 7f 2c 9b 1e ef 0a 11 e1 72 1f 72 b2 10 9f 3f |U.,......r.r...?|
-000000f0 bb 51 8f d0 fe e8 62 fd 93 e4 0d e1 57 7f 3a 3c |.Q....b.....W.:<|
-00000100 22 b4 ca 20 04 cd 65 94 44 df 1a 1c 17 03 03 00 |".. ..e.D.......|
-00000110 a3 38 02 96 5e c2 6d ad 2d 17 79 63 15 bd 06 af |.8..^.m.-.yc....|
-00000120 e3 ae 5a 94 66 b5 2d 12 d1 bc 9c 16 56 ac 71 fe |..Z.f.-.....V.q.|
-00000130 d7 af 1f 27 9a 22 1a d2 de da 90 ca d5 7f 79 d1 |...'."........y.|
-00000140 8a 6e c6 76 e7 76 b4 cc 9b d5 b5 ed b5 b2 9d 4e |.n.v.v.........N|
-00000150 f8 88 a0 b1 14 91 8b 6b d9 b8 5d 34 61 8a a3 b3 |.......k..]4a...|
-00000160 c8 db e9 c9 8d a7 53 d8 46 f0 bd 4b 30 bf 49 3d |......S.F..K0.I=|
-00000170 cc 42 d3 fb b7 f3 ad 78 5b 01 38 5d c3 22 d0 51 |.B.....x[.8].".Q|
-00000180 cb a3 d9 fe 61 f9 4a ee 7d 89 8b 88 22 2b 9b fe |....a.J.}..."+..|
-00000190 19 cd 17 b7 9e 81 57 f6 cb 14 29 cb 3b 87 0e 83 |......W...).;...|
-000001a0 5a 84 7c 13 2d c8 d4 a7 6a db 1d 10 c6 04 ed 0d |Z.|.-...j.......|
-000001b0 1d d7 06 bb |....|
+000000a0 00 29 00 02 00 00 17 03 03 00 17 ea 86 30 48 65 |.)...........0He|
+000000b0 cf a6 d4 9d af f7 75 d4 d3 dd af 79 ce 3a 42 5b |......u....y.:B[|
+000000c0 68 7a 17 03 03 00 35 ef d6 22 53 ec 3c 27 84 c7 |hz....5.."S.<'..|
+000000d0 7f b2 81 8e 3e 70 51 25 95 b4 6a 79 01 15 60 c0 |....>pQ%..jy..`.|
+000000e0 39 eb 5b 90 7b 50 f5 3b 50 64 d2 b2 d6 c7 72 cf |9.[.{P.;Pd....r.|
+000000f0 35 f3 25 1c 86 4b 69 ab 6e 50 86 2e 17 03 03 00 |5.%..Ki.nP......|
+00000100 93 66 5a c1 de c6 92 96 95 92 48 90 e7 0f e1 08 |.fZ.......H.....|
+00000110 25 b2 72 a5 7f c5 17 6e 70 5d 6e 68 78 32 72 8d |%.r....np]nhx2r.|
+00000120 3a fa 7a 66 76 26 10 9e f9 92 ca 3b a7 6c 6c fa |:.zfv&.....;.ll.|
+00000130 72 d1 22 f4 b0 b9 2a 90 bd ce 58 e4 ff 1d 88 99 |r."...*...X.....|
+00000140 a4 8d f9 10 af c8 35 cd c4 6f 99 cd 9e 6c 95 b1 |......5..o...l..|
+00000150 b7 6e a4 48 9e 75 f1 d3 c0 b3 27 f1 61 83 ea 13 |.n.H.u....'.a...|
+00000160 06 7f 37 38 f1 31 9e 71 5a 97 15 b5 46 63 44 e8 |..78.1.qZ...FcD.|
+00000170 f4 a1 fc 81 5d f4 c7 65 be 76 da 79 bd fb e4 e6 |....]..e.v.y....|
+00000180 68 de ce f3 32 6b 0c ee 19 18 75 33 77 f2 34 3d |h...2k....u3w.4=|
+00000190 9e c3 da b7 |....|
>>> Flow 5 (client to server)
-00000000 17 03 03 00 45 44 0b 11 40 bf 4b b4 2b 12 76 b3 |....ED..@.K.+.v.|
-00000010 e4 59 b3 91 bb 45 21 b3 78 aa dc 76 66 dd d6 3c |.Y...E!.x..vf..<|
-00000020 21 cf 32 5c 37 85 ef fb c7 53 cb 55 9c a5 40 0a |!.2\7....S.U..@.|
-00000030 9d f8 aa b4 e3 e4 51 bf d8 cb 15 44 f0 02 19 52 |......Q....D...R|
-00000040 62 73 82 f2 c2 ae d2 03 0e dc |bs........|
+00000000 17 03 03 00 35 59 51 fe aa 0a 69 ef d5 0e ee e3 |....5YQ...i.....|
+00000010 0e 21 f7 e0 80 88 a0 da 23 7a 38 7f 73 e1 da e9 |.!......#z8.s...|
+00000020 7c 02 73 5e f2 64 e5 60 0e c6 d5 9e 7a 45 c2 0b ||.s^.d.`....zE..|
+00000030 6f 08 46 46 5b f1 5b 67 5d 42 |o.FF[.[g]B|
>>> Flow 6 (server to client)
-00000000 17 03 03 00 1e fe e8 25 be 32 b9 ce db 3d 36 54 |.......%.2...=6T|
-00000010 78 7c 70 50 0e 8e f4 04 ec a9 2e 88 7b e5 23 23 |x|pP........{.##|
-00000020 72 f4 04 17 03 03 00 13 cc 7c 8e 1b 85 30 16 57 |r........|...0.W|
-00000030 b0 39 6a 3a b3 ee 57 82 17 03 c9 |.9j:..W....|
+00000000 17 03 03 00 1e 3c a5 86 73 ea 62 44 ee 3b 45 a2 |.....<..s.bD.;E.|
+00000010 2a 57 ed 27 0e 65 40 48 23 10 7f ff 27 e5 4e d1 |*W.'.e@H#...'.N.|
+00000020 99 9a e1 17 03 03 00 13 1e 78 1a 08 4b 24 1b fc |.........x..K$..|
+00000030 78 e5 ab fd 8f bf 53 26 f9 b7 c0 |x.....S&...|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-ResumeDisabled b/src/crypto/tls/testdata/Server-TLSv13-ResumeDisabled
index 1ba7ca1578..9f14b602bd 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-ResumeDisabled
+++ b/src/crypto/tls/testdata/Server-TLSv13-ResumeDisabled
@@ -1,104 +1,99 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 01 a4 01 00 01 a0 03 03 96 06 be 39 9a |..............9.|
-00000010 6b 71 35 ab f4 2a d2 66 4d 8f 2c 86 c9 b6 7b e1 |kq5..*.fM.,...{.|
-00000020 85 55 81 f5 90 49 20 c9 d7 5d ea 20 a2 da 4f 31 |.U...I ..]. ..O1|
-00000030 a6 7a bd 07 5d 24 2e 88 1c 88 0e 19 1e 33 51 51 |.z..]$.......3QQ|
-00000040 a1 14 df d7 70 b5 62 6d 28 a8 5f 0e 00 08 13 02 |....p.bm(._.....|
-00000050 13 03 13 01 00 ff 01 00 01 4f 00 00 00 0e 00 0c |.........O......|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................|
-00000080 00 19 00 18 00 23 00 00 00 16 00 00 00 17 00 00 |.....#..........|
-00000090 00 0d 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 |................|
-000000a0 08 09 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 |................|
-000000b0 06 01 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 |...+......-.....|
-000000c0 33 00 26 00 24 00 1d 00 20 6d b7 14 7e 1b 7e c5 |3.&.$... m..~.~.|
-000000d0 2b 54 1e 88 bd 64 23 49 84 31 73 f0 b8 55 6c 23 |+T...d#I.1s..Ul#|
-000000e0 9e 77 b9 c5 53 a5 7f 1d 15 00 29 00 bc 00 87 00 |.w..S.....).....|
-000000f0 81 50 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 |.PF....8.{+....B|
-00000100 3e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |>...............|
-00000110 00 94 68 2c a3 81 51 ed 14 ef 68 ca 42 c5 4c e2 |..h,..Q...h.B.L.|
-00000120 e9 ab 5a 10 63 08 88 5d 47 1a 77 c1 7c 72 14 12 |..Z.c..]G.w.|r..|
-00000130 24 5f 79 c4 ce 1a 7c 08 bf 81 6d 0e 55 e6 2d 0d |$_y...|...m.U.-.|
-00000140 00 68 79 bc 2d ea f4 19 fd 43 ef 51 3f b5 5f 49 |.hy.-....C.Q?._I|
-00000150 38 16 e0 74 43 a4 e9 95 f6 6d eb bf 6d e2 57 79 |8..tC....m..m.Wy|
-00000160 7a 6e 53 12 bd a2 e0 32 98 1d 4e cb ae 72 1f 4c |znS....2..N..r.L|
-00000170 38 4c 00 00 00 00 00 31 30 b6 c5 6e 26 02 64 56 |8L.....10..n&.dV|
-00000180 65 ab 95 9c 16 62 d0 c5 57 41 c7 4c 78 72 44 c7 |e....b..WA.LxrD.|
-00000190 4f a4 dc e1 d3 ef 49 af 7d a1 e5 ce 6f 22 f9 ec |O.....I.}...o"..|
-000001a0 f4 b3 e4 32 e3 99 b0 85 39 |...2....9|
+00000000 16 03 01 01 6e 01 00 01 6a 03 03 0f 31 f0 17 d6 |....n...j...1...|
+00000010 3e ee f6 b9 14 05 57 cb 41 0b a4 6a 2f 70 9e 69 |>.....W.A..j/p.i|
+00000020 09 2a eb ec 9a f4 47 61 09 43 09 20 d2 5d cf 57 |.*....Ga.C. .].W|
+00000030 b8 81 3c a5 0a 77 50 0a c3 88 79 7a dc d0 2f 8a |..<..wP...yz../.|
+00000040 08 ea 5f 53 54 a6 ff 43 d2 03 55 0e 00 04 13 01 |.._ST..C..U.....|
+00000050 00 ff 01 00 01 1d 00 0b 00 04 03 00 01 02 00 0a |................|
+00000060 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 00 23 |...............#|
+00000070 00 00 00 16 00 00 00 17 00 00 00 0d 00 1e 00 1c |................|
+00000080 04 03 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b |................|
+00000090 08 04 08 05 08 06 04 01 05 01 06 01 00 2b 00 03 |.............+..|
+000000a0 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 24 00 |....-.....3.&.$.|
+000000b0 1d 00 20 b4 ef 07 d4 1b 0e a1 42 ee f1 f3 84 3e |.. .......B....>|
+000000c0 9f fe bb a6 af 59 9d 04 96 03 1b 43 1a b8 f7 7f |.....Y.....C....|
+000000d0 44 64 60 00 29 00 9c 00 77 00 71 50 46 ad c1 db |Dd`.)...w.qPF...|
+000000e0 a8 38 86 7b 2b bb fd d0 c3 42 3e 00 00 00 00 00 |.8.{+....B>.....|
+000000f0 00 00 00 00 00 00 00 00 00 00 00 94 68 2c a3 82 |............h,..|
+00000100 51 ed 14 ef 68 ca 42 c5 5c 90 6b 88 83 a9 b3 63 |Q...h.B.\.k....c|
+00000110 7c 1c 04 ce dd be 5a 26 ef 4e 37 52 ea 9a 45 6b ||.....Z&.N7R..Ek|
+00000120 ea 89 a5 26 7d c3 ea 67 db 99 76 3c e5 52 89 d0 |...&}..g..v<.R..|
+00000130 4b 46 41 2e 62 5c ce a8 2e 9a 67 e9 52 f0 40 d2 |KFA.b\....g.R.@.|
+00000140 f1 0e ab 02 0f 54 c8 0b 5e 91 8f 8b 00 00 00 00 |.....T..^.......|
+00000150 00 21 20 e0 71 35 06 a0 30 9f bf 5a 6e f3 14 fd |.! .q5..0..Zn...|
+00000160 34 0b 6d d5 36 08 82 8f d0 79 cc f3 74 7c a9 a5 |4.m.6....y..t|..|
+00000170 c3 81 27 |..'|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 a2 da 4f 31 |........... ..O1|
-00000030 a6 7a bd 07 5d 24 2e 88 1c 88 0e 19 1e 33 51 51 |.z..]$.......3QQ|
-00000040 a1 14 df d7 70 b5 62 6d 28 a8 5f 0e 13 02 00 00 |....p.bm(._.....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 d2 5d cf 57 |........... .].W|
+00000030 b8 81 3c a5 0a 77 50 0a c3 88 79 7a dc d0 2f 8a |..<..wP...yz../.|
+00000040 08 ea 5f 53 54 a6 ff 43 d2 03 55 0e 13 01 00 00 |.._ST..C..U.....|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 5a 35 3d 19 9b a7 |..........Z5=...|
-00000090 a4 45 2c c3 09 ae 85 be 08 fe 1d e2 9a 5d 7a 4b |.E,..........]zK|
-000000a0 8e 17 03 03 02 6d 87 db fb 18 21 96 c7 2b fb ff |.....m....!..+..|
-000000b0 89 b9 25 f6 0d 89 0f b4 17 bb 17 e1 ba 95 b7 cd |..%.............|
-000000c0 c2 75 b5 8b d8 64 ff 7c dc e2 97 32 0c 2f e0 9f |.u...d.|...2./..|
-000000d0 db b9 ef 14 9d cc e4 68 44 f7 0a 55 d2 b1 a0 f7 |.......hD..U....|
-000000e0 fc de a5 99 f0 5d 0c 60 7b c3 25 85 f6 79 8f e6 |.....].`{.%..y..|
-000000f0 cd 43 1c 43 d9 cd 28 ea ce 10 1c 16 68 b8 d7 3d |.C.C..(.....h..=|
-00000100 b4 d4 db b4 bf 76 f8 45 23 d8 9f d1 be d1 bd db |.....v.E#.......|
-00000110 9c 45 dd 28 3b 68 22 57 6c b7 65 fc 5e 66 f6 cb |.E.(;h"Wl.e.^f..|
-00000120 a2 88 bd 96 e4 00 b5 85 ae 00 95 b9 da 42 16 c9 |.............B..|
-00000130 c9 63 c2 67 ec 22 65 6e 66 0e cf de 68 ad e7 87 |.c.g."enf...h...|
-00000140 ae 63 b4 e9 1c c0 2f 1e 79 7e a3 3f 6d 2b 68 c1 |.c..../.y~.?m+h.|
-00000150 e8 60 cd 26 e0 05 de fa 7b 77 45 71 d8 f9 03 d7 |.`.&....{wEq....|
-00000160 d3 50 51 15 cf fc 39 fa 07 19 28 5e e8 2d 31 00 |.PQ...9...(^.-1.|
-00000170 2a e1 a4 21 31 83 4e 7d 51 e7 53 eb 33 22 51 fe |*..!1.N}Q.S.3"Q.|
-00000180 15 04 e9 3d 73 89 3b 56 3f c6 ec 6e 0a 71 68 a6 |...=s.;V?..n.qh.|
-00000190 76 f3 f1 aa 4e d0 9f 85 45 3f 7b aa ae ad 42 b9 |v...N...E?{...B.|
-000001a0 07 64 ab ad 03 b1 33 78 93 f0 49 95 65 fb 81 8c |.d....3x..I.e...|
-000001b0 04 ee e7 f3 2c 0a 99 51 e5 ef 05 14 d3 93 37 2b |....,..Q......7+|
-000001c0 73 96 81 6f f5 9b a3 9a 20 95 5c 13 fc 97 3e c0 |s..o.... .\...>.|
-000001d0 87 e4 ec 00 84 0b f2 09 29 63 dd 54 03 ce e0 43 |........)c.T...C|
-000001e0 e9 16 a0 98 32 3e fa 58 1d 81 1e 56 ef 64 ff f7 |....2>.X...V.d..|
-000001f0 b0 aa fc 5f 8c 89 48 76 ef d2 f1 d0 9c 16 f9 57 |..._..Hv.......W|
-00000200 ac a6 4a a4 a8 75 ae fc 4b 9f ef 3c 28 a5 0c c1 |..J..u..K..<(...|
-00000210 c8 72 82 bf e9 93 f2 42 00 0a 49 5d be c7 09 91 |.r.....B..I]....|
-00000220 29 40 5e a6 ad ae 9c 69 6f d8 33 53 0a 50 5b 48 |)@^....io.3S.P[H|
-00000230 7d d7 7e 1e 3b d3 ec e6 cf fe 1e 6a 27 a2 83 35 |}.~.;......j'..5|
-00000240 28 13 2f 00 e5 29 c3 10 46 53 a1 17 15 59 5d 74 |(./..)..FS...Y]t|
-00000250 f5 7c fa a5 71 34 32 75 48 e6 2c 1d 90 e8 c1 87 |.|..q42uH.,.....|
-00000260 50 ac 17 27 b8 f7 a9 8e 59 58 d6 b8 d9 ef b6 57 |P..'....YX.....W|
-00000270 b8 13 41 d0 eb 80 1c 48 66 1d 41 a5 b5 0d 12 17 |..A....Hf.A.....|
-00000280 52 96 62 29 0e 4a 09 b4 50 b8 37 c3 8f 85 67 27 |R.b).J..P.7...g'|
-00000290 d9 6f 33 11 95 ca 0a 36 75 ef 15 45 81 d3 ad 7d |.o3....6u..E...}|
-000002a0 1a ff a7 0c 47 21 37 24 27 ce 42 68 5f 5d 7c fe |....G!7$'.Bh_]|.|
-000002b0 0c f2 0b 81 ea f9 25 c9 99 c2 56 72 54 bd 2f 4c |......%...VrT./L|
-000002c0 40 17 f0 54 a0 6e 1d 14 80 9c 3c d3 f9 81 0d 9d |@..T.n....<.....|
-000002d0 e1 47 55 24 e4 62 0e 14 0d 46 3f 52 1b ef ab 45 |.GU$.b...F?R...E|
-000002e0 d8 86 c7 ef aa e2 ea e6 5e 2e d8 89 33 46 a0 d0 |........^...3F..|
-000002f0 39 e2 cc 13 1d 62 11 ae c0 73 71 b8 ef 4b 43 71 |9....b...sq..KCq|
-00000300 dd 14 42 09 c9 10 4e bc b9 93 78 d6 83 02 40 c0 |..B...N...x...@.|
-00000310 62 56 40 17 03 03 00 99 6e 03 4b 38 20 98 d7 3e |bV@.....n.K8 ..>|
-00000320 52 33 e0 be 26 9b 38 4c 7f 2b c1 cc 84 22 7e 86 |R3..&.8L.+..."~.|
-00000330 1d 39 f6 0a c0 ff e9 d9 4d 81 24 26 8d e1 c5 c0 |.9......M.$&....|
-00000340 78 18 59 e0 6a ac 35 ad a0 6d 32 09 63 75 88 10 |x.Y.j.5..m2.cu..|
-00000350 2b 6b d1 36 ea f9 03 41 a9 a7 26 82 38 37 aa 81 |+k.6...A..&.87..|
-00000360 a1 7a 81 5c 0b db 63 32 06 e7 cb a8 1c 0a ff be |.z.\..c2........|
-00000370 a2 e5 00 42 59 61 78 40 2e e2 85 0a ad 6b ea ae |...BYax@.....k..|
-00000380 17 5a 92 f6 d3 8e 97 a2 18 a5 28 8a 41 1d 70 26 |.Z........(.A.p&|
-00000390 bc d8 e7 38 ba c5 68 b9 ae f9 c6 27 bc 5b 3b 9f |...8..h....'.[;.|
-000003a0 db ae 38 84 6f 18 3c e6 1d 30 cb 57 b1 95 63 1d |..8.o.<..0.W..c.|
-000003b0 ef 17 03 03 00 45 40 43 00 0c 81 0a ed cf 35 9d |.....E@C......5.|
-000003c0 45 0f 2b 66 ad b6 bd f9 72 9f 77 aa 87 9a 4f 9a |E.+f....r.w...O.|
-000003d0 f4 1b 08 bd 33 aa f7 dc f1 78 58 d7 53 aa 82 12 |....3....xX.S...|
-000003e0 b1 f7 c2 dd 8b 0d 90 81 e9 a9 7b 7c 17 52 fe ab |..........{|.R..|
-000003f0 e4 94 06 d4 44 b4 7d 81 61 97 6b |....D.}.a.k|
+00000080 03 03 00 01 01 17 03 03 00 17 df 85 83 6b 9d e0 |.............k..|
+00000090 8d b4 da b1 f2 c7 ff c1 13 33 d4 53 b8 92 bf 83 |.........3.S....|
+000000a0 6c 17 03 03 02 6d 6b 0f f6 15 41 46 aa 92 06 af |l....mk...AF....|
+000000b0 c9 a2 73 c5 31 64 c1 cd 3a e5 e6 9a d9 04 f4 01 |..s.1d..:.......|
+000000c0 d5 0e d6 30 e2 7a 6d 0c 23 d5 4b b1 70 58 c8 ca |...0.zm.#.K.pX..|
+000000d0 5d 1f c9 7c 76 f8 f9 90 b0 f6 05 f6 85 d2 10 b6 |]..|v...........|
+000000e0 bb b1 49 07 8a ba 9b d8 1a f4 48 18 f5 c5 90 f1 |..I.......H.....|
+000000f0 a7 24 cd 3b ab 2f 49 28 fa 3c 64 80 50 a6 38 d9 |.$.;./I(..H2..|
+00000170 37 13 08 f2 cc cb bb f5 55 d5 7d 97 5e 6a df 11 |7.......U.}.^j..|
+00000180 33 fd 34 65 99 c2 40 7b a3 7a 04 92 63 ad 19 9d |3.4e..@{.z..c...|
+00000190 02 2a 6f d1 c8 f7 e1 d1 0f a1 c3 5b 81 70 b0 e5 |.*o........[.p..|
+000001a0 97 a4 b2 76 c5 9b 55 f5 da 2d 53 d2 49 4b a7 6a |...v..U..-S.IK.j|
+000001b0 0f 0f c8 d6 a5 00 83 52 fb 12 c6 6b 98 51 a3 4e |.......R...k.Q.N|
+000001c0 86 39 ab 7e 76 1f 31 b5 5e 50 53 1b 21 af 7f a0 |.9.~v.1.^PS.!...|
+000001d0 b9 3c cf 59 19 c7 c8 b6 ef d7 4f e5 ea 5e bc 67 |.<.Y......O..^.g|
+000001e0 00 47 97 50 85 15 54 19 eb de b8 11 0e 39 9a b0 |.G.P..T......9..|
+000001f0 be cd db d9 53 88 9c 78 e8 b9 5e 12 4b 30 63 d5 |....S..x..^.K0c.|
+00000200 eb 48 d1 d4 95 94 58 61 9c 53 ad 97 bd 45 3a 09 |.H....Xa.S...E:.|
+00000210 d0 83 a7 ba 8c 64 87 42 b7 e1 fa 1b 32 58 8b de |.....d.B....2X..|
+00000220 70 34 34 6d fb 0f a0 27 c3 8b 69 61 43 30 24 b2 |p44m...'..iaC0$.|
+00000230 32 4b ca 6c 0b ea f7 4b df e5 5f 3d 06 ea 0d 31 |2K.l...K.._=...1|
+00000240 4a c6 19 44 61 a1 5b 45 ee 9b ea 69 42 8f 35 86 |J..Da.[E...iB.5.|
+00000250 09 c7 83 51 32 e6 7b 45 bb fb 11 1f 4d 3f b8 10 |...Q2.{E....M?..|
+00000260 6a 0c 52 4c fd 20 62 0f 75 26 8a 65 67 e9 7e 56 |j.RL. b.u&.eg.~V|
+00000270 f4 ed 01 67 9e 27 0d 39 98 b4 97 44 50 f6 26 11 |...g.'.9...DP.&.|
+00000280 3c e4 40 17 5c f1 eb 85 1f 13 f9 8d 22 66 2d 2e |<.@.\......."f-.|
+00000290 3b f8 eb 08 7d df f6 ba 7b ec 15 34 04 e2 6d aa |;...}...{..4..m.|
+000002a0 e2 1c 5a e6 e8 4f 00 0c 07 1b dd 6e 07 03 ed 6d |..Z..O.....n...m|
+000002b0 df c0 7d ed 05 84 bb ad 0c 1f df 8b 8d 0a ad 33 |..}............3|
+000002c0 90 38 44 db 8a 32 9f 9d b3 ae 2e 92 d6 ab d3 25 |.8D..2.........%|
+000002d0 12 32 2d 6e a9 17 0d c9 f9 79 25 17 f0 62 1b 91 |.2-n.....y%..b..|
+000002e0 ad d5 2d ec 0d ea cd c4 86 77 04 92 ab a8 8d ea |..-......w......|
+000002f0 ce fc 13 7b a0 ca 32 96 50 49 99 dd 25 d7 73 93 |...{..2.PI..%.s.|
+00000300 f2 00 72 ca 31 07 fd 7e 12 8a 8b 76 51 4e fe 30 |..r.1..~...vQN.0|
+00000310 4d 5c 65 17 03 03 00 99 5b 19 25 c3 5a 4d f0 bd |M\e.....[.%.ZM..|
+00000320 71 0e 48 63 61 bb 55 6b d3 26 81 25 cf ea 45 e6 |q.Hca.Uk.&.%..E.|
+00000330 52 e4 4e c9 5a a8 c2 e2 72 97 51 8a 38 c6 8d 27 |R.N.Z...r.Q.8..'|
+00000340 8d df 09 ce 37 87 a6 41 cb c4 bd 6d 19 ef 56 1a |....7..A...m..V.|
+00000350 e8 79 df ad 76 9e a6 92 e3 da b3 a6 0d 9f 6f 6f |.y..v.........oo|
+00000360 3f 76 0b 62 b4 cf 2c 5b 24 65 bd c1 90 bb 88 ec |?v.b..,[$e......|
+00000370 8b 0c 7d 6b 42 38 26 78 62 5c b0 21 74 95 5f fe |..}kB8&xb\.!t._.|
+00000380 68 7d 31 8c 5f f5 dc a4 f0 23 6b 75 be 70 ea b3 |h}1._....#ku.p..|
+00000390 19 cc 83 9b 8a f6 cb cc 04 2e 66 b5 77 bb 11 68 |..........f.w..h|
+000003a0 56 85 0c b1 b8 b1 4e ed ca bd ea 3c 91 38 8a 63 |V.....N....<.8.c|
+000003b0 f3 17 03 03 00 35 06 2f 99 10 0c 41 cf 70 d2 aa |.....5./...A.p..|
+000003c0 f9 74 e7 3a cb bb 77 1c e6 5c bf f9 3f 02 df af |.t.:..w..\..?...|
+000003d0 ba 08 fa f7 42 60 ad de 65 62 2e 54 5f 35 90 4f |....B`..eb.T_5.O|
+000003e0 9c b1 34 3d 5d f5 6e 04 d8 5a 50 |..4=].n..ZP|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 0e e9 bb 83 d4 |..........E.....|
-00000010 41 da c6 75 69 c2 5c 74 0c 86 c7 b9 08 2f 35 da |A..ui.\t...../5.|
-00000020 19 6f cf 43 a4 23 2f fe 59 5d 0f 1f 1e 0f ca e4 |.o.C.#/.Y]......|
-00000030 7f 4e 7d bc ce 77 76 f2 ce 1c c4 e8 4e a9 80 a8 |.N}..wv.....N...|
-00000040 72 16 5b 3c 97 8f 55 cb 76 cf fa 02 29 41 af 6d |r.[<..U.v...)A.m|
+00000000 14 03 03 00 01 01 17 03 03 00 35 7e dc fc 3f 66 |..........5~..?f|
+00000010 cb ed 57 e3 5c 83 19 22 31 18 cb eb d5 b8 d2 3c |..W.\.."1......<|
+00000020 6c 10 1f be 5c 04 cf 88 6b ec 04 3d aa 0d 15 68 |l...\...k..=...h|
+00000030 e4 42 bb c9 86 12 ef f7 90 c4 f5 41 39 56 62 d0 |.B.........A9Vb.|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e f2 5e b6 bd bc c3 c2 58 fe 90 e9 |......^.....X...|
-00000010 07 07 a2 ab 66 41 f7 c4 1f 48 48 01 c9 38 d2 c7 |....fA...HH..8..|
-00000020 c0 ab b5 17 03 03 00 13 db 6e 0e f9 4a 94 12 a3 |.........n..J...|
-00000030 2a 86 3f d1 a7 ac c3 58 20 0d 09 |*.?....X ..|
+00000000 17 03 03 00 1e ee b9 1c 7b 56 61 76 91 40 90 11 |........{Vav.@..|
+00000010 61 4a 0c 46 60 e2 c1 a7 dd 0c a1 0d da 65 98 3e |aJ.F`........e.>|
+00000020 30 62 98 17 03 03 00 13 27 7a 29 e5 53 f1 9b 41 |0b......'z).S..A|
+00000030 7a 19 ec cd 29 0e 04 57 90 59 7e |z...)..W.Y~|
diff --git a/src/crypto/tls/testdata/Server-TLSv13-X25519 b/src/crypto/tls/testdata/Server-TLSv13-X25519
index 244651268a..0160c5aea7 100644
--- a/src/crypto/tls/testdata/Server-TLSv13-X25519
+++ b/src/crypto/tls/testdata/Server-TLSv13-X25519
@@ -1,102 +1,98 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 d8 01 00 00 d4 03 03 3d 42 5b bc 55 |...........=B[.U|
-00000010 6c e3 e9 9a db 07 85 ca 18 fb f3 e0 56 18 b5 39 |l...........V..9|
-00000020 9d 43 91 41 38 a0 ea c1 eb db ec 20 ca b8 c3 6e |.C.A8...... ...n|
-00000030 c8 78 18 88 ab cf c3 cb 7e ff 7d e5 7e d5 55 94 |.x......~.}.~.U.|
-00000040 f8 b2 01 ad 8c 95 82 f0 8e d8 61 8e 00 08 13 02 |..........a.....|
-00000050 13 03 13 01 00 ff 01 00 00 83 00 00 00 0e 00 0c |................|
-00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....|
-00000070 03 00 01 02 00 0a 00 04 00 02 00 1d 00 16 00 00 |................|
-00000080 00 17 00 00 00 0d 00 1e 00 1c 04 03 05 03 06 03 |................|
-00000090 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 08 06 |................|
-000000a0 04 01 05 01 06 01 00 2b 00 03 02 03 04 00 2d 00 |.......+......-.|
-000000b0 02 01 01 00 33 00 26 00 24 00 1d 00 20 e8 82 c0 |....3.&.$... ...|
-000000c0 e9 dc b5 e1 3f 74 c9 42 e9 98 d1 1b fb 68 52 5d |....?t.B.....hR]|
-000000d0 3e c1 65 56 6c 12 2b 3b ad 02 7c 80 42 |>.eVl.+;..|.B|
+00000000 16 03 01 00 c2 01 00 00 be 03 03 cb 53 78 a8 58 |............Sx.X|
+00000010 de 5b 75 c2 c5 b3 ac fa c3 6e 85 a7 e5 a3 a4 ca |.[u......n......|
+00000020 1f 82 95 38 fa 79 4c e2 c8 66 8a 20 be 7a 94 d6 |...8.yL..f. .z..|
+00000030 f4 82 e2 2f 3b 2c e4 5f ae c2 8b be d1 2f b6 67 |.../;,._...../.g|
+00000040 9e 78 7a 51 86 1f c1 d9 8f 43 2f 78 00 04 13 03 |.xzQ.....C/x....|
+00000050 00 ff 01 00 00 71 00 0b 00 04 03 00 01 02 00 0a |.....q..........|
+00000060 00 04 00 02 00 1d 00 16 00 00 00 17 00 00 00 0d |................|
+00000070 00 1e 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 |................|
+00000080 08 0a 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 |................|
+00000090 00 2b 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 |.+......-.....3.|
+000000a0 26 00 24 00 1d 00 20 7f 3e a2 2e 2f 88 8a e1 f3 |&.$... .>../....|
+000000b0 6a a4 47 d7 6d b7 3c 02 c4 bb f6 de 41 38 50 74 |j.G.m.<.....A8Pt|
+000000c0 29 21 f5 fe 9f 0b 6f |)!....o|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000020 00 00 00 00 00 00 00 00 00 00 00 20 ca b8 c3 6e |........... ...n|
-00000030 c8 78 18 88 ab cf c3 cb 7e ff 7d e5 7e d5 55 94 |.x......~.}.~.U.|
-00000040 f8 b2 01 ad 8c 95 82 f0 8e d8 61 8e 13 02 00 00 |..........a.....|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 be 7a 94 d6 |........... .z..|
+00000030 f4 82 e2 2f 3b 2c e4 5f ae c2 8b be d1 2f b6 67 |.../;,._...../.g|
+00000040 9e 78 7a 51 86 1f c1 d9 8f 43 2f 78 13 03 00 00 |.xzQ.....C/x....|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
-00000080 03 03 00 01 01 17 03 03 00 17 09 03 3f 82 c1 8c |............?...|
-00000090 42 42 8d be 40 51 f5 ba 5d b8 60 d9 87 0f d5 ca |BB..@Q..].`.....|
-000000a0 3d 17 03 03 02 6d 95 e6 a7 87 7a 4a fb 68 16 3b |=....m....zJ.h.;|
-000000b0 38 cb b0 7c 97 39 1e 00 46 7b 2c 32 00 02 6c 34 |8..|.9..F{,2..l4|
-000000c0 de df 5a 3d 11 1b bc 28 d4 c1 05 fc 0c ca 28 e3 |..Z=...(......(.|
-000000d0 90 c7 ad 88 43 45 12 fd 43 f5 be 7d 46 f8 d2 ec |....CE..C..}F...|
-000000e0 00 8e 06 6f 09 0d ce 84 15 5a e7 59 1c f7 10 d4 |...o.....Z.Y....|
-000000f0 2d 37 f2 71 a7 11 7e cb 3b 75 ec 8f d1 7a 8c d0 |-7.q..~.;u...z..|
-00000100 f0 b1 18 aa 2f 3b e8 18 ff ae 0f 63 6b 41 3e 4a |..../;.....ckA>J|
-00000110 04 56 72 1b e0 60 74 a2 ef 1d 81 61 eb 94 56 25 |.Vr..`t....a..V%|
-00000120 e6 46 03 9a 2f 57 85 ca 3a f4 17 81 e3 cf 6c 2e |.F../W..:.....l.|
-00000130 63 66 48 0f 5f f7 7b 5a 55 25 4b cc 24 c9 71 dd |cfH._.{ZU%K.$.q.|
-00000140 42 32 d8 77 6f c5 69 bb 6b c5 c9 51 cb 37 97 ae |B2.wo.i.k..Q.7..|
-00000150 c3 a3 87 5c 50 e1 f3 19 84 d6 9a 7c 56 0d 63 cc |...\P......|V.c.|
-00000160 57 66 17 c8 a6 e2 f0 31 bb 20 3b 7e 9e 4e 30 fe |Wf.....1. ;~.N0.|
-00000170 1e 22 07 71 29 76 c0 a2 7e da 3c 1d 04 31 f8 54 |.".q)v..~.<..1.T|
-00000180 95 3a 84 71 d8 6b ed 43 e9 ad e9 45 c9 72 ad 0e |.:.q.k.C...E.r..|
-00000190 8d 02 21 a6 89 6f 4b 83 5f fd 7f ff 3e cb d0 f7 |..!..oK._...>...|
-000001a0 d3 94 54 7a 82 47 d3 8f 21 2f 1b f8 bf 95 e9 34 |..Tz.G..!/.....4|
-000001b0 cd 06 d6 77 04 c8 57 49 df 0a c0 84 c7 ec 86 ed |...w..WI........|
-000001c0 75 ca 33 56 b4 e8 d3 7c 45 e7 b4 c8 92 9a 73 c8 |u.3V...|E.....s.|
-000001d0 eb 30 df 76 d2 61 70 9a 31 c5 a1 d8 4f 3a 1f dc |.0.v.ap.1...O:..|
-000001e0 df 3d 85 9f b8 48 ed 78 aa 9e c1 ba 07 84 30 ec |.=...H.x......0.|
-000001f0 e5 83 1c 63 47 53 2c 06 85 40 a9 78 ea 4e a0 e3 |...cGS,..@.x.N..|
-00000200 2f 7d 67 39 38 c2 80 66 ff 62 8e 68 1f 67 17 b8 |/}g98..f.b.h.g..|
-00000210 6b af 3c cc 81 46 5a 83 bf 1e ed 65 0e 81 05 fa |k.<..FZ....e....|
-00000220 ac 06 df 63 4e af 9e 02 7f 16 2b 5f b4 0a 5e d9 |...cN.....+_..^.|
-00000230 e5 d1 39 4a 42 d5 34 43 9b 32 ba d8 b7 ad c8 b0 |..9JB.4C.2......|
-00000240 38 81 6f 93 8e 5e ee b7 86 75 d8 f4 bb 15 33 5e |8.o..^...u....3^|
-00000250 a8 39 e4 ee 7f ef 15 7b ec e1 d7 95 31 e1 83 db |.9.....{....1...|
-00000260 00 34 2e 22 02 59 33 2a a6 b5 73 f7 04 4d f5 40 |.4.".Y3*..s..M.@|
-00000270 b7 97 97 33 a0 e2 c3 cf 4b 0a bd 27 84 a1 bb 0b |...3....K..'....|
-00000280 2c 59 bd 3e 2c 82 48 b6 a5 b8 a9 20 00 37 8a 8e |,Y.>,.H.... .7..|
-00000290 f8 f2 4e e2 16 5c fb bf 92 94 37 6a 82 b8 b1 35 |..N..\....7j...5|
-000002a0 4f 77 9e dd 78 1a 07 85 42 3d de fc dc 7f 8c f4 |Ow..x...B=......|
-000002b0 fa 30 de 15 a4 dd c2 08 d5 3d 08 f4 a8 0f f0 df |.0.......=......|
-000002c0 6c 18 40 65 49 ce ce 78 99 5c bc 96 f2 02 2a 1b |l.@eI..x.\....*.|
-000002d0 5f e7 3d 50 ea 9c b4 39 84 33 05 df 3d 1c 3c f7 |_.=P...9.3..=.<.|
-000002e0 3e 55 b6 08 1b 51 b2 87 2b bb 0e 78 1d 7c 19 16 |>U...Q..+..x.|..|
-000002f0 1f 8c ab 6c 56 2b 08 8b 57 2e f9 90 d9 50 a1 30 |...lV+..W....P.0|
-00000300 14 05 54 26 3b 03 0c 46 ec b3 bd c7 eb ce b7 d7 |..T&;..F........|
-00000310 31 64 40 17 03 03 00 99 d5 7d 3d d2 c0 c4 23 6b |1d@......}=...#k|
-00000320 2c 1b 87 70 62 8c c5 63 6b 34 5b 69 e6 2d 61 7a |,..pb..ck4[i.-az|
-00000330 7f 8d 36 96 68 30 71 4b 5c 60 3a dc 28 58 80 ef |..6.h0qK\`:.(X..|
-00000340 09 60 e0 fd 64 d4 fb e5 d3 2f 0a 03 52 78 e4 0b |.`..d..../..Rx..|
-00000350 c8 03 d2 0d 13 36 19 46 50 41 ee 07 44 f8 cc 0b |.....6.FPA..D...|
-00000360 53 f9 42 0d 75 88 6f d0 52 02 67 22 bf df 4b a3 |S.B.u.o.R.g"..K.|
-00000370 0a 43 10 54 27 53 49 5d b3 41 37 df 5b 22 7b b4 |.C.T'SI].A7.["{.|
-00000380 52 21 c7 55 bd 99 a9 0a 0e 46 07 99 b0 38 dc 53 |R!.U.....F...8.S|
-00000390 0e f2 76 82 d9 15 35 62 bb 6d 87 10 a9 91 74 ad |..v...5b.m....t.|
-000003a0 b6 8e 4f 22 b8 72 05 5e de 06 e4 de 70 b3 7b 72 |..O".r.^....p.{r|
-000003b0 3e 17 03 03 00 45 ae 7c de bb a6 79 ca fd 6c fa |>....E.|...y..l.|
-000003c0 26 8b b2 6a eb 40 c0 b0 a7 98 e8 7a 0c e9 ea b3 |&..j.@.....z....|
-000003d0 30 5f b7 fd 52 85 c8 56 93 dc 3a b0 e8 bd 5a d1 |0_..R..V..:...Z.|
-000003e0 2d 94 87 27 c9 4c 57 66 35 bb e7 a5 d2 bf fd 27 |-..'.LWf5......'|
-000003f0 f7 bd e1 8c a7 50 35 64 cc d5 26 17 03 03 00 a3 |.....P5d..&.....|
-00000400 0d a3 74 9e 7e 5c bf d9 cb 27 e0 d2 c6 25 bd 29 |..t.~\...'...%.)|
-00000410 49 23 76 24 91 a8 d0 58 28 60 1d 68 75 ec f8 05 |I#v$...X(`.hu...|
-00000420 18 dd 0d b3 a8 27 98 82 78 81 e1 ee 03 69 8f 26 |.....'..x....i.&|
-00000430 00 94 59 63 ef 9b c9 24 0f c8 99 97 64 4c a3 41 |..Yc...$....dL.A|
-00000440 71 71 88 55 cd a2 61 e9 47 ed 9b e0 5b a8 f9 dc |qq.U..a.G...[...|
-00000450 e6 25 8a 1d e8 18 12 1a 3c b7 d6 86 cc 4b 9f 70 |.%......<....K.p|
-00000460 93 53 cf 8e d2 98 99 74 2a 37 96 07 a9 d5 bd 8e |.S.....t*7......|
-00000470 eb 09 01 a4 4d 46 c8 7b ab 2c 2d 25 7c fc 89 e6 |....MF.{.,-%|...|
-00000480 ac 23 92 98 de 38 1b e4 70 b3 ee 95 9b 83 03 ce |.#...8..p.......|
-00000490 bb 17 df 13 1d 5a 9f be 55 3f dc 28 4b 43 4e fd |.....Z..U?.(KCN.|
-000004a0 74 00 19 |t..|
+00000080 03 03 00 01 01 17 03 03 00 17 fb 0e 8b 72 0d 35 |.............r.5|
+00000090 97 db e2 2e b8 20 be 96 27 6b cd ab 6b 24 5b c4 |..... ..'k..k$[.|
+000000a0 e9 17 03 03 02 6d 3a 21 03 ea 45 e9 4e f1 19 1e |.....m:!..E.N...|
+000000b0 33 37 04 5b 3e db 54 f0 27 6f c7 96 78 50 01 46 |37.[>.T.'o..xP.F|
+000000c0 d1 8b 8f 79 70 21 9d 62 97 b9 bf 6d 14 e5 82 f4 |...yp!.b...m....|
+000000d0 ad 89 90 77 12 1f 61 8e 1d 94 d3 27 0f 0e eb 77 |...w..a....'...w|
+000000e0 8d b2 2f fb 58 b4 ee 88 19 91 47 d1 3d 10 9e 4a |../.X.....G.=..J|
+000000f0 1e 41 b9 c6 41 8f 59 11 7f e0 ac e7 b9 d5 be 40 |.A..A.Y........@|
+00000100 cc aa bc ab 56 5a 2b a9 c9 cf df c0 dc 8f d2 9d |....VZ+.........|
+00000110 59 a7 88 36 98 2e 87 c6 1d af 26 a1 e8 08 2d bd |Y..6......&...-.|
+00000120 9b 5b 1c 4e 22 d2 a1 7c 4d 0b 0f af da 5d fe f7 |.[.N"..|M....]..|
+00000130 83 4d f6 54 c1 fe 03 73 6d c9 17 02 6b 78 09 91 |.M.T...sm...kx..|
+00000140 aa 61 9a 93 04 66 fa 6b e8 2e d7 18 d2 4d 6e 25 |.a...f.k.....Mn%|
+00000150 c3 01 2f a5 0e 1b da a1 64 67 e5 a5 c0 5b ef ec |../.....dg...[..|
+00000160 83 5a d3 0e 44 b7 d5 97 9c c7 c4 94 b4 4b 01 e6 |.Z..D........K..|
+00000170 48 28 21 cb 04 10 be b0 3b 53 df 15 47 12 67 ea |H(!.....;S..G.g.|
+00000180 24 65 a1 ce 0b af 05 5b c9 95 bf 28 2e 55 3c 21 |$e.....[...(.UT.,..?.......|
+000002b0 71 6a d6 0f 53 5e ea 92 53 e3 dd 96 be 38 61 74 |qj..S^..S....8at|
+000002c0 5d 74 ac c4 8c 72 c6 82 dc f4 22 fb 5c 64 0f 33 |]t...r....".\d.3|
+000002d0 b3 31 a1 a9 e0 6d 96 14 0b e1 00 7d 42 44 45 02 |.1...m.....}BDE.|
+000002e0 42 63 a1 15 14 73 b6 e4 18 a7 30 9e e0 df a9 ba |Bc...s....0.....|
+000002f0 44 72 64 ea 06 a4 a1 46 58 07 b1 a8 48 dc ea 73 |Drd....FX...H..s|
+00000300 35 d8 98 de 6c 13 93 bb 7a 64 fb df bf 93 cb 65 |5...l...zd.....e|
+00000310 a4 1a 3a 17 03 03 00 99 41 8d 8b b5 97 ae 6a fb |..:.....A.....j.|
+00000320 28 ae 10 17 a7 a7 bd a2 a2 54 61 33 ea 5c 3d 82 |(........Ta3.\=.|
+00000330 6c 7d fe 3e 3b 6f 92 6b 6a 0a ee fe 85 90 67 59 |l}.>;o.kj.....gY|
+00000340 df d9 fc c0 4a 9a 5b ae 57 29 5d fb ff 74 28 f1 |....J.[.W)]..t(.|
+00000350 27 f4 ab ee f9 e8 04 cf 2b 62 4d a8 6a 4f ac 85 |'.......+bM.jO..|
+00000360 ec a5 18 d7 88 74 9e 3e ea 79 8e 5d df f8 8a 1c |.....t.>.y.]....|
+00000370 10 1b 1d d3 4a cf 2a 56 f2 ca 90 1f 37 2c cc b7 |....J.*V....7,..|
+00000380 31 91 fb d7 7f bb 07 e2 ec 84 8a 6f 08 a1 7e 2e |1..........o..~.|
+00000390 62 8a 5c b9 76 d3 68 e5 d0 b8 73 92 86 80 e5 af |b.\.v.h...s.....|
+000003a0 b4 ef 13 ea 3c 09 2a 3f 7e be 16 72 1c 46 a0 29 |....<.*?~..r.F.)|
+000003b0 0a 17 03 03 00 35 a7 10 63 c4 a1 7f 26 17 ba b7 |.....5..c...&...|
+000003c0 e3 86 6e 52 36 00 8e 68 84 dc 51 8d a6 0c 21 ba |..nR6..h..Q...!.|
+000003d0 c3 d9 84 49 ed 57 78 98 68 be 78 a6 d1 f0 67 ac |...I.Wx.h.x...g.|
+000003e0 65 9e d2 d8 f3 b9 58 27 24 57 83 17 03 03 00 93 |e.....X'$W......|
+000003f0 00 54 de 7f 11 18 1d 12 83 10 77 b2 e9 fd a7 a4 |.T........w.....|
+00000400 46 c4 1c 15 0d 24 e0 94 f8 ff 84 19 45 ad 52 c8 |F....$......E.R.|
+00000410 85 0b c5 4a a7 6d a1 b0 12 cb 13 58 f6 44 a3 e2 |...J.m.....X.D..|
+00000420 b8 7a b5 8c 8f 8a 47 76 ef cb 2d 7b 6e 75 81 39 |.z....Gv..-{nu.9|
+00000430 3e 12 e8 b5 c6 2d cb e0 fd ac af 58 5a 01 70 32 |>....-.....XZ.p2|
+00000440 0e 12 32 95 10 70 94 28 ec 9b 50 e5 78 c4 b7 75 |..2..p.(..P.x..u|
+00000450 97 4a 54 97 bb 30 e6 19 8a 86 87 d7 50 02 8f a8 |.JT..0......P...|
+00000460 1b 97 d6 e7 bf 25 66 9a 5a cd 5c 84 33 42 f1 72 |.....%f.Z.\.3B.r|
+00000470 d2 44 f1 64 e1 3d 38 b7 7a 32 e3 e8 9a 49 19 90 |.D.d.=8.z2...I..|
+00000480 00 2b f6 |.+.|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 17 03 03 00 45 b0 11 eb 24 17 |..........E...$.|
-00000010 1c a4 d5 68 80 b2 21 4b 6d 12 fd 67 c9 8a a8 87 |...h..!Km..g....|
-00000020 27 e9 39 fd 9f 5f e4 ce 82 4f 9f 8d 2f d3 b9 04 |'.9.._...O../...|
-00000030 d0 a8 00 33 5c 58 3f 75 be d5 8b ff 9a e4 30 cb |...3\X?u......0.|
-00000040 4b e2 4d d3 0a e8 3f bb 89 98 1e 87 25 0f 4e 67 |K.M...?.....%.Ng|
+00000000 14 03 03 00 01 01 17 03 03 00 35 9d c7 a1 4d 5f |..........5...M_|
+00000010 7f 3a 04 b0 cf de 09 d5 84 c1 8f 9b 85 a6 a0 53 |.:.............S|
+00000020 c3 aa 19 5e a0 b2 a2 f1 22 f2 51 e0 25 c5 49 57 |...^....".Q.%.IW|
+00000030 52 de ad 75 ec e4 e3 36 84 78 22 c8 6c 80 88 8c |R..u...6.x".l...|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 1e 1e 07 ae 09 4a 05 7b ee f6 ce a5 |.........J.{....|
-00000010 18 11 76 89 e8 67 ed 22 41 d2 a3 b6 cc bc c8 e9 |..v..g."A.......|
-00000020 73 02 7c 17 03 03 00 13 c2 87 1e 19 ea 01 63 5a |s.|...........cZ|
-00000030 aa 72 b2 95 f0 05 08 71 95 0c 75 |.r.....q..u|
+00000000 17 03 03 00 1e 3f 0d f6 84 47 21 4e 37 7b df eb |.....?...G!N7{..|
+00000010 eb 38 af a5 ec b9 b6 20 24 f5 1a 1e 25 77 92 82 |.8..... $...%w..|
+00000020 97 88 9f 17 03 03 00 13 e2 80 d8 e1 2a bf d5 e3 |............*...|
+00000030 bc b7 82 2f 50 2c e5 b9 4b 8c d6 |.../P,..K..|
--
cgit v1.3
From 4f1b0a44cb46f3df28f5ef82e5769ebeac1bc493 Mon Sep 17 00:00:00 2001
From: Russ Cox
Date: Thu, 29 Oct 2020 14:17:47 -0400
Subject: all: update to use os.ReadFile, os.WriteFile, os.CreateTemp,
os.MkdirTemp
As part of #42026, these helpers from io/ioutil were moved to os.
(ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.)
Update the Go tree to use the preferred names.
As usual, code compiled with the Go 1.4 bootstrap toolchain
and code vendored from other sources is excluded.
ReadDir changes are in a separate CL, because they are not a
simple search and replace.
For #42026.
Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/266365
Trust: Russ Cox
Run-TryBot: Russ Cox
TryBot-Result: Go Bot
Reviewed-by: Ian Lance Taylor
---
src/archive/tar/reader_test.go | 3 +-
src/archive/tar/tar_test.go | 3 +-
src/archive/tar/writer_test.go | 3 +-
src/archive/zip/reader_test.go | 11 +++---
src/archive/zip/writer_test.go | 4 +--
src/cmd/addr2line/addr2line_test.go | 7 ++--
src/cmd/api/goapi.go | 3 +-
src/cmd/api/goapi_test.go | 3 +-
src/cmd/cover/cover.go | 3 +-
src/cmd/cover/cover_test.go | 31 ++++++++--------
src/cmd/cover/html.go | 5 ++-
src/cmd/fix/main.go | 3 +-
src/cmd/fix/typecheck.go | 7 ++--
src/cmd/go/go_test.go | 19 +++++-----
src/cmd/go/go_windows_test.go | 5 ++-
src/cmd/go/help_test.go | 4 +--
src/cmd/go/internal/auth/netrc.go | 3 +-
src/cmd/go/internal/bug/bug.go | 5 ++-
src/cmd/go/internal/cache/cache.go | 5 ++-
src/cmd/go/internal/cache/cache_test.go | 13 ++++---
src/cmd/go/internal/cache/default.go | 3 +-
src/cmd/go/internal/cache/hash_test.go | 3 +-
src/cmd/go/internal/cfg/cfg.go | 3 +-
src/cmd/go/internal/envcmd/env.go | 7 ++--
src/cmd/go/internal/fsys/fsys.go | 2 +-
src/cmd/go/internal/fsys/fsys_test.go | 3 +-
src/cmd/go/internal/generate/generate.go | 3 +-
src/cmd/go/internal/imports/scan_test.go | 5 +--
src/cmd/go/internal/load/pkg.go | 4 +--
.../lockedfile/internal/filelock/filelock_test.go | 5 ++-
src/cmd/go/internal/lockedfile/lockedfile_test.go | 9 +++--
src/cmd/go/internal/modcmd/vendor.go | 2 +-
src/cmd/go/internal/modcmd/verify.go | 3 +-
src/cmd/go/internal/modconv/convert_test.go | 5 ++-
src/cmd/go/internal/modconv/modconv_test.go | 6 ++--
src/cmd/go/internal/modfetch/cache_test.go | 3 +-
src/cmd/go/internal/modfetch/codehost/codehost.go | 5 ++-
src/cmd/go/internal/modfetch/codehost/git_test.go | 3 +-
src/cmd/go/internal/modfetch/codehost/shell.go | 3 +-
src/cmd/go/internal/modfetch/codehost/vcs.go | 3 +-
src/cmd/go/internal/modfetch/coderepo.go | 3 +-
src/cmd/go/internal/modfetch/coderepo_test.go | 13 ++++---
src/cmd/go/internal/modfetch/fetch.go | 5 ++-
.../internal/modfetch/zip_sum_test/zip_sum_test.go | 3 +-
src/cmd/go/internal/modload/init.go | 8 ++---
src/cmd/go/internal/modload/query_test.go | 3 +-
src/cmd/go/internal/modload/vendor.go | 4 +--
src/cmd/go/internal/renameio/renameio.go | 4 +--
src/cmd/go/internal/renameio/renameio_test.go | 3 +-
src/cmd/go/internal/renameio/umask_test.go | 3 +-
src/cmd/go/internal/robustio/robustio.go | 2 +-
src/cmd/go/internal/robustio/robustio_flaky.go | 5 ++-
src/cmd/go/internal/robustio/robustio_other.go | 3 +-
src/cmd/go/internal/test/test.go | 4 +--
src/cmd/go/internal/txtar/archive.go | 4 +--
src/cmd/go/internal/vcs/vcs_test.go | 3 +-
src/cmd/go/internal/web/file_test.go | 3 +-
src/cmd/go/internal/work/action.go | 3 +-
src/cmd/go/internal/work/build_test.go | 9 +++--
src/cmd/go/internal/work/buildid.go | 3 +-
src/cmd/go/internal/work/exec.go | 17 +++++----
src/cmd/go/internal/work/gc.go | 7 ++--
src/cmd/go/internal/work/gccgo.go | 3 +-
src/cmd/go/script_test.go | 23 ++++++------
src/cmd/go/testdata/addmod.go | 13 ++++---
src/cmd/go/testdata/savedir.go | 3 +-
src/cmd/go/testdata/script/build_issue6480.txt | 5 ++-
src/cmd/go/testdata/script/build_trimpath.txt | 3 +-
src/cmd/go/testdata/script/cover_error.txt | 5 ++-
src/cmd/go/testdata/script/gopath_moved_repo.txt | 5 ++-
.../script/mod_download_concurrent_read.txt | 3 +-
src/cmd/go/testdata/script/mod_modinfo.txt | 3 +-
src/cmd/go/testdata/script/mod_test_cached.txt | 7 ++--
.../go/testdata/script/test_compile_tempfile.txt | 2 +-
src/cmd/go/testdata/script/test_generated_main.txt | 3 +-
.../go/testdata/script/test_race_install_cgo.txt | 8 ++---
src/cmd/gofmt/gofmt.go | 5 ++-
src/cmd/gofmt/gofmt_test.go | 13 ++++---
src/cmd/nm/nm_test.go | 9 +++--
src/cmd/objdump/objdump_test.go | 5 ++-
src/cmd/pack/pack_test.go | 13 ++++---
src/cmd/trace/annotations_test.go | 4 +--
src/cmd/trace/pprof.go | 3 +-
src/cmd/vet/vet_test.go | 5 ++-
src/compress/bzip2/bzip2_test.go | 4 +--
src/compress/flate/deflate_test.go | 6 ++--
src/compress/flate/huffman_bit_writer_test.go | 29 ++++++++-------
src/compress/flate/reader_test.go | 4 +--
src/compress/lzw/reader_test.go | 4 +--
src/compress/lzw/writer_test.go | 3 +-
src/compress/zlib/writer_test.go | 3 +-
src/crypto/md5/gen.go | 4 +--
src/crypto/tls/handshake_test.go | 3 +-
src/crypto/tls/link_test.go | 3 +-
src/crypto/tls/tls.go | 6 ++--
src/crypto/x509/name_constraints_test.go | 3 +-
src/crypto/x509/root_ios_gen.go | 4 +--
src/crypto/x509/root_plan9.go | 3 +-
src/crypto/x509/root_unix.go | 4 +--
src/crypto/x509/root_unix_test.go | 5 ++-
src/debug/dwarf/dwarf5ranges_test.go | 4 +--
src/debug/gosym/pclntab_test.go | 5 ++-
src/debug/pe/file_test.go | 13 ++++---
src/embed/internal/embedtest/embedx_test.go | 4 +--
src/go/build/build_test.go | 11 +++---
src/go/doc/doc_test.go | 6 ++--
src/go/format/benchmark_test.go | 4 +--
src/go/format/format_test.go | 6 ++--
src/go/importer/importer_test.go | 3 +-
src/go/internal/gccgoimporter/importer_test.go | 5 ++-
src/go/internal/gcimporter/gcimporter_test.go | 6 ++--
src/go/internal/srcimporter/srcimporter.go | 3 +-
src/go/parser/interface.go | 3 +-
src/go/parser/performance_test.go | 4 +--
src/go/printer/performance_test.go | 4 +--
src/go/printer/printer_test.go | 12 +++----
src/go/scanner/scanner_test.go | 3 +-
src/go/types/check_test.go | 3 +-
src/go/types/hilbert_test.go | 4 +--
src/hash/crc32/gen_const_ppc64le.go | 4 +--
src/html/template/examplefiles_test.go | 3 +-
src/html/template/template.go | 4 +--
src/image/color/palette/gen.go | 4 +--
src/image/gif/reader_test.go | 4 +--
src/image/internal/imageutil/gen.go | 3 +-
src/image/jpeg/reader_test.go | 7 ++--
src/image/png/reader_test.go | 3 +-
src/index/suffixarray/gen.go | 6 ++--
src/index/suffixarray/suffixarray_test.go | 6 ++--
src/internal/cpu/cpu_s390x_test.go | 4 +--
src/internal/obscuretestdata/obscuretestdata.go | 3 +-
src/internal/poll/read_test.go | 3 +-
src/internal/testenv/testenv_windows.go | 3 +-
src/internal/trace/gc_test.go | 6 ++--
src/internal/trace/parser_test.go | 2 +-
src/log/syslog/syslog_test.go | 5 ++-
src/math/big/link_test.go | 4 +--
src/math/bits/make_examples.go | 4 +--
src/math/bits/make_tables.go | 4 +--
src/mime/multipart/formdata.go | 3 +-
src/net/dnsclient_unix_test.go | 3 +-
src/net/error_test.go | 3 +-
src/net/http/filetransport_test.go | 5 ++-
src/net/http/fs_test.go | 8 ++---
src/net/http/request_test.go | 3 +-
src/net/http/transfer_test.go | 3 +-
src/net/http/transport_test.go | 3 +-
src/net/mockserver_test.go | 5 ++-
src/net/net_windows_test.go | 7 ++--
src/net/unixsock_test.go | 3 +-
src/os/error_test.go | 9 +++--
src/os/exec/exec_test.go | 2 +-
src/os/exec/lp_unix_test.go | 3 +-
src/os/exec/lp_windows_test.go | 7 ++--
src/os/fifo_test.go | 3 +-
src/os/os_test.go | 42 +++++++++++-----------
src/os/os_unix_test.go | 4 +--
src/os/os_windows_test.go | 29 ++++++++-------
src/os/path_test.go | 4 +--
src/os/path_windows_test.go | 3 +-
src/os/pipe_test.go | 3 +-
src/os/readfrom_linux_test.go | 4 +--
src/os/removeall_test.go | 20 +++++------
src/os/signal/signal_test.go | 3 +-
src/os/signal/signal_windows_test.go | 3 +-
src/os/stat_test.go | 9 +++--
src/os/timeout_test.go | 3 +-
src/os/user/lookup_plan9.go | 3 +-
src/path/filepath/example_unix_walk_test.go | 3 +-
src/path/filepath/match_test.go | 7 ++--
src/path/filepath/path_test.go | 33 +++++++++--------
src/path/filepath/path_windows_test.go | 19 +++++-----
src/runtime/crash_test.go | 3 +-
src/runtime/crash_unix_test.go | 5 ++-
src/runtime/debug/heapdump_test.go | 5 ++-
src/runtime/debug_test.go | 4 +--
src/runtime/env_plan9.go | 4 +--
src/runtime/internal/sys/gengoos.go | 8 ++---
src/runtime/memmove_linux_amd64_test.go | 3 +-
src/runtime/mkduff.go | 4 +--
src/runtime/mkfastlog2table.go | 4 +--
src/runtime/mksizeclasses.go | 3 +-
src/runtime/pprof/pprof_test.go | 5 ++-
src/runtime/pprof/proto.go | 4 +--
src/runtime/pprof/proto_test.go | 3 +-
src/runtime/race/output_test.go | 5 ++-
src/runtime/race/testdata/io_test.go | 3 +-
src/runtime/runtime-gdb_test.go | 25 +++++++------
src/runtime/runtime-lldb_test.go | 9 +++--
src/runtime/signal_windows_test.go | 5 ++-
src/runtime/syscall_windows_test.go | 25 +++++++------
src/runtime/testdata/testprog/memprof.go | 3 +-
src/runtime/testdata/testprog/syscalls_linux.go | 3 +-
src/runtime/testdata/testprog/timeprof.go | 3 +-
src/runtime/testdata/testprog/vdso.go | 3 +-
src/runtime/testdata/testprogcgo/pprof.go | 3 +-
src/runtime/testdata/testprogcgo/threadpprof.go | 3 +-
src/runtime/trace/trace_test.go | 3 +-
src/runtime/wincallback.go | 7 ++--
src/sort/genzfunc.go | 4 +--
src/strconv/makeisprint.go | 4 +--
src/syscall/dirent_test.go | 9 +++--
src/syscall/exec_linux_test.go | 15 ++++----
src/syscall/getdirentries_test.go | 5 ++-
src/syscall/mkasm_darwin.go | 9 +++--
src/syscall/syscall_linux_test.go | 11 +++---
src/syscall/syscall_unix_test.go | 7 ++--
src/syscall/syscall_windows_test.go | 3 +-
src/testing/testing.go | 5 ++-
src/text/template/examplefiles_test.go | 3 +-
src/text/template/helper.go | 4 +--
src/text/template/link_test.go | 7 ++--
src/time/genzabbrs.go | 4 +--
src/time/tzdata/generate_zipdata.go | 3 +-
src/time/zoneinfo_read.go | 2 +-
215 files changed, 556 insertions(+), 704 deletions(-)
(limited to 'src/crypto/tls')
diff --git a/src/archive/tar/reader_test.go b/src/archive/tar/reader_test.go
index 411d1e0b99..789ddc1bc0 100644
--- a/src/archive/tar/reader_test.go
+++ b/src/archive/tar/reader_test.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
"math"
"os"
"path"
@@ -773,7 +772,7 @@ func TestReadTruncation(t *testing.T) {
"testdata/pax-path-hdr.tar",
"testdata/sparse-formats.tar",
} {
- buf, err := ioutil.ReadFile(p)
+ buf, err := os.ReadFile(p)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
diff --git a/src/archive/tar/tar_test.go b/src/archive/tar/tar_test.go
index d4a3d42312..91b38401b6 100644
--- a/src/archive/tar/tar_test.go
+++ b/src/archive/tar/tar_test.go
@@ -11,7 +11,6 @@ import (
"internal/testenv"
"io"
"io/fs"
- "io/ioutil"
"math"
"os"
"path"
@@ -263,7 +262,7 @@ func TestFileInfoHeaderDir(t *testing.T) {
func TestFileInfoHeaderSymlink(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpdir, err := ioutil.TempDir("", "TestFileInfoHeaderSymlink")
+ tmpdir, err := os.MkdirTemp("", "TestFileInfoHeaderSymlink")
if err != nil {
t.Fatal(err)
}
diff --git a/src/archive/tar/writer_test.go b/src/archive/tar/writer_test.go
index 30556d27d0..a00f02d8fa 100644
--- a/src/archive/tar/writer_test.go
+++ b/src/archive/tar/writer_test.go
@@ -9,7 +9,6 @@ import (
"encoding/hex"
"errors"
"io"
- "io/ioutil"
"os"
"path"
"reflect"
@@ -520,7 +519,7 @@ func TestWriter(t *testing.T) {
}
if v.file != "" {
- want, err := ioutil.ReadFile(v.file)
+ want, err := os.ReadFile(v.file)
if err != nil {
t.Fatalf("ReadFile() = %v, want nil", err)
}
diff --git a/src/archive/zip/reader_test.go b/src/archive/zip/reader_test.go
index b7a7d7a757..34e96f7da4 100644
--- a/src/archive/zip/reader_test.go
+++ b/src/archive/zip/reader_test.go
@@ -11,7 +11,6 @@ import (
"internal/obscuretestdata"
"io"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"regexp"
@@ -629,7 +628,7 @@ func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File) {
var c []byte
if ft.Content != nil {
c = ft.Content
- } else if c, err = ioutil.ReadFile("testdata/" + ft.File); err != nil {
+ } else if c, err = os.ReadFile("testdata/" + ft.File); err != nil {
t.Error(err)
return
}
@@ -685,7 +684,7 @@ func TestInvalidFiles(t *testing.T) {
}
func messWith(fileName string, corrupter func(b []byte)) (r io.ReaderAt, size int64) {
- data, err := ioutil.ReadFile(filepath.Join("testdata", fileName))
+ data, err := os.ReadFile(filepath.Join("testdata", fileName))
if err != nil {
panic("Error reading " + fileName + ": " + err.Error())
}
@@ -792,17 +791,17 @@ func returnRecursiveZip() (r io.ReaderAt, size int64) {
//
// func main() {
// bigZip := makeZip("big.file", io.LimitReader(zeros{}, 1<<32-1))
-// if err := ioutil.WriteFile("/tmp/big.zip", bigZip, 0666); err != nil {
+// if err := os.WriteFile("/tmp/big.zip", bigZip, 0666); err != nil {
// log.Fatal(err)
// }
//
// biggerZip := makeZip("big.zip", bytes.NewReader(bigZip))
-// if err := ioutil.WriteFile("/tmp/bigger.zip", biggerZip, 0666); err != nil {
+// if err := os.WriteFile("/tmp/bigger.zip", biggerZip, 0666); err != nil {
// log.Fatal(err)
// }
//
// biggestZip := makeZip("bigger.zip", bytes.NewReader(biggerZip))
-// if err := ioutil.WriteFile("/tmp/biggest.zip", biggestZip, 0666); err != nil {
+// if err := os.WriteFile("/tmp/biggest.zip", biggestZip, 0666); err != nil {
// log.Fatal(err)
// }
// }
diff --git a/src/archive/zip/writer_test.go b/src/archive/zip/writer_test.go
index 2c32eaf4a5..5985144e5c 100644
--- a/src/archive/zip/writer_test.go
+++ b/src/archive/zip/writer_test.go
@@ -10,8 +10,8 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"math/rand"
+ "os"
"strings"
"testing"
"time"
@@ -237,7 +237,7 @@ func TestWriterTime(t *testing.T) {
t.Fatalf("unexpected Close error: %v", err)
}
- want, err := ioutil.ReadFile("testdata/time-go.zip")
+ want, err := os.ReadFile("testdata/time-go.zip")
if err != nil {
t.Fatalf("unexpected ReadFile error: %v", err)
}
diff --git a/src/cmd/addr2line/addr2line_test.go b/src/cmd/addr2line/addr2line_test.go
index 7973aa2fe1..992d7ac11e 100644
--- a/src/cmd/addr2line/addr2line_test.go
+++ b/src/cmd/addr2line/addr2line_test.go
@@ -8,7 +8,6 @@ import (
"bufio"
"bytes"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -98,8 +97,8 @@ func testAddr2Line(t *testing.T, exepath, addr string) {
if !os.SameFile(fi1, fi2) {
t.Fatalf("addr2line_test.go and %s are not same file", srcPath)
}
- if srcLineNo != "107" {
- t.Fatalf("line number = %v; want 107", srcLineNo)
+ if srcLineNo != "106" {
+ t.Fatalf("line number = %v; want 106", srcLineNo)
}
}
@@ -107,7 +106,7 @@ func testAddr2Line(t *testing.T, exepath, addr string) {
func TestAddr2Line(t *testing.T) {
testenv.MustHaveGoBuild(t)
- tmpDir, err := ioutil.TempDir("", "TestAddr2Line")
+ tmpDir, err := os.MkdirTemp("", "TestAddr2Line")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go
index b14d57c236..ba42812fa6 100644
--- a/src/cmd/api/goapi.go
+++ b/src/cmd/api/goapi.go
@@ -17,7 +17,6 @@ import (
"go/token"
"go/types"
"io"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -342,7 +341,7 @@ func fileFeatures(filename string) []string {
if filename == "" {
return nil
}
- bs, err := ioutil.ReadFile(filename)
+ bs, err := os.ReadFile(filename)
if err != nil {
log.Fatalf("Error reading file %s: %v", filename, err)
}
diff --git a/src/cmd/api/goapi_test.go b/src/cmd/api/goapi_test.go
index 24620a94af..16e0058e5e 100644
--- a/src/cmd/api/goapi_test.go
+++ b/src/cmd/api/goapi_test.go
@@ -9,7 +9,6 @@ import (
"flag"
"fmt"
"go/build"
- "io/ioutil"
"os"
"path/filepath"
"sort"
@@ -75,7 +74,7 @@ func TestGolden(t *testing.T) {
f.Close()
}
- bs, err := ioutil.ReadFile(goldenFile)
+ bs, err := os.ReadFile(goldenFile)
if err != nil {
t.Fatalf("opening golden.txt for package %q: %v", fi.Name(), err)
}
diff --git a/src/cmd/cover/cover.go b/src/cmd/cover/cover.go
index 360f9aeb06..7ee000861b 100644
--- a/src/cmd/cover/cover.go
+++ b/src/cmd/cover/cover.go
@@ -12,7 +12,6 @@ import (
"go/parser"
"go/token"
"io"
- "io/ioutil"
"log"
"os"
"sort"
@@ -304,7 +303,7 @@ func (f *File) Visit(node ast.Node) ast.Visitor {
func annotate(name string) {
fset := token.NewFileSet()
- content, err := ioutil.ReadFile(name)
+ content, err := os.ReadFile(name)
if err != nil {
log.Fatalf("cover: %s: %s", name, err)
}
diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go
index 1c252e6e45..86c95d15c5 100644
--- a/src/cmd/cover/cover_test.go
+++ b/src/cmd/cover/cover_test.go
@@ -13,7 +13,6 @@ import (
"go/parser"
"go/token"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -81,7 +80,7 @@ var debug = flag.Bool("debug", false, "keep rewritten files for debugging")
// We use TestMain to set up a temporary directory and remove it when
// the tests are done.
func TestMain(m *testing.M) {
- dir, err := ioutil.TempDir("", "go-testcover")
+ dir, err := os.MkdirTemp("", "go-testcover")
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
@@ -173,7 +172,7 @@ func TestCover(t *testing.T) {
buildCover(t)
// Read in the test file (testTest) and write it, with LINEs specified, to coverInput.
- file, err := ioutil.ReadFile(testTest)
+ file, err := os.ReadFile(testTest)
if err != nil {
t.Fatal(err)
}
@@ -192,7 +191,7 @@ func TestCover(t *testing.T) {
[]byte("}"))
lines = append(lines, []byte("func unFormatted2(b bool) {if b{}else{}}"))
- if err := ioutil.WriteFile(coverInput, bytes.Join(lines, []byte("\n")), 0666); err != nil {
+ if err := os.WriteFile(coverInput, bytes.Join(lines, []byte("\n")), 0666); err != nil {
t.Fatal(err)
}
@@ -208,11 +207,11 @@ func TestCover(t *testing.T) {
// Copy testmain to testTempDir, so that it is in the same directory
// as coverOutput.
- b, err := ioutil.ReadFile(testMain)
+ b, err := os.ReadFile(testMain)
if err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(tmpTestMain, b, 0444); err != nil {
+ if err := os.WriteFile(tmpTestMain, b, 0444); err != nil {
t.Fatal(err)
}
@@ -220,7 +219,7 @@ func TestCover(t *testing.T) {
cmd = exec.Command(testenv.GoToolPath(t), "run", tmpTestMain, coverOutput)
run(cmd, t)
- file, err = ioutil.ReadFile(coverOutput)
+ file, err = os.ReadFile(coverOutput)
if err != nil {
t.Fatal(err)
}
@@ -251,7 +250,7 @@ func TestDirectives(t *testing.T) {
// Read the source file and find all the directives. We'll keep
// track of whether each one has been seen in the output.
testDirectives := filepath.Join(testdata, "directives.go")
- source, err := ioutil.ReadFile(testDirectives)
+ source, err := os.ReadFile(testDirectives)
if err != nil {
t.Fatal(err)
}
@@ -398,7 +397,7 @@ func TestCoverHTML(t *testing.T) {
// Extract the parts of the HTML with comment markers,
// and compare against a golden file.
- entireHTML, err := ioutil.ReadFile(htmlHTML)
+ entireHTML, err := os.ReadFile(htmlHTML)
if err != nil {
t.Fatal(err)
}
@@ -420,7 +419,7 @@ func TestCoverHTML(t *testing.T) {
if scan.Err() != nil {
t.Error(scan.Err())
}
- golden, err := ioutil.ReadFile(htmlGolden)
+ golden, err := os.ReadFile(htmlGolden)
if err != nil {
t.Fatalf("reading golden file: %v", err)
}
@@ -457,7 +456,7 @@ func TestHtmlUnformatted(t *testing.T) {
t.Fatal(err)
}
- if err := ioutil.WriteFile(filepath.Join(htmlUDir, "go.mod"), []byte("module htmlunformatted\n"), 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(htmlUDir, "go.mod"), []byte("module htmlunformatted\n"), 0666); err != nil {
t.Fatal(err)
}
@@ -474,10 +473,10 @@ lab:
const htmlUTestContents = `package htmlunformatted`
- if err := ioutil.WriteFile(htmlU, []byte(htmlUContents), 0444); err != nil {
+ if err := os.WriteFile(htmlU, []byte(htmlUContents), 0444); err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(htmlUTest, []byte(htmlUTestContents), 0444); err != nil {
+ if err := os.WriteFile(htmlUTest, []byte(htmlUTestContents), 0444); err != nil {
t.Fatal(err)
}
@@ -540,13 +539,13 @@ func TestFuncWithDuplicateLines(t *testing.T) {
t.Fatal(err)
}
- if err := ioutil.WriteFile(filepath.Join(lineDupDir, "go.mod"), []byte("module linedup\n"), 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(lineDupDir, "go.mod"), []byte("module linedup\n"), 0666); err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(lineDupGo, []byte(lineDupContents), 0444); err != nil {
+ if err := os.WriteFile(lineDupGo, []byte(lineDupContents), 0444); err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(lineDupTestGo, []byte(lineDupTestContents), 0444); err != nil {
+ if err := os.WriteFile(lineDupTestGo, []byte(lineDupTestContents), 0444); err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/cover/html.go b/src/cmd/cover/html.go
index f76ea03cf5..b2865c427c 100644
--- a/src/cmd/cover/html.go
+++ b/src/cmd/cover/html.go
@@ -11,7 +11,6 @@ import (
"fmt"
"html/template"
"io"
- "io/ioutil"
"math"
"os"
"path/filepath"
@@ -43,7 +42,7 @@ func htmlOutput(profile, outfile string) error {
if err != nil {
return err
}
- src, err := ioutil.ReadFile(file)
+ src, err := os.ReadFile(file)
if err != nil {
return fmt.Errorf("can't read %q: %v", fn, err)
}
@@ -62,7 +61,7 @@ func htmlOutput(profile, outfile string) error {
var out *os.File
if outfile == "" {
var dir string
- dir, err = ioutil.TempDir("", "cover")
+ dir, err = os.MkdirTemp("", "cover")
if err != nil {
return err
}
diff --git a/src/cmd/fix/main.go b/src/cmd/fix/main.go
index 1cedf992cf..d055929aac 100644
--- a/src/cmd/fix/main.go
+++ b/src/cmd/fix/main.go
@@ -15,7 +15,6 @@ import (
"go/token"
"io"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"sort"
@@ -217,7 +216,7 @@ func processFile(filename string, useStdin bool) error {
return nil
}
- return ioutil.WriteFile(f.Name(), newSrc, 0)
+ return os.WriteFile(f.Name(), newSrc, 0)
}
func gofmt(n interface{}) string {
diff --git a/src/cmd/fix/typecheck.go b/src/cmd/fix/typecheck.go
index f45155b06d..40b2287f26 100644
--- a/src/cmd/fix/typecheck.go
+++ b/src/cmd/fix/typecheck.go
@@ -9,7 +9,6 @@ import (
"go/ast"
"go/parser"
"go/token"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -162,12 +161,12 @@ func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[interface{}]string, ass
if err != nil {
return err
}
- dir, err := ioutil.TempDir(os.TempDir(), "fix_cgo_typecheck")
+ dir, err := os.MkdirTemp(os.TempDir(), "fix_cgo_typecheck")
if err != nil {
return err
}
defer os.RemoveAll(dir)
- err = ioutil.WriteFile(filepath.Join(dir, "in.go"), txt, 0600)
+ err = os.WriteFile(filepath.Join(dir, "in.go"), txt, 0600)
if err != nil {
return err
}
@@ -176,7 +175,7 @@ func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[interface{}]string, ass
if err != nil {
return err
}
- out, err := ioutil.ReadFile(filepath.Join(dir, "_cgo_gotypes.go"))
+ out, err := os.ReadFile(filepath.Join(dir, "_cgo_gotypes.go"))
if err != nil {
return err
}
diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go
index 1b8a21ecfa..19764bfc60 100644
--- a/src/cmd/go/go_test.go
+++ b/src/cmd/go/go_test.go
@@ -17,7 +17,6 @@ import (
"internal/testenv"
"io"
"io/fs"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -100,7 +99,7 @@ func TestMain(m *testing.M) {
// Run with a temporary TMPDIR to check that the tests don't
// leave anything behind.
- topTmpdir, err := ioutil.TempDir("", "cmd-go-test-")
+ topTmpdir, err := os.MkdirTemp("", "cmd-go-test-")
if err != nil {
log.Fatal(err)
}
@@ -109,7 +108,7 @@ func TestMain(m *testing.M) {
}
os.Setenv(tempEnvName(), topTmpdir)
- dir, err := ioutil.TempDir(topTmpdir, "tmpdir")
+ dir, err := os.MkdirTemp(topTmpdir, "tmpdir")
if err != nil {
log.Fatal(err)
}
@@ -616,7 +615,7 @@ func (tg *testgoData) makeTempdir() {
tg.t.Helper()
if tg.tempdir == "" {
var err error
- tg.tempdir, err = ioutil.TempDir("", "gotest")
+ tg.tempdir, err = os.MkdirTemp("", "gotest")
tg.must(err)
}
}
@@ -633,7 +632,7 @@ func (tg *testgoData) tempFile(path, contents string) {
bytes = formatted
}
}
- tg.must(ioutil.WriteFile(filepath.Join(tg.tempdir, path), bytes, 0644))
+ tg.must(os.WriteFile(filepath.Join(tg.tempdir, path), bytes, 0644))
}
// tempDir adds a temporary directory for a run of testgo.
@@ -833,7 +832,7 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) {
return err
}
dest := filepath.Join("goroot", copydir, srcrel)
- data, err := ioutil.ReadFile(path)
+ data, err := os.ReadFile(path)
if err != nil {
return err
}
@@ -850,18 +849,18 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) {
tg.setenv("GOROOT", tg.path("goroot"))
addVar := func(name string, idx int) (restore func()) {
- data, err := ioutil.ReadFile(name)
+ data, err := os.ReadFile(name)
if err != nil {
t.Fatal(err)
}
old := data
data = append(data, fmt.Sprintf("var DummyUnusedVar%d bool\n", idx)...)
- if err := ioutil.WriteFile(name, append(data, '\n'), 0666); err != nil {
+ if err := os.WriteFile(name, append(data, '\n'), 0666); err != nil {
t.Fatal(err)
}
tg.sleep()
return func() {
- if err := ioutil.WriteFile(name, old, 0666); err != nil {
+ if err := os.WriteFile(name, old, 0666); err != nil {
t.Fatal(err)
}
}
@@ -2674,7 +2673,7 @@ echo $* >>`+tg.path("pkg-config.out"))
tg.setenv("GOPATH", tg.path("."))
tg.setenv("PKG_CONFIG", tg.path("pkg-config.sh"))
tg.run("build", "x")
- out, err := ioutil.ReadFile(tg.path("pkg-config.out"))
+ out, err := os.ReadFile(tg.path("pkg-config.out"))
tg.must(err)
out = bytes.TrimSpace(out)
want := "--cflags --static --static -- a a\n--libs --static --static -- a a"
diff --git a/src/cmd/go/go_windows_test.go b/src/cmd/go/go_windows_test.go
index 02634f19f5..3094212bae 100644
--- a/src/cmd/go/go_windows_test.go
+++ b/src/cmd/go/go_windows_test.go
@@ -5,7 +5,6 @@
package main_test
import (
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -20,14 +19,14 @@ func TestAbsolutePath(t *testing.T) {
defer tg.cleanup()
tg.parallel()
- tmp, err := ioutil.TempDir("", "TestAbsolutePath")
+ tmp, err := os.MkdirTemp("", "TestAbsolutePath")
if err != nil {
t.Fatal(err)
}
defer robustio.RemoveAll(tmp)
file := filepath.Join(tmp, "a.go")
- err = ioutil.WriteFile(file, []byte{}, 0644)
+ err = os.WriteFile(file, []byte{}, 0644)
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/help_test.go b/src/cmd/go/help_test.go
index 78d63ff05e..abfc3db993 100644
--- a/src/cmd/go/help_test.go
+++ b/src/cmd/go/help_test.go
@@ -6,7 +6,7 @@ package main_test
import (
"bytes"
- "io/ioutil"
+ "os"
"testing"
"cmd/go/internal/help"
@@ -23,7 +23,7 @@ func TestDocsUpToDate(t *testing.T) {
buf := new(bytes.Buffer)
// Match the command in mkalldocs.sh that generates alldocs.go.
help.Help(buf, []string{"documentation"})
- data, err := ioutil.ReadFile("alldocs.go")
+ data, err := os.ReadFile("alldocs.go")
if err != nil {
t.Fatalf("error reading alldocs.go: %v", err)
}
diff --git a/src/cmd/go/internal/auth/netrc.go b/src/cmd/go/internal/auth/netrc.go
index 7a9bdbb72c..0107f20d7a 100644
--- a/src/cmd/go/internal/auth/netrc.go
+++ b/src/cmd/go/internal/auth/netrc.go
@@ -5,7 +5,6 @@
package auth
import (
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -99,7 +98,7 @@ func readNetrc() {
return
}
- data, err := ioutil.ReadFile(path)
+ data, err := os.ReadFile(path)
if err != nil {
if !os.IsNotExist(err) {
netrcErr = err
diff --git a/src/cmd/go/internal/bug/bug.go b/src/cmd/go/internal/bug/bug.go
index 07e3516855..1085feaaee 100644
--- a/src/cmd/go/internal/bug/bug.go
+++ b/src/cmd/go/internal/bug/bug.go
@@ -10,7 +10,6 @@ import (
"context"
"fmt"
"io"
- "io/ioutil"
urlpkg "net/url"
"os"
"os/exec"
@@ -117,7 +116,7 @@ func printOSDetails(w io.Writer) {
case "illumos", "solaris":
// Be sure to use the OS-supplied uname, in "/usr/bin":
printCmdOut(w, "uname -srv: ", "/usr/bin/uname", "-srv")
- out, err := ioutil.ReadFile("/etc/release")
+ out, err := os.ReadFile("/etc/release")
if err == nil {
fmt.Fprintf(w, "/etc/release: %s\n", out)
} else {
@@ -177,7 +176,7 @@ func printGlibcVersion(w io.Writer) {
src := []byte(`int main() {}`)
srcfile := filepath.Join(tempdir, "go-bug.c")
outfile := filepath.Join(tempdir, "go-bug")
- err := ioutil.WriteFile(srcfile, src, 0644)
+ err := os.WriteFile(srcfile, src, 0644)
if err != nil {
return
}
diff --git a/src/cmd/go/internal/cache/cache.go b/src/cmd/go/internal/cache/cache.go
index 5464fe5685..41f921641d 100644
--- a/src/cmd/go/internal/cache/cache.go
+++ b/src/cmd/go/internal/cache/cache.go
@@ -13,7 +13,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"strconv"
@@ -239,7 +238,7 @@ func (c *Cache) GetBytes(id ActionID) ([]byte, Entry, error) {
if err != nil {
return nil, entry, err
}
- data, _ := ioutil.ReadFile(c.OutputFile(entry.OutputID))
+ data, _ := os.ReadFile(c.OutputFile(entry.OutputID))
if sha256.Sum256(data) != entry.OutputID {
return nil, entry, &entryNotFoundError{Err: errors.New("bad checksum")}
}
@@ -378,7 +377,7 @@ func (c *Cache) putIndexEntry(id ActionID, out OutputID, size int64, allowVerify
// Truncate the file only *after* writing it.
// (This should be a no-op, but truncate just in case of previous corruption.)
//
- // This differs from ioutil.WriteFile, which truncates to 0 *before* writing
+ // This differs from os.WriteFile, which truncates to 0 *before* writing
// via os.O_TRUNC. Truncating only after writing ensures that a second write
// of the same content to the same file is idempotent, and does not — even
// temporarily! — undo the effect of the first write.
diff --git a/src/cmd/go/internal/cache/cache_test.go b/src/cmd/go/internal/cache/cache_test.go
index 1988c34502..a865b97018 100644
--- a/src/cmd/go/internal/cache/cache_test.go
+++ b/src/cmd/go/internal/cache/cache_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"encoding/binary"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"testing"
@@ -20,7 +19,7 @@ func init() {
}
func TestBasic(t *testing.T) {
- dir, err := ioutil.TempDir("", "cachetest-")
+ dir, err := os.MkdirTemp("", "cachetest-")
if err != nil {
t.Fatal(err)
}
@@ -65,7 +64,7 @@ func TestBasic(t *testing.T) {
}
func TestGrowth(t *testing.T) {
- dir, err := ioutil.TempDir("", "cachetest-")
+ dir, err := os.MkdirTemp("", "cachetest-")
if err != nil {
t.Fatal(err)
}
@@ -118,7 +117,7 @@ func TestVerifyPanic(t *testing.T) {
t.Fatal("initEnv did not set verify")
}
- dir, err := ioutil.TempDir("", "cachetest-")
+ dir, err := os.MkdirTemp("", "cachetest-")
if err != nil {
t.Fatal(err)
}
@@ -151,7 +150,7 @@ func dummyID(x int) [HashSize]byte {
}
func TestCacheTrim(t *testing.T) {
- dir, err := ioutil.TempDir("", "cachetest-")
+ dir, err := os.MkdirTemp("", "cachetest-")
if err != nil {
t.Fatal(err)
}
@@ -207,7 +206,7 @@ func TestCacheTrim(t *testing.T) {
t.Fatal(err)
}
c.OutputFile(entry.OutputID)
- data, err := ioutil.ReadFile(filepath.Join(dir, "trim.txt"))
+ data, err := os.ReadFile(filepath.Join(dir, "trim.txt"))
if err != nil {
t.Fatal(err)
}
@@ -220,7 +219,7 @@ func TestCacheTrim(t *testing.T) {
t.Fatal(err)
}
c.OutputFile(entry.OutputID)
- data2, err := ioutil.ReadFile(filepath.Join(dir, "trim.txt"))
+ data2, err := os.ReadFile(filepath.Join(dir, "trim.txt"))
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/cache/default.go b/src/cmd/go/internal/cache/default.go
index 9f8dd8af4b..0b1c1e0c20 100644
--- a/src/cmd/go/internal/cache/default.go
+++ b/src/cmd/go/internal/cache/default.go
@@ -6,7 +6,6 @@ package cache
import (
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"sync"
@@ -49,7 +48,7 @@ func initDefaultCache() {
}
if _, err := os.Stat(filepath.Join(dir, "README")); err != nil {
// Best effort.
- ioutil.WriteFile(filepath.Join(dir, "README"), []byte(cacheREADME), 0666)
+ os.WriteFile(filepath.Join(dir, "README"), []byte(cacheREADME), 0666)
}
c, err := Open(dir)
diff --git a/src/cmd/go/internal/cache/hash_test.go b/src/cmd/go/internal/cache/hash_test.go
index 3bf7143039..a0356771ca 100644
--- a/src/cmd/go/internal/cache/hash_test.go
+++ b/src/cmd/go/internal/cache/hash_test.go
@@ -6,7 +6,6 @@ package cache
import (
"fmt"
- "io/ioutil"
"os"
"testing"
)
@@ -28,7 +27,7 @@ func TestHash(t *testing.T) {
}
func TestHashFile(t *testing.T) {
- f, err := ioutil.TempFile("", "cmd-go-test-")
+ f, err := os.CreateTemp("", "cmd-go-test-")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
index 9bc48132ae..c48904eacc 100644
--- a/src/cmd/go/internal/cfg/cfg.go
+++ b/src/cmd/go/internal/cfg/cfg.go
@@ -12,7 +12,6 @@ import (
"go/build"
"internal/cfg"
"io"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -187,7 +186,7 @@ func initEnvCache() {
if file == "" {
return
}
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err != nil {
return
}
diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
index 46af36eb11..6937187522 100644
--- a/src/cmd/go/internal/envcmd/env.go
+++ b/src/cmd/go/internal/envcmd/env.go
@@ -10,7 +10,6 @@ import (
"encoding/json"
"fmt"
"go/build"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -452,7 +451,7 @@ func updateEnvFile(add map[string]string, del map[string]bool) {
if file == "" {
base.Fatalf("go env: cannot find go env config: %v", err)
}
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err != nil && (!os.IsNotExist(err) || len(add) == 0) {
base.Fatalf("go env: reading go env config: %v", err)
}
@@ -506,11 +505,11 @@ func updateEnvFile(add map[string]string, del map[string]bool) {
}
data = []byte(strings.Join(lines, ""))
- err = ioutil.WriteFile(file, data, 0666)
+ err = os.WriteFile(file, data, 0666)
if err != nil {
// Try creating directory.
os.MkdirAll(filepath.Dir(file), 0777)
- err = ioutil.WriteFile(file, data, 0666)
+ err = os.WriteFile(file, data, 0666)
if err != nil {
base.Fatalf("go env: writing go env config: %v", err)
}
diff --git a/src/cmd/go/internal/fsys/fsys.go b/src/cmd/go/internal/fsys/fsys.go
index 0264786e5b..7b06c3c7f3 100644
--- a/src/cmd/go/internal/fsys/fsys.go
+++ b/src/cmd/go/internal/fsys/fsys.go
@@ -86,7 +86,7 @@ func Init(wd string) error {
return nil
}
- b, err := ioutil.ReadFile(OverlayFile)
+ b, err := os.ReadFile(OverlayFile)
if err != nil {
return fmt.Errorf("reading overlay file: %v", err)
}
diff --git a/src/cmd/go/internal/fsys/fsys_test.go b/src/cmd/go/internal/fsys/fsys_test.go
index 90a69de14a..7f175c7031 100644
--- a/src/cmd/go/internal/fsys/fsys_test.go
+++ b/src/cmd/go/internal/fsys/fsys_test.go
@@ -8,7 +8,6 @@ import (
"internal/testenv"
"io"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"reflect"
@@ -47,7 +46,7 @@ func initOverlay(t *testing.T, config string) {
if err := os.MkdirAll(filepath.Dir(name), 0777); err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(name, f.Data, 0666); err != nil {
+ if err := os.WriteFile(name, f.Data, 0666); err != nil {
t.Fatal(err)
}
}
diff --git a/src/cmd/go/internal/generate/generate.go b/src/cmd/go/internal/generate/generate.go
index 98c17bba8c..c7401948b8 100644
--- a/src/cmd/go/internal/generate/generate.go
+++ b/src/cmd/go/internal/generate/generate.go
@@ -13,7 +13,6 @@ import (
"go/parser"
"go/token"
"io"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -201,7 +200,7 @@ func runGenerate(ctx context.Context, cmd *base.Command, args []string) {
// generate runs the generation directives for a single file.
func generate(absFile string) bool {
- src, err := ioutil.ReadFile(absFile)
+ src, err := os.ReadFile(absFile)
if err != nil {
log.Fatalf("generate: %s", err)
}
diff --git a/src/cmd/go/internal/imports/scan_test.go b/src/cmd/go/internal/imports/scan_test.go
index e424656cae..5ba3201968 100644
--- a/src/cmd/go/internal/imports/scan_test.go
+++ b/src/cmd/go/internal/imports/scan_test.go
@@ -8,6 +8,7 @@ import (
"bytes"
"internal/testenv"
"io/ioutil"
+ "os"
"path"
"path/filepath"
"runtime"
@@ -66,7 +67,7 @@ func TestScanDir(t *testing.T) {
continue
}
t.Run(dir.Name(), func(t *testing.T) {
- tagsData, err := ioutil.ReadFile(filepath.Join("testdata", dir.Name(), "tags.txt"))
+ tagsData, err := os.ReadFile(filepath.Join("testdata", dir.Name(), "tags.txt"))
if err != nil {
t.Fatalf("error reading tags: %v", err)
}
@@ -75,7 +76,7 @@ func TestScanDir(t *testing.T) {
tags[t] = true
}
- wantData, err := ioutil.ReadFile(filepath.Join("testdata", dir.Name(), "want.txt"))
+ wantData, err := os.ReadFile(filepath.Join("testdata", dir.Name(), "want.txt"))
if err != nil {
t.Fatalf("error reading want: %v", err)
}
diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
index cbc683da2b..da3e0b895c 100644
--- a/src/cmd/go/internal/load/pkg.go
+++ b/src/cmd/go/internal/load/pkg.go
@@ -1147,7 +1147,7 @@ var (
// goModPath returns the module path in the go.mod in dir, if any.
func goModPath(dir string) (path string) {
return goModPathCache.Do(dir, func() interface{} {
- data, err := ioutil.ReadFile(filepath.Join(dir, "go.mod"))
+ data, err := os.ReadFile(filepath.Join(dir, "go.mod"))
if err != nil {
return ""
}
@@ -1728,7 +1728,7 @@ func (p *Package) load(ctx context.Context, path string, stk *ImportStack, impor
// not work for any package that lacks a Target — such as a non-main
// package in module mode. We should probably fix that.
shlibnamefile := p.Target[:len(p.Target)-2] + ".shlibname"
- shlib, err := ioutil.ReadFile(shlibnamefile)
+ shlib, err := os.ReadFile(shlibnamefile)
if err != nil && !os.IsNotExist(err) {
base.Fatalf("reading shlibname: %v", err)
}
diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go
index 8301fb6b6e..2ac2052b8f 100644
--- a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go
+++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go
@@ -9,7 +9,6 @@ package filelock_test
import (
"fmt"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -51,9 +50,9 @@ func mustTempFile(t *testing.T) (f *os.File, remove func()) {
t.Helper()
base := filepath.Base(t.Name())
- f, err := ioutil.TempFile("", base)
+ f, err := os.CreateTemp("", base)
if err != nil {
- t.Fatalf(`ioutil.TempFile("", %q) = %v`, base, err)
+ t.Fatalf(`os.CreateTemp("", %q) = %v`, base, err)
}
t.Logf("fd %d = %s", f.Fd(), f.Name())
diff --git a/src/cmd/go/internal/lockedfile/lockedfile_test.go b/src/cmd/go/internal/lockedfile/lockedfile_test.go
index 416c69d83b..34327dd841 100644
--- a/src/cmd/go/internal/lockedfile/lockedfile_test.go
+++ b/src/cmd/go/internal/lockedfile/lockedfile_test.go
@@ -10,7 +10,6 @@ package lockedfile_test
import (
"fmt"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -23,7 +22,7 @@ import (
func mustTempDir(t *testing.T) (dir string, remove func()) {
t.Helper()
- dir, err := ioutil.TempDir("", filepath.Base(t.Name()))
+ dir, err := os.MkdirTemp("", filepath.Base(t.Name()))
if err != nil {
t.Fatal(err)
}
@@ -155,8 +154,8 @@ func TestCanLockExistingFile(t *testing.T) {
defer remove()
path := filepath.Join(dir, "existing.txt")
- if err := ioutil.WriteFile(path, []byte("ok"), 0777); err != nil {
- t.Fatalf("ioutil.WriteFile: %v", err)
+ if err := os.WriteFile(path, []byte("ok"), 0777); err != nil {
+ t.Fatalf("os.WriteFile: %v", err)
}
f, err := lockedfile.Edit(path)
@@ -201,7 +200,7 @@ func TestSpuriousEDEADLK(t *testing.T) {
}
defer b.Close()
- if err := ioutil.WriteFile(filepath.Join(dir, "locked"), []byte("ok"), 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(dir, "locked"), []byte("ok"), 0666); err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/modcmd/vendor.go b/src/cmd/go/internal/modcmd/vendor.go
index 38c473d36b..390a195547 100644
--- a/src/cmd/go/internal/modcmd/vendor.go
+++ b/src/cmd/go/internal/modcmd/vendor.go
@@ -155,7 +155,7 @@ func runVendor(ctx context.Context, cmd *base.Command, args []string) {
base.Fatalf("go mod vendor: %v", err)
}
- if err := ioutil.WriteFile(filepath.Join(vdir, "modules.txt"), buf.Bytes(), 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(vdir, "modules.txt"), buf.Bytes(), 0666); err != nil {
base.Fatalf("go mod vendor: %v", err)
}
}
diff --git a/src/cmd/go/internal/modcmd/verify.go b/src/cmd/go/internal/modcmd/verify.go
index ce24793929..c83e70076a 100644
--- a/src/cmd/go/internal/modcmd/verify.go
+++ b/src/cmd/go/internal/modcmd/verify.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"io/fs"
- "io/ioutil"
"os"
"runtime"
@@ -87,7 +86,7 @@ func verifyMod(mod module.Version) []error {
_, zipErr = os.Stat(zip)
}
dir, dirErr := modfetch.DownloadDir(mod)
- data, err := ioutil.ReadFile(zip + "hash")
+ data, err := os.ReadFile(zip + "hash")
if err != nil {
if zipErr != nil && errors.Is(zipErr, fs.ErrNotExist) &&
dirErr != nil && errors.Is(dirErr, fs.ErrNotExist) {
diff --git a/src/cmd/go/internal/modconv/convert_test.go b/src/cmd/go/internal/modconv/convert_test.go
index faa2b4c606..66b9ff4f38 100644
--- a/src/cmd/go/internal/modconv/convert_test.go
+++ b/src/cmd/go/internal/modconv/convert_test.go
@@ -9,7 +9,6 @@ import (
"context"
"fmt"
"internal/testenv"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -37,7 +36,7 @@ func testMain(m *testing.M) int {
return 0
}
- dir, err := ioutil.TempDir("", "modconv-test-")
+ dir, err := os.MkdirTemp("", "modconv-test-")
if err != nil {
log.Fatal(err)
}
@@ -167,7 +166,7 @@ func TestConvertLegacyConfig(t *testing.T) {
for name := range Converters {
file := filepath.Join(dir, name)
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err == nil {
f := new(modfile.File)
f.AddModuleStmt(tt.path)
diff --git a/src/cmd/go/internal/modconv/modconv_test.go b/src/cmd/go/internal/modconv/modconv_test.go
index ccc4f3d576..750525d404 100644
--- a/src/cmd/go/internal/modconv/modconv_test.go
+++ b/src/cmd/go/internal/modconv/modconv_test.go
@@ -7,7 +7,7 @@ package modconv
import (
"bytes"
"fmt"
- "io/ioutil"
+ "os"
"path/filepath"
"testing"
)
@@ -42,7 +42,7 @@ func Test(t *testing.T) {
if Converters[extMap[ext]] == nil {
t.Fatalf("Converters[%q] == nil", extMap[ext])
}
- data, err := ioutil.ReadFile(test)
+ data, err := os.ReadFile(test)
if err != nil {
t.Fatal(err)
}
@@ -50,7 +50,7 @@ func Test(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- want, err := ioutil.ReadFile(test[:len(test)-len(ext)] + ".out")
+ want, err := os.ReadFile(test[:len(test)-len(ext)] + ".out")
if err != nil {
t.Error(err)
}
diff --git a/src/cmd/go/internal/modfetch/cache_test.go b/src/cmd/go/internal/modfetch/cache_test.go
index 241c800e69..722c984e37 100644
--- a/src/cmd/go/internal/modfetch/cache_test.go
+++ b/src/cmd/go/internal/modfetch/cache_test.go
@@ -5,14 +5,13 @@
package modfetch
import (
- "io/ioutil"
"os"
"path/filepath"
"testing"
)
func TestWriteDiskCache(t *testing.T) {
- tmpdir, err := ioutil.TempDir("", "go-writeCache-test-")
+ tmpdir, err := os.MkdirTemp("", "go-writeCache-test-")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/modfetch/codehost/codehost.go b/src/cmd/go/internal/modfetch/codehost/codehost.go
index 286d3f7220..86c1c14d4a 100644
--- a/src/cmd/go/internal/modfetch/codehost/codehost.go
+++ b/src/cmd/go/internal/modfetch/codehost/codehost.go
@@ -12,7 +12,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -189,7 +188,7 @@ func WorkDir(typ, name string) (dir, lockfile string, err error) {
}
defer unlock()
- data, err := ioutil.ReadFile(dir + ".info")
+ data, err := os.ReadFile(dir + ".info")
info, err2 := os.Stat(dir)
if err == nil && err2 == nil && info.IsDir() {
// Info file and directory both already exist: reuse.
@@ -211,7 +210,7 @@ func WorkDir(typ, name string) (dir, lockfile string, err error) {
if err := os.MkdirAll(dir, 0777); err != nil {
return "", "", err
}
- if err := ioutil.WriteFile(dir+".info", []byte(key), 0666); err != nil {
+ if err := os.WriteFile(dir+".info", []byte(key), 0666); err != nil {
os.RemoveAll(dir)
return "", "", err
}
diff --git a/src/cmd/go/internal/modfetch/codehost/git_test.go b/src/cmd/go/internal/modfetch/codehost/git_test.go
index 981e3fe91f..89a73baad9 100644
--- a/src/cmd/go/internal/modfetch/codehost/git_test.go
+++ b/src/cmd/go/internal/modfetch/codehost/git_test.go
@@ -12,7 +12,6 @@ import (
"internal/testenv"
"io"
"io/fs"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -54,7 +53,7 @@ func testMain(m *testing.M) int {
return 0
}
- dir, err := ioutil.TempDir("", "gitrepo-test-")
+ dir, err := os.MkdirTemp("", "gitrepo-test-")
if err != nil {
log.Fatal(err)
}
diff --git a/src/cmd/go/internal/modfetch/codehost/shell.go b/src/cmd/go/internal/modfetch/codehost/shell.go
index b9525adf5e..ce8b501d53 100644
--- a/src/cmd/go/internal/modfetch/codehost/shell.go
+++ b/src/cmd/go/internal/modfetch/codehost/shell.go
@@ -15,7 +15,6 @@ import (
"flag"
"fmt"
"io"
- "io/ioutil"
"log"
"os"
"strings"
@@ -124,7 +123,7 @@ func main() {
}
if f[3] != "-" {
- if err := ioutil.WriteFile(f[3], data, 0666); err != nil {
+ if err := os.WriteFile(f[3], data, 0666); err != nil {
fmt.Fprintf(os.Stderr, "?%s\n", err)
continue
}
diff --git a/src/cmd/go/internal/modfetch/codehost/vcs.go b/src/cmd/go/internal/modfetch/codehost/vcs.go
index e67ee94ad8..c2cca084e3 100644
--- a/src/cmd/go/internal/modfetch/codehost/vcs.go
+++ b/src/cmd/go/internal/modfetch/codehost/vcs.go
@@ -10,7 +10,6 @@ import (
"internal/lazyregexp"
"io"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"sort"
@@ -433,7 +432,7 @@ func (r *vcsRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser,
if rev == "latest" {
rev = r.cmd.latest
}
- f, err := ioutil.TempFile("", "go-readzip-*.zip")
+ f, err := os.CreateTemp("", "go-readzip-*.zip")
if err != nil {
return nil, err
}
diff --git a/src/cmd/go/internal/modfetch/coderepo.go b/src/cmd/go/internal/modfetch/coderepo.go
index b6bcf83f1a..2dcbb99b18 100644
--- a/src/cmd/go/internal/modfetch/coderepo.go
+++ b/src/cmd/go/internal/modfetch/coderepo.go
@@ -11,7 +11,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"os"
"path"
"sort"
@@ -966,7 +965,7 @@ func (r *codeRepo) Zip(dst io.Writer, version string) error {
subdir = strings.Trim(subdir, "/")
// Spool to local file.
- f, err := ioutil.TempFile("", "go-codehost-")
+ f, err := os.CreateTemp("", "go-codehost-")
if err != nil {
dl.Close()
return err
diff --git a/src/cmd/go/internal/modfetch/coderepo_test.go b/src/cmd/go/internal/modfetch/coderepo_test.go
index 53b048dbdf..02e399f352 100644
--- a/src/cmd/go/internal/modfetch/coderepo_test.go
+++ b/src/cmd/go/internal/modfetch/coderepo_test.go
@@ -11,7 +11,6 @@ import (
"hash"
"internal/testenv"
"io"
- "io/ioutil"
"log"
"os"
"reflect"
@@ -38,7 +37,7 @@ func testMain(m *testing.M) int {
// code, bypass the sum database.
cfg.GOSUMDB = "off"
- dir, err := ioutil.TempDir("", "gitrepo-test-")
+ dir, err := os.MkdirTemp("", "gitrepo-test-")
if err != nil {
log.Fatal(err)
}
@@ -424,7 +423,7 @@ var codeRepoTests = []codeRepoTest{
func TestCodeRepo(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
- tmpdir, err := ioutil.TempDir("", "modfetch-test-")
+ tmpdir, err := os.MkdirTemp("", "modfetch-test-")
if err != nil {
t.Fatal(err)
}
@@ -491,9 +490,9 @@ func TestCodeRepo(t *testing.T) {
needHash := !testing.Short() && (tt.zipFileHash != "" || tt.zipSum != "")
if tt.zip != nil || tt.zipErr != "" || needHash {
- f, err := ioutil.TempFile(tmpdir, tt.version+".zip.")
+ f, err := os.CreateTemp(tmpdir, tt.version+".zip.")
if err != nil {
- t.Fatalf("ioutil.TempFile: %v", err)
+ t.Fatalf("os.CreateTemp: %v", err)
}
zipfile := f.Name()
defer func() {
@@ -655,7 +654,7 @@ var codeRepoVersionsTests = []struct {
func TestCodeRepoVersions(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
- tmpdir, err := ioutil.TempDir("", "vgo-modfetch-test-")
+ tmpdir, err := os.MkdirTemp("", "vgo-modfetch-test-")
if err != nil {
t.Fatal(err)
}
@@ -729,7 +728,7 @@ var latestTests = []struct {
func TestLatest(t *testing.T) {
testenv.MustHaveExternalNetwork(t)
- tmpdir, err := ioutil.TempDir("", "vgo-modfetch-test-")
+ tmpdir, err := os.MkdirTemp("", "vgo-modfetch-test-")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/modfetch/fetch.go b/src/cmd/go/internal/modfetch/fetch.go
index 2ee78de5b2..debeb3f319 100644
--- a/src/cmd/go/internal/modfetch/fetch.go
+++ b/src/cmd/go/internal/modfetch/fetch.go
@@ -12,7 +12,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"sort"
@@ -136,7 +135,7 @@ func download(ctx context.Context, mod module.Version) (dir string, err error) {
if err := os.MkdirAll(parentDir, 0777); err != nil {
return "", err
}
- if err := ioutil.WriteFile(partialPath, nil, 0666); err != nil {
+ if err := os.WriteFile(partialPath, nil, 0666); err != nil {
return "", err
}
if err := modzip.Unzip(dir, mod, zipfile); err != nil {
@@ -223,7 +222,7 @@ func downloadZip(ctx context.Context, mod module.Version, zipfile string) (err e
// contents of the file (by hashing it) before we commit it. Because the file
// is zip-compressed, we need an actual file — or at least an io.ReaderAt — to
// validate it: we can't just tee the stream as we write it.
- f, err := ioutil.TempFile(filepath.Dir(zipfile), filepath.Base(renameio.Pattern(zipfile)))
+ f, err := os.CreateTemp(filepath.Dir(zipfile), filepath.Base(renameio.Pattern(zipfile)))
if err != nil {
return err
}
diff --git a/src/cmd/go/internal/modfetch/zip_sum_test/zip_sum_test.go b/src/cmd/go/internal/modfetch/zip_sum_test/zip_sum_test.go
index 82398ebfed..d9ba8ef2da 100644
--- a/src/cmd/go/internal/modfetch/zip_sum_test/zip_sum_test.go
+++ b/src/cmd/go/internal/modfetch/zip_sum_test/zip_sum_test.go
@@ -24,7 +24,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"path/filepath"
"strings"
@@ -81,7 +80,7 @@ func TestZipSums(t *testing.T) {
if *modCacheDir != "" {
cfg.BuildContext.GOPATH = *modCacheDir
} else {
- tmpDir, err := ioutil.TempDir("", "TestZipSums")
+ tmpDir, err := os.MkdirTemp("", "TestZipSums")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go
index 1c31a5f90a..6a2cea668d 100644
--- a/src/cmd/go/internal/modload/init.go
+++ b/src/cmd/go/internal/modload/init.go
@@ -632,7 +632,7 @@ func setDefaultBuildMod() {
func convertLegacyConfig(modPath string) (from string, err error) {
for _, name := range altConfigs {
cfg := filepath.Join(modRoot, name)
- data, err := ioutil.ReadFile(cfg)
+ data, err := os.ReadFile(cfg)
if err == nil {
convert := modconv.Converters[name]
if convert == nil {
@@ -753,7 +753,7 @@ func findModulePath(dir string) (string, error) {
}
// Look for Godeps.json declaring import path.
- data, _ := ioutil.ReadFile(filepath.Join(dir, "Godeps/Godeps.json"))
+ data, _ := os.ReadFile(filepath.Join(dir, "Godeps/Godeps.json"))
var cfg1 struct{ ImportPath string }
json.Unmarshal(data, &cfg1)
if cfg1.ImportPath != "" {
@@ -761,7 +761,7 @@ func findModulePath(dir string) (string, error) {
}
// Look for vendor.json declaring import path.
- data, _ = ioutil.ReadFile(filepath.Join(dir, "vendor/vendor.json"))
+ data, _ = os.ReadFile(filepath.Join(dir, "vendor/vendor.json"))
var cfg2 struct{ RootPath string }
json.Unmarshal(data, &cfg2)
if cfg2.RootPath != "" {
@@ -813,7 +813,7 @@ var (
)
func findImportComment(file string) string {
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err != nil {
return ""
}
diff --git a/src/cmd/go/internal/modload/query_test.go b/src/cmd/go/internal/modload/query_test.go
index 777a56b977..e225a0e71e 100644
--- a/src/cmd/go/internal/modload/query_test.go
+++ b/src/cmd/go/internal/modload/query_test.go
@@ -7,7 +7,6 @@ package modload
import (
"context"
"internal/testenv"
- "io/ioutil"
"log"
"os"
"path"
@@ -27,7 +26,7 @@ func TestMain(m *testing.M) {
func testMain(m *testing.M) int {
cfg.GOPROXY = "direct"
- dir, err := ioutil.TempDir("", "modload-test-")
+ dir, err := os.MkdirTemp("", "modload-test-")
if err != nil {
log.Fatal(err)
}
diff --git a/src/cmd/go/internal/modload/vendor.go b/src/cmd/go/internal/modload/vendor.go
index ab29d4d014..80d49053c6 100644
--- a/src/cmd/go/internal/modload/vendor.go
+++ b/src/cmd/go/internal/modload/vendor.go
@@ -8,7 +8,7 @@ import (
"errors"
"fmt"
"io/fs"
- "io/ioutil"
+ "os"
"path/filepath"
"strings"
"sync"
@@ -40,7 +40,7 @@ func readVendorList() {
vendorPkgModule = make(map[string]module.Version)
vendorVersion = make(map[string]string)
vendorMeta = make(map[module.Version]vendorMetadata)
- data, err := ioutil.ReadFile(filepath.Join(ModRoot(), "vendor/modules.txt"))
+ data, err := os.ReadFile(filepath.Join(ModRoot(), "vendor/modules.txt"))
if err != nil {
if !errors.Is(err, fs.ErrNotExist) {
base.Fatalf("go: %s", err)
diff --git a/src/cmd/go/internal/renameio/renameio.go b/src/cmd/go/internal/renameio/renameio.go
index 60a7138a76..9788171d6e 100644
--- a/src/cmd/go/internal/renameio/renameio.go
+++ b/src/cmd/go/internal/renameio/renameio.go
@@ -25,7 +25,7 @@ func Pattern(filename string) string {
return filepath.Join(filepath.Dir(filename), filepath.Base(filename)+patternSuffix)
}
-// WriteFile is like ioutil.WriteFile, but first writes data to an arbitrary
+// WriteFile is like os.WriteFile, but first writes data to an arbitrary
// file in the same directory as filename, then renames it atomically to the
// final name.
//
@@ -67,7 +67,7 @@ func WriteToFile(filename string, data io.Reader, perm fs.FileMode) (err error)
return robustio.Rename(f.Name(), filename)
}
-// ReadFile is like ioutil.ReadFile, but on Windows retries spurious errors that
+// ReadFile is like os.ReadFile, but on Windows retries spurious errors that
// may occur if the file is concurrently replaced.
//
// Errors are classified heuristically and retries are bounded, so even this
diff --git a/src/cmd/go/internal/renameio/renameio_test.go b/src/cmd/go/internal/renameio/renameio_test.go
index e6d2025a0e..5b2ed83624 100644
--- a/src/cmd/go/internal/renameio/renameio_test.go
+++ b/src/cmd/go/internal/renameio/renameio_test.go
@@ -10,7 +10,6 @@ import (
"encoding/binary"
"errors"
"internal/testenv"
- "io/ioutil"
"math/rand"
"os"
"path/filepath"
@@ -30,7 +29,7 @@ func TestConcurrentReadsAndWrites(t *testing.T) {
testenv.SkipFlaky(t, 33041)
}
- dir, err := ioutil.TempDir("", "renameio")
+ dir, err := os.MkdirTemp("", "renameio")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/renameio/umask_test.go b/src/cmd/go/internal/renameio/umask_test.go
index 19e217c548..65e4fa587b 100644
--- a/src/cmd/go/internal/renameio/umask_test.go
+++ b/src/cmd/go/internal/renameio/umask_test.go
@@ -8,7 +8,6 @@ package renameio
import (
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"syscall"
@@ -16,7 +15,7 @@ import (
)
func TestWriteFileModeAppliesUmask(t *testing.T) {
- dir, err := ioutil.TempDir("", "renameio")
+ dir, err := os.MkdirTemp("", "renameio")
if err != nil {
t.Fatalf("Failed to create temporary directory: %v", err)
}
diff --git a/src/cmd/go/internal/robustio/robustio.go b/src/cmd/go/internal/robustio/robustio.go
index 76e47ad1ff..ce3dbbde6d 100644
--- a/src/cmd/go/internal/robustio/robustio.go
+++ b/src/cmd/go/internal/robustio/robustio.go
@@ -22,7 +22,7 @@ func Rename(oldpath, newpath string) error {
return rename(oldpath, newpath)
}
-// ReadFile is like ioutil.ReadFile, but on Windows retries errors that may
+// ReadFile is like os.ReadFile, but on Windows retries errors that may
// occur if the file is concurrently replaced.
//
// (See golang.org/issue/31247 and golang.org/issue/32188.)
diff --git a/src/cmd/go/internal/robustio/robustio_flaky.go b/src/cmd/go/internal/robustio/robustio_flaky.go
index d4cb7e6457..5bd44bd345 100644
--- a/src/cmd/go/internal/robustio/robustio_flaky.go
+++ b/src/cmd/go/internal/robustio/robustio_flaky.go
@@ -8,7 +8,6 @@ package robustio
import (
"errors"
- "io/ioutil"
"math/rand"
"os"
"syscall"
@@ -70,11 +69,11 @@ func rename(oldpath, newpath string) (err error) {
})
}
-// readFile is like ioutil.ReadFile, but retries ephemeral errors.
+// readFile is like os.ReadFile, but retries ephemeral errors.
func readFile(filename string) ([]byte, error) {
var b []byte
err := retry(func() (err error, mayRetry bool) {
- b, err = ioutil.ReadFile(filename)
+ b, err = os.ReadFile(filename)
// Unlike in rename, we do not retry errFileNotFound here: it can occur
// as a spurious error, but the file may also genuinely not exist, so the
diff --git a/src/cmd/go/internal/robustio/robustio_other.go b/src/cmd/go/internal/robustio/robustio_other.go
index 907b556858..6fe7b7e4e4 100644
--- a/src/cmd/go/internal/robustio/robustio_other.go
+++ b/src/cmd/go/internal/robustio/robustio_other.go
@@ -7,7 +7,6 @@
package robustio
import (
- "io/ioutil"
"os"
)
@@ -16,7 +15,7 @@ func rename(oldpath, newpath string) error {
}
func readFile(filename string) ([]byte, error) {
- return ioutil.ReadFile(filename)
+ return os.ReadFile(filename)
}
func removeAll(path string) error {
diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go
index 24601dc061..401b67c260 100644
--- a/src/cmd/go/internal/test/test.go
+++ b/src/cmd/go/internal/test/test.go
@@ -884,7 +884,7 @@ func builderTest(b *work.Builder, ctx context.Context, p *load.Package) (buildAc
if !cfg.BuildN {
// writeTestmain writes _testmain.go,
// using the test description gathered in t.
- if err := ioutil.WriteFile(testDir+"_testmain.go", *pmain.Internal.TestmainGo, 0666); err != nil {
+ if err := os.WriteFile(testDir+"_testmain.go", *pmain.Internal.TestmainGo, 0666); err != nil {
return nil, nil, nil, err
}
}
@@ -1616,7 +1616,7 @@ func (c *runCache) saveOutput(a *work.Action) {
}
// See comment about two-level lookup in tryCacheWithID above.
- testlog, err := ioutil.ReadFile(a.Objdir + "testlog.txt")
+ testlog, err := os.ReadFile(a.Objdir + "testlog.txt")
if err != nil || !bytes.HasPrefix(testlog, testlogMagic) || testlog[len(testlog)-1] != '\n' {
if cache.DebugTest {
if err != nil {
diff --git a/src/cmd/go/internal/txtar/archive.go b/src/cmd/go/internal/txtar/archive.go
index c384f33bdf..1796684877 100644
--- a/src/cmd/go/internal/txtar/archive.go
+++ b/src/cmd/go/internal/txtar/archive.go
@@ -34,7 +34,7 @@ package txtar
import (
"bytes"
"fmt"
- "io/ioutil"
+ "os"
"strings"
)
@@ -66,7 +66,7 @@ func Format(a *Archive) []byte {
// ParseFile parses the named file as an archive.
func ParseFile(file string) (*Archive, error) {
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err != nil {
return nil, err
}
diff --git a/src/cmd/go/internal/vcs/vcs_test.go b/src/cmd/go/internal/vcs/vcs_test.go
index 72d74a01e3..c5c7a3283b 100644
--- a/src/cmd/go/internal/vcs/vcs_test.go
+++ b/src/cmd/go/internal/vcs/vcs_test.go
@@ -7,7 +7,6 @@ package vcs
import (
"errors"
"internal/testenv"
- "io/ioutil"
"os"
"path"
"path/filepath"
@@ -208,7 +207,7 @@ func TestRepoRootForImportPath(t *testing.T) {
// Test that vcsFromDir correctly inspects a given directory and returns the right VCS and root.
func TestFromDir(t *testing.T) {
- tempDir, err := ioutil.TempDir("", "vcstest")
+ tempDir, err := os.MkdirTemp("", "vcstest")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/web/file_test.go b/src/cmd/go/internal/web/file_test.go
index a1bb080e07..3734df5c4e 100644
--- a/src/cmd/go/internal/web/file_test.go
+++ b/src/cmd/go/internal/web/file_test.go
@@ -7,7 +7,6 @@ package web
import (
"errors"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"testing"
@@ -16,7 +15,7 @@ import (
func TestGetFileURL(t *testing.T) {
const content = "Hello, file!\n"
- f, err := ioutil.TempFile("", "web-TestGetFileURL")
+ f, err := os.CreateTemp("", "web-TestGetFileURL")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go
index f461c5780f..9d141ae233 100644
--- a/src/cmd/go/internal/work/action.go
+++ b/src/cmd/go/internal/work/action.go
@@ -14,7 +14,6 @@ import (
"debug/elf"
"encoding/json"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -253,7 +252,7 @@ func (b *Builder) Init() {
if cfg.BuildN {
b.WorkDir = "$WORK"
} else {
- tmp, err := ioutil.TempDir(cfg.Getenv("GOTMPDIR"), "go-build")
+ tmp, err := os.MkdirTemp(cfg.Getenv("GOTMPDIR"), "go-build")
if err != nil {
base.Fatalf("go: creating work dir: %v", err)
}
diff --git a/src/cmd/go/internal/work/build_test.go b/src/cmd/go/internal/work/build_test.go
index e941729734..eaf2639e9e 100644
--- a/src/cmd/go/internal/work/build_test.go
+++ b/src/cmd/go/internal/work/build_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"reflect"
@@ -170,7 +169,7 @@ func TestSharedLibName(t *testing.T) {
for _, data := range testData {
func() {
if data.rootedAt != "" {
- tmpGopath, err := ioutil.TempDir("", "gopath")
+ tmpGopath, err := os.MkdirTemp("", "gopath")
if err != nil {
t.Fatal(err)
}
@@ -238,7 +237,7 @@ func TestRespectSetgidDir(t *testing.T) {
return cmdBuf.WriteString(fmt.Sprint(a...))
}
- setgiddir, err := ioutil.TempDir("", "SetGroupID")
+ setgiddir, err := os.MkdirTemp("", "SetGroupID")
if err != nil {
t.Fatal(err)
}
@@ -258,9 +257,9 @@ func TestRespectSetgidDir(t *testing.T) {
t.Fatal(err)
}
- pkgfile, err := ioutil.TempFile("", "pkgfile")
+ pkgfile, err := os.CreateTemp("", "pkgfile")
if err != nil {
- t.Fatalf("ioutil.TempFile(\"\", \"pkgfile\"): %v", err)
+ t.Fatalf("os.CreateTemp(\"\", \"pkgfile\"): %v", err)
}
defer os.Remove(pkgfile.Name())
defer pkgfile.Close()
diff --git a/src/cmd/go/internal/work/buildid.go b/src/cmd/go/internal/work/buildid.go
index 3c7be5a3e3..d76988145b 100644
--- a/src/cmd/go/internal/work/buildid.go
+++ b/src/cmd/go/internal/work/buildid.go
@@ -7,7 +7,6 @@ package work
import (
"bytes"
"fmt"
- "io/ioutil"
"os"
"os/exec"
"strings"
@@ -344,7 +343,7 @@ func (b *Builder) gccgoBuildIDFile(a *Action) (string, error) {
}
}
- if err := ioutil.WriteFile(sfile, buf.Bytes(), 0666); err != nil {
+ if err := os.WriteFile(sfile, buf.Bytes(), 0666); err != nil {
return "", err
}
diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
index 6ce56dd6f4..336751df27 100644
--- a/src/cmd/go/internal/work/exec.go
+++ b/src/cmd/go/internal/work/exec.go
@@ -16,7 +16,6 @@ import (
"internal/lazyregexp"
"io"
"io/fs"
- "io/ioutil"
"log"
"math/rand"
"os"
@@ -94,7 +93,7 @@ func (b *Builder) Do(ctx context.Context, root *Action) {
base.Fatalf("go: refusing to write action graph to %v\n", file)
}
js := actionGraphJSON(root)
- if err := ioutil.WriteFile(file, []byte(js), 0666); err != nil {
+ if err := os.WriteFile(file, []byte(js), 0666); err != nil {
fmt.Fprintf(os.Stderr, "go: writing action graph: %v\n", err)
base.SetExitStatus(1)
}
@@ -636,7 +635,7 @@ OverlayLoop:
sfiles, gccfiles = filter(sfiles, sfiles[:0], gccfiles)
} else {
for _, sfile := range sfiles {
- data, err := ioutil.ReadFile(filepath.Join(a.Package.Dir, sfile))
+ data, err := os.ReadFile(filepath.Join(a.Package.Dir, sfile))
if err == nil {
if bytes.HasPrefix(data, []byte("TEXT")) || bytes.Contains(data, []byte("\nTEXT")) ||
bytes.HasPrefix(data, []byte("DATA")) || bytes.Contains(data, []byte("\nDATA")) ||
@@ -1471,7 +1470,7 @@ func (b *Builder) installShlibname(ctx context.Context, a *Action) error {
// TODO: BuildN
a1 := a.Deps[0]
- err := ioutil.WriteFile(a.Target, []byte(filepath.Base(a1.Target)+"\n"), 0666)
+ err := os.WriteFile(a.Target, []byte(filepath.Base(a1.Target)+"\n"), 0666)
if err != nil {
return err
}
@@ -1788,7 +1787,7 @@ func (b *Builder) writeFile(file string, text []byte) error {
if cfg.BuildN {
return nil
}
- return ioutil.WriteFile(file, text, 0666)
+ return os.WriteFile(file, text, 0666)
}
// Install the cgo export header file, if there is one.
@@ -2537,7 +2536,7 @@ func (b *Builder) gccSupportsFlag(compiler []string, flag string) bool {
tmp := os.DevNull
if runtime.GOOS == "windows" {
- f, err := ioutil.TempFile(b.WorkDir, "")
+ f, err := os.CreateTemp(b.WorkDir, "")
if err != nil {
return false
}
@@ -2840,7 +2839,7 @@ func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgo
continue
}
- src, err := ioutil.ReadFile(f)
+ src, err := os.ReadFile(f)
if err != nil {
return nil, nil, err
}
@@ -3070,7 +3069,7 @@ func (b *Builder) swigDoIntSize(objdir string) (intsize string, err error) {
return "$INTBITS", nil
}
src := filepath.Join(b.WorkDir, "swig_intsize.go")
- if err = ioutil.WriteFile(src, []byte(swigIntSizeCode), 0666); err != nil {
+ if err = os.WriteFile(src, []byte(swigIntSizeCode), 0666); err != nil {
return
}
srcs := []string{src}
@@ -3230,7 +3229,7 @@ func passLongArgsInResponseFiles(cmd *exec.Cmd) (cleanup func()) {
return
}
- tf, err := ioutil.TempFile("", "args")
+ tf, err := os.CreateTemp("", "args")
if err != nil {
log.Fatalf("error writing long arguments to response file: %v", err)
}
diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go
index 3a53c714e3..cc4e2b2b2b 100644
--- a/src/cmd/go/internal/work/gc.go
+++ b/src/cmd/go/internal/work/gc.go
@@ -9,7 +9,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"log"
"os"
"path/filepath"
@@ -426,11 +425,11 @@ func toolVerify(a *Action, b *Builder, p *load.Package, newTool string, ofile st
if err := b.run(a, p.Dir, p.ImportPath, nil, newArgs...); err != nil {
return err
}
- data1, err := ioutil.ReadFile(ofile)
+ data1, err := os.ReadFile(ofile)
if err != nil {
return err
}
- data2, err := ioutil.ReadFile(ofile + ".new")
+ data2, err := os.ReadFile(ofile + ".new")
if err != nil {
return err
}
@@ -580,7 +579,7 @@ func pluginPath(a *Action) string {
}
fmt.Fprintf(h, "build ID: %s\n", buildID)
for _, file := range str.StringList(p.GoFiles, p.CgoFiles, p.SFiles) {
- data, err := ioutil.ReadFile(filepath.Join(p.Dir, file))
+ data, err := os.ReadFile(filepath.Join(p.Dir, file))
if err != nil {
base.Fatalf("go: %s", err)
}
diff --git a/src/cmd/go/internal/work/gccgo.go b/src/cmd/go/internal/work/gccgo.go
index 01d2b89159..3ffd01c473 100644
--- a/src/cmd/go/internal/work/gccgo.go
+++ b/src/cmd/go/internal/work/gccgo.go
@@ -6,7 +6,6 @@ package work
import (
"fmt"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -271,7 +270,7 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string
}
readCgoFlags := func(flagsFile string) error {
- flags, err := ioutil.ReadFile(flagsFile)
+ flags, err := os.ReadFile(flagsFile)
if err != nil {
return err
}
diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go
index aee3742f13..dfaa40548e 100644
--- a/src/cmd/go/script_test.go
+++ b/src/cmd/go/script_test.go
@@ -15,7 +15,6 @@ import (
"go/build"
"internal/testenv"
"io/fs"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -220,7 +219,7 @@ func (ts *testScript) run() {
for _, f := range a.Files {
name := ts.mkabs(ts.expand(f.Name, false))
ts.check(os.MkdirAll(filepath.Dir(name), 0777))
- ts.check(ioutil.WriteFile(name, f.Data, 0666))
+ ts.check(os.WriteFile(name, f.Data, 0666))
}
// With -v or -testwork, start log with full environment.
@@ -377,19 +376,19 @@ var (
func isCaseSensitive(t *testing.T) bool {
onceCaseSensitive.Do(func() {
- tmpdir, err := ioutil.TempDir("", "case-sensitive")
+ tmpdir, err := os.MkdirTemp("", "case-sensitive")
if err != nil {
t.Fatal("failed to create directory to determine case-sensitivity:", err)
}
defer os.RemoveAll(tmpdir)
fcap := filepath.Join(tmpdir, "FILE")
- if err := ioutil.WriteFile(fcap, []byte{}, 0644); err != nil {
+ if err := os.WriteFile(fcap, []byte{}, 0644); err != nil {
t.Fatal("error writing file to determine case-sensitivity:", err)
}
flow := filepath.Join(tmpdir, "file")
- _, err = ioutil.ReadFile(flow)
+ _, err = os.ReadFile(flow)
switch {
case err == nil:
caseSensitive = false
@@ -450,9 +449,9 @@ func (ts *testScript) cmdAddcrlf(want simpleStatus, args []string) {
for _, file := range args {
file = ts.mkabs(file)
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
ts.check(err)
- ts.check(ioutil.WriteFile(file, bytes.ReplaceAll(data, []byte("\n"), []byte("\r\n")), 0666))
+ ts.check(os.WriteFile(file, bytes.ReplaceAll(data, []byte("\n"), []byte("\r\n")), 0666))
}
}
@@ -557,12 +556,12 @@ func (ts *testScript) doCmdCmp(args []string, env, quiet bool) {
} else if name1 == "stderr" {
text1 = ts.stderr
} else {
- data, err := ioutil.ReadFile(ts.mkabs(name1))
+ data, err := os.ReadFile(ts.mkabs(name1))
ts.check(err)
text1 = string(data)
}
- data, err := ioutil.ReadFile(ts.mkabs(name2))
+ data, err := os.ReadFile(ts.mkabs(name2))
ts.check(err)
text2 = string(data)
@@ -614,14 +613,14 @@ func (ts *testScript) cmdCp(want simpleStatus, args []string) {
info, err := os.Stat(src)
ts.check(err)
mode = info.Mode() & 0777
- data, err = ioutil.ReadFile(src)
+ data, err = os.ReadFile(src)
ts.check(err)
}
targ := dst
if dstDir {
targ = filepath.Join(dst, filepath.Base(src))
}
- err := ioutil.WriteFile(targ, data, mode)
+ err := os.WriteFile(targ, data, mode)
switch want {
case failure:
if err == nil {
@@ -897,7 +896,7 @@ func scriptMatch(ts *testScript, want simpleStatus, args []string, text, name st
isGrep := name == "grep"
if isGrep {
name = args[1] // for error messages
- data, err := ioutil.ReadFile(ts.mkabs(args[1]))
+ data, err := os.ReadFile(ts.mkabs(args[1]))
ts.check(err)
text = string(data)
}
diff --git a/src/cmd/go/testdata/addmod.go b/src/cmd/go/testdata/addmod.go
index 71ac47fdc1..58376b7ed4 100644
--- a/src/cmd/go/testdata/addmod.go
+++ b/src/cmd/go/testdata/addmod.go
@@ -23,7 +23,6 @@ import (
"flag"
"fmt"
"io/fs"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -58,7 +57,7 @@ func main() {
log.SetFlags(0)
var err error
- tmpdir, err = ioutil.TempDir("", "addmod-")
+ tmpdir, err = os.MkdirTemp("", "addmod-")
if err != nil {
log.Fatal(err)
}
@@ -82,7 +81,7 @@ func main() {
exitCode := 0
for _, arg := range flag.Args() {
- if err := ioutil.WriteFile(filepath.Join(tmpdir, "go.mod"), []byte("module m\n"), 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(tmpdir, "go.mod"), []byte("module m\n"), 0666); err != nil {
fatalf("%v", err)
}
run(goCmd, "get", "-d", arg)
@@ -98,13 +97,13 @@ func main() {
continue
}
path, vers, dir := f[0], f[1], f[2]
- mod, err := ioutil.ReadFile(filepath.Join(gopath, "pkg/mod/cache/download", path, "@v", vers+".mod"))
+ mod, err := os.ReadFile(filepath.Join(gopath, "pkg/mod/cache/download", path, "@v", vers+".mod"))
if err != nil {
log.Printf("%s: %v", arg, err)
exitCode = 1
continue
}
- info, err := ioutil.ReadFile(filepath.Join(gopath, "pkg/mod/cache/download", path, "@v", vers+".info"))
+ info, err := os.ReadFile(filepath.Join(gopath, "pkg/mod/cache/download", path, "@v", vers+".info"))
if err != nil {
log.Printf("%s: %v", arg, err)
exitCode = 1
@@ -128,7 +127,7 @@ func main() {
}
name := info.Name()
if name == "go.mod" || strings.HasSuffix(name, ".go") {
- data, err := ioutil.ReadFile(path)
+ data, err := os.ReadFile(path)
if err != nil {
return err
}
@@ -144,7 +143,7 @@ func main() {
data := txtar.Format(a)
target := filepath.Join("mod", strings.ReplaceAll(path, "/", "_")+"_"+vers+".txt")
- if err := ioutil.WriteFile(target, data, 0666); err != nil {
+ if err := os.WriteFile(target, data, 0666); err != nil {
log.Printf("%s: %v", arg, err)
exitCode = 1
continue
diff --git a/src/cmd/go/testdata/savedir.go b/src/cmd/go/testdata/savedir.go
index 75895ee279..d469c31a91 100644
--- a/src/cmd/go/testdata/savedir.go
+++ b/src/cmd/go/testdata/savedir.go
@@ -18,7 +18,6 @@ import (
"flag"
"fmt"
"io/fs"
- "io/ioutil"
"log"
"os"
"path/filepath"
@@ -63,7 +62,7 @@ func main() {
if !info.Type().IsRegular() {
return nil
}
- data, err := ioutil.ReadFile(path)
+ data, err := os.ReadFile(path)
if err != nil {
log.Fatal(err)
}
diff --git a/src/cmd/go/testdata/script/build_issue6480.txt b/src/cmd/go/testdata/script/build_issue6480.txt
index ae99c60d99..cf1e9ea6c2 100644
--- a/src/cmd/go/testdata/script/build_issue6480.txt
+++ b/src/cmd/go/testdata/script/build_issue6480.txt
@@ -81,7 +81,6 @@ package main
import (
"encoding/json"
"fmt"
- "io/ioutil"
"os"
"time"
)
@@ -100,7 +99,7 @@ func truncateLike(t, p time.Time) time.Time {
func main() {
var t1 time.Time
- b1, err := ioutil.ReadFile(os.Args[1])
+ b1, err := os.ReadFile(os.Args[1])
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
@@ -111,7 +110,7 @@ func main() {
}
var t2 time.Time
- b2, err := ioutil.ReadFile(os.Args[2])
+ b2, err := os.ReadFile(os.Args[2])
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
diff --git a/src/cmd/go/testdata/script/build_trimpath.txt b/src/cmd/go/testdata/script/build_trimpath.txt
index 2c3bee8fdc..e1ea0a48b2 100644
--- a/src/cmd/go/testdata/script/build_trimpath.txt
+++ b/src/cmd/go/testdata/script/build_trimpath.txt
@@ -121,7 +121,6 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -131,7 +130,7 @@ import (
func main() {
exe := os.Args[1]
- data, err := ioutil.ReadFile(exe)
+ data, err := os.ReadFile(exe)
if err != nil {
log.Fatal(err)
}
diff --git a/src/cmd/go/testdata/script/cover_error.txt b/src/cmd/go/testdata/script/cover_error.txt
index 4abdf1137a..583a664237 100644
--- a/src/cmd/go/testdata/script/cover_error.txt
+++ b/src/cmd/go/testdata/script/cover_error.txt
@@ -54,7 +54,6 @@ func Test(t *testing.T) {}
package main
import (
- "io/ioutil"
"log"
"os"
"strings"
@@ -62,13 +61,13 @@ import (
func main() {
log.SetFlags(0)
- b, err := ioutil.ReadFile(os.Args[1])
+ b, err := os.ReadFile(os.Args[1])
if err != nil {
log.Fatal(err)
}
s := strings.ReplaceAll(string(b), "p.go:4:2:", "p.go:4:")
s = strings.ReplaceAll(s, "p1.go:6:2:", "p1.go:6:")
- ioutil.WriteFile(os.Args[1], []byte(s), 0644)
+ os.WriteFile(os.Args[1], []byte(s), 0644)
if err != nil {
log.Fatal(err)
}
diff --git a/src/cmd/go/testdata/script/gopath_moved_repo.txt b/src/cmd/go/testdata/script/gopath_moved_repo.txt
index 869980da7c..99d80bff5d 100644
--- a/src/cmd/go/testdata/script/gopath_moved_repo.txt
+++ b/src/cmd/go/testdata/script/gopath_moved_repo.txt
@@ -45,7 +45,6 @@ package main
import (
"bytes"
- "io/ioutil"
"log"
"os"
)
@@ -57,11 +56,11 @@ func main() {
base := []byte(os.Args[1])
path := os.Args[2]
- data, err := ioutil.ReadFile(path)
+ data, err := os.ReadFile(path)
if err != nil {
log.Fatal(err)
}
- err = ioutil.WriteFile(path, bytes.ReplaceAll(data, base, append(base, "XXX"...)), 0644)
+ err = os.WriteFile(path, bytes.ReplaceAll(data, base, append(base, "XXX"...)), 0644)
if err != nil {
log.Fatal(err)
}
diff --git a/src/cmd/go/testdata/script/mod_download_concurrent_read.txt b/src/cmd/go/testdata/script/mod_download_concurrent_read.txt
index caf105c6e5..231babd0c0 100644
--- a/src/cmd/go/testdata/script/mod_download_concurrent_read.txt
+++ b/src/cmd/go/testdata/script/mod_download_concurrent_read.txt
@@ -25,7 +25,6 @@ package main
import (
"fmt"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -45,7 +44,7 @@ func main() {
// don't need to clean the cache or synchronize closing files after each
// iteration.
func run() (err error) {
- tmpDir, err := ioutil.TempDir("", "")
+ tmpDir, err := os.MkdirTemp("", "")
if err != nil {
return err
}
diff --git a/src/cmd/go/testdata/script/mod_modinfo.txt b/src/cmd/go/testdata/script/mod_modinfo.txt
index d9e9fdec21..8d77e224a5 100644
--- a/src/cmd/go/testdata/script/mod_modinfo.txt
+++ b/src/cmd/go/testdata/script/mod_modinfo.txt
@@ -69,7 +69,6 @@ package main
import (
"bytes"
"encoding/hex"
- "io/ioutil"
"log"
"os"
@@ -77,7 +76,7 @@ import (
)
func main() {
- b, err := ioutil.ReadFile(os.Args[0])
+ b, err := os.ReadFile(os.Args[0])
if err != nil {
log.Fatal(err)
}
diff --git a/src/cmd/go/testdata/script/mod_test_cached.txt b/src/cmd/go/testdata/script/mod_test_cached.txt
index ffd573c02a..3da4358fa1 100644
--- a/src/cmd/go/testdata/script/mod_test_cached.txt
+++ b/src/cmd/go/testdata/script/mod_test_cached.txt
@@ -51,26 +51,25 @@ bar
package foo_test
import (
- "io/ioutil"
"os"
"path/filepath"
"testing"
)
func TestWriteTmp(t *testing.T) {
- dir, err := ioutil.TempDir("", "")
+ dir, err := os.MkdirTemp("", "")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(dir)
- err = ioutil.WriteFile(filepath.Join(dir, "x"), nil, 0666)
+ err = os.WriteFile(filepath.Join(dir, "x"), nil, 0666)
if err != nil {
t.Fatal(err)
}
}
func TestReadTestdata(t *testing.T) {
- _, err := ioutil.ReadFile("testdata/foo.txt")
+ _, err := os.ReadFile("testdata/foo.txt")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/testdata/script/test_compile_tempfile.txt b/src/cmd/go/testdata/script/test_compile_tempfile.txt
index 912410814f..05f721a800 100644
--- a/src/cmd/go/testdata/script/test_compile_tempfile.txt
+++ b/src/cmd/go/testdata/script/test_compile_tempfile.txt
@@ -1,7 +1,7 @@
[short] skip
# Ensure that the target of 'go build -o' can be an existing, empty file so that
-# its name can be reserved using ioutil.TempFile or the 'mktemp` command.
+# its name can be reserved using os.CreateTemp or the 'mktemp` command.
go build -o empty-file$GOEXE main.go
diff --git a/src/cmd/go/testdata/script/test_generated_main.txt b/src/cmd/go/testdata/script/test_generated_main.txt
index 75ffa9cde2..2e991a5797 100644
--- a/src/cmd/go/testdata/script/test_generated_main.txt
+++ b/src/cmd/go/testdata/script/test_generated_main.txt
@@ -12,7 +12,6 @@ package x
import (
"os"
"path/filepath"
- "io/ioutil"
"regexp"
"testing"
)
@@ -23,7 +22,7 @@ func Test(t *testing.T) {
t.Fatal(err)
}
testmainPath := filepath.Join(filepath.Dir(exePath), "_testmain.go")
- source, err := ioutil.ReadFile(testmainPath)
+ source, err := os.ReadFile(testmainPath)
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/go/testdata/script/test_race_install_cgo.txt b/src/cmd/go/testdata/script/test_race_install_cgo.txt
index 82f00f2086..3f4eb90e3f 100644
--- a/src/cmd/go/testdata/script/test_race_install_cgo.txt
+++ b/src/cmd/go/testdata/script/test_race_install_cgo.txt
@@ -29,7 +29,6 @@ go 1.16
package main
import (
- "io/ioutil"
"encoding/json"
"fmt"
"os"
@@ -37,7 +36,7 @@ import (
)
func main() {
- b, err := ioutil.ReadFile(os.Args[1])
+ b, err := os.ReadFile(os.Args[1])
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
@@ -59,7 +58,6 @@ package main
import (
"encoding/json"
"fmt"
- "io/ioutil"
"os"
"time"
)
@@ -67,7 +65,7 @@ import (
func main() {
var t1 time.Time
- b1, err := ioutil.ReadFile(os.Args[1])
+ b1, err := os.ReadFile(os.Args[1])
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
@@ -78,7 +76,7 @@ func main() {
}
var t2 time.Time
- b2, err := ioutil.ReadFile(os.Args[2])
+ b2, err := os.ReadFile(os.Args[2])
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go
index 719c681a3e..2793c2c2a4 100644
--- a/src/cmd/gofmt/gofmt.go
+++ b/src/cmd/gofmt/gofmt.go
@@ -15,7 +15,6 @@ import (
"go/token"
"io"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -137,7 +136,7 @@ func processFile(filename string, in io.Reader, out io.Writer, stdin bool) error
if err != nil {
return err
}
- err = ioutil.WriteFile(filename, res, perm)
+ err = os.WriteFile(filename, res, perm)
if err != nil {
os.Rename(bakname, filename)
return err
@@ -278,7 +277,7 @@ const chmodSupported = runtime.GOOS != "windows"
// the chosen file name.
func backupFile(filename string, data []byte, perm fs.FileMode) (string, error) {
// create backup file
- f, err := ioutil.TempFile(filepath.Dir(filename), filepath.Base(filename))
+ f, err := os.CreateTemp(filepath.Dir(filename), filepath.Base(filename))
if err != nil {
return "", err
}
diff --git a/src/cmd/gofmt/gofmt_test.go b/src/cmd/gofmt/gofmt_test.go
index 98d3eb7eb2..bf2adfe64c 100644
--- a/src/cmd/gofmt/gofmt_test.go
+++ b/src/cmd/gofmt/gofmt_test.go
@@ -7,7 +7,6 @@ package main
import (
"bytes"
"flag"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -93,7 +92,7 @@ func runTest(t *testing.T, in, out string) {
return
}
- expected, err := ioutil.ReadFile(out)
+ expected, err := os.ReadFile(out)
if err != nil {
t.Error(err)
return
@@ -102,7 +101,7 @@ func runTest(t *testing.T, in, out string) {
if got := buf.Bytes(); !bytes.Equal(got, expected) {
if *update {
if in != out {
- if err := ioutil.WriteFile(out, got, 0666); err != nil {
+ if err := os.WriteFile(out, got, 0666); err != nil {
t.Error(err)
}
return
@@ -116,7 +115,7 @@ func runTest(t *testing.T, in, out string) {
if err == nil {
t.Errorf("%s", d)
}
- if err := ioutil.WriteFile(in+".gofmt", got, 0666); err != nil {
+ if err := os.WriteFile(in+".gofmt", got, 0666); err != nil {
t.Error(err)
}
}
@@ -157,7 +156,7 @@ func TestCRLF(t *testing.T) {
const input = "testdata/crlf.input" // must contain CR/LF's
const golden = "testdata/crlf.golden" // must not contain any CR's
- data, err := ioutil.ReadFile(input)
+ data, err := os.ReadFile(input)
if err != nil {
t.Error(err)
}
@@ -165,7 +164,7 @@ func TestCRLF(t *testing.T) {
t.Errorf("%s contains no CR/LF's", input)
}
- data, err = ioutil.ReadFile(golden)
+ data, err = os.ReadFile(golden)
if err != nil {
t.Error(err)
}
@@ -175,7 +174,7 @@ func TestCRLF(t *testing.T) {
}
func TestBackupFile(t *testing.T) {
- dir, err := ioutil.TempDir("", "gofmt_test")
+ dir, err := os.MkdirTemp("", "gofmt_test")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/nm/nm_test.go b/src/cmd/nm/nm_test.go
index 382446e9fe..0d51b07a44 100644
--- a/src/cmd/nm/nm_test.go
+++ b/src/cmd/nm/nm_test.go
@@ -8,7 +8,6 @@ import (
"fmt"
"internal/obscuretestdata"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -31,7 +30,7 @@ func testMain(m *testing.M) int {
return 0
}
- tmpDir, err := ioutil.TempDir("", "TestNM")
+ tmpDir, err := os.MkdirTemp("", "TestNM")
if err != nil {
fmt.Println("TempDir failed:", err)
return 2
@@ -88,7 +87,7 @@ func TestNonGoExecs(t *testing.T) {
func testGoExec(t *testing.T, iscgo, isexternallinker bool) {
t.Parallel()
- tmpdir, err := ioutil.TempDir("", "TestGoExec")
+ tmpdir, err := os.MkdirTemp("", "TestGoExec")
if err != nil {
t.Fatal(err)
}
@@ -222,7 +221,7 @@ func TestGoExec(t *testing.T) {
func testGoLib(t *testing.T, iscgo bool) {
t.Parallel()
- tmpdir, err := ioutil.TempDir("", "TestGoLib")
+ tmpdir, err := os.MkdirTemp("", "TestGoLib")
if err != nil {
t.Fatal(err)
}
@@ -245,7 +244,7 @@ func testGoLib(t *testing.T, iscgo bool) {
err = e
}
if err == nil {
- err = ioutil.WriteFile(filepath.Join(libpath, "go.mod"), []byte("module mylib\n"), 0666)
+ err = os.WriteFile(filepath.Join(libpath, "go.mod"), []byte("module mylib\n"), 0666)
}
if err != nil {
t.Fatal(err)
diff --git a/src/cmd/objdump/objdump_test.go b/src/cmd/objdump/objdump_test.go
index cb692e7a81..edaca774f7 100644
--- a/src/cmd/objdump/objdump_test.go
+++ b/src/cmd/objdump/objdump_test.go
@@ -10,7 +10,6 @@ import (
"fmt"
"go/build"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -39,7 +38,7 @@ func TestMain(m *testing.M) {
func buildObjdump() error {
var err error
- tmp, err = ioutil.TempDir("", "TestObjDump")
+ tmp, err = os.MkdirTemp("", "TestObjDump")
if err != nil {
return fmt.Errorf("TempDir failed: %v", err)
}
@@ -320,7 +319,7 @@ func TestGoobjFileNumber(t *testing.T) {
t.Parallel()
- tmpdir, err := ioutil.TempDir("", "TestGoobjFileNumber")
+ tmpdir, err := os.MkdirTemp("", "TestGoobjFileNumber")
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/pack/pack_test.go b/src/cmd/pack/pack_test.go
index 9f65705def..218c7acda6 100644
--- a/src/cmd/pack/pack_test.go
+++ b/src/cmd/pack/pack_test.go
@@ -12,7 +12,6 @@ import (
"internal/testenv"
"io"
"io/fs"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -22,7 +21,7 @@ import (
// tmpDir creates a temporary directory and returns its name.
func tmpDir(t *testing.T) string {
- name, err := ioutil.TempDir("", "pack")
+ name, err := os.MkdirTemp("", "pack")
if err != nil {
t.Fatal(err)
}
@@ -158,7 +157,7 @@ func TestExtract(t *testing.T) {
ar = openArchive(name, os.O_RDONLY, []string{goodbyeFile.name})
ar.scan(ar.extractContents)
ar.a.File().Close()
- data, err := ioutil.ReadFile(goodbyeFile.name)
+ data, err := os.ReadFile(goodbyeFile.name)
if err != nil {
t.Fatal(err)
}
@@ -183,7 +182,7 @@ func TestHello(t *testing.T) {
println("hello world")
}
`
- err := ioutil.WriteFile(hello, []byte(prog), 0666)
+ err := os.WriteFile(hello, []byte(prog), 0666)
if err != nil {
t.Fatal(err)
}
@@ -251,7 +250,7 @@ func TestLargeDefs(t *testing.T) {
println("ok")
}
`
- err = ioutil.WriteFile(main, []byte(prog), 0666)
+ err = os.WriteFile(main, []byte(prog), 0666)
if err != nil {
t.Fatal(err)
}
@@ -281,13 +280,13 @@ func TestIssue21703(t *testing.T) {
defer os.RemoveAll(dir)
const aSrc = `package a; const X = "\n!\n"`
- err := ioutil.WriteFile(filepath.Join(dir, "a.go"), []byte(aSrc), 0666)
+ err := os.WriteFile(filepath.Join(dir, "a.go"), []byte(aSrc), 0666)
if err != nil {
t.Fatal(err)
}
const bSrc = `package b; import _ "a"`
- err = ioutil.WriteFile(filepath.Join(dir, "b.go"), []byte(bSrc), 0666)
+ err = os.WriteFile(filepath.Join(dir, "b.go"), []byte(bSrc), 0666)
if err != nil {
t.Fatal(err)
}
diff --git a/src/cmd/trace/annotations_test.go b/src/cmd/trace/annotations_test.go
index a9068d53c1..9c2d027366 100644
--- a/src/cmd/trace/annotations_test.go
+++ b/src/cmd/trace/annotations_test.go
@@ -12,7 +12,7 @@ import (
"flag"
"fmt"
traceparser "internal/trace"
- "io/ioutil"
+ "os"
"reflect"
"runtime/debug"
"runtime/trace"
@@ -386,7 +386,7 @@ func saveTrace(buf *bytes.Buffer, name string) {
if !*saveTraces {
return
}
- if err := ioutil.WriteFile(name+".trace", buf.Bytes(), 0600); err != nil {
+ if err := os.WriteFile(name+".trace", buf.Bytes(), 0600); err != nil {
panic(fmt.Errorf("failed to write trace file: %v", err))
}
}
diff --git a/src/cmd/trace/pprof.go b/src/cmd/trace/pprof.go
index a31d71b013..a73ff5336a 100644
--- a/src/cmd/trace/pprof.go
+++ b/src/cmd/trace/pprof.go
@@ -11,7 +11,6 @@ import (
"fmt"
"internal/trace"
"io"
- "io/ioutil"
"net/http"
"os"
"os/exec"
@@ -294,7 +293,7 @@ func serveSVGProfile(prof func(w io.Writer, r *http.Request) error) http.Handler
return
}
- blockf, err := ioutil.TempFile("", "block")
+ blockf, err := os.CreateTemp("", "block")
if err != nil {
http.Error(w, fmt.Sprintf("failed to create temp file: %v", err), http.StatusInternalServerError)
return
diff --git a/src/cmd/vet/vet_test.go b/src/cmd/vet/vet_test.go
index 5d8139d977..d15d1ce377 100644
--- a/src/cmd/vet/vet_test.go
+++ b/src/cmd/vet/vet_test.go
@@ -9,7 +9,6 @@ import (
"errors"
"fmt"
"internal/testenv"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -32,7 +31,7 @@ func TestMain(m *testing.M) {
}
func testMain(m *testing.M) int {
- dir, err := ioutil.TempDir("", "vet_test")
+ dir, err := os.MkdirTemp("", "vet_test")
if err != nil {
fmt.Fprintln(os.Stderr, err)
return 1
@@ -345,7 +344,7 @@ var (
func wantedErrors(file, short string) (errs []wantedError) {
cache := make(map[string]*regexp.Regexp)
- src, err := ioutil.ReadFile(file)
+ src, err := os.ReadFile(file)
if err != nil {
log.Fatal(err)
}
diff --git a/src/compress/bzip2/bzip2_test.go b/src/compress/bzip2/bzip2_test.go
index 98477791b3..e6065cb43f 100644
--- a/src/compress/bzip2/bzip2_test.go
+++ b/src/compress/bzip2/bzip2_test.go
@@ -9,7 +9,7 @@ import (
"encoding/hex"
"fmt"
"io"
- "io/ioutil"
+ "os"
"testing"
)
@@ -22,7 +22,7 @@ func mustDecodeHex(s string) []byte {
}
func mustLoadFile(f string) []byte {
- b, err := ioutil.ReadFile(f)
+ b, err := os.ReadFile(f)
if err != nil {
panic(err)
}
diff --git a/src/compress/flate/deflate_test.go b/src/compress/flate/deflate_test.go
index 6fc5abf4d5..ff56712123 100644
--- a/src/compress/flate/deflate_test.go
+++ b/src/compress/flate/deflate_test.go
@@ -10,8 +10,8 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"math/rand"
+ "os"
"reflect"
"runtime/debug"
"sync"
@@ -387,7 +387,7 @@ func TestDeflateInflateString(t *testing.T) {
t.Skip("skipping in short mode")
}
for _, test := range deflateInflateStringTests {
- gold, err := ioutil.ReadFile(test.filename)
+ gold, err := os.ReadFile(test.filename)
if err != nil {
t.Error(err)
}
@@ -685,7 +685,7 @@ func (w *failWriter) Write(b []byte) (int, error) {
func TestWriterPersistentError(t *testing.T) {
t.Parallel()
- d, err := ioutil.ReadFile("../../testdata/Isaac.Newton-Opticks.txt")
+ d, err := os.ReadFile("../../testdata/Isaac.Newton-Opticks.txt")
if err != nil {
t.Fatalf("ReadFile: %v", err)
}
diff --git a/src/compress/flate/huffman_bit_writer_test.go b/src/compress/flate/huffman_bit_writer_test.go
index 882d3abec1..a57799cae0 100644
--- a/src/compress/flate/huffman_bit_writer_test.go
+++ b/src/compress/flate/huffman_bit_writer_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"flag"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"strings"
@@ -38,7 +37,7 @@ func TestBlockHuff(t *testing.T) {
}
func testBlockHuff(t *testing.T, in, out string) {
- all, err := ioutil.ReadFile(in)
+ all, err := os.ReadFile(in)
if err != nil {
t.Error(err)
return
@@ -49,7 +48,7 @@ func testBlockHuff(t *testing.T, in, out string) {
bw.flush()
got := buf.Bytes()
- want, err := ioutil.ReadFile(out)
+ want, err := os.ReadFile(out)
if err != nil && !*update {
t.Error(err)
return
@@ -60,7 +59,7 @@ func testBlockHuff(t *testing.T, in, out string) {
if *update {
if in != out {
t.Logf("Updating %q", out)
- if err := ioutil.WriteFile(out, got, 0666); err != nil {
+ if err := os.WriteFile(out, got, 0666); err != nil {
t.Error(err)
}
return
@@ -70,7 +69,7 @@ func testBlockHuff(t *testing.T, in, out string) {
}
t.Errorf("%q != %q (see %q)", in, out, in+".got")
- if err := ioutil.WriteFile(in+".got", got, 0666); err != nil {
+ if err := os.WriteFile(in+".got", got, 0666); err != nil {
t.Error(err)
}
return
@@ -85,7 +84,7 @@ func testBlockHuff(t *testing.T, in, out string) {
got = buf.Bytes()
if !bytes.Equal(got, want) {
t.Errorf("after reset %q != %q (see %q)", in, out, in+".reset.got")
- if err := ioutil.WriteFile(in+".reset.got", got, 0666); err != nil {
+ if err := os.WriteFile(in+".reset.got", got, 0666); err != nil {
t.Error(err)
}
return
@@ -186,7 +185,7 @@ func testBlock(t *testing.T, test huffTest, ttype string) {
if *update {
if test.input != "" {
t.Logf("Updating %q", test.want)
- input, err := ioutil.ReadFile(test.input)
+ input, err := os.ReadFile(test.input)
if err != nil {
t.Error(err)
return
@@ -216,12 +215,12 @@ func testBlock(t *testing.T, test huffTest, ttype string) {
if test.input != "" {
t.Logf("Testing %q", test.want)
- input, err := ioutil.ReadFile(test.input)
+ input, err := os.ReadFile(test.input)
if err != nil {
t.Error(err)
return
}
- want, err := ioutil.ReadFile(test.want)
+ want, err := os.ReadFile(test.want)
if err != nil {
t.Error(err)
return
@@ -233,7 +232,7 @@ func testBlock(t *testing.T, test huffTest, ttype string) {
got := buf.Bytes()
if !bytes.Equal(got, want) {
t.Errorf("writeBlock did not yield expected result for file %q with input. See %q", test.want, test.want+".got")
- if err := ioutil.WriteFile(test.want+".got", got, 0666); err != nil {
+ if err := os.WriteFile(test.want+".got", got, 0666); err != nil {
t.Error(err)
}
}
@@ -247,7 +246,7 @@ func testBlock(t *testing.T, test huffTest, ttype string) {
got = buf.Bytes()
if !bytes.Equal(got, want) {
t.Errorf("reset: writeBlock did not yield expected result for file %q with input. See %q", test.want, test.want+".reset.got")
- if err := ioutil.WriteFile(test.want+".reset.got", got, 0666); err != nil {
+ if err := os.WriteFile(test.want+".reset.got", got, 0666); err != nil {
t.Error(err)
}
return
@@ -256,7 +255,7 @@ func testBlock(t *testing.T, test huffTest, ttype string) {
testWriterEOF(t, "wb", test, true)
}
t.Logf("Testing %q", test.wantNoInput)
- wantNI, err := ioutil.ReadFile(test.wantNoInput)
+ wantNI, err := os.ReadFile(test.wantNoInput)
if err != nil {
t.Error(err)
return
@@ -268,7 +267,7 @@ func testBlock(t *testing.T, test huffTest, ttype string) {
got := buf.Bytes()
if !bytes.Equal(got, wantNI) {
t.Errorf("writeBlock did not yield expected result for file %q with input. See %q", test.wantNoInput, test.wantNoInput+".got")
- if err := ioutil.WriteFile(test.want+".got", got, 0666); err != nil {
+ if err := os.WriteFile(test.want+".got", got, 0666); err != nil {
t.Error(err)
}
} else if got[0]&1 == 1 {
@@ -286,7 +285,7 @@ func testBlock(t *testing.T, test huffTest, ttype string) {
got = buf.Bytes()
if !bytes.Equal(got, wantNI) {
t.Errorf("reset: writeBlock did not yield expected result for file %q without input. See %q", test.want, test.want+".reset.got")
- if err := ioutil.WriteFile(test.want+".reset.got", got, 0666); err != nil {
+ if err := os.WriteFile(test.want+".reset.got", got, 0666); err != nil {
t.Error(err)
}
return
@@ -325,7 +324,7 @@ func testWriterEOF(t *testing.T, ttype string, test huffTest, useInput bool) {
var input []byte
if useInput {
var err error
- input, err = ioutil.ReadFile(test.input)
+ input, err = os.ReadFile(test.input)
if err != nil {
t.Error(err)
return
diff --git a/src/compress/flate/reader_test.go b/src/compress/flate/reader_test.go
index eb32c89184..94610fbb78 100644
--- a/src/compress/flate/reader_test.go
+++ b/src/compress/flate/reader_test.go
@@ -7,7 +7,7 @@ package flate
import (
"bytes"
"io"
- "io/ioutil"
+ "os"
"runtime"
"strings"
"testing"
@@ -80,7 +80,7 @@ var sizes = []struct {
func doBench(b *testing.B, f func(b *testing.B, buf []byte, level, n int)) {
for _, suite := range suites {
- buf, err := ioutil.ReadFile(suite.file)
+ buf, err := os.ReadFile(suite.file)
if err != nil {
b.Fatal(err)
}
diff --git a/src/compress/lzw/reader_test.go b/src/compress/lzw/reader_test.go
index 6d91dd806f..d1eb76d042 100644
--- a/src/compress/lzw/reader_test.go
+++ b/src/compress/lzw/reader_test.go
@@ -8,8 +8,8 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"math"
+ "os"
"runtime"
"strconv"
"strings"
@@ -218,7 +218,7 @@ func TestNoLongerSavingPriorExpansions(t *testing.T) {
}
func BenchmarkDecoder(b *testing.B) {
- buf, err := ioutil.ReadFile("../testdata/e.txt")
+ buf, err := os.ReadFile("../testdata/e.txt")
if err != nil {
b.Fatal(err)
}
diff --git a/src/compress/lzw/writer_test.go b/src/compress/lzw/writer_test.go
index 33a28bdd3a..1a5dbcae93 100644
--- a/src/compress/lzw/writer_test.go
+++ b/src/compress/lzw/writer_test.go
@@ -8,7 +8,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"math"
"os"
"runtime"
@@ -125,7 +124,7 @@ func TestSmallLitWidth(t *testing.T) {
}
func BenchmarkEncoder(b *testing.B) {
- buf, err := ioutil.ReadFile("../testdata/e.txt")
+ buf, err := os.ReadFile("../testdata/e.txt")
if err != nil {
b.Fatal(err)
}
diff --git a/src/compress/zlib/writer_test.go b/src/compress/zlib/writer_test.go
index c518729146..f0b38880a6 100644
--- a/src/compress/zlib/writer_test.go
+++ b/src/compress/zlib/writer_test.go
@@ -9,7 +9,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"testing"
)
@@ -95,7 +94,7 @@ func testFileLevelDictReset(t *testing.T, fn string, level int, dict []byte) {
var b0 []byte
var err error
if fn != "" {
- b0, err = ioutil.ReadFile(fn)
+ b0, err = os.ReadFile(fn)
if err != nil {
t.Errorf("%s (level=%d): %v", fn, level, err)
return
diff --git a/src/crypto/md5/gen.go b/src/crypto/md5/gen.go
index a11f22059f..1468924cbc 100644
--- a/src/crypto/md5/gen.go
+++ b/src/crypto/md5/gen.go
@@ -15,8 +15,8 @@ import (
"bytes"
"flag"
"go/format"
- "io/ioutil"
"log"
+ "os"
"strings"
"text/template"
)
@@ -37,7 +37,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
- err = ioutil.WriteFile(*filename, data, 0644)
+ err = os.WriteFile(*filename, data, 0644)
if err != nil {
log.Fatal(err)
}
diff --git a/src/crypto/tls/handshake_test.go b/src/crypto/tls/handshake_test.go
index 605be587b5..d9ff9fe948 100644
--- a/src/crypto/tls/handshake_test.go
+++ b/src/crypto/tls/handshake_test.go
@@ -13,7 +13,6 @@ import (
"flag"
"fmt"
"io"
- "io/ioutil"
"net"
"os"
"os/exec"
@@ -224,7 +223,7 @@ func parseTestData(r io.Reader) (flows [][]byte, err error) {
// tempFile creates a temp file containing contents and returns its path.
func tempFile(contents string) string {
- file, err := ioutil.TempFile("", "go-tls-test")
+ file, err := os.CreateTemp("", "go-tls-test")
if err != nil {
panic("failed to create temp file: " + err.Error())
}
diff --git a/src/crypto/tls/link_test.go b/src/crypto/tls/link_test.go
index 8224216b5c..8c392ff7c4 100644
--- a/src/crypto/tls/link_test.go
+++ b/src/crypto/tls/link_test.go
@@ -7,7 +7,6 @@ package tls
import (
"bytes"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -77,7 +76,7 @@ func main() { tls.Dial("", "", nil) }
exeFile := filepath.Join(tmpDir, "x.exe")
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- if err := ioutil.WriteFile(goFile, []byte(tt.program), 0644); err != nil {
+ if err := os.WriteFile(goFile, []byte(tt.program), 0644); err != nil {
t.Fatal(err)
}
os.Remove(exeFile)
diff --git a/src/crypto/tls/tls.go b/src/crypto/tls/tls.go
index bf577cadea..19884f96e7 100644
--- a/src/crypto/tls/tls.go
+++ b/src/crypto/tls/tls.go
@@ -22,8 +22,8 @@ import (
"encoding/pem"
"errors"
"fmt"
- "io/ioutil"
"net"
+ "os"
"strings"
)
@@ -222,11 +222,11 @@ func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Con
// form a certificate chain. On successful return, Certificate.Leaf will
// be nil because the parsed form of the certificate is not retained.
func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) {
- certPEMBlock, err := ioutil.ReadFile(certFile)
+ certPEMBlock, err := os.ReadFile(certFile)
if err != nil {
return Certificate{}, err
}
- keyPEMBlock, err := ioutil.ReadFile(keyFile)
+ keyPEMBlock, err := os.ReadFile(keyFile)
if err != nil {
return Certificate{}, err
}
diff --git a/src/crypto/x509/name_constraints_test.go b/src/crypto/x509/name_constraints_test.go
index 34055d07b5..3826c82c38 100644
--- a/src/crypto/x509/name_constraints_test.go
+++ b/src/crypto/x509/name_constraints_test.go
@@ -14,7 +14,6 @@ import (
"encoding/hex"
"encoding/pem"
"fmt"
- "io/ioutil"
"math/big"
"net"
"net/url"
@@ -2005,7 +2004,7 @@ func TestConstraintCases(t *testing.T) {
}
func writePEMsToTempFile(certs []*Certificate) *os.File {
- file, err := ioutil.TempFile("", "name_constraints_test")
+ file, err := os.CreateTemp("", "name_constraints_test")
if err != nil {
panic("cannot create tempfile")
}
diff --git a/src/crypto/x509/root_ios_gen.go b/src/crypto/x509/root_ios_gen.go
index 2bcdab1a77..8bc6e7d9c4 100644
--- a/src/crypto/x509/root_ios_gen.go
+++ b/src/crypto/x509/root_ios_gen.go
@@ -27,9 +27,9 @@ import (
"fmt"
"go/format"
"io"
- "io/ioutil"
"log"
"net/http"
+ "os"
"path"
"sort"
"strings"
@@ -155,7 +155,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
- if err := ioutil.WriteFile(*output, source, 0644); err != nil {
+ if err := os.WriteFile(*output, source, 0644); err != nil {
log.Fatal(err)
}
}
diff --git a/src/crypto/x509/root_plan9.go b/src/crypto/x509/root_plan9.go
index 09f0e23033..2dc4aaf5d7 100644
--- a/src/crypto/x509/root_plan9.go
+++ b/src/crypto/x509/root_plan9.go
@@ -7,7 +7,6 @@
package x509
import (
- "io/ioutil"
"os"
)
@@ -24,7 +23,7 @@ func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
var bestErr error
for _, file := range certFiles {
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err == nil {
roots.AppendCertsFromPEM(data)
return roots, nil
diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go
index 1090b69f83..3c643466ed 100644
--- a/src/crypto/x509/root_unix.go
+++ b/src/crypto/x509/root_unix.go
@@ -40,7 +40,7 @@ func loadSystemRoots() (*CertPool, error) {
var firstErr error
for _, file := range files {
- data, err := ioutil.ReadFile(file)
+ data, err := os.ReadFile(file)
if err == nil {
roots.AppendCertsFromPEM(data)
break
@@ -68,7 +68,7 @@ func loadSystemRoots() (*CertPool, error) {
continue
}
for _, fi := range fis {
- data, err := ioutil.ReadFile(directory + "/" + fi.Name())
+ data, err := os.ReadFile(directory + "/" + fi.Name())
if err == nil {
roots.AppendCertsFromPEM(data)
}
diff --git a/src/crypto/x509/root_unix_test.go b/src/crypto/x509/root_unix_test.go
index b2e832ff36..878ed7c2fa 100644
--- a/src/crypto/x509/root_unix_test.go
+++ b/src/crypto/x509/root_unix_test.go
@@ -9,7 +9,6 @@ package x509
import (
"bytes"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"reflect"
@@ -147,7 +146,7 @@ func TestLoadSystemCertsLoadColonSeparatedDirs(t *testing.T) {
os.Setenv(certFileEnv, origFile)
}()
- tmpDir, err := ioutil.TempDir(os.TempDir(), "x509-issue35325")
+ tmpDir, err := os.MkdirTemp(os.TempDir(), "x509-issue35325")
if err != nil {
t.Fatalf("Failed to create temporary directory: %v", err)
}
@@ -166,7 +165,7 @@ func TestLoadSystemCertsLoadColonSeparatedDirs(t *testing.T) {
t.Fatalf("Failed to create certificate dir: %v", err)
}
certOutFile := filepath.Join(certDir, "cert.crt")
- if err := ioutil.WriteFile(certOutFile, []byte(certPEM), 0655); err != nil {
+ if err := os.WriteFile(certOutFile, []byte(certPEM), 0655); err != nil {
t.Fatalf("Failed to write certificate to file: %v", err)
}
certDirs = append(certDirs, certDir)
diff --git a/src/debug/dwarf/dwarf5ranges_test.go b/src/debug/dwarf/dwarf5ranges_test.go
index 2229d439a5..0ff1a55bc9 100644
--- a/src/debug/dwarf/dwarf5ranges_test.go
+++ b/src/debug/dwarf/dwarf5ranges_test.go
@@ -6,13 +6,13 @@ package dwarf
import (
"encoding/binary"
- "io/ioutil"
+ "os"
"reflect"
"testing"
)
func TestDwarf5Ranges(t *testing.T) {
- rngLists, err := ioutil.ReadFile("testdata/debug_rnglists")
+ rngLists, err := os.ReadFile("testdata/debug_rnglists")
if err != nil {
t.Fatalf("could not read test data: %v", err)
}
diff --git a/src/debug/gosym/pclntab_test.go b/src/debug/gosym/pclntab_test.go
index f93a5bf5e5..7347139b5d 100644
--- a/src/debug/gosym/pclntab_test.go
+++ b/src/debug/gosym/pclntab_test.go
@@ -10,7 +10,6 @@ import (
"debug/elf"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -31,7 +30,7 @@ func dotest(t *testing.T) {
t.Skipf("skipping on non-AMD64 system %s", runtime.GOARCH)
}
var err error
- pclineTempDir, err = ioutil.TempDir("", "pclinetest")
+ pclineTempDir, err = os.MkdirTemp("", "pclinetest")
if err != nil {
t.Fatal(err)
}
@@ -278,7 +277,7 @@ func TestPCLine(t *testing.T) {
// }
// [END]
func Test115PclnParsing(t *testing.T) {
- zippedDat, err := ioutil.ReadFile("testdata/pcln115.gz")
+ zippedDat, err := os.ReadFile("testdata/pcln115.gz")
if err != nil {
t.Fatal(err)
}
diff --git a/src/debug/pe/file_test.go b/src/debug/pe/file_test.go
index d96cd30904..58deff1450 100644
--- a/src/debug/pe/file_test.go
+++ b/src/debug/pe/file_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"debug/dwarf"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -354,7 +353,7 @@ func testDWARF(t *testing.T, linktype int) {
}
testenv.MustHaveGoRun(t)
- tmpdir, err := ioutil.TempDir("", "TestDWARF")
+ tmpdir, err := os.MkdirTemp("", "TestDWARF")
if err != nil {
t.Fatal(err)
}
@@ -473,7 +472,7 @@ func TestBSSHasZeros(t *testing.T) {
t.Skip("skipping test: gcc is missing")
}
- tmpdir, err := ioutil.TempDir("", "TestBSSHasZeros")
+ tmpdir, err := os.MkdirTemp("", "TestBSSHasZeros")
if err != nil {
t.Fatal(err)
}
@@ -492,7 +491,7 @@ main(void)
return 0;
}
`
- err = ioutil.WriteFile(srcpath, []byte(src), 0644)
+ err = os.WriteFile(srcpath, []byte(src), 0644)
if err != nil {
t.Fatal(err)
}
@@ -597,14 +596,14 @@ func TestBuildingWindowsGUI(t *testing.T) {
if runtime.GOOS != "windows" {
t.Skip("skipping windows only test")
}
- tmpdir, err := ioutil.TempDir("", "TestBuildingWindowsGUI")
+ tmpdir, err := os.MkdirTemp("", "TestBuildingWindowsGUI")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmpdir)
src := filepath.Join(tmpdir, "a.go")
- err = ioutil.WriteFile(src, []byte(`package main; func main() {}`), 0644)
+ err = os.WriteFile(src, []byte(`package main; func main() {}`), 0644)
if err != nil {
t.Fatal(err)
}
@@ -684,7 +683,7 @@ func TestInvalidOptionalHeaderMagic(t *testing.T) {
func TestImportedSymbolsNoPanicMissingOptionalHeader(t *testing.T) {
// https://golang.org/issue/30250
// ImportedSymbols shouldn't panic if optional headers is missing
- data, err := ioutil.ReadFile("testdata/gcc-amd64-mingw-obj")
+ data, err := os.ReadFile("testdata/gcc-amd64-mingw-obj")
if err != nil {
t.Fatal(err)
}
diff --git a/src/embed/internal/embedtest/embedx_test.go b/src/embed/internal/embedtest/embedx_test.go
index 53d45488f1..20d5a28c11 100644
--- a/src/embed/internal/embedtest/embedx_test.go
+++ b/src/embed/internal/embedtest/embedx_test.go
@@ -6,7 +6,7 @@ package embedtest_test
import (
"embed"
- "io/ioutil"
+ "os"
"testing"
)
@@ -59,7 +59,7 @@ func TestXGlobal(t *testing.T) {
testString(t, concurrency2, "concurrency2", "Concurrency is not parallelism.\n")
testString(t, string(glass2), "glass2", "I can eat glass and it doesn't hurt me.\n")
- big, err := ioutil.ReadFile("testdata/ascii.txt")
+ big, err := os.ReadFile("testdata/ascii.txt")
if err != nil {
t.Fatal(err)
}
diff --git a/src/go/build/build_test.go b/src/go/build/build_test.go
index 5a4a2d62f5..5a3e9ee714 100644
--- a/src/go/build/build_test.go
+++ b/src/go/build/build_test.go
@@ -8,7 +8,6 @@ import (
"flag"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"path/filepath"
"reflect"
@@ -454,7 +453,7 @@ func TestImportDirNotExist(t *testing.T) {
testenv.MustHaveGoBuild(t) // really must just have source
ctxt := Default
- emptyDir, err := ioutil.TempDir("", t.Name())
+ emptyDir, err := os.MkdirTemp("", t.Name())
if err != nil {
t.Fatal(err)
}
@@ -592,7 +591,7 @@ func TestImportPackageOutsideModule(t *testing.T) {
// Create a GOPATH in a temporary directory. We don't use testdata
// because it's in GOROOT, which interferes with the module heuristic.
- gopath, err := ioutil.TempDir("", "gobuild-notmodule")
+ gopath, err := os.MkdirTemp("", "gobuild-notmodule")
if err != nil {
t.Fatal(err)
}
@@ -600,7 +599,7 @@ func TestImportPackageOutsideModule(t *testing.T) {
if err := os.MkdirAll(filepath.Join(gopath, "src/example.com/p"), 0777); err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(filepath.Join(gopath, "src/example.com/p/p.go"), []byte("package p"), 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(gopath, "src/example.com/p/p.go"), []byte("package p"), 0666); err != nil {
t.Fatal(err)
}
@@ -656,12 +655,12 @@ func TestIssue23594(t *testing.T) {
// Verifies golang.org/issue/34752.
func TestMissingImportErrorRepetition(t *testing.T) {
testenv.MustHaveGoBuild(t) // need 'go list' internally
- tmp, err := ioutil.TempDir("", "")
+ tmp, err := os.MkdirTemp("", "")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmp)
- if err := ioutil.WriteFile(filepath.Join(tmp, "go.mod"), []byte("module m"), 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(tmp, "go.mod"), []byte("module m"), 0666); err != nil {
t.Fatal(err)
}
defer os.Setenv("GO111MODULE", os.Getenv("GO111MODULE"))
diff --git a/src/go/doc/doc_test.go b/src/go/doc/doc_test.go
index ab98bed62b..cbdca62aa1 100644
--- a/src/go/doc/doc_test.go
+++ b/src/go/doc/doc_test.go
@@ -13,7 +13,7 @@ import (
"go/printer"
"go/token"
"io/fs"
- "io/ioutil"
+ "os"
"path/filepath"
"regexp"
"strings"
@@ -127,7 +127,7 @@ func test(t *testing.T, mode Mode) {
// update golden file if necessary
golden := filepath.Join(dataDir, fmt.Sprintf("%s.%d.golden", pkg.Name, mode))
if *update {
- err := ioutil.WriteFile(golden, got, 0644)
+ err := os.WriteFile(golden, got, 0644)
if err != nil {
t.Error(err)
}
@@ -135,7 +135,7 @@ func test(t *testing.T, mode Mode) {
}
// get golden file
- want, err := ioutil.ReadFile(golden)
+ want, err := os.ReadFile(golden)
if err != nil {
t.Error(err)
continue
diff --git a/src/go/format/benchmark_test.go b/src/go/format/benchmark_test.go
index 7bd45c0e95..ac19aa3bf5 100644
--- a/src/go/format/benchmark_test.go
+++ b/src/go/format/benchmark_test.go
@@ -12,7 +12,7 @@ import (
"flag"
"fmt"
"go/format"
- "io/ioutil"
+ "os"
"testing"
)
@@ -67,7 +67,7 @@ func BenchmarkFormat(b *testing.B) {
if *debug {
filename := t.name + ".src"
- err := ioutil.WriteFile(filename, data, 0660)
+ err := os.WriteFile(filename, data, 0660)
if err != nil {
b.Fatalf("couldn't write %s: %v", filename, err)
}
diff --git a/src/go/format/format_test.go b/src/go/format/format_test.go
index 58e088ede3..27f4c74cdf 100644
--- a/src/go/format/format_test.go
+++ b/src/go/format/format_test.go
@@ -9,7 +9,7 @@ import (
"go/ast"
"go/parser"
"go/token"
- "io/ioutil"
+ "os"
"strings"
"testing"
)
@@ -38,7 +38,7 @@ func diff(t *testing.T, dst, src []byte) {
}
func TestNode(t *testing.T) {
- src, err := ioutil.ReadFile(testfile)
+ src, err := os.ReadFile(testfile)
if err != nil {
t.Fatal(err)
}
@@ -96,7 +96,7 @@ func TestNodeNoModify(t *testing.T) {
}
func TestSource(t *testing.T) {
- src, err := ioutil.ReadFile(testfile)
+ src, err := os.ReadFile(testfile)
if err != nil {
t.Fatal(err)
}
diff --git a/src/go/importer/importer_test.go b/src/go/importer/importer_test.go
index ff6e12c0da..0f5121d802 100644
--- a/src/go/importer/importer_test.go
+++ b/src/go/importer/importer_test.go
@@ -8,7 +8,6 @@ import (
"go/token"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"os/exec"
"runtime"
@@ -52,7 +51,7 @@ func TestForCompiler(t *testing.T) {
mathBigInt := pkg.Scope().Lookup("Int")
posn := fset.Position(mathBigInt.Pos()) // "$GOROOT/src/math/big/int.go:25:1"
filename := strings.Replace(posn.Filename, "$GOROOT", runtime.GOROOT(), 1)
- data, err := ioutil.ReadFile(filename)
+ data, err := os.ReadFile(filename)
if err != nil {
t.Fatalf("can't read file containing declaration of math/big.Int: %v", err)
}
diff --git a/src/go/internal/gccgoimporter/importer_test.go b/src/go/internal/gccgoimporter/importer_test.go
index e4236a5867..35240c8fe6 100644
--- a/src/go/internal/gccgoimporter/importer_test.go
+++ b/src/go/internal/gccgoimporter/importer_test.go
@@ -7,7 +7,6 @@ package gccgoimporter
import (
"go/types"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -150,7 +149,7 @@ func TestObjImporter(t *testing.T) {
}
t.Logf("gccgo version %d.%d", major, minor)
- tmpdir, err := ioutil.TempDir("", "TestObjImporter")
+ tmpdir, err := os.MkdirTemp("", "TestObjImporter")
if err != nil {
t.Fatal(err)
}
@@ -159,7 +158,7 @@ func TestObjImporter(t *testing.T) {
initmap := make(map[*types.Package]InitData)
imp := GetImporter([]string{tmpdir}, initmap)
- artmpdir, err := ioutil.TempDir("", "TestObjImporter")
+ artmpdir, err := os.MkdirTemp("", "TestObjImporter")
if err != nil {
t.Fatal(err)
}
diff --git a/src/go/internal/gcimporter/gcimporter_test.go b/src/go/internal/gcimporter/gcimporter_test.go
index 663753a18a..8991e3bdee 100644
--- a/src/go/internal/gcimporter/gcimporter_test.go
+++ b/src/go/internal/gcimporter/gcimporter_test.go
@@ -94,7 +94,7 @@ func testDir(t *testing.T, dir string, endTime time.Time) (nimports int) {
}
func mktmpdir(t *testing.T) string {
- tmpdir, err := ioutil.TempDir("", "gcimporter_test")
+ tmpdir, err := os.MkdirTemp("", "gcimporter_test")
if err != nil {
t.Fatal("mktmpdir:", err)
}
@@ -199,7 +199,7 @@ func TestVersionHandling(t *testing.T) {
// create file with corrupted export data
// 1) read file
- data, err := ioutil.ReadFile(filepath.Join(dir, name))
+ data, err := os.ReadFile(filepath.Join(dir, name))
if err != nil {
t.Fatal(err)
}
@@ -216,7 +216,7 @@ func TestVersionHandling(t *testing.T) {
// 4) write the file
pkgpath += "_corrupted"
filename := filepath.Join(corruptdir, pkgpath) + ".a"
- ioutil.WriteFile(filename, data, 0666)
+ os.WriteFile(filename, data, 0666)
// test that importing the corrupted file results in an error
_, err = Import(fset, make(map[string]*types.Package), pkgpath, corruptdir, nil)
diff --git a/src/go/internal/srcimporter/srcimporter.go b/src/go/internal/srcimporter/srcimporter.go
index 90bb3a9bc1..c4d501dcd9 100644
--- a/src/go/internal/srcimporter/srcimporter.go
+++ b/src/go/internal/srcimporter/srcimporter.go
@@ -14,7 +14,6 @@ import (
"go/token"
"go/types"
"io"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -200,7 +199,7 @@ func (p *Importer) parseFiles(dir string, filenames []string) ([]*ast.File, erro
}
func (p *Importer) cgo(bp *build.Package) (*ast.File, error) {
- tmpdir, err := ioutil.TempDir("", "srcimporter")
+ tmpdir, err := os.MkdirTemp("", "srcimporter")
if err != nil {
return nil, err
}
diff --git a/src/go/parser/interface.go b/src/go/parser/interface.go
index d5c18a9e2d..41d9a52847 100644
--- a/src/go/parser/interface.go
+++ b/src/go/parser/interface.go
@@ -14,6 +14,7 @@ import (
"io"
"io/fs"
"io/ioutil"
+ "os"
"path/filepath"
"strings"
)
@@ -39,7 +40,7 @@ func readSource(filename string, src interface{}) ([]byte, error) {
}
return nil, errors.New("invalid source")
}
- return ioutil.ReadFile(filename)
+ return os.ReadFile(filename)
}
// A Mode value is a set of flags (or 0).
diff --git a/src/go/parser/performance_test.go b/src/go/parser/performance_test.go
index f2732c0e2b..f81bcee969 100644
--- a/src/go/parser/performance_test.go
+++ b/src/go/parser/performance_test.go
@@ -6,14 +6,14 @@ package parser
import (
"go/token"
- "io/ioutil"
+ "os"
"testing"
)
var src = readFile("parser.go")
func readFile(filename string) []byte {
- data, err := ioutil.ReadFile(filename)
+ data, err := os.ReadFile(filename)
if err != nil {
panic(err)
}
diff --git a/src/go/printer/performance_test.go b/src/go/printer/performance_test.go
index e23de3fbae..e655fa13ee 100644
--- a/src/go/printer/performance_test.go
+++ b/src/go/printer/performance_test.go
@@ -12,8 +12,8 @@ import (
"go/ast"
"go/parser"
"io"
- "io/ioutil"
"log"
+ "os"
"testing"
)
@@ -29,7 +29,7 @@ func testprint(out io.Writer, file *ast.File) {
func initialize() {
const filename = "testdata/parser.go"
- src, err := ioutil.ReadFile(filename)
+ src, err := os.ReadFile(filename)
if err != nil {
log.Fatalf("%s", err)
}
diff --git a/src/go/printer/printer_test.go b/src/go/printer/printer_test.go
index b64bc6bfb7..45e501115a 100644
--- a/src/go/printer/printer_test.go
+++ b/src/go/printer/printer_test.go
@@ -13,7 +13,7 @@ import (
"go/parser"
"go/token"
"io"
- "io/ioutil"
+ "os"
"path/filepath"
"testing"
"time"
@@ -119,7 +119,7 @@ func diff(aname, bname string, a, b []byte) error {
}
func runcheck(t *testing.T, source, golden string, mode checkMode) {
- src, err := ioutil.ReadFile(source)
+ src, err := os.ReadFile(source)
if err != nil {
t.Error(err)
return
@@ -133,14 +133,14 @@ func runcheck(t *testing.T, source, golden string, mode checkMode) {
// update golden files if necessary
if *update {
- if err := ioutil.WriteFile(golden, res, 0644); err != nil {
+ if err := os.WriteFile(golden, res, 0644); err != nil {
t.Error(err)
}
return
}
// get golden
- gld, err := ioutil.ReadFile(golden)
+ gld, err := os.ReadFile(golden)
if err != nil {
t.Error(err)
return
@@ -552,7 +552,7 @@ func TestBaseIndent(t *testing.T) {
// are not indented (because their values must not change) and make
// this test fail.
const filename = "printer.go"
- src, err := ioutil.ReadFile(filename)
+ src, err := os.ReadFile(filename)
if err != nil {
panic(err) // error in test
}
@@ -639,7 +639,7 @@ func (l *limitWriter) Write(buf []byte) (n int, err error) {
func TestWriteErrors(t *testing.T) {
t.Parallel()
const filename = "printer.go"
- src, err := ioutil.ReadFile(filename)
+ src, err := os.ReadFile(filename)
if err != nil {
panic(err) // error in test
}
diff --git a/src/go/scanner/scanner_test.go b/src/go/scanner/scanner_test.go
index 9d3bbbbb24..ab4c2dd962 100644
--- a/src/go/scanner/scanner_test.go
+++ b/src/go/scanner/scanner_test.go
@@ -6,7 +6,6 @@ package scanner
import (
"go/token"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -893,7 +892,7 @@ func BenchmarkScan(b *testing.B) {
func BenchmarkScanFile(b *testing.B) {
b.StopTimer()
const filename = "scanner.go"
- src, err := ioutil.ReadFile(filename)
+ src, err := os.ReadFile(filename)
if err != nil {
panic(err)
}
diff --git a/src/go/types/check_test.go b/src/go/types/check_test.go
index 37b287a20d..841ca24511 100644
--- a/src/go/types/check_test.go
+++ b/src/go/types/check_test.go
@@ -34,6 +34,7 @@ import (
"go/token"
"internal/testenv"
"io/ioutil"
+ "os"
"path/filepath"
"regexp"
"strings"
@@ -153,7 +154,7 @@ func errMap(t *testing.T, testname string, files []*ast.File) map[string][]strin
for _, file := range files {
filename := fset.Position(file.Package).Filename
- src, err := ioutil.ReadFile(filename)
+ src, err := os.ReadFile(filename)
if err != nil {
t.Fatalf("%s: could not read %s", testname, filename)
}
diff --git a/src/go/types/hilbert_test.go b/src/go/types/hilbert_test.go
index 9783ce6dc9..77954d2f8b 100644
--- a/src/go/types/hilbert_test.go
+++ b/src/go/types/hilbert_test.go
@@ -12,7 +12,7 @@ import (
"go/importer"
"go/parser"
"go/token"
- "io/ioutil"
+ "os"
"testing"
. "go/types"
@@ -27,7 +27,7 @@ func TestHilbert(t *testing.T) {
// generate source
src := program(*H, *out)
if *out != "" {
- ioutil.WriteFile(*out, src, 0666)
+ os.WriteFile(*out, src, 0666)
return
}
diff --git a/src/hash/crc32/gen_const_ppc64le.go b/src/hash/crc32/gen_const_ppc64le.go
index bfb3b3a227..d7af018af4 100644
--- a/src/hash/crc32/gen_const_ppc64le.go
+++ b/src/hash/crc32/gen_const_ppc64le.go
@@ -27,7 +27,7 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
+ "os"
)
var blocking = 32 * 1024
@@ -103,7 +103,7 @@ func main() {
genCrc32ConstTable(w, 0xeb31d82e, "Koop")
b := w.Bytes()
- err := ioutil.WriteFile("crc32_table_ppc64le.s", b, 0666)
+ err := os.WriteFile("crc32_table_ppc64le.s", b, 0666)
if err != nil {
fmt.Printf("can't write output: %s\n", err)
}
diff --git a/src/html/template/examplefiles_test.go b/src/html/template/examplefiles_test.go
index 60518aee9e..5eb2597464 100644
--- a/src/html/template/examplefiles_test.go
+++ b/src/html/template/examplefiles_test.go
@@ -6,7 +6,6 @@ package template_test
import (
"io"
- "io/ioutil"
"log"
"os"
"path/filepath"
@@ -20,7 +19,7 @@ type templateFile struct {
}
func createTestDir(files []templateFile) string {
- dir, err := ioutil.TempDir("", "template")
+ dir, err := os.MkdirTemp("", "template")
if err != nil {
log.Fatal(err)
}
diff --git a/src/html/template/template.go b/src/html/template/template.go
index bc960afe5f..69312d36fd 100644
--- a/src/html/template/template.go
+++ b/src/html/template/template.go
@@ -8,7 +8,7 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
+ "os"
"path"
"path/filepath"
"sync"
@@ -523,7 +523,7 @@ func parseFS(t *Template, fsys fs.FS, patterns []string) (*Template, error) {
func readFileOS(file string) (name string, b []byte, err error) {
name = filepath.Base(file)
- b, err = ioutil.ReadFile(file)
+ b, err = os.ReadFile(file)
return
}
diff --git a/src/image/color/palette/gen.go b/src/image/color/palette/gen.go
index f8587db8f3..3243e53981 100644
--- a/src/image/color/palette/gen.go
+++ b/src/image/color/palette/gen.go
@@ -15,8 +15,8 @@ import (
"fmt"
"go/format"
"io"
- "io/ioutil"
"log"
+ "os"
)
var filename = flag.String("output", "palette.go", "output file name")
@@ -43,7 +43,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
- err = ioutil.WriteFile(*filename, data, 0644)
+ err = os.WriteFile(*filename, data, 0644)
if err != nil {
log.Fatal(err)
}
diff --git a/src/image/gif/reader_test.go b/src/image/gif/reader_test.go
index 29f47b6c08..5eec5ecb4a 100644
--- a/src/image/gif/reader_test.go
+++ b/src/image/gif/reader_test.go
@@ -11,7 +11,7 @@ import (
"image/color"
"image/color/palette"
"io"
- "io/ioutil"
+ "os"
"reflect"
"runtime"
"runtime/debug"
@@ -424,7 +424,7 @@ func TestDecodeMemoryConsumption(t *testing.T) {
}
func BenchmarkDecode(b *testing.B) {
- data, err := ioutil.ReadFile("../testdata/video-001.gif")
+ data, err := os.ReadFile("../testdata/video-001.gif")
if err != nil {
b.Fatal(err)
}
diff --git a/src/image/internal/imageutil/gen.go b/src/image/internal/imageutil/gen.go
index bc85c512f9..36de5dc9cc 100644
--- a/src/image/internal/imageutil/gen.go
+++ b/src/image/internal/imageutil/gen.go
@@ -11,7 +11,6 @@ import (
"flag"
"fmt"
"go/format"
- "io/ioutil"
"log"
"os"
)
@@ -36,7 +35,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
- if err := ioutil.WriteFile("impl.go", out, 0660); err != nil {
+ if err := os.WriteFile("impl.go", out, 0660); err != nil {
log.Fatal(err)
}
}
diff --git a/src/image/jpeg/reader_test.go b/src/image/jpeg/reader_test.go
index 1e2798c945..bf07fadede 100644
--- a/src/image/jpeg/reader_test.go
+++ b/src/image/jpeg/reader_test.go
@@ -11,7 +11,6 @@ import (
"image"
"image/color"
"io"
- "io/ioutil"
"math/rand"
"os"
"strings"
@@ -118,7 +117,7 @@ func (r *eofReader) Read(b []byte) (n int, err error) {
func TestDecodeEOF(t *testing.T) {
// Check that if reader returns final data and EOF at same time, jpeg handles it.
- data, err := ioutil.ReadFile("../testdata/video-001.jpeg")
+ data, err := os.ReadFile("../testdata/video-001.jpeg")
if err != nil {
t.Fatal(err)
}
@@ -189,7 +188,7 @@ func pixString(pix []byte, stride, x, y int) string {
}
func TestTruncatedSOSDataDoesntPanic(t *testing.T) {
- b, err := ioutil.ReadFile("../testdata/video-005.gray.q50.jpeg")
+ b, err := os.ReadFile("../testdata/video-005.gray.q50.jpeg")
if err != nil {
t.Fatal(err)
}
@@ -493,7 +492,7 @@ func TestExtraneousData(t *testing.T) {
}
func benchmarkDecode(b *testing.B, filename string) {
- data, err := ioutil.ReadFile(filename)
+ data, err := os.ReadFile(filename)
if err != nil {
b.Fatal(err)
}
diff --git a/src/image/png/reader_test.go b/src/image/png/reader_test.go
index 22c704e5cb..3937685294 100644
--- a/src/image/png/reader_test.go
+++ b/src/image/png/reader_test.go
@@ -11,7 +11,6 @@ import (
"image"
"image/color"
"io"
- "io/ioutil"
"os"
"reflect"
"strings"
@@ -785,7 +784,7 @@ func TestDimensionOverflow(t *testing.T) {
}
func benchmarkDecode(b *testing.B, filename string, bytesPerPixel int) {
- data, err := ioutil.ReadFile(filename)
+ data, err := os.ReadFile(filename)
if err != nil {
b.Fatal(err)
}
diff --git a/src/index/suffixarray/gen.go b/src/index/suffixarray/gen.go
index 8c3de553c9..94184d71b6 100644
--- a/src/index/suffixarray/gen.go
+++ b/src/index/suffixarray/gen.go
@@ -11,8 +11,8 @@ package main
import (
"bytes"
- "io/ioutil"
"log"
+ "os"
"strings"
)
@@ -20,7 +20,7 @@ func main() {
log.SetPrefix("gen: ")
log.SetFlags(0)
- data, err := ioutil.ReadFile("sais.go")
+ data, err := os.ReadFile("sais.go")
if err != nil {
log.Fatal(err)
}
@@ -64,7 +64,7 @@ func main() {
}
}
- if err := ioutil.WriteFile("sais2.go", buf.Bytes(), 0666); err != nil {
+ if err := os.WriteFile("sais2.go", buf.Bytes(), 0666); err != nil {
log.Fatal(err)
}
}
diff --git a/src/index/suffixarray/suffixarray_test.go b/src/index/suffixarray/suffixarray_test.go
index a11a98dae0..44c5041535 100644
--- a/src/index/suffixarray/suffixarray_test.go
+++ b/src/index/suffixarray/suffixarray_test.go
@@ -8,8 +8,8 @@ import (
"bytes"
"fmt"
"io/fs"
- "io/ioutil"
"math/rand"
+ "os"
"path/filepath"
"regexp"
"sort"
@@ -498,14 +498,14 @@ func makeText(name string) ([]byte, error) {
switch name {
case "opticks":
var err error
- data, err = ioutil.ReadFile("../../testdata/Isaac.Newton-Opticks.txt")
+ data, err = os.ReadFile("../../testdata/Isaac.Newton-Opticks.txt")
if err != nil {
return nil, err
}
case "go":
err := filepath.WalkDir("../..", func(path string, info fs.DirEntry, err error) error {
if err == nil && strings.HasSuffix(path, ".go") && !info.IsDir() {
- file, err := ioutil.ReadFile(path)
+ file, err := os.ReadFile(path)
if err != nil {
return err
}
diff --git a/src/internal/cpu/cpu_s390x_test.go b/src/internal/cpu/cpu_s390x_test.go
index d910bbe695..ad86858db0 100644
--- a/src/internal/cpu/cpu_s390x_test.go
+++ b/src/internal/cpu/cpu_s390x_test.go
@@ -7,13 +7,13 @@ package cpu_test
import (
"errors"
. "internal/cpu"
- "io/ioutil"
+ "os"
"regexp"
"testing"
)
func getFeatureList() ([]string, error) {
- cpuinfo, err := ioutil.ReadFile("/proc/cpuinfo")
+ cpuinfo, err := os.ReadFile("/proc/cpuinfo")
if err != nil {
return nil, err
}
diff --git a/src/internal/obscuretestdata/obscuretestdata.go b/src/internal/obscuretestdata/obscuretestdata.go
index 06cd1df22c..5ea2cdf5d1 100644
--- a/src/internal/obscuretestdata/obscuretestdata.go
+++ b/src/internal/obscuretestdata/obscuretestdata.go
@@ -10,7 +10,6 @@ package obscuretestdata
import (
"encoding/base64"
"io"
- "io/ioutil"
"os"
)
@@ -24,7 +23,7 @@ func DecodeToTempFile(name string) (path string, err error) {
}
defer f.Close()
- tmp, err := ioutil.TempFile("", "obscuretestdata-decoded-")
+ tmp, err := os.CreateTemp("", "obscuretestdata-decoded-")
if err != nil {
return "", err
}
diff --git a/src/internal/poll/read_test.go b/src/internal/poll/read_test.go
index 2d4ef97da0..598a52ee44 100644
--- a/src/internal/poll/read_test.go
+++ b/src/internal/poll/read_test.go
@@ -5,7 +5,6 @@
package poll_test
import (
- "io/ioutil"
"os"
"runtime"
"sync"
@@ -22,7 +21,7 @@ func TestRead(t *testing.T) {
go func(p string) {
defer wg.Done()
for i := 0; i < 100; i++ {
- if _, err := ioutil.ReadFile(p); err != nil {
+ if _, err := os.ReadFile(p); err != nil {
t.Error(err)
return
}
diff --git a/src/internal/testenv/testenv_windows.go b/src/internal/testenv/testenv_windows.go
index eb8d6ac165..4802b13951 100644
--- a/src/internal/testenv/testenv_windows.go
+++ b/src/internal/testenv/testenv_windows.go
@@ -5,7 +5,6 @@
package testenv
import (
- "io/ioutil"
"os"
"path/filepath"
"sync"
@@ -16,7 +15,7 @@ var symlinkOnce sync.Once
var winSymlinkErr error
func initWinHasSymlink() {
- tmpdir, err := ioutil.TempDir("", "symtest")
+ tmpdir, err := os.MkdirTemp("", "symtest")
if err != nil {
panic("failed to create temp directory: " + err.Error())
}
diff --git a/src/internal/trace/gc_test.go b/src/internal/trace/gc_test.go
index 4f9c77041a..9b9771e7b0 100644
--- a/src/internal/trace/gc_test.go
+++ b/src/internal/trace/gc_test.go
@@ -6,8 +6,8 @@ package trace
import (
"bytes"
- "io/ioutil"
"math"
+ "os"
"testing"
"time"
)
@@ -84,7 +84,7 @@ func TestMMUTrace(t *testing.T) {
t.Skip("skipping in -short mode")
}
- data, err := ioutil.ReadFile("testdata/stress_1_10_good")
+ data, err := os.ReadFile("testdata/stress_1_10_good")
if err != nil {
t.Fatalf("failed to read input file: %v", err)
}
@@ -126,7 +126,7 @@ func TestMMUTrace(t *testing.T) {
}
func BenchmarkMMU(b *testing.B) {
- data, err := ioutil.ReadFile("testdata/stress_1_10_good")
+ data, err := os.ReadFile("testdata/stress_1_10_good")
if err != nil {
b.Fatalf("failed to read input file: %v", err)
}
diff --git a/src/internal/trace/parser_test.go b/src/internal/trace/parser_test.go
index 6d87970157..316220cfa8 100644
--- a/src/internal/trace/parser_test.go
+++ b/src/internal/trace/parser_test.go
@@ -47,7 +47,7 @@ func TestParseCanned(t *testing.T) {
if testing.Short() && info.Size() > 10000 {
continue
}
- data, err := ioutil.ReadFile(name)
+ data, err := os.ReadFile(name)
if err != nil {
t.Fatal(err)
}
diff --git a/src/log/syslog/syslog_test.go b/src/log/syslog/syslog_test.go
index 8f472a56b7..207bcf57c1 100644
--- a/src/log/syslog/syslog_test.go
+++ b/src/log/syslog/syslog_test.go
@@ -10,7 +10,6 @@ import (
"bufio"
"fmt"
"io"
- "io/ioutil"
"log"
"net"
"os"
@@ -88,8 +87,8 @@ func startServer(n, la string, done chan<- string) (addr string, sock io.Closer,
} else {
// unix and unixgram: choose an address if none given
if la == "" {
- // use ioutil.TempFile to get a name that is unique
- f, err := ioutil.TempFile("", "syslogtest")
+ // use os.CreateTemp to get a name that is unique
+ f, err := os.CreateTemp("", "syslogtest")
if err != nil {
log.Fatal("TempFile: ", err)
}
diff --git a/src/math/big/link_test.go b/src/math/big/link_test.go
index 2212bd444f..42f9cefca0 100644
--- a/src/math/big/link_test.go
+++ b/src/math/big/link_test.go
@@ -7,7 +7,7 @@ package big
import (
"bytes"
"internal/testenv"
- "io/ioutil"
+ "os"
"os/exec"
"path/filepath"
"testing"
@@ -27,7 +27,7 @@ func TestLinkerGC(t *testing.T) {
import _ "math/big"
func main() {}
`)
- if err := ioutil.WriteFile(goFile, file, 0644); err != nil {
+ if err := os.WriteFile(goFile, file, 0644); err != nil {
t.Fatal(err)
}
cmd := exec.Command(goBin, "build", "-o", "x.exe", "x.go")
diff --git a/src/math/bits/make_examples.go b/src/math/bits/make_examples.go
index cd81cd6c4d..1d3ad53fe6 100644
--- a/src/math/bits/make_examples.go
+++ b/src/math/bits/make_examples.go
@@ -11,9 +11,9 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"log"
"math/bits"
+ "os"
)
const header = `// Copyright 2017 The Go Authors. All rights reserved.
@@ -106,7 +106,7 @@ func main() {
}
}
- if err := ioutil.WriteFile("example_test.go", w.Bytes(), 0666); err != nil {
+ if err := os.WriteFile("example_test.go", w.Bytes(), 0666); err != nil {
log.Fatal(err)
}
}
diff --git a/src/math/bits/make_tables.go b/src/math/bits/make_tables.go
index ff2fe2e385..b068d5e0e3 100644
--- a/src/math/bits/make_tables.go
+++ b/src/math/bits/make_tables.go
@@ -13,8 +13,8 @@ import (
"fmt"
"go/format"
"io"
- "io/ioutil"
"log"
+ "os"
)
var header = []byte(`// Copyright 2017 The Go Authors. All rights reserved.
@@ -40,7 +40,7 @@ func main() {
log.Fatal(err)
}
- err = ioutil.WriteFile("bits_tables.go", out, 0666)
+ err = os.WriteFile("bits_tables.go", out, 0666)
if err != nil {
log.Fatal(err)
}
diff --git a/src/mime/multipart/formdata.go b/src/mime/multipart/formdata.go
index 9c42ea8c02..fca5f9e15f 100644
--- a/src/mime/multipart/formdata.go
+++ b/src/mime/multipart/formdata.go
@@ -8,7 +8,6 @@ import (
"bytes"
"errors"
"io"
- "io/ioutil"
"math"
"net/textproto"
"os"
@@ -91,7 +90,7 @@ func (r *Reader) readForm(maxMemory int64) (_ *Form, err error) {
}
if n > maxMemory {
// too big, write to disk and flush buffer
- file, err := ioutil.TempFile("", "multipart-")
+ file, err := os.CreateTemp("", "multipart-")
if err != nil {
return nil, err
}
diff --git a/src/net/dnsclient_unix_test.go b/src/net/dnsclient_unix_test.go
index 06553636ee..0530c92c2e 100644
--- a/src/net/dnsclient_unix_test.go
+++ b/src/net/dnsclient_unix_test.go
@@ -10,7 +10,6 @@ import (
"context"
"errors"
"fmt"
- "io/ioutil"
"os"
"path"
"reflect"
@@ -235,7 +234,7 @@ type resolvConfTest struct {
}
func newResolvConfTest() (*resolvConfTest, error) {
- dir, err := ioutil.TempDir("", "go-resolvconftest")
+ dir, err := os.MkdirTemp("", "go-resolvconftest")
if err != nil {
return nil, err
}
diff --git a/src/net/error_test.go b/src/net/error_test.go
index 7823fdf9d8..556eb8c8d4 100644
--- a/src/net/error_test.go
+++ b/src/net/error_test.go
@@ -13,7 +13,6 @@ import (
"internal/poll"
"io"
"io/fs"
- "io/ioutil"
"net/internal/socktest"
"os"
"runtime"
@@ -730,7 +729,7 @@ func TestFileError(t *testing.T) {
t.Skipf("not supported on %s", runtime.GOOS)
}
- f, err := ioutil.TempFile("", "go-nettest")
+ f, err := os.CreateTemp("", "go-nettest")
if err != nil {
t.Fatal(err)
}
diff --git a/src/net/http/filetransport_test.go b/src/net/http/filetransport_test.go
index fdfd44d967..b58888dcb1 100644
--- a/src/net/http/filetransport_test.go
+++ b/src/net/http/filetransport_test.go
@@ -6,7 +6,6 @@ package http
import (
"io"
- "io/ioutil"
"os"
"path/filepath"
"testing"
@@ -24,10 +23,10 @@ func checker(t *testing.T) func(string, error) {
func TestFileTransport(t *testing.T) {
check := checker(t)
- dname, err := ioutil.TempDir("", "")
+ dname, err := os.MkdirTemp("", "")
check("TempDir", err)
fname := filepath.Join(dname, "foo.txt")
- err = ioutil.WriteFile(fname, []byte("Bar"), 0644)
+ err = os.WriteFile(fname, []byte("Bar"), 0644)
check("WriteFile", err)
defer os.Remove(dname)
defer os.Remove(fname)
diff --git a/src/net/http/fs_test.go b/src/net/http/fs_test.go
index 2e4751114d..2499051625 100644
--- a/src/net/http/fs_test.go
+++ b/src/net/http/fs_test.go
@@ -79,7 +79,7 @@ func TestServeFile(t *testing.T) {
var err error
- file, err := ioutil.ReadFile(testFile)
+ file, err := os.ReadFile(testFile)
if err != nil {
t.Fatal("reading file:", err)
}
@@ -379,12 +379,12 @@ func mustRemoveAll(dir string) {
func TestFileServerImplicitLeadingSlash(t *testing.T) {
defer afterTest(t)
- tempDir, err := ioutil.TempDir("", "")
+ tempDir, err := os.MkdirTemp("", "")
if err != nil {
t.Fatalf("TempDir: %v", err)
}
defer mustRemoveAll(tempDir)
- if err := ioutil.WriteFile(filepath.Join(tempDir, "foo.txt"), []byte("Hello world"), 0644); err != nil {
+ if err := os.WriteFile(filepath.Join(tempDir, "foo.txt"), []byte("Hello world"), 0644); err != nil {
t.Fatalf("WriteFile: %v", err)
}
ts := httptest.NewServer(StripPrefix("/bar/", FileServer(Dir(tempDir))))
@@ -1177,7 +1177,7 @@ func TestLinuxSendfile(t *testing.T) {
filename := fmt.Sprintf("1kb-%d", os.Getpid())
filepath := path.Join(os.TempDir(), filename)
- if err := ioutil.WriteFile(filepath, bytes.Repeat([]byte{'a'}, 1<<10), 0755); err != nil {
+ if err := os.WriteFile(filepath, bytes.Repeat([]byte{'a'}, 1<<10), 0755); err != nil {
t.Fatal(err)
}
defer os.Remove(filepath)
diff --git a/src/net/http/request_test.go b/src/net/http/request_test.go
index 689498e19d..29297b0e7b 100644
--- a/src/net/http/request_test.go
+++ b/src/net/http/request_test.go
@@ -12,7 +12,6 @@ import (
"encoding/base64"
"fmt"
"io"
- "io/ioutil"
"math"
"mime/multipart"
. "net/http"
@@ -1164,7 +1163,7 @@ func BenchmarkFileAndServer_64MB(b *testing.B) {
}
func benchmarkFileAndServer(b *testing.B, n int64) {
- f, err := ioutil.TempFile(os.TempDir(), "go-bench-http-file-and-server")
+ f, err := os.CreateTemp(os.TempDir(), "go-bench-http-file-and-server")
if err != nil {
b.Fatalf("Failed to create temp file: %v", err)
}
diff --git a/src/net/http/transfer_test.go b/src/net/http/transfer_test.go
index 1f3d32526d..f0c28b2629 100644
--- a/src/net/http/transfer_test.go
+++ b/src/net/http/transfer_test.go
@@ -10,7 +10,6 @@ import (
"crypto/rand"
"fmt"
"io"
- "io/ioutil"
"os"
"reflect"
"strings"
@@ -118,7 +117,7 @@ func TestTransferWriterWriteBodyReaderTypes(t *testing.T) {
nBytes := int64(1 << 10)
newFileFunc := func() (r io.Reader, done func(), err error) {
- f, err := ioutil.TempFile("", "net-http-newfilefunc")
+ f, err := os.CreateTemp("", "net-http-newfilefunc")
if err != nil {
return nil, nil, err
}
diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go
index f22b798035..7f6e0938c2 100644
--- a/src/net/http/transport_test.go
+++ b/src/net/http/transport_test.go
@@ -23,7 +23,6 @@ import (
"go/token"
"internal/nettrace"
"io"
- "io/ioutil"
"log"
mrand "math/rand"
"net"
@@ -5746,7 +5745,7 @@ func (c *testMockTCPConn) ReadFrom(r io.Reader) (int64, error) {
func TestTransportRequestWriteRoundTrip(t *testing.T) {
nBytes := int64(1 << 10)
newFileFunc := func() (r io.Reader, done func(), err error) {
- f, err := ioutil.TempFile("", "net-http-newfilefunc")
+ f, err := os.CreateTemp("", "net-http-newfilefunc")
if err != nil {
return nil, nil, err
}
diff --git a/src/net/mockserver_test.go b/src/net/mockserver_test.go
index e085f4440b..9faf173679 100644
--- a/src/net/mockserver_test.go
+++ b/src/net/mockserver_test.go
@@ -9,16 +9,15 @@ package net
import (
"errors"
"fmt"
- "io/ioutil"
"os"
"sync"
"testing"
"time"
)
-// testUnixAddr uses ioutil.TempFile to get a name that is unique.
+// testUnixAddr uses os.CreateTemp to get a name that is unique.
func testUnixAddr() string {
- f, err := ioutil.TempFile("", "go-nettest")
+ f, err := os.CreateTemp("", "go-nettest")
if err != nil {
panic(err)
}
diff --git a/src/net/net_windows_test.go b/src/net/net_windows_test.go
index 8aa719f433..a0000950c6 100644
--- a/src/net/net_windows_test.go
+++ b/src/net/net_windows_test.go
@@ -9,7 +9,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"os"
"os/exec"
"regexp"
@@ -176,7 +175,7 @@ func runCmd(args ...string) ([]byte, error) {
}
return b
}
- f, err := ioutil.TempFile("", "netcmd")
+ f, err := os.CreateTemp("", "netcmd")
if err != nil {
return nil, err
}
@@ -189,7 +188,7 @@ func runCmd(args ...string) ([]byte, error) {
return nil, fmt.Errorf("%s failed: %v: %q", args[0], err, string(removeUTF8BOM(out)))
}
var err2 error
- out, err2 = ioutil.ReadFile(f.Name())
+ out, err2 = os.ReadFile(f.Name())
if err2 != nil {
return nil, err2
}
@@ -198,7 +197,7 @@ func runCmd(args ...string) ([]byte, error) {
}
return nil, fmt.Errorf("%s failed: %v", args[0], err)
}
- out, err = ioutil.ReadFile(f.Name())
+ out, err = os.ReadFile(f.Name())
if err != nil {
return nil, err
}
diff --git a/src/net/unixsock_test.go b/src/net/unixsock_test.go
index 4b2cfc4d62..0b13bf655f 100644
--- a/src/net/unixsock_test.go
+++ b/src/net/unixsock_test.go
@@ -9,7 +9,6 @@ package net
import (
"bytes"
"internal/testenv"
- "io/ioutil"
"os"
"reflect"
"runtime"
@@ -417,7 +416,7 @@ func TestUnixUnlink(t *testing.T) {
checkExists(t, "after Listen")
l.Close()
checkNotExists(t, "after Listener close")
- if err := ioutil.WriteFile(name, []byte("hello world"), 0666); err != nil {
+ if err := os.WriteFile(name, []byte("hello world"), 0666); err != nil {
t.Fatalf("cannot recreate socket file: %v", err)
}
checkExists(t, "after writing temp file")
diff --git a/src/os/error_test.go b/src/os/error_test.go
index 060cf59875..6264ccc966 100644
--- a/src/os/error_test.go
+++ b/src/os/error_test.go
@@ -8,14 +8,13 @@ import (
"errors"
"fmt"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"testing"
)
func TestErrIsExist(t *testing.T) {
- f, err := ioutil.TempFile("", "_Go_ErrIsExist")
+ f, err := os.CreateTemp("", "_Go_ErrIsExist")
if err != nil {
t.Fatalf("open ErrIsExist tempfile: %s", err)
return
@@ -55,7 +54,7 @@ func testErrNotExist(name string) string {
}
func TestErrIsNotExist(t *testing.T) {
- tmpDir, err := ioutil.TempDir("", "_Go_ErrIsNotExist")
+ tmpDir, err := os.MkdirTemp("", "_Go_ErrIsNotExist")
if err != nil {
t.Fatalf("create ErrIsNotExist tempdir: %s", err)
return
@@ -147,12 +146,12 @@ func TestIsPermission(t *testing.T) {
}
func TestErrPathNUL(t *testing.T) {
- f, err := ioutil.TempFile("", "_Go_ErrPathNUL\x00")
+ f, err := os.CreateTemp("", "_Go_ErrPathNUL\x00")
if err == nil {
f.Close()
t.Fatal("TempFile should have failed")
}
- f, err = ioutil.TempFile("", "_Go_ErrPathNUL")
+ f, err = os.CreateTemp("", "_Go_ErrPathNUL")
if err != nil {
t.Fatalf("open ErrPathNUL tempfile: %s", err)
}
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
index fc49b8a332..92429f63a5 100644
--- a/src/os/exec/exec_test.go
+++ b/src/os/exec/exec_test.go
@@ -645,7 +645,7 @@ func TestExtraFiles(t *testing.T) {
t.Errorf("success trying to fetch %s; want an error", ts.URL)
}
- tf, err := ioutil.TempFile("", "")
+ tf, err := os.CreateTemp("", "")
if err != nil {
t.Fatalf("TempFile: %v", err)
}
diff --git a/src/os/exec/lp_unix_test.go b/src/os/exec/lp_unix_test.go
index e4656cafb8..296480fd04 100644
--- a/src/os/exec/lp_unix_test.go
+++ b/src/os/exec/lp_unix_test.go
@@ -7,13 +7,12 @@
package exec
import (
- "io/ioutil"
"os"
"testing"
)
func TestLookPathUnixEmptyPath(t *testing.T) {
- tmp, err := ioutil.TempDir("", "TestLookPathUnixEmptyPath")
+ tmp, err := os.MkdirTemp("", "TestLookPathUnixEmptyPath")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
diff --git a/src/os/exec/lp_windows_test.go b/src/os/exec/lp_windows_test.go
index 59b5f1c2c7..c6f3d5d406 100644
--- a/src/os/exec/lp_windows_test.go
+++ b/src/os/exec/lp_windows_test.go
@@ -11,7 +11,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -307,7 +306,7 @@ var lookPathTests = []lookPathTest{
}
func TestLookPath(t *testing.T) {
- tmp, err := ioutil.TempDir("", "TestLookPath")
+ tmp, err := os.MkdirTemp("", "TestLookPath")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
@@ -504,7 +503,7 @@ var commandTests = []commandTest{
}
func TestCommand(t *testing.T) {
- tmp, err := ioutil.TempDir("", "TestCommand")
+ tmp, err := os.MkdirTemp("", "TestCommand")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
@@ -529,7 +528,7 @@ func TestCommand(t *testing.T) {
func buildPrintPathExe(t *testing.T, dir string) string {
const name = "printpath"
srcname := name + ".go"
- err := ioutil.WriteFile(filepath.Join(dir, srcname), []byte(printpathSrc), 0644)
+ err := os.WriteFile(filepath.Join(dir, srcname), []byte(printpathSrc), 0644)
if err != nil {
t.Fatalf("failed to create source: %v", err)
}
diff --git a/src/os/fifo_test.go b/src/os/fifo_test.go
index 3041dcfa02..2439192a9d 100644
--- a/src/os/fifo_test.go
+++ b/src/os/fifo_test.go
@@ -11,7 +11,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -31,7 +30,7 @@ func TestFifoEOF(t *testing.T) {
t.Skip("skipping on OpenBSD; issue 25877")
}
- dir, err := ioutil.TempDir("", "TestFifoEOF")
+ dir, err := os.MkdirTemp("", "TestFifoEOF")
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/os_test.go b/src/os/os_test.go
index c5e5cbbb1b..765797f5fb 100644
--- a/src/os/os_test.go
+++ b/src/os/os_test.go
@@ -11,7 +11,7 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
+ "os"
. "os"
osexec "os/exec"
"path/filepath"
@@ -155,7 +155,7 @@ func localTmp() string {
}
func newFile(testName string, t *testing.T) (f *File) {
- f, err := ioutil.TempFile(localTmp(), "_Go_"+testName)
+ f, err := os.CreateTemp(localTmp(), "_Go_"+testName)
if err != nil {
t.Fatalf("TempFile %s: %s", testName, err)
}
@@ -163,7 +163,7 @@ func newFile(testName string, t *testing.T) (f *File) {
}
func newDir(testName string, t *testing.T) (name string) {
- name, err := ioutil.TempDir(localTmp(), "_Go_"+testName)
+ name, err := os.MkdirTemp(localTmp(), "_Go_"+testName)
if err != nil {
t.Fatalf("TempDir %s: %s", testName, err)
}
@@ -616,7 +616,7 @@ func TestReaddirNValues(t *testing.T) {
if testing.Short() {
t.Skip("test.short; skipping")
}
- dir, err := ioutil.TempDir("", "")
+ dir, err := os.MkdirTemp("", "")
if err != nil {
t.Fatalf("TempDir: %v", err)
}
@@ -715,7 +715,7 @@ func TestReaddirStatFailures(t *testing.T) {
// testing it wouldn't work.
t.Skipf("skipping test on %v", runtime.GOOS)
}
- dir, err := ioutil.TempDir("", "")
+ dir, err := os.MkdirTemp("", "")
if err != nil {
t.Fatalf("TempDir: %v", err)
}
@@ -776,7 +776,7 @@ func TestReaddirStatFailures(t *testing.T) {
// Readdir on a regular file should fail.
func TestReaddirOfFile(t *testing.T) {
- f, err := ioutil.TempFile("", "_Go_ReaddirOfFile")
+ f, err := os.CreateTemp("", "_Go_ReaddirOfFile")
if err != nil {
t.Fatal(err)
}
@@ -867,7 +867,7 @@ func chtmpdir(t *testing.T) func() {
if err != nil {
t.Fatalf("chtmpdir: %v", err)
}
- d, err := ioutil.TempDir("", "test")
+ d, err := os.MkdirTemp("", "test")
if err != nil {
t.Fatalf("chtmpdir: %v", err)
}
@@ -992,12 +992,12 @@ func TestRenameOverwriteDest(t *testing.T) {
toData := []byte("to")
fromData := []byte("from")
- err := ioutil.WriteFile(to, toData, 0777)
+ err := os.WriteFile(to, toData, 0777)
if err != nil {
t.Fatalf("write file %q failed: %v", to, err)
}
- err = ioutil.WriteFile(from, fromData, 0777)
+ err = os.WriteFile(from, fromData, 0777)
if err != nil {
t.Fatalf("write file %q failed: %v", from, err)
}
@@ -1341,7 +1341,7 @@ func testChtimes(t *testing.T, name string) {
// the contents are accessed; also, it is set
// whenever mtime is set.
case "netbsd":
- mounts, _ := ioutil.ReadFile("/proc/mounts")
+ mounts, _ := os.ReadFile("/proc/mounts")
if strings.Contains(string(mounts), "noatime") {
t.Logf("AccessTime didn't go backwards, but see a filesystem mounted noatime; ignoring. Issue 19293.")
} else {
@@ -1415,7 +1415,7 @@ func TestChdirAndGetwd(t *testing.T) {
case "arm64":
dirs = nil
for _, d := range []string{"d1", "d2"} {
- dir, err := ioutil.TempDir("", d)
+ dir, err := os.MkdirTemp("", d)
if err != nil {
t.Fatalf("TempDir: %v", err)
}
@@ -1509,7 +1509,7 @@ func TestProgWideChdir(t *testing.T) {
c <- true
t.Fatalf("Getwd: %v", err)
}
- d, err := ioutil.TempDir("", "test")
+ d, err := os.MkdirTemp("", "test")
if err != nil {
c <- true
t.Fatalf("TempDir: %v", err)
@@ -1576,7 +1576,7 @@ func TestSeek(t *testing.T) {
off, err := f.Seek(tt.in, tt.whence)
if off != tt.out || err != nil {
if e, ok := err.(*PathError); ok && e.Err == syscall.EINVAL && tt.out > 1<<32 && runtime.GOOS == "linux" {
- mounts, _ := ioutil.ReadFile("/proc/mounts")
+ mounts, _ := os.ReadFile("/proc/mounts")
if strings.Contains(string(mounts), "reiserfs") {
// Reiserfs rejects the big seeks.
t.Skipf("skipping test known to fail on reiserfs; https://golang.org/issue/91")
@@ -1858,7 +1858,7 @@ func TestWriteAt(t *testing.T) {
t.Fatalf("WriteAt 7: %d, %v", n, err)
}
- b, err := ioutil.ReadFile(f.Name())
+ b, err := os.ReadFile(f.Name())
if err != nil {
t.Fatalf("ReadFile %s: %v", f.Name(), err)
}
@@ -1906,7 +1906,7 @@ func writeFile(t *testing.T, fname string, flag int, text string) string {
t.Fatalf("WriteString: %d, %v", n, err)
}
f.Close()
- data, err := ioutil.ReadFile(fname)
+ data, err := os.ReadFile(fname)
if err != nil {
t.Fatalf("ReadFile: %v", err)
}
@@ -1948,7 +1948,7 @@ func TestAppend(t *testing.T) {
func TestStatDirWithTrailingSlash(t *testing.T) {
// Create new temporary directory and arrange to clean it up.
- path, err := ioutil.TempDir("", "_TestStatDirWithSlash_")
+ path, err := os.MkdirTemp("", "_TestStatDirWithSlash_")
if err != nil {
t.Fatalf("TempDir: %s", err)
}
@@ -2090,7 +2090,7 @@ func TestLargeWriteToConsole(t *testing.T) {
func TestStatDirModeExec(t *testing.T) {
const mode = 0111
- path, err := ioutil.TempDir("", "go-build")
+ path, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("Failed to create temp directory: %v", err)
}
@@ -2159,7 +2159,7 @@ func TestStatStdin(t *testing.T) {
func TestStatRelativeSymlink(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpdir, err := ioutil.TempDir("", "TestStatRelativeSymlink")
+ tmpdir, err := os.MkdirTemp("", "TestStatRelativeSymlink")
if err != nil {
t.Fatal(err)
}
@@ -2249,8 +2249,8 @@ func TestLongPath(t *testing.T) {
t.Fatalf("MkdirAll failed: %v", err)
}
data := []byte("hello world\n")
- if err := ioutil.WriteFile(sizedTempDir+"/foo.txt", data, 0644); err != nil {
- t.Fatalf("ioutil.WriteFile() failed: %v", err)
+ if err := os.WriteFile(sizedTempDir+"/foo.txt", data, 0644); err != nil {
+ t.Fatalf("os.WriteFile() failed: %v", err)
}
if err := Rename(sizedTempDir+"/foo.txt", sizedTempDir+"/bar.txt"); err != nil {
t.Fatalf("Rename failed: %v", err)
@@ -2434,7 +2434,7 @@ func TestRemoveAllRace(t *testing.T) {
n := runtime.GOMAXPROCS(16)
defer runtime.GOMAXPROCS(n)
- root, err := ioutil.TempDir("", "issue")
+ root, err := os.MkdirTemp("", "issue")
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/os_unix_test.go b/src/os/os_unix_test.go
index 0bce2989c4..51693fd82a 100644
--- a/src/os/os_unix_test.go
+++ b/src/os/os_unix_test.go
@@ -8,7 +8,7 @@ package os_test
import (
"io"
- "io/ioutil"
+ "os"
. "os"
"path/filepath"
"runtime"
@@ -190,7 +190,7 @@ func TestReaddirRemoveRace(t *testing.T) {
}
dir := newDir("TestReaddirRemoveRace", t)
defer RemoveAll(dir)
- if err := ioutil.WriteFile(filepath.Join(dir, "some-file"), []byte("hello"), 0644); err != nil {
+ if err := os.WriteFile(filepath.Join(dir, "some-file"), []byte("hello"), 0644); err != nil {
t.Fatal(err)
}
d, err := Open(dir)
diff --git a/src/os/os_windows_test.go b/src/os/os_windows_test.go
index e002774844..8d1d1f61b2 100644
--- a/src/os/os_windows_test.go
+++ b/src/os/os_windows_test.go
@@ -13,7 +13,6 @@ import (
"internal/testenv"
"io"
"io/fs"
- "io/ioutil"
"os"
osexec "os/exec"
"path/filepath"
@@ -31,7 +30,7 @@ import (
type syscallDescriptor = syscall.Handle
func TestSameWindowsFile(t *testing.T) {
- temp, err := ioutil.TempDir("", "TestSameWindowsFile")
+ temp, err := os.MkdirTemp("", "TestSameWindowsFile")
if err != nil {
t.Fatal(err)
}
@@ -90,7 +89,7 @@ type dirLinkTest struct {
}
func testDirLinks(t *testing.T, tests []dirLinkTest) {
- tmpdir, err := ioutil.TempDir("", "testDirLinks")
+ tmpdir, err := os.MkdirTemp("", "testDirLinks")
if err != nil {
t.Fatal(err)
}
@@ -115,7 +114,7 @@ func testDirLinks(t *testing.T, tests []dirLinkTest) {
if err != nil {
t.Fatal(err)
}
- err = ioutil.WriteFile(filepath.Join(dir, "abc"), []byte("abc"), 0644)
+ err = os.WriteFile(filepath.Join(dir, "abc"), []byte("abc"), 0644)
if err != nil {
t.Fatal(err)
}
@@ -127,7 +126,7 @@ func testDirLinks(t *testing.T, tests []dirLinkTest) {
continue
}
- data, err := ioutil.ReadFile(filepath.Join(link, "abc"))
+ data, err := os.ReadFile(filepath.Join(link, "abc"))
if err != nil {
t.Errorf("failed to read abc file: %v", err)
continue
@@ -439,7 +438,7 @@ func TestNetworkSymbolicLink(t *testing.T) {
const _NERR_ServerNotStarted = syscall.Errno(2114)
- dir, err := ioutil.TempDir("", "TestNetworkSymbolicLink")
+ dir, err := os.MkdirTemp("", "TestNetworkSymbolicLink")
if err != nil {
t.Fatal(err)
}
@@ -600,7 +599,7 @@ func TestStatDir(t *testing.T) {
}
func TestOpenVolumeName(t *testing.T) {
- tmpdir, err := ioutil.TempDir("", "TestOpenVolumeName")
+ tmpdir, err := os.MkdirTemp("", "TestOpenVolumeName")
if err != nil {
t.Fatal(err)
}
@@ -619,7 +618,7 @@ func TestOpenVolumeName(t *testing.T) {
want := []string{"file1", "file2", "file3", "gopher.txt"}
sort.Strings(want)
for _, name := range want {
- err := ioutil.WriteFile(filepath.Join(tmpdir, name), nil, 0777)
+ err := os.WriteFile(filepath.Join(tmpdir, name), nil, 0777)
if err != nil {
t.Fatal(err)
}
@@ -643,7 +642,7 @@ func TestOpenVolumeName(t *testing.T) {
}
func TestDeleteReadOnly(t *testing.T) {
- tmpdir, err := ioutil.TempDir("", "TestDeleteReadOnly")
+ tmpdir, err := os.MkdirTemp("", "TestDeleteReadOnly")
if err != nil {
t.Fatal(err)
}
@@ -804,7 +803,7 @@ func compareCommandLineToArgvWithSyscall(t *testing.T, cmd string) {
}
func TestCmdArgs(t *testing.T) {
- tmpdir, err := ioutil.TempDir("", "TestCmdArgs")
+ tmpdir, err := os.MkdirTemp("", "TestCmdArgs")
if err != nil {
t.Fatal(err)
}
@@ -823,7 +822,7 @@ func main() {
}
`
src := filepath.Join(tmpdir, "main.go")
- err = ioutil.WriteFile(src, []byte(prog), 0666)
+ err = os.WriteFile(src, []byte(prog), 0666)
if err != nil {
t.Fatal(err)
}
@@ -971,14 +970,14 @@ func TestSymlinkCreation(t *testing.T) {
}
t.Parallel()
- temp, err := ioutil.TempDir("", "TestSymlinkCreation")
+ temp, err := os.MkdirTemp("", "TestSymlinkCreation")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(temp)
dummyFile := filepath.Join(temp, "file")
- err = ioutil.WriteFile(dummyFile, []byte(""), 0644)
+ err = os.WriteFile(dummyFile, []byte(""), 0644)
if err != nil {
t.Fatal(err)
}
@@ -1207,7 +1206,7 @@ func mklinkd(t *testing.T, link, target string) {
}
func TestWindowsReadlink(t *testing.T) {
- tmpdir, err := ioutil.TempDir("", "TestWindowsReadlink")
+ tmpdir, err := os.MkdirTemp("", "TestWindowsReadlink")
if err != nil {
t.Fatal(err)
}
@@ -1272,7 +1271,7 @@ func TestWindowsReadlink(t *testing.T) {
testReadlink(t, "reldirlink", "dir")
file := filepath.Join(tmpdir, "file")
- err = ioutil.WriteFile(file, []byte(""), 0666)
+ err = os.WriteFile(file, []byte(""), 0666)
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/path_test.go b/src/os/path_test.go
index 3fe9c5ffa3..b79d958711 100644
--- a/src/os/path_test.go
+++ b/src/os/path_test.go
@@ -6,7 +6,7 @@ package os_test
import (
"internal/testenv"
- "io/ioutil"
+ "os"
. "os"
"path/filepath"
"runtime"
@@ -78,7 +78,7 @@ func TestMkdirAll(t *testing.T) {
func TestMkdirAllWithSymlink(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpDir, err := ioutil.TempDir("", "TestMkdirAllWithSymlink-")
+ tmpDir, err := os.MkdirTemp("", "TestMkdirAllWithSymlink-")
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/path_windows_test.go b/src/os/path_windows_test.go
index 862b404362..869db8fd6c 100644
--- a/src/os/path_windows_test.go
+++ b/src/os/path_windows_test.go
@@ -5,7 +5,6 @@
package os_test
import (
- "io/ioutil"
"os"
"strings"
"syscall"
@@ -48,7 +47,7 @@ func TestFixLongPath(t *testing.T) {
}
func TestMkdirAllExtendedLength(t *testing.T) {
- tmpDir, err := ioutil.TempDir("", "TestMkdirAllExtendedLength")
+ tmpDir, err := os.MkdirTemp("", "TestMkdirAllExtendedLength")
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/pipe_test.go b/src/os/pipe_test.go
index 0593efec75..b98e53845c 100644
--- a/src/os/pipe_test.go
+++ b/src/os/pipe_test.go
@@ -14,7 +14,6 @@ import (
"internal/testenv"
"io"
"io/fs"
- "io/ioutil"
"os"
osexec "os/exec"
"os/signal"
@@ -161,7 +160,7 @@ func testClosedPipeRace(t *testing.T, read bool) {
// Get the amount we have to write to overload a pipe
// with no reader.
limit = 131073
- if b, err := ioutil.ReadFile("/proc/sys/fs/pipe-max-size"); err == nil {
+ if b, err := os.ReadFile("/proc/sys/fs/pipe-max-size"); err == nil {
if i, err := strconv.Atoi(strings.TrimSpace(string(b))); err == nil {
limit = i + 1
}
diff --git a/src/os/readfrom_linux_test.go b/src/os/readfrom_linux_test.go
index 00faf39fe5..37047175e6 100644
--- a/src/os/readfrom_linux_test.go
+++ b/src/os/readfrom_linux_test.go
@@ -8,8 +8,8 @@ import (
"bytes"
"internal/poll"
"io"
- "io/ioutil"
"math/rand"
+ "os"
. "os"
"path/filepath"
"strconv"
@@ -173,7 +173,7 @@ func TestCopyFileRange(t *testing.T) {
})
t.Run("Nil", func(t *testing.T) {
var nilFile *File
- anyFile, err := ioutil.TempFile("", "")
+ anyFile, err := os.CreateTemp("", "")
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/removeall_test.go b/src/os/removeall_test.go
index 90efa313ea..3a2f6e3759 100644
--- a/src/os/removeall_test.go
+++ b/src/os/removeall_test.go
@@ -6,7 +6,7 @@ package os_test
import (
"fmt"
- "io/ioutil"
+ "os"
. "os"
"path/filepath"
"runtime"
@@ -15,7 +15,7 @@ import (
)
func TestRemoveAll(t *testing.T) {
- tmpDir, err := ioutil.TempDir("", "TestRemoveAll-")
+ tmpDir, err := os.MkdirTemp("", "TestRemoveAll-")
if err != nil {
t.Fatal(err)
}
@@ -128,7 +128,7 @@ func TestRemoveAllLarge(t *testing.T) {
t.Skip("skipping in short mode")
}
- tmpDir, err := ioutil.TempDir("", "TestRemoveAll-")
+ tmpDir, err := os.MkdirTemp("", "TestRemoveAll-")
if err != nil {
t.Fatal(err)
}
@@ -169,7 +169,7 @@ func TestRemoveAllLongPath(t *testing.T) {
t.Fatalf("Could not get wd: %s", err)
}
- startPath, err := ioutil.TempDir("", "TestRemoveAllLongPath-")
+ startPath, err := os.MkdirTemp("", "TestRemoveAllLongPath-")
if err != nil {
t.Fatalf("Could not create TempDir: %s", err)
}
@@ -211,7 +211,7 @@ func TestRemoveAllDot(t *testing.T) {
if err != nil {
t.Fatalf("Could not get wd: %s", err)
}
- tempDir, err := ioutil.TempDir("", "TestRemoveAllDot-")
+ tempDir, err := os.MkdirTemp("", "TestRemoveAllDot-")
if err != nil {
t.Fatalf("Could not create TempDir: %s", err)
}
@@ -236,7 +236,7 @@ func TestRemoveAllDot(t *testing.T) {
func TestRemoveAllDotDot(t *testing.T) {
t.Parallel()
- tempDir, err := ioutil.TempDir("", "TestRemoveAllDotDot-")
+ tempDir, err := os.MkdirTemp("", "TestRemoveAllDotDot-")
if err != nil {
t.Fatal(err)
}
@@ -261,7 +261,7 @@ func TestRemoveAllDotDot(t *testing.T) {
func TestRemoveReadOnlyDir(t *testing.T) {
t.Parallel()
- tempDir, err := ioutil.TempDir("", "TestRemoveReadOnlyDir-")
+ tempDir, err := os.MkdirTemp("", "TestRemoveReadOnlyDir-")
if err != nil {
t.Fatal(err)
}
@@ -298,7 +298,7 @@ func TestRemoveAllButReadOnlyAndPathError(t *testing.T) {
t.Parallel()
- tempDir, err := ioutil.TempDir("", "TestRemoveAllButReadOnly-")
+ tempDir, err := os.MkdirTemp("", "TestRemoveAllButReadOnly-")
if err != nil {
t.Fatal(err)
}
@@ -389,7 +389,7 @@ func TestRemoveUnreadableDir(t *testing.T) {
t.Parallel()
- tempDir, err := ioutil.TempDir("", "TestRemoveAllButReadOnly-")
+ tempDir, err := os.MkdirTemp("", "TestRemoveAllButReadOnly-")
if err != nil {
t.Fatal(err)
}
@@ -413,7 +413,7 @@ func TestRemoveAllWithMoreErrorThanReqSize(t *testing.T) {
t.Skip("skipping in short mode")
}
- tmpDir, err := ioutil.TempDir("", "TestRemoveAll-")
+ tmpDir, err := os.MkdirTemp("", "TestRemoveAll-")
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/signal/signal_test.go b/src/os/signal/signal_test.go
index 23e33fe82b..8945cbfccb 100644
--- a/src/os/signal/signal_test.go
+++ b/src/os/signal/signal_test.go
@@ -12,7 +12,6 @@ import (
"flag"
"fmt"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"runtime"
@@ -304,7 +303,7 @@ func TestDetectNohup(t *testing.T) {
os.Remove("nohup.out")
out, err := exec.Command("/usr/bin/nohup", os.Args[0], "-test.run=TestDetectNohup", "-check_sighup_ignored").CombinedOutput()
- data, _ := ioutil.ReadFile("nohup.out")
+ data, _ := os.ReadFile("nohup.out")
os.Remove("nohup.out")
if err != nil {
t.Errorf("ran test with -check_sighup_ignored under nohup and it failed: expected success.\nError: %v\nOutput:\n%s%s", err, out, data)
diff --git a/src/os/signal/signal_windows_test.go b/src/os/signal/signal_windows_test.go
index c2b59010fc..4640428587 100644
--- a/src/os/signal/signal_windows_test.go
+++ b/src/os/signal/signal_windows_test.go
@@ -7,7 +7,6 @@ package signal
import (
"bytes"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -57,7 +56,7 @@ func main() {
}
}
`
- tmp, err := ioutil.TempDir("", "TestCtrlBreak")
+ tmp, err := os.MkdirTemp("", "TestCtrlBreak")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
diff --git a/src/os/stat_test.go b/src/os/stat_test.go
index 88b789080e..c409f0ff18 100644
--- a/src/os/stat_test.go
+++ b/src/os/stat_test.go
@@ -7,7 +7,6 @@ package os_test
import (
"internal/testenv"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -186,7 +185,7 @@ func testSymlinkSameFile(t *testing.T, path, link string) {
func TestDirAndSymlinkStats(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpdir, err := ioutil.TempDir("", "TestDirAndSymlinkStats")
+ tmpdir, err := os.MkdirTemp("", "TestDirAndSymlinkStats")
if err != nil {
t.Fatal(err)
}
@@ -219,14 +218,14 @@ func TestDirAndSymlinkStats(t *testing.T) {
func TestFileAndSymlinkStats(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpdir, err := ioutil.TempDir("", "TestFileAndSymlinkStats")
+ tmpdir, err := os.MkdirTemp("", "TestFileAndSymlinkStats")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmpdir)
file := filepath.Join(tmpdir, "file")
- err = ioutil.WriteFile(file, []byte(""), 0644)
+ err = os.WriteFile(file, []byte(""), 0644)
if err != nil {
t.Fatal(err)
}
@@ -253,7 +252,7 @@ func TestFileAndSymlinkStats(t *testing.T) {
func TestSymlinkWithTrailingSlash(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpdir, err := ioutil.TempDir("", "TestSymlinkWithTrailingSlash")
+ tmpdir, err := os.MkdirTemp("", "TestSymlinkWithTrailingSlash")
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/timeout_test.go b/src/os/timeout_test.go
index d848e41642..0a39f46333 100644
--- a/src/os/timeout_test.go
+++ b/src/os/timeout_test.go
@@ -11,7 +11,6 @@ package os_test
import (
"fmt"
"io"
- "io/ioutil"
"math/rand"
"os"
"os/signal"
@@ -29,7 +28,7 @@ func TestNonpollableDeadline(t *testing.T) {
t.Skipf("skipping on %s", runtime.GOOS)
}
- f, err := ioutil.TempFile("", "ostest")
+ f, err := os.CreateTemp("", "ostest")
if err != nil {
t.Fatal(err)
}
diff --git a/src/os/user/lookup_plan9.go b/src/os/user/lookup_plan9.go
index ea3ce0bc7c..33ae3a6adf 100644
--- a/src/os/user/lookup_plan9.go
+++ b/src/os/user/lookup_plan9.go
@@ -6,7 +6,6 @@ package user
import (
"fmt"
- "io/ioutil"
"os"
"syscall"
)
@@ -23,7 +22,7 @@ func init() {
}
func current() (*User, error) {
- ubytes, err := ioutil.ReadFile(userFile)
+ ubytes, err := os.ReadFile(userFile)
if err != nil {
return nil, fmt.Errorf("user: %s", err)
}
diff --git a/src/path/filepath/example_unix_walk_test.go b/src/path/filepath/example_unix_walk_test.go
index 66dc7f6b53..c8a818fd6e 100644
--- a/src/path/filepath/example_unix_walk_test.go
+++ b/src/path/filepath/example_unix_walk_test.go
@@ -9,13 +9,12 @@ package filepath_test
import (
"fmt"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
)
func prepareTestDirTree(tree string) (string, error) {
- tmpDir, err := ioutil.TempDir("", "")
+ tmpDir, err := os.MkdirTemp("", "")
if err != nil {
return "", fmt.Errorf("error creating temp directory: %v\n", err)
}
diff --git a/src/path/filepath/match_test.go b/src/path/filepath/match_test.go
index 1c3b567fa3..48880ea439 100644
--- a/src/path/filepath/match_test.go
+++ b/src/path/filepath/match_test.go
@@ -7,7 +7,6 @@ package filepath_test
import (
"fmt"
"internal/testenv"
- "io/ioutil"
"os"
. "path/filepath"
"reflect"
@@ -182,7 +181,7 @@ var globSymlinkTests = []struct {
func TestGlobSymlink(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpDir, err := ioutil.TempDir("", "globsymlink")
+ tmpDir, err := os.MkdirTemp("", "globsymlink")
if err != nil {
t.Fatal("creating temp dir:", err)
}
@@ -268,7 +267,7 @@ func TestWindowsGlob(t *testing.T) {
t.Skipf("skipping windows specific test")
}
- tmpDir, err := ioutil.TempDir("", "TestWindowsGlob")
+ tmpDir, err := os.MkdirTemp("", "TestWindowsGlob")
if err != nil {
t.Fatal(err)
}
@@ -302,7 +301,7 @@ func TestWindowsGlob(t *testing.T) {
}
}
for _, file := range files {
- err := ioutil.WriteFile(Join(tmpDir, file), nil, 0666)
+ err := os.WriteFile(Join(tmpDir, file), nil, 0666)
if err != nil {
t.Fatal(err)
}
diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go
index d760530e26..8616256ac0 100644
--- a/src/path/filepath/path_test.go
+++ b/src/path/filepath/path_test.go
@@ -9,7 +9,6 @@ import (
"fmt"
"internal/testenv"
"io/fs"
- "io/ioutil"
"os"
"path/filepath"
"reflect"
@@ -416,7 +415,7 @@ func chtmpdir(t *testing.T) (restore func()) {
if err != nil {
t.Fatalf("chtmpdir: %v", err)
}
- d, err := ioutil.TempDir("", "test")
+ d, err := os.MkdirTemp("", "test")
if err != nil {
t.Fatalf("chtmpdir: %v", err)
}
@@ -459,7 +458,7 @@ func testWalk(t *testing.T, walk func(string, fs.WalkDirFunc) error, errVisit in
defer restore()
}
- tmpDir, err := ioutil.TempDir("", "TestWalk")
+ tmpDir, err := os.MkdirTemp("", "TestWalk")
if err != nil {
t.Fatal("creating temp dir:", err)
}
@@ -563,7 +562,7 @@ func touch(t *testing.T, name string) {
}
func TestWalkSkipDirOnFile(t *testing.T) {
- td, err := ioutil.TempDir("", "walktest")
+ td, err := os.MkdirTemp("", "walktest")
if err != nil {
t.Fatal(err)
}
@@ -613,7 +612,7 @@ func TestWalkSkipDirOnFile(t *testing.T) {
}
func TestWalkFileError(t *testing.T) {
- td, err := ioutil.TempDir("", "walktest")
+ td, err := os.MkdirTemp("", "walktest")
if err != nil {
t.Fatal(err)
}
@@ -892,7 +891,7 @@ func testEvalSymlinksAfterChdir(t *testing.T, wd, path, want string) {
func TestEvalSymlinks(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpDir, err := ioutil.TempDir("", "evalsymlink")
+ tmpDir, err := os.MkdirTemp("", "evalsymlink")
if err != nil {
t.Fatal("creating temp dir:", err)
}
@@ -978,7 +977,7 @@ func TestEvalSymlinksIsNotExist(t *testing.T) {
func TestIssue13582(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpDir, err := ioutil.TempDir("", "issue13582")
+ tmpDir, err := os.MkdirTemp("", "issue13582")
if err != nil {
t.Fatal(err)
}
@@ -995,7 +994,7 @@ func TestIssue13582(t *testing.T) {
t.Fatal(err)
}
file := filepath.Join(linkToDir, "file")
- err = ioutil.WriteFile(file, nil, 0644)
+ err = os.WriteFile(file, nil, 0644)
if err != nil {
t.Fatal(err)
}
@@ -1065,7 +1064,7 @@ var absTests = []string{
}
func TestAbs(t *testing.T) {
- root, err := ioutil.TempDir("", "TestAbs")
+ root, err := os.MkdirTemp("", "TestAbs")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
@@ -1136,7 +1135,7 @@ func TestAbs(t *testing.T) {
// We test it separately from all other absTests because the empty string is not
// a valid path, so it can't be used with os.Stat.
func TestAbsEmptyString(t *testing.T) {
- root, err := ioutil.TempDir("", "TestAbsEmptyString")
+ root, err := os.MkdirTemp("", "TestAbsEmptyString")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
@@ -1357,7 +1356,7 @@ func TestBug3486(t *testing.T) { // https://golang.org/issue/3486
}
func testWalkSymlink(t *testing.T, mklink func(target, link string) error) {
- tmpdir, err := ioutil.TempDir("", "testWalkSymlink")
+ tmpdir, err := os.MkdirTemp("", "testWalkSymlink")
if err != nil {
t.Fatal(err)
}
@@ -1407,14 +1406,14 @@ func TestWalkSymlink(t *testing.T) {
}
func TestIssue29372(t *testing.T) {
- tmpDir, err := ioutil.TempDir("", "TestIssue29372")
+ tmpDir, err := os.MkdirTemp("", "TestIssue29372")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(tmpDir)
path := filepath.Join(tmpDir, "file.txt")
- err = ioutil.WriteFile(path, nil, 0644)
+ err = os.WriteFile(path, nil, 0644)
if err != nil {
t.Fatal(err)
}
@@ -1443,7 +1442,7 @@ func TestEvalSymlinksAboveRoot(t *testing.T) {
t.Parallel()
- tmpDir, err := ioutil.TempDir("", "TestEvalSymlinksAboveRoot")
+ tmpDir, err := os.MkdirTemp("", "TestEvalSymlinksAboveRoot")
if err != nil {
t.Fatal(err)
}
@@ -1460,7 +1459,7 @@ func TestEvalSymlinksAboveRoot(t *testing.T) {
if err := os.Symlink(filepath.Join(evalTmpDir, "a"), filepath.Join(evalTmpDir, "b")); err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(filepath.Join(evalTmpDir, "a", "file"), nil, 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(evalTmpDir, "a", "file"), nil, 0666); err != nil {
t.Fatal(err)
}
@@ -1491,7 +1490,7 @@ func TestEvalSymlinksAboveRoot(t *testing.T) {
func TestEvalSymlinksAboveRootChdir(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpDir, err := ioutil.TempDir("", "TestEvalSymlinksAboveRootChdir")
+ tmpDir, err := os.MkdirTemp("", "TestEvalSymlinksAboveRootChdir")
if err != nil {
t.Fatal(err)
}
@@ -1514,7 +1513,7 @@ func TestEvalSymlinksAboveRootChdir(t *testing.T) {
if err := os.Symlink(subdir, "c"); err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(filepath.Join(subdir, "file"), nil, 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(subdir, "file"), nil, 0666); err != nil {
t.Fatal(err)
}
diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go
index 9309a7dc4d..1c3d84c62d 100644
--- a/src/path/filepath/path_windows_test.go
+++ b/src/path/filepath/path_windows_test.go
@@ -9,7 +9,6 @@ import (
"fmt"
"internal/testenv"
"io/fs"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -38,7 +37,7 @@ func testWinSplitListTestIsValid(t *testing.T, ti int, tt SplitListTest,
perm fs.FileMode = 0700
)
- tmp, err := ioutil.TempDir("", "testWinSplitListTestIsValid")
+ tmp, err := os.MkdirTemp("", "testWinSplitListTestIsValid")
if err != nil {
t.Fatalf("TempDir failed: %v", err)
}
@@ -63,7 +62,7 @@ func testWinSplitListTestIsValid(t *testing.T, ti int, tt SplitListTest,
return
}
fn, data := filepath.Join(dd, cmdfile), []byte("@echo "+d+"\r\n")
- if err = ioutil.WriteFile(fn, data, perm); err != nil {
+ if err = os.WriteFile(fn, data, perm); err != nil {
t.Errorf("%d,%d: WriteFile(%#q) failed: %v", ti, i, fn, err)
return
}
@@ -104,7 +103,7 @@ func testWinSplitListTestIsValid(t *testing.T, ti int, tt SplitListTest,
func TestWindowsEvalSymlinks(t *testing.T) {
testenv.MustHaveSymlink(t)
- tmpDir, err := ioutil.TempDir("", "TestWindowsEvalSymlinks")
+ tmpDir, err := os.MkdirTemp("", "TestWindowsEvalSymlinks")
if err != nil {
t.Fatal(err)
}
@@ -162,13 +161,13 @@ func TestWindowsEvalSymlinks(t *testing.T) {
// TestEvalSymlinksCanonicalNames verify that EvalSymlinks
// returns "canonical" path names on windows.
func TestEvalSymlinksCanonicalNames(t *testing.T) {
- tmp, err := ioutil.TempDir("", "evalsymlinkcanonical")
+ tmp, err := os.MkdirTemp("", "evalsymlinkcanonical")
if err != nil {
t.Fatal("creating temp dir:", err)
}
defer os.RemoveAll(tmp)
- // ioutil.TempDir might return "non-canonical" name.
+ // os.MkdirTemp might return "non-canonical" name.
cTmpName, err := filepath.EvalSymlinks(tmp)
if err != nil {
t.Errorf("EvalSymlinks(%q) error: %v", tmp, err)
@@ -418,7 +417,7 @@ func TestToNorm(t *testing.T) {
{".", `\\localhost\c$`, `\\localhost\c$`},
}
- tmp, err := ioutil.TempDir("", "testToNorm")
+ tmp, err := os.MkdirTemp("", "testToNorm")
if err != nil {
t.Fatal(err)
}
@@ -429,7 +428,7 @@ func TestToNorm(t *testing.T) {
}
}()
- // ioutil.TempDir might return "non-canonical" name.
+ // os.MkdirTemp might return "non-canonical" name.
ctmp, err := filepath.EvalSymlinks(tmp)
if err != nil {
t.Fatal(err)
@@ -527,7 +526,7 @@ func TestNTNamespaceSymlink(t *testing.T) {
t.Skip("skipping test because mklink command does not support junctions")
}
- tmpdir, err := ioutil.TempDir("", "TestNTNamespaceSymlink")
+ tmpdir, err := os.MkdirTemp("", "TestNTNamespaceSymlink")
if err != nil {
t.Fatal(err)
}
@@ -564,7 +563,7 @@ func TestNTNamespaceSymlink(t *testing.T) {
testenv.MustHaveSymlink(t)
file := filepath.Join(tmpdir, "file")
- err = ioutil.WriteFile(file, []byte(""), 0666)
+ err = os.WriteFile(file, []byte(""), 0666)
if err != nil {
t.Fatal(err)
}
diff --git a/src/runtime/crash_test.go b/src/runtime/crash_test.go
index 5e22b7593e..58ad4f3eba 100644
--- a/src/runtime/crash_test.go
+++ b/src/runtime/crash_test.go
@@ -9,7 +9,6 @@ import (
"flag"
"fmt"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -117,7 +116,7 @@ func buildTestProg(t *testing.T, binary string, flags ...string) (string, error)
testprog.Lock()
defer testprog.Unlock()
if testprog.dir == "" {
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
diff --git a/src/runtime/crash_unix_test.go b/src/runtime/crash_unix_test.go
index ebbdbfe5b9..803b031873 100644
--- a/src/runtime/crash_unix_test.go
+++ b/src/runtime/crash_unix_test.go
@@ -10,7 +10,6 @@ import (
"bytes"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -85,13 +84,13 @@ func TestCrashDumpsAllThreads(t *testing.T) {
t.Parallel()
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
defer os.RemoveAll(dir)
- if err := ioutil.WriteFile(filepath.Join(dir, "main.go"), []byte(crashDumpsAllThreadsSource), 0666); err != nil {
+ if err := os.WriteFile(filepath.Join(dir, "main.go"), []byte(crashDumpsAllThreadsSource), 0666); err != nil {
t.Fatalf("failed to create Go file: %v", err)
}
diff --git a/src/runtime/debug/heapdump_test.go b/src/runtime/debug/heapdump_test.go
index de1ec27d21..768934d05d 100644
--- a/src/runtime/debug/heapdump_test.go
+++ b/src/runtime/debug/heapdump_test.go
@@ -5,7 +5,6 @@
package debug_test
import (
- "io/ioutil"
"os"
"runtime"
. "runtime/debug"
@@ -16,7 +15,7 @@ func TestWriteHeapDumpNonempty(t *testing.T) {
if runtime.GOOS == "js" {
t.Skipf("WriteHeapDump is not available on %s.", runtime.GOOS)
}
- f, err := ioutil.TempFile("", "heapdumptest")
+ f, err := os.CreateTemp("", "heapdumptest")
if err != nil {
t.Fatalf("TempFile failed: %v", err)
}
@@ -45,7 +44,7 @@ func TestWriteHeapDumpFinalizers(t *testing.T) {
if runtime.GOOS == "js" {
t.Skipf("WriteHeapDump is not available on %s.", runtime.GOOS)
}
- f, err := ioutil.TempFile("", "heapdumptest")
+ f, err := os.CreateTemp("", "heapdumptest")
if err != nil {
t.Fatalf("TempFile failed: %v", err)
}
diff --git a/src/runtime/debug_test.go b/src/runtime/debug_test.go
index 722e81121f..a0b3f84382 100644
--- a/src/runtime/debug_test.go
+++ b/src/runtime/debug_test.go
@@ -17,7 +17,7 @@ package runtime_test
import (
"fmt"
- "io/ioutil"
+ "os"
"regexp"
"runtime"
"runtime/debug"
@@ -95,7 +95,7 @@ func debugCallTKill(tid int) error {
// Linux-specific.
func skipUnderDebugger(t *testing.T) {
pid := syscall.Getpid()
- status, err := ioutil.ReadFile(fmt.Sprintf("/proc/%d/status", pid))
+ status, err := os.ReadFile(fmt.Sprintf("/proc/%d/status", pid))
if err != nil {
t.Logf("couldn't get proc tracer: %s", err)
return
diff --git a/src/runtime/env_plan9.go b/src/runtime/env_plan9.go
index b7ea863735..f1ac4760a7 100644
--- a/src/runtime/env_plan9.go
+++ b/src/runtime/env_plan9.go
@@ -23,8 +23,8 @@ const (
// to the (possibly shared) Plan 9 environment, so that Setenv and Getenv
// conform to the same Posix semantics as on other operating systems.
// For Plan 9 shared environment semantics, instead of Getenv(key) and
-// Setenv(key, value), one can use ioutil.ReadFile("/env/" + key) and
-// ioutil.WriteFile("/env/" + key, value, 0666) respectively.
+// Setenv(key, value), one can use os.ReadFile("/env/" + key) and
+// os.WriteFile("/env/" + key, value, 0666) respectively.
//go:nosplit
func goenvs() {
buf := make([]byte, envBufSize)
diff --git a/src/runtime/internal/sys/gengoos.go b/src/runtime/internal/sys/gengoos.go
index 2a4bf0c3b4..9bbc48d94f 100644
--- a/src/runtime/internal/sys/gengoos.go
+++ b/src/runtime/internal/sys/gengoos.go
@@ -9,8 +9,8 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"log"
+ "os"
"strconv"
"strings"
)
@@ -18,7 +18,7 @@ import (
var gooses, goarches []string
func main() {
- data, err := ioutil.ReadFile("../../../go/build/syslist.go")
+ data, err := os.ReadFile("../../../go/build/syslist.go")
if err != nil {
log.Fatal(err)
}
@@ -68,7 +68,7 @@ func main() {
}
fmt.Fprintf(&buf, "const Goos%s = %d\n", strings.Title(goos), value)
}
- err := ioutil.WriteFile("zgoos_"+target+".go", buf.Bytes(), 0666)
+ err := os.WriteFile("zgoos_"+target+".go", buf.Bytes(), 0666)
if err != nil {
log.Fatal(err)
}
@@ -90,7 +90,7 @@ func main() {
}
fmt.Fprintf(&buf, "const Goarch%s = %d\n", strings.Title(goarch), value)
}
- err := ioutil.WriteFile("zgoarch_"+target+".go", buf.Bytes(), 0666)
+ err := os.WriteFile("zgoarch_"+target+".go", buf.Bytes(), 0666)
if err != nil {
log.Fatal(err)
}
diff --git a/src/runtime/memmove_linux_amd64_test.go b/src/runtime/memmove_linux_amd64_test.go
index d0e8b42a5a..b3ccd907b9 100644
--- a/src/runtime/memmove_linux_amd64_test.go
+++ b/src/runtime/memmove_linux_amd64_test.go
@@ -5,7 +5,6 @@
package runtime_test
import (
- "io/ioutil"
"os"
"reflect"
"syscall"
@@ -18,7 +17,7 @@ import (
func TestMemmoveOverflow(t *testing.T) {
t.Parallel()
// Create a temporary file.
- tmp, err := ioutil.TempFile("", "go-memmovetest")
+ tmp, err := os.CreateTemp("", "go-memmovetest")
if err != nil {
t.Fatal(err)
}
diff --git a/src/runtime/mkduff.go b/src/runtime/mkduff.go
index 6ddf0256e9..94ae75fbfe 100644
--- a/src/runtime/mkduff.go
+++ b/src/runtime/mkduff.go
@@ -27,8 +27,8 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"log"
+ "os"
)
func main() {
@@ -54,7 +54,7 @@ func gen(arch string, tags, zero, copy func(io.Writer)) {
fmt.Fprintln(&buf)
copy(&buf)
- if err := ioutil.WriteFile("duff_"+arch+".s", buf.Bytes(), 0644); err != nil {
+ if err := os.WriteFile("duff_"+arch+".s", buf.Bytes(), 0644); err != nil {
log.Fatalln(err)
}
}
diff --git a/src/runtime/mkfastlog2table.go b/src/runtime/mkfastlog2table.go
index 305c84a7c1..d650292394 100644
--- a/src/runtime/mkfastlog2table.go
+++ b/src/runtime/mkfastlog2table.go
@@ -12,9 +12,9 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"log"
"math"
+ "os"
)
func main() {
@@ -36,7 +36,7 @@ func main() {
}
fmt.Fprintln(&buf, "}")
- if err := ioutil.WriteFile("fastlog2table.go", buf.Bytes(), 0644); err != nil {
+ if err := os.WriteFile("fastlog2table.go", buf.Bytes(), 0644); err != nil {
log.Fatalln(err)
}
}
diff --git a/src/runtime/mksizeclasses.go b/src/runtime/mksizeclasses.go
index 1a210953a4..b92d1fed5f 100644
--- a/src/runtime/mksizeclasses.go
+++ b/src/runtime/mksizeclasses.go
@@ -35,7 +35,6 @@ import (
"fmt"
"go/format"
"io"
- "io/ioutil"
"log"
"os"
)
@@ -65,7 +64,7 @@ func main() {
if *stdout {
_, err = os.Stdout.Write(out)
} else {
- err = ioutil.WriteFile("sizeclasses.go", out, 0666)
+ err = os.WriteFile("sizeclasses.go", out, 0666)
}
if err != nil {
log.Fatal(err)
diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go
index b807072485..b6ee160e84 100644
--- a/src/runtime/pprof/pprof_test.go
+++ b/src/runtime/pprof/pprof_test.go
@@ -13,7 +13,6 @@ import (
"internal/profile"
"internal/testenv"
"io"
- "io/ioutil"
"math/big"
"os"
"os/exec"
@@ -1179,7 +1178,7 @@ func TestLabelRace(t *testing.T) {
// Check that there is no deadlock when the program receives SIGPROF while in
// 64bit atomics' critical section. Used to happen on mips{,le}. See #20146.
func TestAtomicLoadStore64(t *testing.T) {
- f, err := ioutil.TempFile("", "profatomic")
+ f, err := os.CreateTemp("", "profatomic")
if err != nil {
t.Fatalf("TempFile: %v", err)
}
@@ -1208,7 +1207,7 @@ func TestAtomicLoadStore64(t *testing.T) {
func TestTracebackAll(t *testing.T) {
// With gccgo, if a profiling signal arrives at the wrong time
// during traceback, it may crash or hang. See issue #29448.
- f, err := ioutil.TempFile("", "proftraceback")
+ f, err := os.CreateTemp("", "proftraceback")
if err != nil {
t.Fatalf("TempFile: %v", err)
}
diff --git a/src/runtime/pprof/proto.go b/src/runtime/pprof/proto.go
index 8519af6985..bdb4454b6e 100644
--- a/src/runtime/pprof/proto.go
+++ b/src/runtime/pprof/proto.go
@@ -9,7 +9,7 @@ import (
"compress/gzip"
"fmt"
"io"
- "io/ioutil"
+ "os"
"runtime"
"strconv"
"time"
@@ -575,7 +575,7 @@ func (b *profileBuilder) emitLocation() uint64 {
// It saves the address ranges of the mappings in b.mem for use
// when emitting locations.
func (b *profileBuilder) readMapping() {
- data, _ := ioutil.ReadFile("/proc/self/maps")
+ data, _ := os.ReadFile("/proc/self/maps")
parseProcSelfMaps(data, b.addMapping)
if len(b.mem) == 0 { // pprof expects a map entry, so fake one.
b.addMappingEntry(0, 0, 0, "", "", true)
diff --git a/src/runtime/pprof/proto_test.go b/src/runtime/pprof/proto_test.go
index 3043d5353f..5eb1aab140 100644
--- a/src/runtime/pprof/proto_test.go
+++ b/src/runtime/pprof/proto_test.go
@@ -10,7 +10,6 @@ import (
"fmt"
"internal/profile"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"reflect"
@@ -78,7 +77,7 @@ func testPCs(t *testing.T) (addr1, addr2 uint64, map1, map2 *profile.Mapping) {
switch runtime.GOOS {
case "linux", "android", "netbsd":
// Figure out two addresses from /proc/self/maps.
- mmap, err := ioutil.ReadFile("/proc/self/maps")
+ mmap, err := os.ReadFile("/proc/self/maps")
if err != nil {
t.Fatal(err)
}
diff --git a/src/runtime/race/output_test.go b/src/runtime/race/output_test.go
index 5d0192f67f..986667332f 100644
--- a/src/runtime/race/output_test.go
+++ b/src/runtime/race/output_test.go
@@ -8,7 +8,6 @@ package race_test
import (
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -19,7 +18,7 @@ import (
)
func TestOutput(t *testing.T) {
- pkgdir, err := ioutil.TempDir("", "go-build-race-output")
+ pkgdir, err := os.MkdirTemp("", "go-build-race-output")
if err != nil {
t.Fatal(err)
}
@@ -34,7 +33,7 @@ func TestOutput(t *testing.T) {
t.Logf("test %v runs only on %v, skipping: ", test.name, test.goos)
continue
}
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
diff --git a/src/runtime/race/testdata/io_test.go b/src/runtime/race/testdata/io_test.go
index 30a121bee4..c5055f7837 100644
--- a/src/runtime/race/testdata/io_test.go
+++ b/src/runtime/race/testdata/io_test.go
@@ -6,7 +6,6 @@ package race_test
import (
"fmt"
- "io/ioutil"
"net"
"net/http"
"os"
@@ -18,7 +17,7 @@ import (
func TestNoRaceIOFile(t *testing.T) {
x := 0
- path, _ := ioutil.TempDir("", "race_test")
+ path, _ := os.MkdirTemp("", "race_test")
fname := filepath.Join(path, "data")
go func() {
x = 42
diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go
index e52bd1c4c4..5df8c3c745 100644
--- a/src/runtime/runtime-gdb_test.go
+++ b/src/runtime/runtime-gdb_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -170,7 +169,7 @@ func testGdbPython(t *testing.T, cgo bool) {
checkGdbVersion(t)
checkGdbPython(t)
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
@@ -195,7 +194,7 @@ func testGdbPython(t *testing.T, cgo bool) {
}
}
- err = ioutil.WriteFile(filepath.Join(dir, "main.go"), src, 0644)
+ err = os.WriteFile(filepath.Join(dir, "main.go"), src, 0644)
if err != nil {
t.Fatalf("failed to create file: %v", err)
}
@@ -404,7 +403,7 @@ func TestGdbBacktrace(t *testing.T) {
t.Parallel()
checkGdbVersion(t)
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
@@ -412,7 +411,7 @@ func TestGdbBacktrace(t *testing.T) {
// Build the source code.
src := filepath.Join(dir, "main.go")
- err = ioutil.WriteFile(src, []byte(backtraceSource), 0644)
+ err = os.WriteFile(src, []byte(backtraceSource), 0644)
if err != nil {
t.Fatalf("failed to create file: %v", err)
}
@@ -482,7 +481,7 @@ func TestGdbAutotmpTypes(t *testing.T) {
t.Skip("TestGdbAutotmpTypes is too slow on aix/ppc64")
}
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
@@ -490,7 +489,7 @@ func TestGdbAutotmpTypes(t *testing.T) {
// Build the source code.
src := filepath.Join(dir, "main.go")
- err = ioutil.WriteFile(src, []byte(autotmpTypeSource), 0644)
+ err = os.WriteFile(src, []byte(autotmpTypeSource), 0644)
if err != nil {
t.Fatalf("failed to create file: %v", err)
}
@@ -551,7 +550,7 @@ func TestGdbConst(t *testing.T) {
t.Parallel()
checkGdbVersion(t)
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
@@ -559,7 +558,7 @@ func TestGdbConst(t *testing.T) {
// Build the source code.
src := filepath.Join(dir, "main.go")
- err = ioutil.WriteFile(src, []byte(constsSource), 0644)
+ err = os.WriteFile(src, []byte(constsSource), 0644)
if err != nil {
t.Fatalf("failed to create file: %v", err)
}
@@ -618,7 +617,7 @@ func TestGdbPanic(t *testing.T) {
t.Parallel()
checkGdbVersion(t)
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
@@ -626,7 +625,7 @@ func TestGdbPanic(t *testing.T) {
// Build the source code.
src := filepath.Join(dir, "main.go")
- err = ioutil.WriteFile(src, []byte(panicSource), 0644)
+ err = os.WriteFile(src, []byte(panicSource), 0644)
if err != nil {
t.Fatalf("failed to create file: %v", err)
}
@@ -696,7 +695,7 @@ func TestGdbInfCallstack(t *testing.T) {
t.Parallel()
checkGdbVersion(t)
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
@@ -704,7 +703,7 @@ func TestGdbInfCallstack(t *testing.T) {
// Build the source code.
src := filepath.Join(dir, "main.go")
- err = ioutil.WriteFile(src, []byte(InfCallstackSource), 0644)
+ err = os.WriteFile(src, []byte(InfCallstackSource), 0644)
if err != nil {
t.Fatalf("failed to create file: %v", err)
}
diff --git a/src/runtime/runtime-lldb_test.go b/src/runtime/runtime-lldb_test.go
index 1e2e5d5be9..c923b872aa 100644
--- a/src/runtime/runtime-lldb_test.go
+++ b/src/runtime/runtime-lldb_test.go
@@ -6,7 +6,6 @@ package runtime_test
import (
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -143,20 +142,20 @@ func TestLldbPython(t *testing.T) {
checkLldbPython(t)
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
defer os.RemoveAll(dir)
src := filepath.Join(dir, "main.go")
- err = ioutil.WriteFile(src, []byte(lldbHelloSource), 0644)
+ err = os.WriteFile(src, []byte(lldbHelloSource), 0644)
if err != nil {
t.Fatalf("failed to create src file: %v", err)
}
mod := filepath.Join(dir, "go.mod")
- err = ioutil.WriteFile(mod, []byte("module lldbtest"), 0644)
+ err = os.WriteFile(mod, []byte("module lldbtest"), 0644)
if err != nil {
t.Fatalf("failed to create mod file: %v", err)
}
@@ -172,7 +171,7 @@ func TestLldbPython(t *testing.T) {
}
src = filepath.Join(dir, "script.py")
- err = ioutil.WriteFile(src, []byte(lldbScriptSource), 0755)
+ err = os.WriteFile(src, []byte(lldbScriptSource), 0755)
if err != nil {
t.Fatalf("failed to create script: %v", err)
}
diff --git a/src/runtime/signal_windows_test.go b/src/runtime/signal_windows_test.go
index f99857193c..a5a885c2f7 100644
--- a/src/runtime/signal_windows_test.go
+++ b/src/runtime/signal_windows_test.go
@@ -7,7 +7,6 @@ import (
"bytes"
"fmt"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -28,7 +27,7 @@ func TestVectoredHandlerDontCrashOnLibrary(t *testing.T) {
testenv.MustHaveExecPath(t, "gcc")
testprog.Lock()
defer testprog.Unlock()
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
@@ -93,7 +92,7 @@ func TestLibraryCtrlHandler(t *testing.T) {
testenv.MustHaveExecPath(t, "gcc")
testprog.Lock()
defer testprog.Unlock()
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go
index a20573eb6a..fb215b3c31 100644
--- a/src/runtime/syscall_windows_test.go
+++ b/src/runtime/syscall_windows_test.go
@@ -10,7 +10,6 @@ import (
"internal/syscall/windows/sysdll"
"internal/testenv"
"io"
- "io/ioutil"
"math"
"os"
"os/exec"
@@ -446,7 +445,7 @@ func TestStdcallAndCDeclCallbacks(t *testing.T) {
if _, err := exec.LookPath("gcc"); err != nil {
t.Skip("skipping test: gcc is missing")
}
- tmp, err := ioutil.TempDir("", "TestCDeclCallback")
+ tmp, err := os.MkdirTemp("", "TestCDeclCallback")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
@@ -602,14 +601,14 @@ uintptr_t cfunc(callback f, uintptr_t n) {
return r;
}
`
- tmpdir, err := ioutil.TempDir("", "TestReturnAfterStackGrowInCallback")
+ tmpdir, err := os.MkdirTemp("", "TestReturnAfterStackGrowInCallback")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
defer os.RemoveAll(tmpdir)
srcname := "mydll.c"
- err = ioutil.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
+ err = os.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
if err != nil {
t.Fatal(err)
}
@@ -671,14 +670,14 @@ uintptr_t cfunc(uintptr_t a, double b, float c, double d) {
return 0;
}
`
- tmpdir, err := ioutil.TempDir("", "TestFloatArgs")
+ tmpdir, err := os.MkdirTemp("", "TestFloatArgs")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
defer os.RemoveAll(tmpdir)
srcname := "mydll.c"
- err = ioutil.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
+ err = os.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
if err != nil {
t.Fatal(err)
}
@@ -733,14 +732,14 @@ double cfuncDouble(uintptr_t a, double b, float c, double d) {
return 0;
}
`
- tmpdir, err := ioutil.TempDir("", "TestFloatReturn")
+ tmpdir, err := os.MkdirTemp("", "TestFloatReturn")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
defer os.RemoveAll(tmpdir)
srcname := "mydll.c"
- err = ioutil.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
+ err = os.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
if err != nil {
t.Fatal(err)
}
@@ -948,7 +947,7 @@ func TestDLLPreloadMitigation(t *testing.T) {
t.Skip("skipping test: gcc is missing")
}
- tmpdir, err := ioutil.TempDir("", "TestDLLPreloadMitigation")
+ tmpdir, err := os.MkdirTemp("", "TestDLLPreloadMitigation")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
@@ -975,7 +974,7 @@ uintptr_t cfunc(void) {
}
`
srcname := "nojack.c"
- err = ioutil.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
+ err = os.WriteFile(filepath.Join(tmpdir, srcname), []byte(src), 0)
if err != nil {
t.Fatal(err)
}
@@ -1035,7 +1034,7 @@ func TestBigStackCallbackSyscall(t *testing.T) {
t.Fatal("Abs failed: ", err)
}
- tmpdir, err := ioutil.TempDir("", "TestBigStackCallback")
+ tmpdir, err := os.MkdirTemp("", "TestBigStackCallback")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
@@ -1184,14 +1183,14 @@ func BenchmarkOsYield(b *testing.B) {
}
func BenchmarkRunningGoProgram(b *testing.B) {
- tmpdir, err := ioutil.TempDir("", "BenchmarkRunningGoProgram")
+ tmpdir, err := os.MkdirTemp("", "BenchmarkRunningGoProgram")
if err != nil {
b.Fatal(err)
}
defer os.RemoveAll(tmpdir)
src := filepath.Join(tmpdir, "main.go")
- err = ioutil.WriteFile(src, []byte(benchmarkRunningGoProgram), 0666)
+ err = os.WriteFile(src, []byte(benchmarkRunningGoProgram), 0666)
if err != nil {
b.Fatal(err)
}
diff --git a/src/runtime/testdata/testprog/memprof.go b/src/runtime/testdata/testprog/memprof.go
index 7b134bc078..0392e60f84 100644
--- a/src/runtime/testdata/testprog/memprof.go
+++ b/src/runtime/testdata/testprog/memprof.go
@@ -7,7 +7,6 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"os"
"runtime"
"runtime/pprof"
@@ -31,7 +30,7 @@ func MemProf() {
runtime.GC()
- f, err := ioutil.TempFile("", "memprof")
+ f, err := os.CreateTemp("", "memprof")
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(2)
diff --git a/src/runtime/testdata/testprog/syscalls_linux.go b/src/runtime/testdata/testprog/syscalls_linux.go
index b8ac087626..48f8014237 100644
--- a/src/runtime/testdata/testprog/syscalls_linux.go
+++ b/src/runtime/testdata/testprog/syscalls_linux.go
@@ -7,7 +7,6 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"os"
"syscall"
)
@@ -17,7 +16,7 @@ func gettid() int {
}
func tidExists(tid int) (exists, supported bool) {
- stat, err := ioutil.ReadFile(fmt.Sprintf("/proc/self/task/%d/stat", tid))
+ stat, err := os.ReadFile(fmt.Sprintf("/proc/self/task/%d/stat", tid))
if os.IsNotExist(err) {
return false, true
}
diff --git a/src/runtime/testdata/testprog/timeprof.go b/src/runtime/testdata/testprog/timeprof.go
index 0702885369..1e90af4033 100644
--- a/src/runtime/testdata/testprog/timeprof.go
+++ b/src/runtime/testdata/testprog/timeprof.go
@@ -6,7 +6,6 @@ package main
import (
"fmt"
- "io/ioutil"
"os"
"runtime/pprof"
"time"
@@ -17,7 +16,7 @@ func init() {
}
func TimeProf() {
- f, err := ioutil.TempFile("", "timeprof")
+ f, err := os.CreateTemp("", "timeprof")
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(2)
diff --git a/src/runtime/testdata/testprog/vdso.go b/src/runtime/testdata/testprog/vdso.go
index ef92f48758..d2a300d8f2 100644
--- a/src/runtime/testdata/testprog/vdso.go
+++ b/src/runtime/testdata/testprog/vdso.go
@@ -8,7 +8,6 @@ package main
import (
"fmt"
- "io/ioutil"
"os"
"runtime/pprof"
"time"
@@ -19,7 +18,7 @@ func init() {
}
func signalInVDSO() {
- f, err := ioutil.TempFile("", "timeprofnow")
+ f, err := os.CreateTemp("", "timeprofnow")
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(2)
diff --git a/src/runtime/testdata/testprogcgo/pprof.go b/src/runtime/testdata/testprogcgo/pprof.go
index 00f2c42e93..3b73fa0bdd 100644
--- a/src/runtime/testdata/testprogcgo/pprof.go
+++ b/src/runtime/testdata/testprogcgo/pprof.go
@@ -60,7 +60,6 @@ import "C"
import (
"fmt"
- "io/ioutil"
"os"
"runtime"
"runtime/pprof"
@@ -75,7 +74,7 @@ func init() {
func CgoPprof() {
runtime.SetCgoTraceback(0, unsafe.Pointer(C.pprofCgoTraceback), nil, nil)
- f, err := ioutil.TempFile("", "prof")
+ f, err := os.CreateTemp("", "prof")
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(2)
diff --git a/src/runtime/testdata/testprogcgo/threadpprof.go b/src/runtime/testdata/testprogcgo/threadpprof.go
index 37a2a1ab65..feb774ba59 100644
--- a/src/runtime/testdata/testprogcgo/threadpprof.go
+++ b/src/runtime/testdata/testprogcgo/threadpprof.go
@@ -74,7 +74,6 @@ import "C"
import (
"fmt"
- "io/ioutil"
"os"
"runtime"
"runtime/pprof"
@@ -97,7 +96,7 @@ func CgoPprofThreadNoTraceback() {
}
func pprofThread() {
- f, err := ioutil.TempFile("", "prof")
+ f, err := os.CreateTemp("", "prof")
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(2)
diff --git a/src/runtime/trace/trace_test.go b/src/runtime/trace/trace_test.go
index 235845df4e..b316eafe4c 100644
--- a/src/runtime/trace/trace_test.go
+++ b/src/runtime/trace/trace_test.go
@@ -10,7 +10,6 @@ import (
"internal/race"
"internal/trace"
"io"
- "io/ioutil"
"net"
"os"
"runtime"
@@ -586,7 +585,7 @@ func saveTrace(t *testing.T, buf *bytes.Buffer, name string) {
if !*saveTraces {
return
}
- if err := ioutil.WriteFile(name+".trace", buf.Bytes(), 0600); err != nil {
+ if err := os.WriteFile(name+".trace", buf.Bytes(), 0600); err != nil {
t.Errorf("failed to write trace file: %s", err)
}
}
diff --git a/src/runtime/wincallback.go b/src/runtime/wincallback.go
index c022916422..fb452222da 100644
--- a/src/runtime/wincallback.go
+++ b/src/runtime/wincallback.go
@@ -11,7 +11,6 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"os"
)
@@ -38,7 +37,7 @@ TEXT runtime·callbackasm(SB),7,$0
}
filename := fmt.Sprintf("zcallback_windows.s")
- err := ioutil.WriteFile(filename, buf.Bytes(), 0666)
+ err := os.WriteFile(filename, buf.Bytes(), 0666)
if err != nil {
fmt.Fprintf(os.Stderr, "wincallback: %s\n", err)
os.Exit(2)
@@ -66,7 +65,7 @@ TEXT runtime·callbackasm(SB),NOSPLIT|NOFRAME,$0
buf.WriteString("\tB\truntime·callbackasm1(SB)\n")
}
- err := ioutil.WriteFile("zcallback_windows_arm.s", buf.Bytes(), 0666)
+ err := os.WriteFile("zcallback_windows_arm.s", buf.Bytes(), 0666)
if err != nil {
fmt.Fprintf(os.Stderr, "wincallback: %s\n", err)
os.Exit(2)
@@ -82,7 +81,7 @@ package runtime
const cb_max = %d // maximum number of windows callbacks allowed
`, maxCallback))
- err := ioutil.WriteFile("zcallback_windows.go", buf.Bytes(), 0666)
+ err := os.WriteFile("zcallback_windows.go", buf.Bytes(), 0666)
if err != nil {
fmt.Fprintf(os.Stderr, "wincallback: %s\n", err)
os.Exit(2)
diff --git a/src/sort/genzfunc.go b/src/sort/genzfunc.go
index 66408d26c6..e7eb573737 100644
--- a/src/sort/genzfunc.go
+++ b/src/sort/genzfunc.go
@@ -20,8 +20,8 @@ import (
"go/format"
"go/parser"
"go/token"
- "io/ioutil"
"log"
+ "os"
"regexp"
)
@@ -92,7 +92,7 @@ func main() {
out.Write(src)
const target = "zfuncversion.go"
- if err := ioutil.WriteFile(target, out.Bytes(), 0644); err != nil {
+ if err := os.WriteFile(target, out.Bytes(), 0644); err != nil {
log.Fatal(err)
}
}
diff --git a/src/strconv/makeisprint.go b/src/strconv/makeisprint.go
index 1a3248f308..0e6e90a6c6 100644
--- a/src/strconv/makeisprint.go
+++ b/src/strconv/makeisprint.go
@@ -17,8 +17,8 @@ import (
"flag"
"fmt"
"go/format"
- "io/ioutil"
"log"
+ "os"
"unicode"
)
@@ -196,7 +196,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
- err = ioutil.WriteFile(*filename, data, 0644)
+ err = os.WriteFile(*filename, data, 0644)
if err != nil {
log.Fatal(err)
}
diff --git a/src/syscall/dirent_test.go b/src/syscall/dirent_test.go
index f63153340a..7dac98ff4b 100644
--- a/src/syscall/dirent_test.go
+++ b/src/syscall/dirent_test.go
@@ -9,7 +9,6 @@ package syscall_test
import (
"bytes"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
@@ -27,7 +26,7 @@ func TestDirent(t *testing.T) {
filenameMinSize = 11
)
- d, err := ioutil.TempDir("", "dirent-test")
+ d, err := os.MkdirTemp("", "dirent-test")
if err != nil {
t.Fatalf("tempdir: %v", err)
}
@@ -36,7 +35,7 @@ func TestDirent(t *testing.T) {
for i, c := range []byte("0123456789") {
name := string(bytes.Repeat([]byte{c}, filenameMinSize+i))
- err = ioutil.WriteFile(filepath.Join(d, name), nil, 0644)
+ err = os.WriteFile(filepath.Join(d, name), nil, 0644)
if err != nil {
t.Fatalf("writefile: %v", err)
}
@@ -93,7 +92,7 @@ func TestDirentRepeat(t *testing.T) {
}
// Make a directory containing N files
- d, err := ioutil.TempDir("", "direntRepeat-test")
+ d, err := os.MkdirTemp("", "direntRepeat-test")
if err != nil {
t.Fatalf("tempdir: %v", err)
}
@@ -104,7 +103,7 @@ func TestDirentRepeat(t *testing.T) {
files = append(files, fmt.Sprintf("file%d", i))
}
for _, file := range files {
- err = ioutil.WriteFile(filepath.Join(d, file), []byte("contents"), 0644)
+ err = os.WriteFile(filepath.Join(d, file), []byte("contents"), 0644)
if err != nil {
t.Fatalf("writefile: %v", err)
}
diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go
index b79dee7525..ac3a5754ae 100644
--- a/src/syscall/exec_linux_test.go
+++ b/src/syscall/exec_linux_test.go
@@ -11,7 +11,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"os/exec"
"os/user"
@@ -65,7 +64,7 @@ func skipNoUserNamespaces(t *testing.T) {
func skipUnprivilegedUserClone(t *testing.T) {
// Skip the test if the sysctl that prevents unprivileged user
// from creating user namespaces is enabled.
- data, errRead := ioutil.ReadFile("/proc/sys/kernel/unprivileged_userns_clone")
+ data, errRead := os.ReadFile("/proc/sys/kernel/unprivileged_userns_clone")
if errRead != nil || len(data) < 1 || data[0] == '0' {
t.Skip("kernel prohibits user namespace in unprivileged process")
}
@@ -98,7 +97,7 @@ func checkUserNS(t *testing.T) {
// On Centos 7 make sure they set the kernel parameter user_namespace=1
// See issue 16283 and 20796.
if _, err := os.Stat("/sys/module/user_namespace/parameters/enable"); err == nil {
- buf, _ := ioutil.ReadFile("/sys/module/user_namespace/parameters/enabled")
+ buf, _ := os.ReadFile("/sys/module/user_namespace/parameters/enabled")
if !strings.HasPrefix(string(buf), "Y") {
t.Skip("kernel doesn't support user namespaces")
}
@@ -106,7 +105,7 @@ func checkUserNS(t *testing.T) {
// On Centos 7.5+, user namespaces are disabled if user.max_user_namespaces = 0
if _, err := os.Stat("/proc/sys/user/max_user_namespaces"); err == nil {
- buf, errRead := ioutil.ReadFile("/proc/sys/user/max_user_namespaces")
+ buf, errRead := os.ReadFile("/proc/sys/user/max_user_namespaces")
if errRead == nil && buf[0] == '0' {
t.Skip("kernel doesn't support user namespaces")
}
@@ -226,7 +225,7 @@ func TestUnshare(t *testing.T) {
t.Fatal(err)
}
- orig, err := ioutil.ReadFile(path)
+ orig, err := os.ReadFile(path)
if err != nil {
t.Fatal(err)
}
@@ -349,7 +348,7 @@ func TestUnshareMountNameSpace(t *testing.T) {
t.Skip("kernel prohibits unshare in unprivileged process, unless using user namespace")
}
- d, err := ioutil.TempDir("", "unshare")
+ d, err := os.MkdirTemp("", "unshare")
if err != nil {
t.Fatalf("tempdir: %v", err)
}
@@ -391,7 +390,7 @@ func TestUnshareMountNameSpaceChroot(t *testing.T) {
t.Skip("kernel prohibits unshare in unprivileged process, unless using user namespace")
}
- d, err := ioutil.TempDir("", "unshare")
+ d, err := os.MkdirTemp("", "unshare")
if err != nil {
t.Fatalf("tempdir: %v", err)
}
@@ -599,7 +598,7 @@ func testAmbientCaps(t *testing.T, userns bool) {
}
// Copy the test binary to a temporary location which is readable by nobody.
- f, err := ioutil.TempFile("", "gotest")
+ f, err := os.CreateTemp("", "gotest")
if err != nil {
t.Fatal(err)
}
diff --git a/src/syscall/getdirentries_test.go b/src/syscall/getdirentries_test.go
index 2a3419c230..66bb8acba2 100644
--- a/src/syscall/getdirentries_test.go
+++ b/src/syscall/getdirentries_test.go
@@ -8,7 +8,6 @@ package syscall_test
import (
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"sort"
@@ -29,7 +28,7 @@ func testGetdirentries(t *testing.T, count int) {
if count > 100 && testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
t.Skip("skipping in -short mode")
}
- d, err := ioutil.TempDir("", "getdirentries-test")
+ d, err := os.MkdirTemp("", "getdirentries-test")
if err != nil {
t.Fatalf("Tempdir: %v", err)
}
@@ -41,7 +40,7 @@ func testGetdirentries(t *testing.T, count int) {
// Make files in the temp directory
for _, name := range names {
- err := ioutil.WriteFile(filepath.Join(d, name), []byte("data"), 0)
+ err := os.WriteFile(filepath.Join(d, name), []byte("data"), 0)
if err != nil {
t.Fatalf("WriteFile: %v", err)
}
diff --git a/src/syscall/mkasm_darwin.go b/src/syscall/mkasm_darwin.go
index f6f75f99f6..1783387a53 100644
--- a/src/syscall/mkasm_darwin.go
+++ b/src/syscall/mkasm_darwin.go
@@ -11,23 +11,22 @@ package main
import (
"bytes"
"fmt"
- "io/ioutil"
"log"
"os"
"strings"
)
func main() {
- in1, err := ioutil.ReadFile("syscall_darwin.go")
+ in1, err := os.ReadFile("syscall_darwin.go")
if err != nil {
log.Fatalf("can't open syscall_darwin.go: %s", err)
}
arch := os.Args[1]
- in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch))
+ in2, err := os.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch))
if err != nil {
log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err)
}
- in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch))
+ in3, err := os.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch))
if err != nil {
log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err)
}
@@ -51,7 +50,7 @@ func main() {
fmt.Fprintf(&out, "\tJMP\t%s(SB)\n", fn)
}
}
- err = ioutil.WriteFile(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644)
+ err = os.WriteFile(fmt.Sprintf("zsyscall_darwin_%s.s", arch), out.Bytes(), 0644)
if err != nil {
log.Fatalf("can't write zsyscall_darwin_%s.s: %s", arch, err)
}
diff --git a/src/syscall/syscall_linux_test.go b/src/syscall/syscall_linux_test.go
index 92764323ee..153d0efef1 100644
--- a/src/syscall/syscall_linux_test.go
+++ b/src/syscall/syscall_linux_test.go
@@ -9,7 +9,6 @@ import (
"fmt"
"io"
"io/fs"
- "io/ioutil"
"os"
"os/exec"
"os/signal"
@@ -30,7 +29,7 @@ func chtmpdir(t *testing.T) func() {
if err != nil {
t.Fatalf("chtmpdir: %v", err)
}
- d, err := ioutil.TempDir("", "test")
+ d, err := os.MkdirTemp("", "test")
if err != nil {
t.Fatalf("chtmpdir: %v", err)
}
@@ -160,7 +159,7 @@ func TestLinuxDeathSignal(t *testing.T) {
// Copy the test binary to a location that a non-root user can read/execute
// after we drop privileges
- tempDir, err := ioutil.TempDir("", "TestDeathSignal")
+ tempDir, err := os.MkdirTemp("", "TestDeathSignal")
if err != nil {
t.Fatalf("cannot create temporary directory: %v", err)
}
@@ -321,7 +320,7 @@ func TestSyscallNoError(t *testing.T) {
// Copy the test binary to a location that a non-root user can read/execute
// after we drop privileges
- tempDir, err := ioutil.TempDir("", "TestSyscallNoError")
+ tempDir, err := os.MkdirTemp("", "TestSyscallNoError")
if err != nil {
t.Fatalf("cannot create temporary directory: %v", err)
}
@@ -543,7 +542,7 @@ func TestAllThreadsSyscall(t *testing.T) {
func compareStatus(filter, expect string) error {
expected := filter + expect
pid := syscall.Getpid()
- fs, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/task", pid))
+ fs, err := os.ReadDir(fmt.Sprintf("/proc/%d/task", pid))
if err != nil {
return fmt.Errorf("unable to find %d tasks: %v", pid, err)
}
@@ -551,7 +550,7 @@ func compareStatus(filter, expect string) error {
foundAThread := false
for _, f := range fs {
tf := fmt.Sprintf("/proc/%s/status", f.Name())
- d, err := ioutil.ReadFile(tf)
+ d, err := os.ReadFile(tf)
if err != nil {
// There are a surprising number of ways this
// can error out on linux. We've seen all of
diff --git a/src/syscall/syscall_unix_test.go b/src/syscall/syscall_unix_test.go
index 1c34ed2c27..7e6a8c9043 100644
--- a/src/syscall/syscall_unix_test.go
+++ b/src/syscall/syscall_unix_test.go
@@ -11,7 +11,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"net"
"os"
"os/exec"
@@ -79,7 +78,7 @@ func TestFcntlFlock(t *testing.T) {
}
if os.Getenv("GO_WANT_HELPER_PROCESS") == "" {
// parent
- tempDir, err := ioutil.TempDir("", "TestFcntlFlock")
+ tempDir, err := os.MkdirTemp("", "TestFcntlFlock")
if err != nil {
t.Fatalf("Failed to create temp dir: %v", err)
}
@@ -157,7 +156,7 @@ func TestPassFD(t *testing.T) {
}
- tempDir, err := ioutil.TempDir("", "TestPassFD")
+ tempDir, err := os.MkdirTemp("", "TestPassFD")
if err != nil {
t.Fatal(err)
}
@@ -257,7 +256,7 @@ func passFDChild() {
// We make it in tempDir, which our parent will clean up.
flag.Parse()
tempDir := flag.Arg(0)
- f, err := ioutil.TempFile(tempDir, "")
+ f, err := os.CreateTemp(tempDir, "")
if err != nil {
fmt.Printf("TempFile: %v", err)
return
diff --git a/src/syscall/syscall_windows_test.go b/src/syscall/syscall_windows_test.go
index d146911073..a9ae54752b 100644
--- a/src/syscall/syscall_windows_test.go
+++ b/src/syscall/syscall_windows_test.go
@@ -5,7 +5,6 @@
package syscall_test
import (
- "io/ioutil"
"os"
"path/filepath"
"syscall"
@@ -13,7 +12,7 @@ import (
)
func TestWin32finddata(t *testing.T) {
- dir, err := ioutil.TempDir("", "go-build")
+ dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
diff --git a/src/testing/testing.go b/src/testing/testing.go
index d4b108a183..80354d5ce8 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -242,7 +242,6 @@ import (
"fmt"
"internal/race"
"io"
- "io/ioutil"
"os"
"runtime"
"runtime/debug"
@@ -936,14 +935,14 @@ func (c *common) TempDir() string {
if nonExistent {
c.Helper()
- // ioutil.TempDir doesn't like path separators in its pattern,
+ // os.MkdirTemp doesn't like path separators in its pattern,
// so mangle the name to accommodate subtests.
tempDirReplacer.Do(func() {
tempDirReplacer.r = strings.NewReplacer("/", "_", "\\", "_", ":", "_")
})
pattern := tempDirReplacer.r.Replace(c.Name())
- c.tempDir, c.tempDirErr = ioutil.TempDir("", pattern)
+ c.tempDir, c.tempDirErr = os.MkdirTemp("", pattern)
if c.tempDirErr == nil {
c.Cleanup(func() {
if err := os.RemoveAll(c.tempDir); err != nil {
diff --git a/src/text/template/examplefiles_test.go b/src/text/template/examplefiles_test.go
index a15c7a62a3..6534ee3315 100644
--- a/src/text/template/examplefiles_test.go
+++ b/src/text/template/examplefiles_test.go
@@ -6,7 +6,6 @@ package template_test
import (
"io"
- "io/ioutil"
"log"
"os"
"path/filepath"
@@ -20,7 +19,7 @@ type templateFile struct {
}
func createTestDir(files []templateFile) string {
- dir, err := ioutil.TempDir("", "template")
+ dir, err := os.MkdirTemp("", "template")
if err != nil {
log.Fatal(err)
}
diff --git a/src/text/template/helper.go b/src/text/template/helper.go
index 8269fa28c5..57905e613a 100644
--- a/src/text/template/helper.go
+++ b/src/text/template/helper.go
@@ -9,7 +9,7 @@ package template
import (
"fmt"
"io/fs"
- "io/ioutil"
+ "os"
"path"
"path/filepath"
)
@@ -164,7 +164,7 @@ func parseFS(t *Template, fsys fs.FS, patterns []string) (*Template, error) {
func readFileOS(file string) (name string, b []byte, err error) {
name = filepath.Base(file)
- b, err = ioutil.ReadFile(file)
+ b, err = os.ReadFile(file)
return
}
diff --git a/src/text/template/link_test.go b/src/text/template/link_test.go
index 4eac7e6755..9dc70dfc0d 100644
--- a/src/text/template/link_test.go
+++ b/src/text/template/link_test.go
@@ -7,7 +7,6 @@ package template_test
import (
"bytes"
"internal/testenv"
- "io/ioutil"
"os"
"os/exec"
"path/filepath"
@@ -40,13 +39,13 @@ func main() {
t.Used()
}
`
- td, err := ioutil.TempDir("", "text_template_TestDeadCodeElimination")
+ td, err := os.MkdirTemp("", "text_template_TestDeadCodeElimination")
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(td)
- if err := ioutil.WriteFile(filepath.Join(td, "x.go"), []byte(prog), 0644); err != nil {
+ if err := os.WriteFile(filepath.Join(td, "x.go"), []byte(prog), 0644); err != nil {
t.Fatal(err)
}
cmd := exec.Command(testenv.GoToolPath(t), "build", "-o", "x.exe", "x.go")
@@ -54,7 +53,7 @@ func main() {
if out, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("go build: %v, %s", err, out)
}
- slurp, err := ioutil.ReadFile(filepath.Join(td, "x.exe"))
+ slurp, err := os.ReadFile(filepath.Join(td, "x.exe"))
if err != nil {
t.Fatal(err)
}
diff --git a/src/time/genzabbrs.go b/src/time/genzabbrs.go
index 1d59ba73ce..9825e705d2 100644
--- a/src/time/genzabbrs.go
+++ b/src/time/genzabbrs.go
@@ -18,9 +18,9 @@ import (
"flag"
"go/format"
"io"
- "io/ioutil"
"log"
"net/http"
+ "os"
"sort"
"text/template"
"time"
@@ -128,7 +128,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
- err = ioutil.WriteFile(*filename, data, 0644)
+ err = os.WriteFile(*filename, data, 0644)
if err != nil {
log.Fatal(err)
}
diff --git a/src/time/tzdata/generate_zipdata.go b/src/time/tzdata/generate_zipdata.go
index d8b47e7878..21357fbf1c 100644
--- a/src/time/tzdata/generate_zipdata.go
+++ b/src/time/tzdata/generate_zipdata.go
@@ -10,7 +10,6 @@ package main
import (
"bufio"
"fmt"
- "io/ioutil"
"os"
"strconv"
)
@@ -40,7 +39,7 @@ const zipdata = `
func main() {
// We should be run in the $GOROOT/src/time/tzdata directory.
- data, err := ioutil.ReadFile("../../../lib/time/zoneinfo.zip")
+ data, err := os.ReadFile("../../../lib/time/zoneinfo.zip")
if err != nil {
die("cannot find zoneinfo.zip file: %v", err)
}
diff --git a/src/time/zoneinfo_read.go b/src/time/zoneinfo_read.go
index 22a60f3211..c739864815 100644
--- a/src/time/zoneinfo_read.go
+++ b/src/time/zoneinfo_read.go
@@ -546,7 +546,7 @@ func loadLocation(name string, sources []string) (z *Location, firstErr error) {
}
// readFile reads and returns the content of the named file.
-// It is a trivial implementation of ioutil.ReadFile, reimplemented
+// It is a trivial implementation of os.ReadFile, reimplemented
// here to avoid depending on io/ioutil or os.
// It returns an error if name exceeds maxFileSize bytes.
func readFile(name string) ([]byte, error) {
--
cgit v1.3