summaryrefslogtreecommitdiff
path: root/libgo/go/crypto/tls
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/crypto/tls')
-rw-r--r--libgo/go/crypto/tls/cipher_suites.go16
-rw-r--r--libgo/go/crypto/tls/common.go175
-rw-r--r--libgo/go/crypto/tls/conn.go22
-rw-r--r--libgo/go/crypto/tls/handshake_client.go60
-rw-r--r--libgo/go/crypto/tls/handshake_client_test.go130
-rw-r--r--libgo/go/crypto/tls/handshake_messages.go98
-rw-r--r--libgo/go/crypto/tls/handshake_messages_test.go13
-rw-r--r--libgo/go/crypto/tls/handshake_server.go181
-rw-r--r--libgo/go/crypto/tls/handshake_server_test.go285
-rw-r--r--libgo/go/crypto/tls/key_agreement.go108
-rw-r--r--libgo/go/crypto/tls/prf.go178
-rw-r--r--libgo/go/crypto/tls/prf_test.go18
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA105
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA65
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA103
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA63
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES83
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES83
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv10-RSA-RC445
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES85
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES83
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv11-RSA-RC445
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN78
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch79
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA108
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA69
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384139
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA108
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA69
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES85
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM79
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA38485
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES83
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-RSA-RC445
-rw-r--r--libgo/go/crypto/tls/testdata/Client-TLSv12-SCT118
-rw-r--r--libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-3DES145
-rw-r--r--libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-AES147
-rw-r--r--libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-RC4137
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES79
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-3DES137
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-AES143
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-RC4131
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv11-RSA-RC4131
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN217
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch217
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA173
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA189
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven157
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven157
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven139
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES82
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicket154
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable154
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-3DES142
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES146
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM156
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA38487
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-RC4136
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-Resume59
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-ResumeDisabled156
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-SNI56
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate64
-rw-r--r--libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound64
-rw-r--r--libgo/go/crypto/tls/ticket.go43
-rw-r--r--libgo/go/crypto/tls/tls.go38
-rw-r--r--libgo/go/crypto/tls/tls_test.go54
66 files changed, 4141 insertions, 2938 deletions
diff --git a/libgo/go/crypto/tls/cipher_suites.go b/libgo/go/crypto/tls/cipher_suites.go
index 226e06d68d6..a5fed293752 100644
--- a/libgo/go/crypto/tls/cipher_suites.go
+++ b/libgo/go/crypto/tls/cipher_suites.go
@@ -48,6 +48,12 @@ const (
// suiteTLS12 indicates that the cipher suite should only be advertised
// and accepted when using TLS 1.2.
suiteTLS12
+ // suiteSHA384 indicates that the cipher suite uses SHA384 as the
+ // handshake hash.
+ suiteSHA384
+ // suiteDefaultOff indicates that this cipher suite is not included by
+ // default.
+ suiteDefaultOff
)
// A cipherSuite is a specific combination of key agreement, cipher and MAC
@@ -71,13 +77,15 @@ var cipherSuites = []*cipherSuite{
// and RC4 comes before AES (because of the Lucky13 attack).
{TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, ecdheRSAKA, suiteECDHE | suiteTLS12, nil, nil, aeadAESGCM},
{TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12, nil, nil, aeadAESGCM},
- {TLS_ECDHE_RSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheRSAKA, suiteECDHE, cipherRC4, macSHA1, nil},
- {TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherRC4, macSHA1, nil},
+ {TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 32, 0, 4, ecdheRSAKA, suiteECDHE | suiteTLS12 | suiteSHA384, nil, nil, aeadAESGCM},
+ {TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 32, 0, 4, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12 | suiteSHA384, nil, nil, aeadAESGCM},
+ {TLS_ECDHE_RSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheRSAKA, suiteECDHE | suiteDefaultOff, cipherRC4, macSHA1, nil},
+ {TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteDefaultOff, cipherRC4, macSHA1, nil},
{TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, 16, 20, 16, ecdheRSAKA, suiteECDHE, cipherAES, macSHA1, nil},
{TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, 16, 20, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherAES, macSHA1, nil},
{TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, 32, 20, 16, ecdheRSAKA, suiteECDHE, cipherAES, macSHA1, nil},
{TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, 32, 20, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherAES, macSHA1, nil},
- {TLS_RSA_WITH_RC4_128_SHA, 16, 20, 0, rsaKA, 0, cipherRC4, macSHA1, nil},
+ {TLS_RSA_WITH_RC4_128_SHA, 16, 20, 0, rsaKA, suiteDefaultOff, cipherRC4, macSHA1, nil},
{TLS_RSA_WITH_AES_128_CBC_SHA, 16, 20, 16, rsaKA, 0, cipherAES, macSHA1, nil},
{TLS_RSA_WITH_AES_256_CBC_SHA, 32, 20, 16, rsaKA, 0, cipherAES, macSHA1, nil},
{TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, 24, 20, 8, ecdheRSAKA, suiteECDHE, cipher3DES, macSHA1, nil},
@@ -267,6 +275,8 @@ const (
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xc014
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02f
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02b
+ TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xc030
+ TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xc02c
// TLS_FALLBACK_SCSV isn't a standard cipher suite but an indicator
// that the client is doing version fallback. See
diff --git a/libgo/go/crypto/tls/common.go b/libgo/go/crypto/tls/common.go
index 776b70c93c8..a3d75d69cbf 100644
--- a/libgo/go/crypto/tls/common.go
+++ b/libgo/go/crypto/tls/common.go
@@ -8,7 +8,9 @@ import (
"container/list"
"crypto"
"crypto/rand"
+ "crypto/sha512"
"crypto/x509"
+ "errors"
"fmt"
"io"
"math/big"
@@ -30,7 +32,7 @@ const (
recordHeaderLen = 5 // record header length
maxHandshake = 65536 // maximum handshake we support (protocol max is 16 MB)
- minVersion = VersionSSL30
+ minVersion = VersionTLS10
maxVersion = VersionTLS12
)
@@ -73,6 +75,7 @@ const (
extensionSupportedPoints uint16 = 11
extensionSignatureAlgorithms uint16 = 13
extensionALPN uint16 = 16
+ extensionSCT uint16 = 18 // https://tools.ietf.org/html/rfc6962#section-6
extensionSessionTicket uint16 = 35
extensionNextProtoNeg uint16 = 13172 // not IANA assigned
extensionRenegotiationInfo uint16 = 0xff01
@@ -123,6 +126,7 @@ const (
const (
hashSHA1 uint8 = 2
hashSHA256 uint8 = 4
+ hashSHA384 uint8 = 5
)
// Signature algorithms for TLS 1.2 (See RFC 5246, section A.4.1)
@@ -137,34 +141,31 @@ type signatureAndHash struct {
hash, signature uint8
}
-// supportedSKXSignatureAlgorithms contains the signature and hash algorithms
-// that the code advertises as supported in a TLS 1.2 ClientHello.
-var supportedSKXSignatureAlgorithms = []signatureAndHash{
+// supportedSignatureAlgorithms contains the signature and hash algorithms that
+// the code advertises as supported in a TLS 1.2 ClientHello and in a TLS 1.2
+// CertificateRequest.
+var supportedSignatureAlgorithms = []signatureAndHash{
{hashSHA256, signatureRSA},
{hashSHA256, signatureECDSA},
+ {hashSHA384, signatureRSA},
+ {hashSHA384, signatureECDSA},
{hashSHA1, signatureRSA},
{hashSHA1, signatureECDSA},
}
-// supportedClientCertSignatureAlgorithms contains the signature and hash
-// algorithms that the code advertises as supported in a TLS 1.2
-// CertificateRequest.
-var supportedClientCertSignatureAlgorithms = []signatureAndHash{
- {hashSHA256, signatureRSA},
- {hashSHA256, signatureECDSA},
-}
-
// ConnectionState records basic TLS details about the connection.
type ConnectionState struct {
- Version uint16 // TLS version used by the connection (e.g. VersionTLS12)
- HandshakeComplete bool // TLS handshake is complete
- DidResume bool // connection resumes a previous TLS connection
- CipherSuite uint16 // cipher suite in use (TLS_RSA_WITH_RC4_128_SHA, ...)
- NegotiatedProtocol string // negotiated next protocol (from Config.NextProtos)
- NegotiatedProtocolIsMutual bool // negotiated protocol was advertised by server
- ServerName string // server name requested by client, if any (server side only)
- PeerCertificates []*x509.Certificate // certificate chain presented by remote peer
- VerifiedChains [][]*x509.Certificate // verified chains built from PeerCertificates
+ Version uint16 // TLS version used by the connection (e.g. VersionTLS12)
+ HandshakeComplete bool // TLS handshake is complete
+ DidResume bool // connection resumes a previous TLS connection
+ CipherSuite uint16 // cipher suite in use (TLS_RSA_WITH_RC4_128_SHA, ...)
+ NegotiatedProtocol string // negotiated next protocol (from Config.NextProtos)
+ NegotiatedProtocolIsMutual bool // negotiated protocol was advertised by server
+ ServerName string // server name requested by client, if any (server side only)
+ PeerCertificates []*x509.Certificate // certificate chain presented by remote peer
+ VerifiedChains [][]*x509.Certificate // verified chains built from PeerCertificates
+ SignedCertificateTimestamps [][]byte // SCTs from the server, if any
+ OCSPResponse []byte // stapled OCSP response from server, if any
// TLSUnique contains the "tls-unique" channel binding value (see RFC
// 5929, section 3). For resumed sessions this value will be nil
@@ -190,11 +191,12 @@ const (
// ClientSessionState contains the state needed by clients to resume TLS
// sessions.
type ClientSessionState struct {
- sessionTicket []uint8 // Encrypted ticket used for session resumption with server
- vers uint16 // SSL/TLS version negotiated for the session
- cipherSuite uint16 // Ciphersuite negotiated for the session
- masterSecret []byte // MasterSecret generated by client on a full handshake
- serverCertificates []*x509.Certificate // Certificate chain presented by the server
+ sessionTicket []uint8 // Encrypted ticket used for session resumption with server
+ vers uint16 // SSL/TLS version negotiated for the session
+ cipherSuite uint16 // Ciphersuite negotiated for the session
+ masterSecret []byte // MasterSecret generated by client on a full handshake
+ serverCertificates []*x509.Certificate // Certificate chain presented by the server
+ verifiedChains [][]*x509.Certificate // Certificate chains we built for verification
}
// ClientSessionCache is a cache of ClientSessionState objects that can be used
@@ -265,10 +267,12 @@ type Config struct {
NameToCertificate map[string]*Certificate
// GetCertificate returns a Certificate based on the given
- // ClientHelloInfo. If GetCertificate is nil or returns nil, then the
- // certificate is retrieved from NameToCertificate. If
- // NameToCertificate is nil, the first element of Certificates will be
- // used.
+ // ClientHelloInfo. It will only be called if the client supplies SNI
+ // information or if Certificates is empty.
+ //
+ // If GetCertificate is nil or returns nil, then the certificate is
+ // retrieved from NameToCertificate. If NameToCertificate is nil, the
+ // first element of Certificates will be used.
GetCertificate func(clientHello *ClientHelloInfo) (*Certificate, error)
// RootCAs defines the set of root certificate authorities
@@ -330,7 +334,7 @@ type Config struct {
ClientSessionCache ClientSessionCache
// MinVersion contains the minimum SSL/TLS version that is acceptable.
- // If zero, then SSLv3 is taken as the minimum.
+ // If zero, then TLS 1.0 is taken as the minimum.
MinVersion uint16
// MaxVersion contains the maximum SSL/TLS version that is acceptable.
@@ -344,6 +348,38 @@ type Config struct {
CurvePreferences []CurveID
serverInitOnce sync.Once // guards calling (*Config).serverInit
+
+ // mutex protects sessionTicketKeys
+ mutex sync.RWMutex
+ // sessionTicketKeys contains zero or more ticket keys. If the length
+ // is zero, SessionTicketsDisabled must be true. The first key is used
+ // for new tickets and any subsequent keys can be used to decrypt old
+ // tickets.
+ sessionTicketKeys []ticketKey
+}
+
+// ticketKeyNameLen is the number of bytes of identifier that is prepended to
+// an encrypted session ticket in order to identify the key used to encrypt it.
+const ticketKeyNameLen = 16
+
+// ticketKey is the internal representation of a session ticket key.
+type ticketKey struct {
+ // keyName is an opaque byte string that serves to identify the session
+ // ticket key. It's exposed as plaintext in every session ticket.
+ keyName [ticketKeyNameLen]byte
+ aesKey [16]byte
+ hmacKey [16]byte
+}
+
+// ticketKeyFromBytes converts from the external representation of a session
+// ticket key to a ticketKey. Externally, session ticket keys are 32 random
+// bytes and this function expands that into sufficient name and key material.
+func ticketKeyFromBytes(b [32]byte) (key ticketKey) {
+ hashed := sha512.Sum512(b[:])
+ copy(key.keyName[:], hashed[:ticketKeyNameLen])
+ copy(key.aesKey[:], hashed[ticketKeyNameLen:ticketKeyNameLen+16])
+ copy(key.hmacKey[:], hashed[ticketKeyNameLen+16:ticketKeyNameLen+32])
+ return key
}
func (c *Config) serverInit() {
@@ -351,16 +387,51 @@ func (c *Config) serverInit() {
return
}
- // If the key has already been set then we have nothing to do.
+ alreadySet := false
for _, b := range c.SessionTicketKey {
if b != 0 {
+ alreadySet = true
+ break
+ }
+ }
+
+ if !alreadySet {
+ if _, err := io.ReadFull(c.rand(), c.SessionTicketKey[:]); err != nil {
+ c.SessionTicketsDisabled = true
return
}
}
- if _, err := io.ReadFull(c.rand(), c.SessionTicketKey[:]); err != nil {
- c.SessionTicketsDisabled = true
+ c.sessionTicketKeys = []ticketKey{ticketKeyFromBytes(c.SessionTicketKey)}
+}
+
+func (c *Config) ticketKeys() []ticketKey {
+ c.mutex.RLock()
+ // c.sessionTicketKeys is constant once created. SetSessionTicketKeys
+ // will only update it by replacing it with a new value.
+ ret := c.sessionTicketKeys
+ c.mutex.RUnlock()
+ return ret
+}
+
+// SetSessionTicketKeys updates the session ticket keys for a server. The first
+// key will be used when creating new tickets, while all keys can be used for
+// decrypting tickets. It is safe to call this function while the server is
+// running in order to rotate the session ticket keys. The function will panic
+// if keys is empty.
+func (c *Config) SetSessionTicketKeys(keys [][32]byte) {
+ if len(keys) == 0 {
+ panic("tls: keys must have at least one key")
}
+
+ newKeys := make([]ticketKey, len(keys))
+ for i, bytes := range keys {
+ newKeys[i] = ticketKeyFromBytes(bytes)
+ }
+
+ c.mutex.Lock()
+ c.sessionTicketKeys = newKeys
+ c.mutex.Unlock()
}
func (c *Config) rand() io.Reader {
@@ -428,13 +499,18 @@ func (c *Config) mutualVersion(vers uint16) (uint16, bool) {
// getCertificate returns the best certificate for the given ClientHelloInfo,
// defaulting to the first element of c.Certificates.
func (c *Config) getCertificate(clientHello *ClientHelloInfo) (*Certificate, error) {
- if c.GetCertificate != nil {
+ if c.GetCertificate != nil &&
+ (len(c.Certificates) == 0 || len(clientHello.ServerName) > 0) {
cert, err := c.GetCertificate(clientHello)
if cert != nil || err != nil {
return cert, err
}
}
+ if len(c.Certificates) == 0 {
+ return nil, errors.New("crypto/tls: no certificates configured")
+ }
+
if len(c.Certificates) == 1 || c.NameToCertificate == nil {
// There's only one choice, so no point doing any work.
return &c.Certificates[0], nil
@@ -488,14 +564,17 @@ func (c *Config) BuildNameToCertificate() {
type Certificate struct {
Certificate [][]byte
// PrivateKey contains the private key corresponding to the public key
- // in Leaf. For a server, this must be a *rsa.PrivateKey or
- // *ecdsa.PrivateKey. For a client doing client authentication, this
- // can be any type that implements crypto.Signer (which includes RSA
- // and ECDSA private keys).
+ // in Leaf. For a server, this must implement crypto.Signer and/or
+ // crypto.Decrypter, with an RSA or ECDSA PublicKey. For a client
+ // (performing client authentication), this must be a crypto.Signer
+ // with an RSA or ECDSA PublicKey.
PrivateKey crypto.PrivateKey
// OCSPStaple contains an optional OCSP response which will be served
// to clients that request it.
OCSPStaple []byte
+ // SignedCertificateTimestamps contains an optional list of Signed
+ // Certificate Timestamps which will be served to clients that request it.
+ SignedCertificateTimestamps [][]byte
// Leaf is the parsed form of the leaf certificate, which may be
// initialized using x509.ParseCertificate to reduce per-handshake
// processing for TLS clients doing client authentication. If nil, the
@@ -610,12 +689,24 @@ func defaultCipherSuites() []uint16 {
}
func initDefaultCipherSuites() {
- varDefaultCipherSuites = make([]uint16, len(cipherSuites))
- for i, suite := range cipherSuites {
- varDefaultCipherSuites[i] = suite.id
+ varDefaultCipherSuites = make([]uint16, 0, len(cipherSuites))
+ for _, suite := range cipherSuites {
+ if suite.flags&suiteDefaultOff != 0 {
+ continue
+ }
+ varDefaultCipherSuites = append(varDefaultCipherSuites, suite.id)
}
}
func unexpectedMessageError(wanted, got interface{}) error {
return fmt.Errorf("tls: received unexpected handshake message of type %T when waiting for %T", got, wanted)
}
+
+func isSupportedSignatureAndHash(sigHash signatureAndHash, sigHashes []signatureAndHash) bool {
+ for _, s := range sigHashes {
+ if s == sigHash {
+ return true
+ }
+ }
+ return false
+}
diff --git a/libgo/go/crypto/tls/conn.go b/libgo/go/crypto/tls/conn.go
index ba8e4c22b70..e3dcf15400c 100644
--- a/libgo/go/crypto/tls/conn.go
+++ b/libgo/go/crypto/tls/conn.go
@@ -35,7 +35,8 @@ type Conn struct {
handshakeComplete bool
didResume bool // whether this connection was a session resumption
cipherSuite uint16
- ocspResponse []byte // stapled OCSP response
+ ocspResponse []byte // stapled OCSP response
+ scts [][]byte // signed certificate timestamps from server
peerCertificates []*x509.Certificate
// verifiedChains contains the certificate chains that we built, as
// opposed to the ones presented by the server.
@@ -570,15 +571,11 @@ Again:
return c.in.setErrorLocked(fmt.Errorf("tls: oversized record received with length %d", n))
}
if !c.haveVers {
- // First message, be extra suspicious:
- // this might not be a TLS client.
- // Bail out before reading a full 'body', if possible.
- // The current max version is 3.1.
- // If the version is >= 16.0, it's probably not real.
- // Similarly, a clientHello message encodes in
- // well under a kilobyte. If the length is >= 12 kB,
+ // First message, be extra suspicious: this might not be a TLS
+ // client. Bail out before reading a full 'body', if possible.
+ // The current max version is 3.3 so if the version is >= 16.0,
// it's probably not real.
- if (typ != recordTypeAlert && typ != want) || vers >= 0x1000 || n >= 0x3000 {
+ if (typ != recordTypeAlert && typ != want) || vers >= 0x1000 {
c.sendAlert(alertUnexpectedMessage)
return c.in.setErrorLocked(fmt.Errorf("tls: first record does not look like a TLS handshake"))
}
@@ -926,7 +923,7 @@ func (c *Conn) Read(b []byte) (n int, err error) {
// tried to reuse the HTTP connection for a new
// request.
// See https://codereview.appspot.com/76400046
- // and http://golang.org/issue/3514
+ // and https://golang.org/issue/3514
if ri := c.rawInput; ri != nil &&
n != 0 && err == nil &&
c.input == nil && len(ri.data) > 0 && recordType(ri.data[0]) == recordTypeAlert {
@@ -997,6 +994,8 @@ func (c *Conn) ConnectionState() ConnectionState {
state.PeerCertificates = c.peerCertificates
state.VerifiedChains = c.verifiedChains
state.ServerName = c.serverName
+ state.SignedCertificateTimestamps = c.scts
+ state.OCSPResponse = c.ocspResponse
if !c.didResume {
state.TLSUnique = c.firstFinished[:]
}
@@ -1026,5 +1025,8 @@ func (c *Conn) VerifyHostname(host string) error {
if !c.handshakeComplete {
return errors.New("tls: handshake has not yet been performed")
}
+ if len(c.verifiedChains) == 0 {
+ return errors.New("tls: handshake did not verify certificate chain")
+ }
return c.peerCertificates[0].VerifyHostname(host)
}
diff --git a/libgo/go/crypto/tls/handshake_client.go b/libgo/go/crypto/tls/handshake_client.go
index 7f662e9c9f3..0b591d7309c 100644
--- a/libgo/go/crypto/tls/handshake_client.go
+++ b/libgo/go/crypto/tls/handshake_client.go
@@ -54,6 +54,7 @@ func (c *Conn) clientHandshake() error {
compressionMethods: []uint8{compressionNone},
random: make([]byte, 32),
ocspStapling: true,
+ scts: true,
serverName: c.config.ServerName,
supportedCurves: c.config.curvePreferences(),
supportedPoints: []uint8{pointFormatUncompressed},
@@ -88,7 +89,7 @@ NextCipherSuite:
}
if hello.vers >= VersionTLS12 {
- hello.signatureAndHashes = supportedSKXSignatureAlgorithms
+ hello.signatureAndHashes = supportedSignatureAlgorithms
}
var session *ClientSessionState
@@ -168,18 +169,26 @@ NextCipherSuite:
serverHello: serverHello,
hello: hello,
suite: suite,
- finishedHash: newFinishedHash(c.vers),
+ finishedHash: newFinishedHash(c.vers, suite),
session: session,
}
- hs.finishedHash.Write(hs.hello.marshal())
- hs.finishedHash.Write(hs.serverHello.marshal())
-
isResume, err := hs.processServerHello()
if err != nil {
return err
}
+ // No signatures of the handshake are needed in a resumption.
+ // Otherwise, in a full handshake, if we don't have any certificates
+ // configured then we will never send a CertificateVerify message and
+ // thus no signatures are needed in that case either.
+ if isResume || len(c.config.Certificates) == 0 {
+ hs.finishedHash.discardHandshakeBuffer()
+ }
+
+ hs.finishedHash.Write(hs.hello.marshal())
+ hs.finishedHash.Write(hs.serverHello.marshal())
+
if isResume {
if err := hs.establishKeys(); err != nil {
return err
@@ -423,7 +432,6 @@ func (hs *clientHandshakeState) doFullHandshake() error {
}
if chainToSend != nil {
- var signed []byte
certVerify := &certificateVerifyMsg{
hasSignatureAndHash: c.vers >= VersionTLS12,
}
@@ -433,31 +441,42 @@ func (hs *clientHandshakeState) doFullHandshake() error {
c.sendAlert(alertInternalError)
return fmt.Errorf("tls: client certificate private key of type %T does not implement crypto.Signer", chainToSend.PrivateKey)
}
+
+ var signatureType uint8
switch key.Public().(type) {
case *ecdsa.PublicKey:
- digest, hashFunc, hashId := hs.finishedHash.hashForClientCertificate(signatureECDSA)
- signed, err = key.Sign(c.config.rand(), digest, hashFunc)
- certVerify.signatureAndHash.signature = signatureECDSA
- certVerify.signatureAndHash.hash = hashId
+ signatureType = signatureECDSA
case *rsa.PublicKey:
- digest, hashFunc, hashId := hs.finishedHash.hashForClientCertificate(signatureRSA)
- signed, err = key.Sign(c.config.rand(), digest, hashFunc)
- certVerify.signatureAndHash.signature = signatureRSA
- certVerify.signatureAndHash.hash = hashId
+ signatureType = signatureRSA
default:
- err = fmt.Errorf("tls: unknown client certificate key type: %T", key)
+ c.sendAlert(alertInternalError)
+ return fmt.Errorf("tls: failed to sign handshake with client certificate: unknown client certificate key type: %T", key)
+ }
+
+ certVerify.signatureAndHash, err = hs.finishedHash.selectClientCertSignatureAlgorithm(certReq.signatureAndHashes, signatureType)
+ if err != nil {
+ c.sendAlert(alertInternalError)
+ return err
}
+ digest, hashFunc, err := hs.finishedHash.hashForClientCertificate(certVerify.signatureAndHash, hs.masterSecret)
if err != nil {
c.sendAlert(alertInternalError)
- return errors.New("tls: failed to sign handshake with client certificate: " + err.Error())
+ return err
+ }
+ certVerify.signature, err = key.Sign(c.config.rand(), digest, hashFunc)
+ if err != nil {
+ c.sendAlert(alertInternalError)
+ return err
}
- certVerify.signature = signed
hs.finishedHash.Write(certVerify.marshal())
c.writeRecord(recordTypeHandshake, certVerify.marshal())
}
- hs.masterSecret = masterFromPreMasterSecret(c.vers, preMasterSecret, hs.hello.random, hs.serverHello.random)
+ hs.masterSecret = masterFromPreMasterSecret(c.vers, hs.suite, preMasterSecret, hs.hello.random, hs.serverHello.random)
+
+ hs.finishedHash.discardHandshakeBuffer()
+
return nil
}
@@ -465,7 +484,7 @@ func (hs *clientHandshakeState) establishKeys() error {
c := hs.c
clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
- keysFromMasterSecret(c.vers, hs.masterSecret, hs.hello.random, hs.serverHello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
+ 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
if hs.suite.cipher != nil {
@@ -522,11 +541,13 @@ func (hs *clientHandshakeState) processServerHello() (bool, error) {
c.clientProtocol = hs.serverHello.alpnProtocol
c.clientProtocolFallback = false
}
+ c.scts = hs.serverHello.scts
if hs.serverResumedSession() {
// Restore masterSecret and peerCerts from previous state
hs.masterSecret = hs.session.masterSecret
c.peerCertificates = hs.session.serverCertificates
+ c.verifiedChains = hs.session.verifiedChains
return true, nil
}
return false, nil
@@ -584,6 +605,7 @@ func (hs *clientHandshakeState) readSessionTicket() error {
cipherSuite: hs.suite.id,
masterSecret: hs.masterSecret,
serverCertificates: c.peerCertificates,
+ verifiedChains: c.verifiedChains,
}
return nil
diff --git a/libgo/go/crypto/tls/handshake_client_test.go b/libgo/go/crypto/tls/handshake_client_test.go
index e5eaa7de208..664fe8de6a0 100644
--- a/libgo/go/crypto/tls/handshake_client_test.go
+++ b/libgo/go/crypto/tls/handshake_client_test.go
@@ -9,6 +9,8 @@ import (
"crypto/ecdsa"
"crypto/rsa"
"crypto/x509"
+ "encoding/base64"
+ "encoding/binary"
"encoding/pem"
"fmt"
"io"
@@ -49,6 +51,10 @@ type clientTest struct {
// key, if not nil, contains either a *rsa.PrivateKey or
// *ecdsa.PrivateKey which is the private key for the reference server.
key interface{}
+ // extensions, if not nil, contains a list of extension data to be returned
+ // from the ServerHello. The data should be in standard TLS format with
+ // a 2-byte uint16 type, 2-byte data length, followed by the extension data.
+ extensions [][]byte
// validate, if not nil, is a function that will be called with the
// ConnectionState of the resulting connection. It returns a non-nil
// error if the ConnectionState is unacceptable.
@@ -111,6 +117,19 @@ func (test *clientTest) connFromCommand() (conn *recordingConn, child *exec.Cmd,
const serverPort = 24323
command = append(command, "-accept", strconv.Itoa(serverPort))
+ if len(test.extensions) > 0 {
+ var serverInfo bytes.Buffer
+ for _, ext := range test.extensions {
+ pem.Encode(&serverInfo, &pem.Block{
+ Type: fmt.Sprintf("SERVERINFO FOR EXTENSION %d", binary.BigEndian.Uint16(ext)),
+ Bytes: ext,
+ })
+ }
+ serverInfoPath := tempFile(serverInfo.String())
+ defer os.Remove(serverInfoPath)
+ command = append(command, "-serverinfo", serverInfoPath)
+ }
+
cmd := exec.Command(command[0], command[1:]...)
stdin = blockingSource(make(chan bool))
cmd.Stdin = stdin
@@ -127,7 +146,6 @@ func (test *clientTest) connFromCommand() (conn *recordingConn, child *exec.Cmd,
// connection.
var tcpConn net.Conn
for i := uint(0); i < 5; i++ {
- var err error
tcpConn, err = net.DialTCP("tcp", nil, &net.TCPAddr{
IP: net.IPv4(127, 0, 0, 1),
Port: serverPort,
@@ -137,7 +155,7 @@ func (test *clientTest) connFromCommand() (conn *recordingConn, child *exec.Cmd,
}
time.Sleep((1 << i) * 5 * time.Millisecond)
}
- if tcpConn == nil {
+ if err != nil {
close(stdin)
out.WriteTo(os.Stdout)
cmd.Process.Kill()
@@ -190,11 +208,11 @@ func (test *clientTest) run(t *testing.T, write bool) {
doneChan := make(chan bool)
go func() {
if _, err := client.Write([]byte("hello\n")); err != nil {
- t.Logf("Client.Write failed: %s", err)
+ t.Errorf("Client.Write failed: %s", err)
}
if test.validate != nil {
if err := test.validate(client.ConnectionState()); err != nil {
- t.Logf("validate callback returned error: %s", err)
+ t.Errorf("validate callback returned error: %s", err)
}
}
client.Close()
@@ -311,6 +329,16 @@ func TestHandshakeClientECDHEECDSAAESGCM(t *testing.T) {
runClientTestTLS12(t, test)
}
+func TestHandshakeClientAES256GCMSHA384(t *testing.T) {
+ test := &clientTest{
+ name: "ECDHE-ECDSA-AES256-GCM-SHA384",
+ command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES256-GCM-SHA384"},
+ cert: testECDSACertificate,
+ key: testECDSAPrivateKey,
+ }
+ runClientTestTLS12(t, test)
+}
+
func TestHandshakeClientCertRSA(t *testing.T) {
config := *testConfig
cert, _ := X509KeyPair([]byte(clientCertificatePEM), []byte(clientKeyPEM))
@@ -335,6 +363,16 @@ func TestHandshakeClientCertRSA(t *testing.T) {
runClientTestTLS10(t, test)
runClientTestTLS12(t, test)
+
+ test = &clientTest{
+ name: "ClientCert-RSA-AES256-GCM-SHA384",
+ command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES256-GCM-SHA384", "-verify", "1"},
+ config: &config,
+ cert: testRSACertificate,
+ key: testRSAPrivateKey,
+ }
+
+ runClientTestTLS12(t, test)
}
func TestHandshakeClientCertECDSA(t *testing.T) {
@@ -368,31 +406,67 @@ func TestClientResumption(t *testing.T) {
CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA},
Certificates: testConfig.Certificates,
}
+
+ issuer, err := x509.ParseCertificate(testRSACertificateIssuer)
+ if err != nil {
+ panic(err)
+ }
+
+ rootCAs := x509.NewCertPool()
+ rootCAs.AddCert(issuer)
+
clientConfig := &Config{
CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
- InsecureSkipVerify: true,
ClientSessionCache: NewLRUClientSessionCache(32),
+ RootCAs: rootCAs,
+ ServerName: "example.golang",
}
testResumeState := func(test string, didResume bool) {
- hs, err := testHandshake(clientConfig, serverConfig)
+ _, hs, err := testHandshake(clientConfig, serverConfig)
if err != nil {
t.Fatalf("%s: handshake failed: %s", test, err)
}
if hs.DidResume != didResume {
t.Fatalf("%s resumed: %v, expected: %v", test, hs.DidResume, didResume)
}
+ if didResume && (hs.PeerCertificates == nil || hs.VerifiedChains == nil) {
+ t.Fatalf("expected non-nil certificates after resumption. Got peerCertificates: %#v, verifedCertificates: %#v", hs.PeerCertificates, hs.VerifiedChains)
+ }
+ }
+
+ getTicket := func() []byte {
+ return clientConfig.ClientSessionCache.(*lruSessionCache).q.Front().Value.(*lruSessionCacheEntry).state.sessionTicket
+ }
+ randomKey := func() [32]byte {
+ var k [32]byte
+ if _, err := io.ReadFull(serverConfig.rand(), k[:]); err != nil {
+ t.Fatalf("Failed to read new SessionTicketKey: %s", err)
+ }
+ return k
}
testResumeState("Handshake", false)
+ ticket := getTicket()
testResumeState("Resume", true)
-
- if _, err := io.ReadFull(serverConfig.rand(), serverConfig.SessionTicketKey[:]); err != nil {
- t.Fatalf("Failed to invalidate SessionTicketKey")
+ if !bytes.Equal(ticket, getTicket()) {
+ t.Fatal("first ticket doesn't match ticket after resumption")
}
+
+ key2 := randomKey()
+ serverConfig.SetSessionTicketKeys([][32]byte{key2})
+
testResumeState("InvalidSessionTicketKey", false)
testResumeState("ResumeAfterInvalidSessionTicketKey", true)
+ serverConfig.SetSessionTicketKeys([][32]byte{randomKey(), key2})
+ ticket = getTicket()
+ testResumeState("KeyChange", true)
+ if bytes.Equal(ticket, getTicket()) {
+ t.Fatal("new ticket wasn't included while resuming")
+ }
+ testResumeState("KeyChangeFinish", true)
+
clientConfig.CipherSuites = []uint16{TLS_ECDHE_RSA_WITH_RC4_128_SHA}
testResumeState("DifferentCipherSuite", false)
testResumeState("DifferentCipherSuiteRecovers", true)
@@ -488,3 +562,41 @@ func TestHandshakeClientALPNNoMatch(t *testing.T) {
}
runClientTestTLS12(t, test)
}
+
+// sctsBase64 contains data from `openssl s_client -serverinfo 18 -connect ritter.vg:443`
+const sctsBase64 = "ABIBaQFnAHUApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFHl5nuFgAABAMARjBEAiAcS4JdlW5nW9sElUv2zvQyPoZ6ejKrGGB03gjaBZFMLwIgc1Qbbn+hsH0RvObzhS+XZhr3iuQQJY8S9G85D9KeGPAAdgBo9pj4H2SCvjqM7rkoHUz8cVFdZ5PURNEKZ6y7T0/7xAAAAUeX4bVwAAAEAwBHMEUCIDIhFDgG2HIuADBkGuLobU5a4dlCHoJLliWJ1SYT05z6AiEAjxIoZFFPRNWMGGIjskOTMwXzQ1Wh2e7NxXE1kd1J0QsAdgDuS723dc5guuFCaR+r4Z5mow9+X7By2IMAxHuJeqj9ywAAAUhcZIqHAAAEAwBHMEUCICmJ1rBT09LpkbzxtUC+Hi7nXLR0J+2PmwLp+sJMuqK+AiEAr0NkUnEVKVhAkccIFpYDqHOlZaBsuEhWWrYpg2RtKp0="
+
+func TestHandshakClientSCTs(t *testing.T) {
+ config := *testConfig
+
+ scts, err := base64.StdEncoding.DecodeString(sctsBase64)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ test := &clientTest{
+ name: "SCT",
+ // Note that this needs OpenSSL 1.0.2 because that is the first
+ // version that supports the -serverinfo flag.
+ command: []string{"openssl", "s_server"},
+ config: &config,
+ extensions: [][]byte{scts},
+ validate: func(state ConnectionState) error {
+ expectedSCTs := [][]byte{
+ scts[8:125],
+ scts[127:245],
+ scts[247:],
+ }
+ if n := len(state.SignedCertificateTimestamps); n != len(expectedSCTs) {
+ return fmt.Errorf("Got %d scts, wanted %d", n, len(expectedSCTs))
+ }
+ for i, expected := range expectedSCTs {
+ if sct := state.SignedCertificateTimestamps[i]; !bytes.Equal(sct, expected) {
+ return fmt.Errorf("SCT #%d contained %x, expected %x", i, sct, expected)
+ }
+ }
+ return nil
+ },
+ }
+ runClientTestTLS12(t, test)
+}
diff --git a/libgo/go/crypto/tls/handshake_messages.go b/libgo/go/crypto/tls/handshake_messages.go
index 5d14871a348..799a776799a 100644
--- a/libgo/go/crypto/tls/handshake_messages.go
+++ b/libgo/go/crypto/tls/handshake_messages.go
@@ -16,6 +16,7 @@ type clientHelloMsg struct {
nextProtoNeg bool
serverName string
ocspStapling bool
+ scts bool
supportedCurves []CurveID
supportedPoints []uint8
ticketSupported bool
@@ -40,6 +41,7 @@ func (m *clientHelloMsg) equal(i interface{}) bool {
m.nextProtoNeg == m1.nextProtoNeg &&
m.serverName == m1.serverName &&
m.ocspStapling == m1.ocspStapling &&
+ m.scts == m1.scts &&
eqCurveIDs(m.supportedCurves, m1.supportedCurves) &&
bytes.Equal(m.supportedPoints, m1.supportedPoints) &&
m.ticketSupported == m1.ticketSupported &&
@@ -99,6 +101,9 @@ func (m *clientHelloMsg) marshal() []byte {
}
numExtensions++
}
+ if m.scts {
+ numExtensions++
+ }
if numExtensions > 0 {
extensionsLength += 4 * numExtensions
length += 2 + extensionsLength
@@ -271,6 +276,13 @@ func (m *clientHelloMsg) marshal() []byte {
lengths[0] = byte(stringsLength >> 8)
lengths[1] = byte(stringsLength)
}
+ if m.scts {
+ // https://tools.ietf.org/html/rfc6962#section-3.3.1
+ z[0] = byte(extensionSCT >> 8)
+ z[1] = byte(extensionSCT)
+ // zero uint16 for the zero-length extension_data
+ z = z[4:]
+ }
m.raw = x
@@ -326,6 +338,7 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool {
m.sessionTicket = nil
m.signatureAndHashes = nil
m.alpnProtocols = nil
+ m.scts = false
if len(data) == 0 {
// ClientHello is optionally followed by extension data
@@ -354,12 +367,16 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool {
switch extension {
case extensionServerName:
- if length < 2 {
+ d := data[:length]
+ if len(d) < 2 {
return false
}
- numNames := int(data[0])<<8 | int(data[1])
- d := data[2:]
- for i := 0; i < numNames; i++ {
+ namesLen := int(d[0])<<8 | int(d[1])
+ d = d[2:]
+ if len(d) != namesLen {
+ return false
+ }
+ for len(d) > 0 {
if len(d) < 3 {
return false
}
@@ -370,7 +387,7 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool {
return false
}
if nameType == 0 {
- m.serverName = string(d[0:nameLen])
+ m.serverName = string(d[:nameLen])
break
}
d = d[nameLen:]
@@ -430,7 +447,7 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool {
m.signatureAndHashes[i].signature = d[1]
d = d[2:]
}
- case extensionRenegotiationInfo + 1:
+ case extensionRenegotiationInfo:
if length != 1 || data[0] != 0 {
return false
}
@@ -453,6 +470,11 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool {
m.alpnProtocols = append(m.alpnProtocols, string(d[:stringLen]))
d = d[stringLen:]
}
+ case extensionSCT:
+ m.scts = true
+ if length != 0 {
+ return false
+ }
}
data = data[length:]
}
@@ -470,6 +492,7 @@ type serverHelloMsg struct {
nextProtoNeg bool
nextProtos []string
ocspStapling bool
+ scts [][]byte
ticketSupported bool
secureRenegotiation bool
alpnProtocol string
@@ -481,6 +504,15 @@ func (m *serverHelloMsg) equal(i interface{}) bool {
return false
}
+ if len(m.scts) != len(m1.scts) {
+ return false
+ }
+ for i, sct := range m.scts {
+ if !bytes.Equal(sct, m1.scts[i]) {
+ return false
+ }
+ }
+
return bytes.Equal(m.raw, m1.raw) &&
m.vers == m1.vers &&
bytes.Equal(m.random, m1.random) &&
@@ -530,6 +562,14 @@ func (m *serverHelloMsg) marshal() []byte {
extensionsLength += 2 + 1 + alpnLen
numExtensions++
}
+ sctLen := 0
+ if len(m.scts) > 0 {
+ for _, sct := range m.scts {
+ sctLen += len(sct) + 2
+ }
+ extensionsLength += 2 + sctLen
+ numExtensions++
+ }
if numExtensions > 0 {
extensionsLength += 4 * numExtensions
@@ -605,6 +645,23 @@ func (m *serverHelloMsg) marshal() []byte {
copy(z[7:], []byte(m.alpnProtocol))
z = z[7+alpnLen:]
}
+ if sctLen > 0 {
+ z[0] = byte(extensionSCT >> 8)
+ z[1] = byte(extensionSCT)
+ l := sctLen + 2
+ z[2] = byte(l >> 8)
+ z[3] = byte(l)
+ z[4] = byte(sctLen >> 8)
+ z[5] = byte(sctLen)
+
+ z = z[6:]
+ for _, sct := range m.scts {
+ z[0] = byte(len(sct) >> 8)
+ z[1] = byte(len(sct))
+ copy(z[2:], sct)
+ z = z[len(sct)+2:]
+ }
+ }
m.raw = x
@@ -634,6 +691,7 @@ func (m *serverHelloMsg) unmarshal(data []byte) bool {
m.nextProtoNeg = false
m.nextProtos = nil
m.ocspStapling = false
+ m.scts = nil
m.ticketSupported = false
m.alpnProtocol = ""
@@ -706,6 +764,34 @@ func (m *serverHelloMsg) unmarshal(data []byte) bool {
}
d = d[1:]
m.alpnProtocol = string(d)
+ case extensionSCT:
+ d := data[:length]
+
+ if len(d) < 2 {
+ return false
+ }
+ l := int(d[0])<<8 | int(d[1])
+ d = d[2:]
+ if len(d) != l {
+ return false
+ }
+ if l == 0 {
+ continue
+ }
+
+ m.scts = make([][]byte, 0, 3)
+ for len(d) != 0 {
+ if len(d) < 2 {
+ return false
+ }
+ sctLen := int(d[0])<<8 | int(d[1])
+ d = d[2:]
+ if len(d) < sctLen {
+ return false
+ }
+ m.scts = append(m.scts, d[:sctLen])
+ d = d[sctLen:]
+ }
}
data = data[length:]
}
diff --git a/libgo/go/crypto/tls/handshake_messages_test.go b/libgo/go/crypto/tls/handshake_messages_test.go
index a96e95c3f03..95d825bd175 100644
--- a/libgo/go/crypto/tls/handshake_messages_test.go
+++ b/libgo/go/crypto/tls/handshake_messages_test.go
@@ -136,12 +136,15 @@ func (*clientHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
}
}
if rand.Intn(10) > 5 {
- m.signatureAndHashes = supportedSKXSignatureAlgorithms
+ m.signatureAndHashes = supportedSignatureAlgorithms
}
m.alpnProtocols = make([]string, rand.Intn(5))
for i := range m.alpnProtocols {
m.alpnProtocols[i] = randomString(rand.Intn(20)+1, rand)
}
+ if rand.Intn(10) > 5 {
+ m.scts = true
+ }
return reflect.ValueOf(m)
}
@@ -172,6 +175,14 @@ func (*serverHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
}
m.alpnProtocol = randomString(rand.Intn(32)+1, rand)
+ if rand.Intn(10) > 5 {
+ numSCTs := rand.Intn(4)
+ m.scts = make([][]byte, numSCTs)
+ for i := range m.scts {
+ m.scts[i] = randomBytes(rand.Intn(500), rand)
+ }
+ }
+
return reflect.ValueOf(m)
}
diff --git a/libgo/go/crypto/tls/handshake_server.go b/libgo/go/crypto/tls/handshake_server.go
index 0d907656c6c..e16cddcbd81 100644
--- a/libgo/go/crypto/tls/handshake_server.go
+++ b/libgo/go/crypto/tls/handshake_server.go
@@ -25,6 +25,8 @@ type serverHandshakeState struct {
suite *cipherSuite
ellipticOk bool
ecdsaOk bool
+ rsaDecryptOk bool
+ rsaSignOk bool
sessionState *sessionState
finishedHash finishedHash
masterSecret []byte
@@ -57,6 +59,14 @@ func (c *Conn) serverHandshake() error {
if err := hs.establishKeys(); err != nil {
return err
}
+ // ticketSupported is set in a resumption handshake if the
+ // ticket from the client was encrypted with an old session
+ // ticket key and thus a refreshed ticket should be sent.
+ if hs.hello.ticketSupported {
+ if err := hs.sendSessionTicket(); err != nil {
+ return err
+ }
+ }
if err := hs.sendFinished(c.firstFinished[:]); err != nil {
return err
}
@@ -111,9 +121,6 @@ func (hs *serverHandshakeState) readClientHello() (isResume bool, err error) {
}
c.haveVers = true
- hs.finishedHash = newFinishedHash(c.vers)
- hs.finishedHash.Write(hs.clientHello.marshal())
-
hs.hello = new(serverHelloMsg)
supportedCurve := false
@@ -173,33 +180,47 @@ Curves:
// Although sending an empty NPN extension is reasonable, Firefox has
// had a bug around this. Best to send nothing at all if
// config.NextProtos is empty. See
- // https://code.google.com/p/go/issues/detail?id=5445.
+ // https://golang.org/issue/5445.
if hs.clientHello.nextProtoNeg && len(config.NextProtos) > 0 {
hs.hello.nextProtoNeg = true
hs.hello.nextProtos = config.NextProtos
}
}
- if len(config.Certificates) == 0 {
+ if hs.cert, err = config.getCertificate(&ClientHelloInfo{
+ CipherSuites: hs.clientHello.cipherSuites,
+ ServerName: hs.clientHello.serverName,
+ SupportedCurves: hs.clientHello.supportedCurves,
+ SupportedPoints: hs.clientHello.supportedPoints,
+ }); err != nil {
c.sendAlert(alertInternalError)
- return false, errors.New("tls: no certificates configured")
+ return false, err
}
- hs.cert = &config.Certificates[0]
- if len(hs.clientHello.serverName) > 0 {
- chi := &ClientHelloInfo{
- CipherSuites: hs.clientHello.cipherSuites,
- ServerName: hs.clientHello.serverName,
- SupportedCurves: hs.clientHello.supportedCurves,
- SupportedPoints: hs.clientHello.supportedPoints,
+ if hs.clientHello.scts {
+ hs.hello.scts = hs.cert.SignedCertificateTimestamps
+ }
+
+ if priv, ok := hs.cert.PrivateKey.(crypto.Signer); ok {
+ switch priv.Public().(type) {
+ case *ecdsa.PublicKey:
+ hs.ecdsaOk = true
+ case *rsa.PublicKey:
+ hs.rsaSignOk = true
+ default:
+ c.sendAlert(alertInternalError)
+ return false, fmt.Errorf("crypto/tls: unsupported signing key type (%T)", priv.Public())
}
- if hs.cert, err = config.getCertificate(chi); err != nil {
+ }
+ if priv, ok := hs.cert.PrivateKey.(crypto.Decrypter); ok {
+ switch priv.Public().(type) {
+ case *rsa.PublicKey:
+ hs.rsaDecryptOk = true
+ default:
c.sendAlert(alertInternalError)
- return false, err
+ return false, fmt.Errorf("crypto/tls: unsupported decryption key type (%T)", priv.Public())
}
}
- _, hs.ecdsaOk = hs.cert.PrivateKey.(*ecdsa.PrivateKey)
-
if hs.checkForResumption() {
return true, nil
}
@@ -214,7 +235,7 @@ Curves:
}
for _, id := range preferenceList {
- if hs.suite = c.tryCipherSuite(id, supportedList, c.vers, hs.ellipticOk, hs.ecdsaOk); hs.suite != nil {
+ if hs.setCipherSuite(id, supportedList, c.vers) {
break
}
}
@@ -228,9 +249,9 @@ Curves:
for _, id := range hs.clientHello.cipherSuites {
if id == TLS_FALLBACK_SCSV {
// The client is doing a fallback connection.
- if hs.clientHello.vers < c.config.MaxVersion {
+ if hs.clientHello.vers < c.config.maxVersion() {
c.sendAlert(alertInappropriateFallback)
- return false, errors.New("tls: client using inppropriate protocol fallback")
+ return false, errors.New("tls: client using inappropriate protocol fallback")
}
break
}
@@ -239,7 +260,7 @@ Curves:
return false, nil
}
-// checkForResumption returns true if we should perform resumption on this connection.
+// checkForResumption reports whether we should perform resumption on this connection.
func (hs *serverHandshakeState) checkForResumption() bool {
c := hs.c
@@ -248,7 +269,8 @@ func (hs *serverHandshakeState) checkForResumption() bool {
}
var ok bool
- if hs.sessionState, ok = c.decryptTicket(hs.clientHello.sessionTicket); !ok {
+ var sessionTicket = append([]uint8{}, hs.clientHello.sessionTicket...)
+ if hs.sessionState, ok = c.decryptTicket(sessionTicket); !ok {
return false
}
@@ -272,8 +294,7 @@ func (hs *serverHandshakeState) checkForResumption() bool {
}
// Check that we also support the ciphersuite from the session.
- hs.suite = c.tryCipherSuite(hs.sessionState.cipherSuite, c.config.cipherSuites(), hs.sessionState.vers, hs.ellipticOk, hs.ecdsaOk)
- if hs.suite == nil {
+ if !hs.setCipherSuite(hs.sessionState.cipherSuite, c.config.cipherSuites(), hs.sessionState.vers) {
return false
}
@@ -296,6 +317,10 @@ func (hs *serverHandshakeState) doResumeHandshake() error {
// We echo the client's session ID in the ServerHello to let it know
// that we're doing a resumption.
hs.hello.sessionId = hs.clientHello.sessionId
+ hs.hello.ticketSupported = hs.sessionState.usedOldKey
+ hs.finishedHash = newFinishedHash(c.vers, hs.suite)
+ hs.finishedHash.discardHandshakeBuffer()
+ hs.finishedHash.Write(hs.clientHello.marshal())
hs.finishedHash.Write(hs.hello.marshal())
c.writeRecord(recordTypeHandshake, hs.hello.marshal())
@@ -320,6 +345,14 @@ func (hs *serverHandshakeState) doFullHandshake() error {
hs.hello.ticketSupported = hs.clientHello.ticketSupported && !config.SessionTicketsDisabled
hs.hello.cipherSuite = hs.suite.id
+
+ hs.finishedHash = newFinishedHash(hs.c.vers, hs.suite)
+ if config.ClientAuth == NoClientCert {
+ // No need to keep a full record of the handshake if client
+ // certificates won't be used.
+ hs.finishedHash.discardHandshakeBuffer()
+ }
+ hs.finishedHash.Write(hs.clientHello.marshal())
hs.finishedHash.Write(hs.hello.marshal())
c.writeRecord(recordTypeHandshake, hs.hello.marshal())
@@ -356,7 +389,7 @@ func (hs *serverHandshakeState) doFullHandshake() error {
}
if c.vers >= VersionTLS12 {
certReq.hasSignatureAndHash = true
- certReq.signatureAndHashes = supportedClientCertSignatureAlgorithms
+ certReq.signatureAndHashes = supportedSignatureAlgorithms
}
// An empty list of certificateAuthorities signals to
@@ -420,6 +453,13 @@ func (hs *serverHandshakeState) doFullHandshake() error {
}
hs.finishedHash.Write(ckx.marshal())
+ preMasterSecret, err := keyAgreement.processClientKeyExchange(config, hs.cert, ckx, c.vers)
+ if err != nil {
+ c.sendAlert(alertHandshakeFailure)
+ return err
+ }
+ hs.masterSecret = masterFromPreMasterSecret(c.vers, hs.suite, preMasterSecret, hs.clientHello.random, hs.hello.random)
+
// If we received a client cert in response to our certificate request message,
// the client will send us a certificateVerifyMsg immediately after the
// clientKeyExchangeMsg. This message is a digest of all preceding
@@ -437,8 +477,31 @@ func (hs *serverHandshakeState) doFullHandshake() error {
return unexpectedMessageError(certVerify, msg)
}
+ // Determine the signature type.
+ var signatureAndHash signatureAndHash
+ if certVerify.hasSignatureAndHash {
+ signatureAndHash = certVerify.signatureAndHash
+ if !isSupportedSignatureAndHash(signatureAndHash, supportedSignatureAlgorithms) {
+ return errors.New("tls: unsupported hash function for client certificate")
+ }
+ } else {
+ // Before TLS 1.2 the signature algorithm was implicit
+ // from the key type, and only one hash per signature
+ // algorithm was possible. Leave the hash as zero.
+ switch pub.(type) {
+ case *ecdsa.PublicKey:
+ signatureAndHash.signature = signatureECDSA
+ case *rsa.PublicKey:
+ signatureAndHash.signature = signatureRSA
+ }
+ }
+
switch key := pub.(type) {
case *ecdsa.PublicKey:
+ if signatureAndHash.signature != signatureECDSA {
+ err = errors.New("bad signature type for client's ECDSA certificate")
+ break
+ }
ecdsaSig := new(ecdsaSignature)
if _, err = asn1.Unmarshal(certVerify.signature, ecdsaSig); err != nil {
break
@@ -447,29 +510,34 @@ func (hs *serverHandshakeState) doFullHandshake() error {
err = errors.New("ECDSA signature contained zero or negative values")
break
}
- digest, _, _ := hs.finishedHash.hashForClientCertificate(signatureECDSA)
+ var digest []byte
+ if digest, _, err = hs.finishedHash.hashForClientCertificate(signatureAndHash, hs.masterSecret); err != nil {
+ break
+ }
if !ecdsa.Verify(key, digest, ecdsaSig.R, ecdsaSig.S) {
err = errors.New("ECDSA verification failure")
- break
}
case *rsa.PublicKey:
- digest, hashFunc, _ := hs.finishedHash.hashForClientCertificate(signatureRSA)
+ if signatureAndHash.signature != signatureRSA {
+ err = errors.New("bad signature type for client's RSA certificate")
+ break
+ }
+ var digest []byte
+ var hashFunc crypto.Hash
+ if digest, hashFunc, err = hs.finishedHash.hashForClientCertificate(signatureAndHash, hs.masterSecret); err != nil {
+ break
+ }
err = rsa.VerifyPKCS1v15(key, hashFunc, digest, certVerify.signature)
}
if err != nil {
c.sendAlert(alertBadCertificate)
- return errors.New("could not validate signature of connection nonces: " + err.Error())
+ return errors.New("tls: could not validate signature of connection nonces: " + err.Error())
}
hs.finishedHash.Write(certVerify.marshal())
}
- preMasterSecret, err := keyAgreement.processClientKeyExchange(config, hs.cert, ckx, c.vers)
- if err != nil {
- c.sendAlert(alertHandshakeFailure)
- return err
- }
- hs.masterSecret = masterFromPreMasterSecret(c.vers, preMasterSecret, hs.clientHello.random, hs.hello.random)
+ hs.finishedHash.discardHandshakeBuffer()
return nil
}
@@ -478,7 +546,7 @@ func (hs *serverHandshakeState) establishKeys() error {
c := hs.c
clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
- keysFromMasterSecret(c.vers, hs.masterSecret, hs.clientHello.random, hs.hello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen)
+ 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
@@ -619,18 +687,6 @@ func (hs *serverHandshakeState) processCertsFromClient(certificates [][]byte) (c
return nil, errors.New("tls: failed to verify client's certificate: " + err.Error())
}
- ok := false
- for _, ku := range certs[0].ExtKeyUsage {
- if ku == x509.ExtKeyUsageClientAuth {
- ok = true
- break
- }
- }
- if !ok {
- c.sendAlert(alertHandshakeFailure)
- return nil, errors.New("tls: client's certificate's extended key usage doesn't permit it to be used for client authentication")
- }
-
c.verifiedChains = chains
}
@@ -650,9 +706,10 @@ func (hs *serverHandshakeState) processCertsFromClient(certificates [][]byte) (c
return nil, nil
}
-// tryCipherSuite returns a cipherSuite with the given id if that cipher suite
-// is acceptable to use.
-func (c *Conn) tryCipherSuite(id uint16, supportedCipherSuites []uint16, version uint16, ellipticOk, ecdsaOk bool) *cipherSuite {
+// setCipherSuite sets a cipherSuite with the given id as the serverHandshakeState
+// suite if that cipher suite is acceptable to use.
+// It returns a bool indicating if the suite was set.
+func (hs *serverHandshakeState) setCipherSuite(id uint16, supportedCipherSuites []uint16, version uint16) bool {
for _, supported := range supportedCipherSuites {
if id == supported {
var candidate *cipherSuite
@@ -668,18 +725,26 @@ func (c *Conn) tryCipherSuite(id uint16, supportedCipherSuites []uint16, version
}
// Don't select a ciphersuite which we can't
// support for this client.
- if (candidate.flags&suiteECDHE != 0) && !ellipticOk {
- continue
- }
- if (candidate.flags&suiteECDSA != 0) != ecdsaOk {
+ if candidate.flags&suiteECDHE != 0 {
+ if !hs.ellipticOk {
+ continue
+ }
+ if candidate.flags&suiteECDSA != 0 {
+ if !hs.ecdsaOk {
+ continue
+ }
+ } else if !hs.rsaSignOk {
+ continue
+ }
+ } else if !hs.rsaDecryptOk {
continue
}
if version < VersionTLS12 && candidate.flags&suiteTLS12 != 0 {
continue
}
- return candidate
+ hs.suite = candidate
+ return true
}
}
-
- return nil
+ return false
}
diff --git a/libgo/go/crypto/tls/handshake_server_test.go b/libgo/go/crypto/tls/handshake_server_test.go
index 0338af457ee..20c2bd6d4d4 100644
--- a/libgo/go/crypto/tls/handshake_server_test.go
+++ b/libgo/go/crypto/tls/handshake_server_test.go
@@ -37,6 +37,15 @@ func (zeroSource) Read(b []byte) (n int, err error) {
var testConfig *Config
+func allCipherSuites() []uint16 {
+ ids := make([]uint16, len(cipherSuites))
+ for i, suite := range cipherSuites {
+ ids[i] = suite.id
+ }
+
+ return ids
+}
+
func init() {
testConfig = &Config{
Time: func() time.Time { return time.Unix(0, 0) },
@@ -45,6 +54,7 @@ func init() {
InsecureSkipVerify: true,
MinVersion: VersionSSL30,
MaxVersion: VersionTLS12,
+ CipherSuites: allCipherSuites(),
}
testConfig.Certificates[0].Certificate = [][]byte{testRSACertificate}
testConfig.Certificates[0].PrivateKey = testRSAPrivateKey
@@ -53,7 +63,11 @@ func init() {
testConfig.BuildNameToCertificate()
}
-func testClientHelloFailure(t *testing.T, m handshakeMessage, expectedSubStr string) {
+func testClientHello(t *testing.T, serverConfig *Config, m handshakeMessage) {
+ testClientHelloFailure(t, serverConfig, m, "")
+}
+
+func testClientHelloFailure(t *testing.T, serverConfig *Config, m handshakeMessage, expectedSubStr string) {
// Create in-memory network connection,
// send message to server. Should return
// expected error.
@@ -66,22 +80,26 @@ func testClientHelloFailure(t *testing.T, m handshakeMessage, expectedSubStr str
cli.writeRecord(recordTypeHandshake, m.marshal())
c.Close()
}()
- err := Server(s, testConfig).Handshake()
+ err := Server(s, serverConfig).Handshake()
s.Close()
- if err == nil || !strings.Contains(err.Error(), expectedSubStr) {
+ if len(expectedSubStr) == 0 {
+ if err != nil && err != io.EOF {
+ t.Errorf("Got error: %s; expected to succeed", err, expectedSubStr)
+ }
+ } else if err == nil || !strings.Contains(err.Error(), expectedSubStr) {
t.Errorf("Got error: %s; expected to match substring '%s'", err, expectedSubStr)
}
}
func TestSimpleError(t *testing.T) {
- testClientHelloFailure(t, &serverHelloDoneMsg{}, "unexpected handshake message")
+ testClientHelloFailure(t, testConfig, &serverHelloDoneMsg{}, "unexpected handshake message")
}
var badProtocolVersions = []uint16{0x0000, 0x0005, 0x0100, 0x0105, 0x0200, 0x0205}
func TestRejectBadProtocolVersion(t *testing.T) {
for _, v := range badProtocolVersions {
- testClientHelloFailure(t, &clientHelloMsg{vers: v}, "unsupported, maximum protocol version")
+ testClientHelloFailure(t, testConfig, &clientHelloMsg{vers: v}, "unsupported, maximum protocol version")
}
}
@@ -91,7 +109,7 @@ func TestNoSuiteOverlap(t *testing.T) {
cipherSuites: []uint16{0xff00},
compressionMethods: []uint8{0},
}
- testClientHelloFailure(t, clientHello, "no cipher suite supported by both client and server")
+ testClientHelloFailure(t, testConfig, clientHello, "no cipher suite supported by both client and server")
}
func TestNoCompressionOverlap(t *testing.T) {
@@ -100,7 +118,117 @@ func TestNoCompressionOverlap(t *testing.T) {
cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
compressionMethods: []uint8{0xff},
}
- testClientHelloFailure(t, clientHello, "client does not support uncompressed connections")
+ testClientHelloFailure(t, testConfig, clientHello, "client does not support uncompressed connections")
+}
+
+func TestNoRC4ByDefault(t *testing.T) {
+ clientHello := &clientHelloMsg{
+ vers: 0x0301,
+ cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
+ compressionMethods: []uint8{0},
+ }
+ serverConfig := *testConfig
+ // Reset the enabled cipher suites to nil in order to test the
+ // defaults.
+ serverConfig.CipherSuites = nil
+ testClientHelloFailure(t, &serverConfig, clientHello, "no cipher suite supported by both client and server")
+}
+
+func TestDontSelectECDSAWithRSAKey(t *testing.T) {
+ // Test that, even when both sides support an ECDSA cipher suite, it
+ // won't be selected if the server's private key doesn't support it.
+ clientHello := &clientHelloMsg{
+ vers: 0x0301,
+ cipherSuites: []uint16{TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA},
+ compressionMethods: []uint8{0},
+ supportedCurves: []CurveID{CurveP256},
+ supportedPoints: []uint8{pointFormatUncompressed},
+ }
+ serverConfig := *testConfig
+ serverConfig.CipherSuites = clientHello.cipherSuites
+ serverConfig.Certificates = make([]Certificate, 1)
+ serverConfig.Certificates[0].Certificate = [][]byte{testECDSACertificate}
+ serverConfig.Certificates[0].PrivateKey = testECDSAPrivateKey
+ serverConfig.BuildNameToCertificate()
+ // First test that it *does* work when the server's key is ECDSA.
+ testClientHello(t, &serverConfig, clientHello)
+
+ // Now test that switching to an RSA key causes the expected error (and
+ // not an internal error about a signing failure).
+ serverConfig.Certificates = testConfig.Certificates
+ testClientHelloFailure(t, &serverConfig, clientHello, "no cipher suite supported by both client and server")
+}
+
+func TestDontSelectRSAWithECDSAKey(t *testing.T) {
+ // Test that, even when both sides support an RSA cipher suite, it
+ // won't be selected if the server's private key doesn't support it.
+ clientHello := &clientHelloMsg{
+ vers: 0x0301,
+ cipherSuites: []uint16{TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA},
+ compressionMethods: []uint8{0},
+ supportedCurves: []CurveID{CurveP256},
+ supportedPoints: []uint8{pointFormatUncompressed},
+ }
+ serverConfig := *testConfig
+ serverConfig.CipherSuites = clientHello.cipherSuites
+ // First test that it *does* work when the server's key is RSA.
+ testClientHello(t, &serverConfig, clientHello)
+
+ // Now test that switching to an ECDSA key causes the expected error
+ // (and not an internal error about a signing failure).
+ serverConfig.Certificates = make([]Certificate, 1)
+ serverConfig.Certificates[0].Certificate = [][]byte{testECDSACertificate}
+ serverConfig.Certificates[0].PrivateKey = testECDSAPrivateKey
+ serverConfig.BuildNameToCertificate()
+ testClientHelloFailure(t, &serverConfig, clientHello, "no cipher suite supported by both client and server")
+}
+
+func TestRenegotiationExtension(t *testing.T) {
+ clientHello := &clientHelloMsg{
+ vers: VersionTLS12,
+ compressionMethods: []uint8{compressionNone},
+ random: make([]byte, 32),
+ secureRenegotiation: true,
+ cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
+ }
+
+ var buf []byte
+ c, s := net.Pipe()
+
+ go func() {
+ cli := Client(c, testConfig)
+ cli.vers = clientHello.vers
+ cli.writeRecord(recordTypeHandshake, clientHello.marshal())
+
+ buf = make([]byte, 1024)
+ n, err := c.Read(buf)
+ if err != nil {
+ t.Fatalf("Server read returned error: %s", err)
+ }
+ buf = buf[:n]
+ c.Close()
+ }()
+
+ Server(s, testConfig).Handshake()
+
+ if len(buf) < 5+4 {
+ t.Fatalf("Server returned short message of length %d", len(buf))
+ }
+ // buf contains a TLS record, with a 5 byte record header and a 4 byte
+ // handshake header. The length of the ServerHello is taken from the
+ // handshake header.
+ serverHelloLen := int(buf[6])<<16 | int(buf[7])<<8 | int(buf[8])
+
+ var serverHello serverHelloMsg
+ // unmarshal expects to be given the handshake header, but
+ // serverHelloLen doesn't include it.
+ if !serverHello.unmarshal(buf[5 : 9+serverHelloLen]) {
+ t.Fatalf("Failed to parse ServerHello")
+ }
+
+ if !serverHello.secureRenegotiation {
+ t.Errorf("Secure renegotiation extension was not echoed.")
+ }
}
func TestTLS12OnlyCipherSuites(t *testing.T) {
@@ -175,19 +303,20 @@ func TestClose(t *testing.T) {
}
}
-func testHandshake(clientConfig, serverConfig *Config) (state ConnectionState, err error) {
+func testHandshake(clientConfig, serverConfig *Config) (serverState, clientState ConnectionState, err error) {
c, s := net.Pipe()
done := make(chan bool)
go func() {
cli := Client(c, clientConfig)
cli.Handshake()
+ clientState = cli.ConnectionState()
c.Close()
done <- true
}()
server := Server(s, serverConfig)
err = server.Handshake()
if err == nil {
- state = server.ConnectionState()
+ serverState = server.ConnectionState()
}
s.Close()
<-done
@@ -202,7 +331,7 @@ func TestVersion(t *testing.T) {
clientConfig := &Config{
InsecureSkipVerify: true,
}
- state, err := testHandshake(clientConfig, serverConfig)
+ state, _, err := testHandshake(clientConfig, serverConfig)
if err != nil {
t.Fatalf("handshake failed: %s", err)
}
@@ -221,7 +350,7 @@ func TestCipherSuitePreference(t *testing.T) {
CipherSuites: []uint16{TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_RC4_128_SHA},
InsecureSkipVerify: true,
}
- state, err := testHandshake(clientConfig, serverConfig)
+ state, _, err := testHandshake(clientConfig, serverConfig)
if err != nil {
t.Fatalf("handshake failed: %s", err)
}
@@ -231,7 +360,7 @@ func TestCipherSuitePreference(t *testing.T) {
}
serverConfig.PreferServerCipherSuites = true
- state, err = testHandshake(clientConfig, serverConfig)
+ state, _, err = testHandshake(clientConfig, serverConfig)
if err != nil {
t.Fatalf("handshake failed: %s", err)
}
@@ -240,6 +369,33 @@ func TestCipherSuitePreference(t *testing.T) {
}
}
+func TestSCTHandshake(t *testing.T) {
+ expected := [][]byte{[]byte("certificate"), []byte("transparency")}
+ serverConfig := &Config{
+ Certificates: []Certificate{{
+ Certificate: [][]byte{testRSACertificate},
+ PrivateKey: testRSAPrivateKey,
+ SignedCertificateTimestamps: expected,
+ }},
+ }
+ clientConfig := &Config{
+ InsecureSkipVerify: true,
+ }
+ _, state, err := testHandshake(clientConfig, serverConfig)
+ if err != nil {
+ t.Fatalf("handshake failed: %s", err)
+ }
+ actual := state.SignedCertificateTimestamps
+ if len(actual) != len(expected) {
+ t.Fatalf("got %d scts, want %d", len(actual), len(expected))
+ }
+ for i, sct := range expected {
+ if !bytes.Equal(sct, actual[i]) {
+ t.Fatalf("SCT #%d was %x, but expected %x", i, actual[i], sct)
+ }
+ }
+}
+
// Note: see comment in handshake_test.go for details of how the reference
// tests work.
@@ -257,9 +413,6 @@ type serverTest struct {
expectedPeerCerts []string
// config, if not nil, contains a custom Config to use for this test.
config *Config
- // expectAlert, if true, indicates that a fatal alert should be returned
- // when handshaking with the server.
- expectAlert bool
// expectHandshakeErrorIncluding, when not empty, contains a string
// that must be a substring of the error resulting from the handshake.
expectHandshakeErrorIncluding string
@@ -384,9 +537,7 @@ func (test *serverTest) run(t *testing.T, write bool) {
if !write {
flows, err := test.loadData()
if err != nil {
- if !test.expectAlert {
- t.Fatalf("%s: failed to load data from %s", test.name, test.dataPath())
- }
+ t.Fatalf("%s: failed to load data from %s", test.name, test.dataPath())
}
for i, b := range flows {
if i%2 == 0 {
@@ -395,17 +546,11 @@ func (test *serverTest) run(t *testing.T, write bool) {
}
bb := make([]byte, len(b))
n, err := io.ReadFull(clientConn, bb)
- if test.expectAlert {
- if err == nil {
- t.Fatal("Expected read failure but read succeeded")
- }
- } else {
- if err != nil {
- t.Fatalf("%s #%d: %s\nRead %d, wanted %d, got %x, wanted %x\n", test.name, i+1, err, n, len(bb), bb[:n], b)
- }
- if !bytes.Equal(b, bb) {
- t.Fatalf("%s #%d: mismatch on read: got:%x want:%x", test.name, i+1, bb, b)
- }
+ if err != nil {
+ t.Fatalf("%s #%d: %s\nRead %d, wanted %d, got %x, wanted %x\n", test.name, i+1, err, n, len(bb), bb[:n], b)
+ }
+ if !bytes.Equal(b, bb) {
+ t.Fatalf("%s #%d: mismatch on read: got:%x want:%x", test.name, i+1, bb, b)
}
}
clientConn.Close()
@@ -516,6 +661,14 @@ func TestHandshakeServerAESGCM(t *testing.T) {
runServerTestTLS12(t, test)
}
+func TestHandshakeServerAES256GCMSHA384(t *testing.T) {
+ test := &serverTest{
+ name: "RSA-AES256-GCM-SHA384",
+ command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-AES256-GCM-SHA384"},
+ }
+ runServerTestTLS12(t, test)
+}
+
func TestHandshakeServerECDHEECDSAAES(t *testing.T) {
config := *testConfig
config.Certificates = make([]Certificate, 1)
@@ -599,7 +752,7 @@ func TestHandshakeServerSNIGetCertificate(t *testing.T) {
return cert, nil
}
test := &serverTest{
- name: "SNI",
+ name: "SNI-GetCertificate",
command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"},
config: &config,
}
@@ -617,7 +770,7 @@ func TestHandshakeServerSNIGetCertificateNotFound(t *testing.T) {
return nil, nil
}
test := &serverTest{
- name: "SNI",
+ name: "SNI-GetCertificateNotFound",
command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"},
config: &config,
}
@@ -627,18 +780,50 @@ func TestHandshakeServerSNIGetCertificateNotFound(t *testing.T) {
// TestHandshakeServerSNICertForNameError tests to make sure that errors in
// GetCertificate result in a tls alert.
func TestHandshakeServerSNIGetCertificateError(t *testing.T) {
- config := *testConfig
+ const errMsg = "TestHandshakeServerSNIGetCertificateError error"
- config.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) {
- return nil, fmt.Errorf("Test error in GetCertificate")
+ serverConfig := *testConfig
+ serverConfig.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) {
+ return nil, errors.New(errMsg)
}
- test := &serverTest{
- name: "SNI",
- command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"},
- config: &config,
- expectAlert: true,
+
+ clientHello := &clientHelloMsg{
+ vers: 0x0301,
+ cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
+ compressionMethods: []uint8{0},
+ serverName: "test",
}
- runServerTestTLS12(t, test)
+ testClientHelloFailure(t, &serverConfig, clientHello, errMsg)
+}
+
+// TestHandshakeServerEmptyCertificates tests that GetCertificates is called in
+// the case that Certificates is empty, even without SNI.
+func TestHandshakeServerEmptyCertificates(t *testing.T) {
+ const errMsg = "TestHandshakeServerEmptyCertificates error"
+
+ serverConfig := *testConfig
+ serverConfig.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) {
+ return nil, errors.New(errMsg)
+ }
+ serverConfig.Certificates = nil
+
+ clientHello := &clientHelloMsg{
+ vers: 0x0301,
+ cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
+ compressionMethods: []uint8{0},
+ }
+ testClientHelloFailure(t, &serverConfig, clientHello, errMsg)
+
+ // With an empty Certificates and a nil GetCertificate, the server
+ // should always return a “no certificates” error.
+ serverConfig.GetCertificate = nil
+
+ clientHello = &clientHelloMsg{
+ vers: 0x0301,
+ cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
+ compressionMethods: []uint8{0},
+ }
+ testClientHelloFailure(t, &serverConfig, clientHello, "no certificates")
}
// TestCipherSuiteCertPreferance ensures that we select an RSA ciphersuite with
@@ -716,11 +901,15 @@ func TestResumptionDisabled(t *testing.T) {
}
func TestFallbackSCSV(t *testing.T) {
+ serverConfig := &Config{
+ Certificates: testConfig.Certificates,
+ }
test := &serverTest{
- name: "FallbackSCSV",
+ name: "FallbackSCSV",
+ config: serverConfig,
// OpenSSL 1.0.1j is needed for the -fallback_scsv option.
command: []string{"openssl", "s_client", "-fallback_scsv"},
- expectHandshakeErrorIncluding: "inppropriate protocol fallback",
+ expectHandshakeErrorIncluding: "inappropriate protocol fallback",
}
runServerTestTLS11(t, test)
}
@@ -840,7 +1029,9 @@ func fromHex(s string) []byte {
return b
}
-var testRSACertificate = fromHex("308202b030820219a00302010202090085b0bba48a7fb8ca300d06092a864886f70d01010505003045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c7464301e170d3130303432343039303933385a170d3131303432343039303933385a3045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746430819f300d06092a864886f70d010101050003818d0030818902818100bb79d6f517b5e5bf4610d0dc69bee62b07435ad0032d8a7a4385b71452e7a5654c2c78b8238cb5b482e5de1f953b7e62a52ca533d6fe125c7a56fcf506bffa587b263fb5cd04d3d0c921964ac7f4549f5abfef427100fe1899077f7e887d7df10439c4a22edb51c97ce3c04c3b326601cfafb11db8719a1ddbdb896baeda2d790203010001a381a73081a4301d0603551d0e04160414b1ade2855acfcb28db69ce2369ded3268e18883930750603551d23046e306c8014b1ade2855acfcb28db69ce2369ded3268e188839a149a4473045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746482090085b0bba48a7fb8ca300c0603551d13040530030101ff300d06092a864886f70d010105050003818100086c4524c76bb159ab0c52ccf2b014d7879d7a6475b55a9566e4c52b8eae12661feb4f38b36e60d392fdf74108b52513b1187a24fb301dbaed98b917ece7d73159db95d31d78ea50565cd5825a2d5a5f33c4b6d8c97590968c0f5298b5cd981f89205ff2a01ca31b9694dda9fd57e970e8266d71999b266e3850296c90a7bdd9")
+var testRSACertificate = fromHex("30820263308201cca003020102020900a273000c8100cbf3300d06092a864886f70d01010b0500302b31173015060355040a130e476f6f676c652054455354494e473110300e06035504031307476f20526f6f74301e170d3135303130313030303030305a170d3235303130313030303030305a302631173015060355040a130e476f6f676c652054455354494e47310b300906035504031302476f30819f300d06092a864886f70d010101050003818d0030818902818100af8788f6201b95656c14ab4405af3b4514e3b76dfd00634d957ffe6a623586c04af9187cf6aa255e7a64316600baf48e92afc76bd876d4f35f41cb6e5615971b97c13c123921663d2b16d1bcdb1cc0a7dab7caadbadacbd52150ecde8dabd16b814b8902f3c4bec16c89b14484bd21d1047d9d164df98215f6effad60947f2fb0203010001a38193308190300e0603551d0f0101ff0404030205a0301d0603551d250416301406082b0601050507030106082b06010505070302300c0603551d130101ff0402300030190603551d0e0412041012508d896f1bd1dc544d6ecb695e06f4301b0603551d23041430128010bf3db6a966f2b840cfeab40378481a4130190603551d1104123010820e6578616d706c652e676f6c616e67300d06092a864886f70d01010b050003818100927caf91551218965931a64840d52dd5eebb02a0f5c21e7c9bb3307d3cdc76da4f3dc0faae2d33246b037b1b67591121b511bc77b9d9e06ea82d2e35fa645f223e63106bbeff14866d0df01531a814381e3b84872ccb98ed5176b9b14fdddb9b84048640fa51ddbab48debe346de46b94f86c7f9a4c24134acccf6eab0ab3918")
+
+var testRSACertificateIssuer = fromHex("3082024d308201b6a003020102020827326bd913b7c43d300d06092a864886f70d01010b0500302b31173015060355040a130e476f6f676c652054455354494e473110300e06035504031307476f20526f6f74301e170d3135303130313030303030305a170d3235303130313030303030305a302b31173015060355040a130e476f6f676c652054455354494e473110300e06035504031307476f20526f6f7430819f300d06092a864886f70d010101050003818d0030818902818100f0429a7b9f66a222c8453800452db355b34c4409fee09af2510a6589bfa35bdb4d453200d1de24338d6d5e5a91cc8301628445d6eb4e675927b9c1ea5c0f676acfb0f708ce4f19827e321c1898bf86df9823d5f0b05df2b6779888eff8abbc7f41c6e7d2667386a579b8cbaad3f6fd597cd7c4b187911a425aed1b555c1965190203010001a37a3078300e0603551d0f0101ff040403020204301d0603551d250416301406082b0601050507030106082b06010505070302300f0603551d130101ff040530030101ff30190603551d0e04120410bf3db6a966f2b840cfeab40378481a41301b0603551d23041430128010bf3db6a966f2b840cfeab40378481a41300d06092a864886f70d01010b050003818100586e68c1219ed4f5782b7cfd53cf1a55750a98781b2023f8694bb831fff6d7d4aad1f0ac782b1ec787f00a8956bdd06b4a1063444fcafe955c07d679163a730802c568886a2cf8a3c2ab41176957131c4b9e077ebd7ffbb91fdad8b08b932e9aeefac04923ffdc0aa145563f7f061995317400203578f350e3e566deb29dec5e")
var testECDSACertificate = fromHex("3082020030820162020900b8bf2d47a0d2ebf4300906072a8648ce3d04013045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c7464301e170d3132313132323135303633325a170d3232313132303135303633325a3045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746430819b301006072a8648ce3d020106052b81040023038186000400c4a1edbe98f90b4873367ec316561122f23d53c33b4d213dcd6b75e6f6b0dc9adf26c1bcb287f072327cb3642f1c90bcea6823107efee325c0483a69e0286dd33700ef0462dd0da09c706283d881d36431aa9e9731bd96b068c09b23de76643f1a5c7fe9120e5858b65f70dd9bd8ead5d7f5d5ccb9b69f30665b669a20e227e5bffe3b300906072a8648ce3d040103818c0030818802420188a24febe245c5487d1bacf5ed989dae4770c05e1bb62fbdf1b64db76140d311a2ceee0b7e927eff769dc33b7ea53fcefa10e259ec472d7cacda4e970e15a06fd00242014dfcbe67139c2d050ebd3fa38c25c13313830d9406bbd4377af6ec7ac9862eddd711697f857c56defb31782be4c7780daecbbe9e4e3624317b6a0f399512078f2a")
@@ -848,13 +1039,13 @@ var testSNICertificate = fromHex("308201f23082015da003020102020100300b06092a8648
var testRSAPrivateKey = &rsa.PrivateKey{
PublicKey: rsa.PublicKey{
- N: bigFromString("131650079503776001033793877885499001334664249354723305978524647182322416328664556247316495448366990052837680518067798333412266673813370895702118944398081598789828837447552603077848001020611640547221687072142537202428102790818451901395596882588063427854225330436740647715202971973145151161964464812406232198521"),
+ N: bigFromString("123260960069105588390096594560395120585636206567569540256061833976822892593755073841963170165000086278069699238754008398039246547214989242849418349143232951701395321381739566687846006911427966669790845430647688107009232778985142860108863460556510585049041936029324503323373417214453307648498561956908810892027L"),
E: 65537,
},
- D: bigFromString("29354450337804273969007277378287027274721892607543397931919078829901848876371746653677097639302788129485893852488285045793268732234230875671682624082413996177431586734171663258657462237320300610850244186316880055243099640544518318093544057213190320837094958164973959123058337475052510833916491060913053867729"),
+ D: bigFromString("73196363031103823625826315929954946106043759818067219550565550066527203472294428548476778865091068522665312037075674791871635825938217363523103946045078950060973913307430314113074463630778799389010335923241901501086246276485964417618981733827707048660375428006201525399194575538037883519254056917253456403553L"),
Primes: []*big.Int{
- bigFromString("11969277782311800166562047708379380720136961987713178380670422671426759650127150688426177829077494755200794297055316163155755835813760102405344560929062149"),
- bigFromString("10998999429884441391899182616418192492905073053684657075974935218461686523870125521822756579792315215543092255516093840728890783887287417039645833477273829"),
+ bigFromString("11157426355495284553529769521954035649776033703833034489026848970480272318436419662860715175517581249375929775774910501512841707465207184924996975125010787L"),
+ bigFromString("11047436580963564307160117670964629323534448585520694947919342920137706075617545637058809770319843170934495909554506529982972972247390145716507031692656521L"),
},
}
diff --git a/libgo/go/crypto/tls/key_agreement.go b/libgo/go/crypto/tls/key_agreement.go
index 0974fc6e0f4..0e6a7c22624 100644
--- a/libgo/go/crypto/tls/key_agreement.go
+++ b/libgo/go/crypto/tls/key_agreement.go
@@ -11,7 +11,6 @@ import (
"crypto/md5"
"crypto/rsa"
"crypto/sha1"
- "crypto/sha256"
"crypto/x509"
"encoding/asn1"
"errors"
@@ -31,12 +30,6 @@ func (ka rsaKeyAgreement) generateServerKeyExchange(config *Config, cert *Certif
}
func (ka rsaKeyAgreement) processClientKeyExchange(config *Config, cert *Certificate, ckx *clientKeyExchangeMsg, version uint16) ([]byte, error) {
- preMasterSecret := make([]byte, 48)
- _, err := io.ReadFull(config.rand(), preMasterSecret[2:])
- if err != nil {
- return nil, err
- }
-
if len(ckx.ciphertext) < 2 {
return nil, errClientKeyExchange
}
@@ -49,8 +42,12 @@ func (ka rsaKeyAgreement) processClientKeyExchange(config *Config, cert *Certifi
}
ciphertext = ckx.ciphertext[2:]
}
-
- err = rsa.DecryptPKCS1v15SessionKey(config.rand(), cert.PrivateKey.(*rsa.PrivateKey), ciphertext, preMasterSecret)
+ priv, ok := cert.PrivateKey.(crypto.Decrypter)
+ if !ok {
+ return nil, errors.New("tls: certificate private key does not implement crypto.Decrypter")
+ }
+ // Perform constant time RSA PKCS#1 v1.5 decryption
+ preMasterSecret, err := priv.Decrypt(config.rand(), ciphertext, &rsa.PKCS1v15DecryptOptions{SessionKeyLen: 48})
if err != nil {
return nil, err
}
@@ -110,30 +107,26 @@ func md5SHA1Hash(slices [][]byte) []byte {
return md5sha1
}
-// sha256Hash implements TLS 1.2's hash function.
-func sha256Hash(slices [][]byte) []byte {
- h := sha256.New()
- for _, slice := range slices {
- h.Write(slice)
- }
- return h.Sum(nil)
-}
-
// hashForServerKeyExchange hashes the given slices and returns their digest
-// and the identifier of the hash function used. The hashFunc argument is only
-// used for >= TLS 1.2 and precisely identifies the hash function to use.
-func hashForServerKeyExchange(sigType, hashFunc uint8, version uint16, slices ...[]byte) ([]byte, crypto.Hash, error) {
+// and the identifier of the hash function used. The sigAndHash argument is
+// only used for >= TLS 1.2 and precisely identifies the hash function to use.
+func hashForServerKeyExchange(sigAndHash signatureAndHash, version uint16, slices ...[]byte) ([]byte, crypto.Hash, error) {
if version >= VersionTLS12 {
- switch hashFunc {
- case hashSHA256:
- return sha256Hash(slices), crypto.SHA256, nil
- case hashSHA1:
- return sha1Hash(slices), crypto.SHA1, nil
- default:
- return nil, crypto.Hash(0), errors.New("tls: unknown hash function used by peer")
+ if !isSupportedSignatureAndHash(sigAndHash, supportedSignatureAlgorithms) {
+ return nil, crypto.Hash(0), errors.New("tls: unsupported hash function used by peer")
}
+ hashFunc, err := lookupTLSHash(sigAndHash.hash)
+ if err != nil {
+ return nil, crypto.Hash(0), err
+ }
+ h := hashFunc.New()
+ for _, slice := range slices {
+ h.Write(slice)
+ }
+ digest := h.Sum(nil)
+ return digest, hashFunc, nil
}
- if sigType == signatureECDSA {
+ if sigAndHash.signature == signatureECDSA {
return sha1Hash(slices), crypto.SHA1, nil
}
return md5SHA1Hash(slices), crypto.MD5SHA1, nil
@@ -142,20 +135,19 @@ func hashForServerKeyExchange(sigType, hashFunc uint8, version uint16, slices ..
// pickTLS12HashForSignature returns a TLS 1.2 hash identifier for signing a
// ServerKeyExchange given the signature type being used and the client's
// advertised list of supported signature and hash combinations.
-func pickTLS12HashForSignature(sigType uint8, clientSignatureAndHashes []signatureAndHash) (uint8, error) {
- if len(clientSignatureAndHashes) == 0 {
+func pickTLS12HashForSignature(sigType uint8, clientList []signatureAndHash) (uint8, error) {
+ if len(clientList) == 0 {
// If the client didn't specify any signature_algorithms
// extension then we can assume that it supports SHA1. See
// http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1
return hashSHA1, nil
}
- for _, sigAndHash := range clientSignatureAndHashes {
+ for _, sigAndHash := range clientList {
if sigAndHash.signature != sigType {
continue
}
- switch sigAndHash.hash {
- case hashSHA1, hashSHA256:
+ if isSupportedSignatureAndHash(sigAndHash, supportedSignatureAlgorithms) {
return sigAndHash.hash, nil
}
}
@@ -228,41 +220,42 @@ NextCandidate:
serverECDHParams[3] = byte(len(ecdhePublic))
copy(serverECDHParams[4:], ecdhePublic)
- var tls12HashId uint8
+ sigAndHash := signatureAndHash{signature: ka.sigType}
+
if ka.version >= VersionTLS12 {
- if tls12HashId, err = pickTLS12HashForSignature(ka.sigType, clientHello.signatureAndHashes); err != nil {
+ if sigAndHash.hash, err = pickTLS12HashForSignature(ka.sigType, clientHello.signatureAndHashes); err != nil {
return nil, err
}
}
- digest, hashFunc, err := hashForServerKeyExchange(ka.sigType, tls12HashId, ka.version, clientHello.random, hello.random, serverECDHParams)
+ digest, hashFunc, err := hashForServerKeyExchange(sigAndHash, ka.version, clientHello.random, hello.random, serverECDHParams)
if err != nil {
return nil, err
}
+
+ priv, ok := cert.PrivateKey.(crypto.Signer)
+ if !ok {
+ return nil, errors.New("tls: certificate private key does not implement crypto.Signer")
+ }
var sig []byte
switch ka.sigType {
case signatureECDSA:
- privKey, ok := cert.PrivateKey.(*ecdsa.PrivateKey)
+ _, ok := priv.Public().(*ecdsa.PublicKey)
if !ok {
- return nil, errors.New("ECDHE ECDSA requires an ECDSA server private key")
+ return nil, errors.New("ECDHE ECDSA requires an ECDSA server key")
}
- r, s, err := ecdsa.Sign(config.rand(), privKey, digest)
- if err != nil {
- return nil, errors.New("failed to sign ECDHE parameters: " + err.Error())
- }
- sig, err = asn1.Marshal(ecdsaSignature{r, s})
case signatureRSA:
- privKey, ok := cert.PrivateKey.(*rsa.PrivateKey)
+ _, ok := priv.Public().(*rsa.PublicKey)
if !ok {
- return nil, errors.New("ECDHE RSA requires a RSA server private key")
- }
- sig, err = rsa.SignPKCS1v15(config.rand(), privKey, hashFunc, digest)
- if err != nil {
- return nil, errors.New("failed to sign ECDHE parameters: " + err.Error())
+ return nil, errors.New("ECDHE RSA requires a RSA server key")
}
default:
return nil, errors.New("unknown ECDHE signature algorithm")
}
+ sig, err = priv.Sign(config.rand(), digest, hashFunc)
+ if err != nil {
+ return nil, errors.New("failed to sign ECDHE parameters: " + err.Error())
+ }
skx := new(serverKeyExchangeMsg)
sigAndHashLen := 0
@@ -273,8 +266,8 @@ NextCandidate:
copy(skx.key, serverECDHParams)
k := skx.key[len(serverECDHParams):]
if ka.version >= VersionTLS12 {
- k[0] = tls12HashId
- k[1] = ka.sigType
+ k[0] = sigAndHash.hash
+ k[1] = sigAndHash.signature
k = k[2:]
}
k[0] = byte(len(sig) >> 8)
@@ -335,15 +328,14 @@ func (ka *ecdheKeyAgreement) processServerKeyExchange(config *Config, clientHell
return errServerKeyExchange
}
- var tls12HashId uint8
+ sigAndHash := signatureAndHash{signature: ka.sigType}
if ka.version >= VersionTLS12 {
// handle SignatureAndHashAlgorithm
- var sigAndHash []uint8
- sigAndHash, sig = sig[:2], sig[2:]
- if sigAndHash[1] != ka.sigType {
+ sigAndHash = signatureAndHash{hash: sig[0], signature: sig[1]}
+ if sigAndHash.signature != ka.sigType {
return errServerKeyExchange
}
- tls12HashId = sigAndHash[0]
+ sig = sig[2:]
if len(sig) < 2 {
return errServerKeyExchange
}
@@ -354,7 +346,7 @@ func (ka *ecdheKeyAgreement) processServerKeyExchange(config *Config, clientHell
}
sig = sig[2:]
- digest, hashFunc, err := hashForServerKeyExchange(ka.sigType, tls12HashId, ka.version, clientHello.random, serverHello.random, serverECDHParams)
+ digest, hashFunc, err := hashForServerKeyExchange(sigAndHash, ka.version, clientHello.random, serverHello.random, serverECDHParams)
if err != nil {
return err
}
diff --git a/libgo/go/crypto/tls/prf.go b/libgo/go/crypto/tls/prf.go
index fb8b3ab4d1e..6127c1ccfe7 100644
--- a/libgo/go/crypto/tls/prf.go
+++ b/libgo/go/crypto/tls/prf.go
@@ -10,6 +10,8 @@ import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
+ "crypto/sha512"
+ "errors"
"hash"
)
@@ -65,12 +67,14 @@ func prf10(result, secret, label, seed []byte) {
}
// prf12 implements the TLS 1.2 pseudo-random function, as defined in RFC 5246, section 5.
-func prf12(result, secret, label, seed []byte) {
- labelAndSeed := make([]byte, len(label)+len(seed))
- copy(labelAndSeed, label)
- copy(labelAndSeed[len(label):], seed)
+func prf12(hashFunc func() hash.Hash) func(result, secret, label, seed []byte) {
+ return func(result, secret, label, seed []byte) {
+ labelAndSeed := make([]byte, len(label)+len(seed))
+ copy(labelAndSeed, label)
+ copy(labelAndSeed[len(label):], seed)
- pHash(result, secret, labelAndSeed, sha256.New)
+ pHash(result, secret, labelAndSeed, hashFunc)
+ }
}
// prf30 implements the SSL 3.0 pseudo-random function, as defined in
@@ -117,41 +121,49 @@ var keyExpansionLabel = []byte("key expansion")
var clientFinishedLabel = []byte("client finished")
var serverFinishedLabel = []byte("server finished")
-func prfForVersion(version uint16) func(result, secret, label, seed []byte) {
+func prfAndHashForVersion(version uint16, suite *cipherSuite) (func(result, secret, label, seed []byte), crypto.Hash) {
switch version {
case VersionSSL30:
- return prf30
+ return prf30, crypto.Hash(0)
case VersionTLS10, VersionTLS11:
- return prf10
+ return prf10, crypto.Hash(0)
case VersionTLS12:
- return prf12
+ if suite.flags&suiteSHA384 != 0 {
+ return prf12(sha512.New384), crypto.SHA384
+ }
+ return prf12(sha256.New), crypto.SHA256
default:
panic("unknown version")
}
}
+func prfForVersion(version uint16, suite *cipherSuite) func(result, secret, label, seed []byte) {
+ prf, _ := prfAndHashForVersion(version, suite)
+ return prf
+}
+
// masterFromPreMasterSecret generates the master secret from the pre-master
// secret. See http://tools.ietf.org/html/rfc5246#section-8.1
-func masterFromPreMasterSecret(version uint16, preMasterSecret, clientRandom, serverRandom []byte) []byte {
+func masterFromPreMasterSecret(version uint16, suite *cipherSuite, preMasterSecret, clientRandom, serverRandom []byte) []byte {
var seed [tlsRandomLength * 2]byte
copy(seed[0:len(clientRandom)], clientRandom)
copy(seed[len(clientRandom):], serverRandom)
masterSecret := make([]byte, masterSecretLength)
- prfForVersion(version)(masterSecret, preMasterSecret, masterSecretLabel, seed[0:])
+ prfForVersion(version, suite)(masterSecret, preMasterSecret, masterSecretLabel, seed[0:])
return masterSecret
}
// keysFromMasterSecret generates the connection keys from the master
// secret, given the lengths of the MAC key, cipher key and IV, as defined in
// RFC 2246, section 6.3.
-func keysFromMasterSecret(version uint16, masterSecret, clientRandom, serverRandom []byte, macLen, keyLen, ivLen int) (clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV []byte) {
+func keysFromMasterSecret(version uint16, suite *cipherSuite, masterSecret, clientRandom, serverRandom []byte, macLen, keyLen, ivLen int) (clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV []byte) {
var seed [tlsRandomLength * 2]byte
copy(seed[0:len(clientRandom)], serverRandom)
copy(seed[len(serverRandom):], clientRandom)
n := 2*macLen + 2*keyLen + 2*ivLen
keyMaterial := make([]byte, n)
- prfForVersion(version)(keyMaterial, masterSecret, keyExpansionLabel, seed[0:])
+ prfForVersion(version, suite)(keyMaterial, masterSecret, keyExpansionLabel, seed[0:])
clientMAC = keyMaterial[:macLen]
keyMaterial = keyMaterial[macLen:]
serverMAC = keyMaterial[:macLen]
@@ -166,11 +178,33 @@ func keysFromMasterSecret(version uint16, masterSecret, clientRandom, serverRand
return
}
-func newFinishedHash(version uint16) finishedHash {
- if version >= VersionTLS12 {
- return finishedHash{sha256.New(), sha256.New(), nil, nil, version}
+// lookupTLSHash looks up the corresponding crypto.Hash for a given
+// TLS hash identifier.
+func lookupTLSHash(hash uint8) (crypto.Hash, error) {
+ switch hash {
+ case hashSHA1:
+ return crypto.SHA1, nil
+ case hashSHA256:
+ return crypto.SHA256, nil
+ case hashSHA384:
+ return crypto.SHA384, nil
+ default:
+ return 0, errors.New("tls: unsupported hash algorithm")
+ }
+}
+
+func newFinishedHash(version uint16, cipherSuite *cipherSuite) finishedHash {
+ var buffer []byte
+ if version == VersionSSL30 || version >= VersionTLS12 {
+ buffer = []byte{}
}
- return finishedHash{sha1.New(), sha1.New(), md5.New(), md5.New(), version}
+
+ prf, hash := prfAndHashForVersion(version, cipherSuite)
+ if hash != 0 {
+ return finishedHash{hash.New(), hash.New(), nil, nil, buffer, version, prf}
+ }
+
+ return finishedHash{sha1.New(), sha1.New(), md5.New(), md5.New(), buffer, version, prf}
}
// A finishedHash calculates the hash of a set of handshake messages suitable
@@ -183,10 +217,14 @@ type finishedHash struct {
clientMD5 hash.Hash
serverMD5 hash.Hash
+ // In TLS 1.2, a full buffer is sadly required.
+ buffer []byte
+
version uint16
+ prf func(result, secret, label, seed []byte)
}
-func (h finishedHash) Write(msg []byte) (n int, err error) {
+func (h *finishedHash) Write(msg []byte) (n int, err error) {
h.client.Write(msg)
h.server.Write(msg)
@@ -194,14 +232,29 @@ func (h finishedHash) Write(msg []byte) (n int, err error) {
h.clientMD5.Write(msg)
h.serverMD5.Write(msg)
}
+
+ if h.buffer != nil {
+ h.buffer = append(h.buffer, msg...)
+ }
+
return len(msg), nil
}
+func (h finishedHash) Sum() []byte {
+ if h.version >= VersionTLS12 {
+ return h.client.Sum(nil)
+ }
+
+ out := make([]byte, 0, md5.Size+sha1.Size)
+ out = h.clientMD5.Sum(out)
+ return h.client.Sum(out)
+}
+
// finishedSum30 calculates the contents of the verify_data member of a SSLv3
// Finished message given the MD5 and SHA1 hashes of a set of handshake
// messages.
-func finishedSum30(md5, sha1 hash.Hash, masterSecret []byte, magic [4]byte) []byte {
- md5.Write(magic[:])
+func finishedSum30(md5, sha1 hash.Hash, masterSecret []byte, magic []byte) []byte {
+ md5.Write(magic)
md5.Write(masterSecret)
md5.Write(ssl30Pad1[:])
md5Digest := md5.Sum(nil)
@@ -212,7 +265,7 @@ func finishedSum30(md5, sha1 hash.Hash, masterSecret []byte, magic [4]byte) []by
md5.Write(md5Digest)
md5Digest = md5.Sum(nil)
- sha1.Write(magic[:])
+ sha1.Write(magic)
sha1.Write(masterSecret)
sha1.Write(ssl30Pad1[:40])
sha1Digest := sha1.Sum(nil)
@@ -236,19 +289,11 @@ var ssl3ServerFinishedMagic = [4]byte{0x53, 0x52, 0x56, 0x52}
// Finished message.
func (h finishedHash) clientSum(masterSecret []byte) []byte {
if h.version == VersionSSL30 {
- return finishedSum30(h.clientMD5, h.client, masterSecret, ssl3ClientFinishedMagic)
+ return finishedSum30(h.clientMD5, h.client, masterSecret, ssl3ClientFinishedMagic[:])
}
out := make([]byte, finishedVerifyLength)
- if h.version >= VersionTLS12 {
- seed := h.client.Sum(nil)
- prf12(out, masterSecret, clientFinishedLabel, seed)
- } else {
- seed := make([]byte, 0, md5.Size+sha1.Size)
- seed = h.clientMD5.Sum(seed)
- seed = h.client.Sum(seed)
- prf10(out, masterSecret, clientFinishedLabel, seed)
- }
+ h.prf(out, masterSecret, clientFinishedLabel, h.Sum())
return out
}
@@ -256,36 +301,67 @@ func (h finishedHash) clientSum(masterSecret []byte) []byte {
// Finished message.
func (h finishedHash) serverSum(masterSecret []byte) []byte {
if h.version == VersionSSL30 {
- return finishedSum30(h.serverMD5, h.server, masterSecret, ssl3ServerFinishedMagic)
+ return finishedSum30(h.serverMD5, h.server, masterSecret, ssl3ServerFinishedMagic[:])
}
out := make([]byte, finishedVerifyLength)
- if h.version >= VersionTLS12 {
- seed := h.server.Sum(nil)
- prf12(out, masterSecret, serverFinishedLabel, seed)
- } else {
- seed := make([]byte, 0, md5.Size+sha1.Size)
- seed = h.serverMD5.Sum(seed)
- seed = h.server.Sum(seed)
- prf10(out, masterSecret, serverFinishedLabel, seed)
- }
+ h.prf(out, masterSecret, serverFinishedLabel, h.Sum())
return out
}
+// selectClientCertSignatureAlgorithm returns a signatureAndHash to sign a
+// client's CertificateVerify with, or an error if none can be found.
+func (h finishedHash) selectClientCertSignatureAlgorithm(serverList []signatureAndHash, sigType uint8) (signatureAndHash, error) {
+ if h.version < VersionTLS12 {
+ // Nothing to negotiate before TLS 1.2.
+ return signatureAndHash{signature: sigType}, nil
+ }
+
+ for _, v := range serverList {
+ if v.signature == sigType && isSupportedSignatureAndHash(v, supportedSignatureAlgorithms) {
+ return v, nil
+ }
+ }
+ return signatureAndHash{}, errors.New("tls: no supported signature algorithm found for signing client certificate")
+}
+
// hashForClientCertificate returns a digest, hash function, and TLS 1.2 hash
// id suitable for signing by a TLS client certificate.
-func (h finishedHash) hashForClientCertificate(sigType uint8) ([]byte, crypto.Hash, uint8) {
+func (h finishedHash) hashForClientCertificate(signatureAndHash signatureAndHash, masterSecret []byte) ([]byte, crypto.Hash, error) {
+ if (h.version == VersionSSL30 || h.version >= VersionTLS12) && h.buffer == nil {
+ panic("a handshake hash for a client-certificate was requested after discarding the handshake buffer")
+ }
+
+ if h.version == VersionSSL30 {
+ if signatureAndHash.signature != signatureRSA {
+ return nil, 0, errors.New("tls: unsupported signature type for client certificate")
+ }
+
+ md5Hash := md5.New()
+ md5Hash.Write(h.buffer)
+ sha1Hash := sha1.New()
+ sha1Hash.Write(h.buffer)
+ return finishedSum30(md5Hash, sha1Hash, masterSecret, nil), crypto.MD5SHA1, nil
+ }
if h.version >= VersionTLS12 {
- digest := h.server.Sum(nil)
- return digest, crypto.SHA256, hashSHA256
+ hashAlg, err := lookupTLSHash(signatureAndHash.hash)
+ if err != nil {
+ return nil, 0, err
+ }
+ hash := hashAlg.New()
+ hash.Write(h.buffer)
+ return hash.Sum(nil), hashAlg, nil
}
- if sigType == signatureECDSA {
- digest := h.server.Sum(nil)
- return digest, crypto.SHA1, hashSHA1
+
+ if signatureAndHash.signature == signatureECDSA {
+ return h.server.Sum(nil), crypto.SHA1, nil
}
- digest := make([]byte, 0, 36)
- digest = h.serverMD5.Sum(digest)
- digest = h.server.Sum(digest)
- return digest, crypto.MD5SHA1, 0 /* not specified in TLS 1.2. */
+ return h.Sum(), crypto.MD5SHA1, nil
+}
+
+// discardHandshakeBuffer is called when there is no more need to
+// buffer the entirety of the handshake messages.
+func (h *finishedHash) discardHandshakeBuffer() {
+ h.buffer = nil
}
diff --git a/libgo/go/crypto/tls/prf_test.go b/libgo/go/crypto/tls/prf_test.go
index a9b6c9e4c79..0a1b1bcbd1b 100644
--- a/libgo/go/crypto/tls/prf_test.go
+++ b/libgo/go/crypto/tls/prf_test.go
@@ -35,6 +35,7 @@ func TestSplitPreMasterSecret(t *testing.T) {
type testKeysFromTest struct {
version uint16
+ suite *cipherSuite
preMasterSecret string
clientRandom, serverRandom string
masterSecret string
@@ -49,13 +50,13 @@ func TestKeysFromPreMasterSecret(t *testing.T) {
clientRandom, _ := hex.DecodeString(test.clientRandom)
serverRandom, _ := hex.DecodeString(test.serverRandom)
- masterSecret := masterFromPreMasterSecret(test.version, in, clientRandom, serverRandom)
+ masterSecret := masterFromPreMasterSecret(test.version, test.suite, in, clientRandom, serverRandom)
if s := hex.EncodeToString(masterSecret); s != test.masterSecret {
t.Errorf("#%d: bad master secret %s, want %s", i, s, test.masterSecret)
continue
}
- clientMAC, serverMAC, clientKey, serverKey, _, _ := keysFromMasterSecret(test.version, masterSecret, clientRandom, serverRandom, test.macLen, test.keyLen, 0)
+ clientMAC, serverMAC, clientKey, serverKey, _, _ := keysFromMasterSecret(test.version, test.suite, masterSecret, clientRandom, serverRandom, test.macLen, test.keyLen, 0)
clientMACString := hex.EncodeToString(clientMAC)
serverMACString := hex.EncodeToString(serverMAC)
clientKeyString := hex.EncodeToString(clientKey)
@@ -69,10 +70,20 @@ func TestKeysFromPreMasterSecret(t *testing.T) {
}
}
+func cipherSuiteById(id uint16) *cipherSuite {
+ for _, cipherSuite := range cipherSuites {
+ if cipherSuite.id == id {
+ return cipherSuite
+ }
+ }
+ panic("ciphersuite not found")
+}
+
// These test vectors were generated from GnuTLS using `gnutls-cli --insecure -d 9 `
var testKeysFromTests = []testKeysFromTest{
{
VersionTLS10,
+ cipherSuiteById(TLS_RSA_WITH_RC4_128_SHA),
"0302cac83ad4b1db3b9ab49ad05957de2a504a634a386fc600889321e1a971f57479466830ac3e6f468e87f5385fa0c5",
"4ae66303755184a3917fcb44880605fcc53baa01912b22ed94473fc69cebd558",
"4ae663020ec16e6bb5130be918cfcafd4d765979a3136a5d50c593446e4e44db",
@@ -86,6 +97,7 @@ var testKeysFromTests = []testKeysFromTest{
},
{
VersionTLS10,
+ cipherSuiteById(TLS_RSA_WITH_RC4_128_SHA),
"03023f7527316bc12cbcd69e4b9e8275d62c028f27e65c745cfcddc7ce01bd3570a111378b63848127f1c36e5f9e4890",
"4ae66364b5ea56b20ce4e25555aed2d7e67f42788dd03f3fee4adae0459ab106",
"4ae66363ab815cbf6a248b87d6b556184e945e9b97fbdf247858b0bdafacfa1c",
@@ -99,6 +111,7 @@ var testKeysFromTests = []testKeysFromTest{
},
{
VersionTLS10,
+ cipherSuiteById(TLS_RSA_WITH_RC4_128_SHA),
"832d515f1d61eebb2be56ba0ef79879efb9b527504abb386fb4310ed5d0e3b1f220d3bb6b455033a2773e6d8bdf951d278a187482b400d45deb88a5d5a6bb7d6a7a1decc04eb9ef0642876cd4a82d374d3b6ff35f0351dc5d411104de431375355addc39bfb1f6329fb163b0bc298d658338930d07d313cd980a7e3d9196cac1",
"4ae663b2ee389c0de147c509d8f18f5052afc4aaf9699efe8cb05ece883d3a5e",
"4ae664d503fd4cff50cfc1fb8fc606580f87b0fcdac9554ba0e01d785bdf278e",
@@ -112,6 +125,7 @@ var testKeysFromTests = []testKeysFromTest{
},
{
VersionSSL30,
+ cipherSuiteById(TLS_RSA_WITH_RC4_128_SHA),
"832d515f1d61eebb2be56ba0ef79879efb9b527504abb386fb4310ed5d0e3b1f220d3bb6b455033a2773e6d8bdf951d278a187482b400d45deb88a5d5a6bb7d6a7a1decc04eb9ef0642876cd4a82d374d3b6ff35f0351dc5d411104de431375355addc39bfb1f6329fb163b0bc298d658338930d07d313cd980a7e3d9196cac1",
"4ae663b2ee389c0de147c509d8f18f5052afc4aaf9699efe8cb05ece883d3a5e",
"4ae664d503fd4cff50cfc1fb8fc606580f87b0fcdac9554ba0e01d785bdf278e",
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA b/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA
index 00722cba945..4bad7865df3 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 01 00 59 02 00 00 55 03 01 53 04 f1 03 46 |....Y...U..S...F|
-00000010 0f 84 c4 cb 55 ef 85 f6 4f d7 0e e1 4b 10 d4 bb |....U...O...K...|
-00000020 35 87 2d f3 d7 18 ec 4e 95 4b f4 20 28 82 94 d9 |5.-....N.K. (...|
-00000030 df c4 fc ee 21 23 c1 e2 76 3e 7b 09 af 2c 39 23 |....!#..v>{..,9#|
-00000040 f8 46 6c 31 88 42 f0 79 de 37 2b 00 c0 09 00 00 |.Fl1.B.y.7+.....|
+00000000 16 03 01 00 59 02 00 00 55 03 01 c0 e1 5c 5b 45 |....Y...U....\[E|
+00000010 70 fc a1 73 44 e7 69 b6 83 a1 71 bc 03 21 2e cc |p..sD.i...q..!..|
+00000020 21 7a 28 20 82 6b 2f 77 7d 40 c7 20 0d e4 19 db |!z( .k/w}@. ....|
+00000030 35 cd 75 a4 e7 e5 6c 3e c9 d5 fe 9d c5 88 78 7b |5.u...l>......x{|
+00000040 c4 fc 04 9a c1 10 7a 15 d9 e9 4a 95 c0 09 00 00 |......z...J.....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@@ -47,21 +48,21 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 01 00 d5 0c 00 00 d1 03 00 17 41 04 4f |*............A.O|
-00000280 47 16 72 98 9e 9f 2e 8e 78 e9 0f fe 95 83 7b aa |G.r.....x.....{.|
-00000290 e5 3d c0 7d cf 83 bd 22 0b fd 48 f1 a7 49 a5 7d |.=.}..."..H..I.}|
-000002a0 8e 0c 83 7f e1 2d 71 03 cc 90 09 ab f7 35 81 48 |.....-q......5.H|
-000002b0 a4 1e 7d 87 21 23 12 58 2c 47 f3 af c7 6c 71 00 |..}.!#.X,G...lq.|
-000002c0 8a 30 81 87 02 42 00 b4 03 38 60 43 d9 32 ef 64 |.0...B...8`C.2.d|
-000002d0 5a 9c 91 95 0d 10 21 53 c7 78 f8 bf 50 ed 13 5d |Z.....!S.x..P..]|
-000002e0 c3 e7 71 d6 11 04 f1 e4 9d ce 17 99 8d 1a 87 1f |..q.............|
-000002f0 cb dd f8 1b ae cd bc 4a 77 ab 7c 50 bf 73 c3 ea |.......Jw.|P.s..|
-00000300 d6 df 88 56 f6 b1 03 83 02 41 66 3d fb 4e 7e af |...V.....Af=.N~.|
-00000310 4e c1 60 fe 09 fa 7e 74 99 66 7f de b4 b2 74 89 |N.`...~t.f....t.|
-00000320 1c a4 cf 74 1a 55 a5 be 74 f9 36 21 3d ae c8 c3 |...t.U..t.6!=...|
-00000330 24 8e ad db a3 26 67 8f 98 27 e3 93 ee d9 5c fb |$....&g..'....\.|
-00000340 85 82 e2 13 c3 50 ab e9 f6 39 2b 16 03 01 00 0e |.....P...9+.....|
-00000350 0d 00 00 06 03 01 02 40 00 00 0e 00 00 00 |.......@......|
+00000270 2a 16 03 01 00 d6 0c 00 00 d2 03 00 17 41 04 01 |*............A..|
+00000280 74 83 af 3a 65 7a ad 1a 63 1f 13 82 9d f4 de 06 |t..:ez..c.......|
+00000290 4e 3a 03 81 61 72 ff f8 58 da 7b f5 81 6d 81 57 |N:..ar..X.{..m.W|
+000002a0 d9 d1 b1 6d e3 97 db 86 72 17 15 18 16 d4 ec 04 |...m....r.......|
+000002b0 32 7c 38 90 6b a4 3c e9 35 79 2d 4c 39 5e 2d 00 |2|8.k.<.5y-L9^-.|
+000002c0 8b 30 81 88 02 42 01 44 78 e1 2a bb 95 f7 45 58 |.0...B.Dx.*...EX|
+000002d0 d4 0d b6 e4 4e ff 48 b3 11 14 ee d5 6c bb 5f 0c |....N.H.....l._.|
+000002e0 90 b6 ef bc 05 77 f6 05 42 b4 d8 a6 70 e6 8c 90 |.....w..B...p...|
+000002f0 f0 4b 3b c9 d3 4e 0c 85 65 b4 e0 fe b5 10 09 9b |.K;..N..e.......|
+00000300 e1 08 84 ea 93 96 8e a4 02 42 01 c7 15 ee 9d 98 |.........B......|
+00000310 b7 25 eb 07 ff f6 94 7e e7 9d a5 17 9e 37 93 40 |.%.....~.....7.@|
+00000320 4c 9f eb 6b a3 7a 57 d8 81 c6 d9 09 34 aa 96 8c |L..k.zW.....4...|
+00000330 4d 28 2e 9f f7 0b 1c 09 e1 d1 d8 48 6e 8a 8e 9c |M(.........Hn...|
+00000340 01 4c e7 2d 53 8f 8e 71 61 82 ff ff 16 03 01 00 |.L.-S..qa.......|
+00000350 0e 0d 00 00 06 03 01 02 40 00 00 0e 00 00 00 |........@......|
>>> Flow 3 (client to server)
00000000 16 03 01 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|
@@ -100,30 +101,30 @@
00000220 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..|
00000230 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..|
00000240 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.|
-00000250 b5 68 1a 41 03 56 6b dc 5a 89 16 03 01 00 90 0f |.h.A.Vk.Z.......|
-00000260 00 00 8c 00 8a 30 81 87 02 42 00 c6 85 8e 06 b7 |.....0...B......|
-00000270 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 81 39 |.....>.f#..B.d.9|
-00000280 05 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b 5e 77 |.?.!.(.`kM=..K^w|
-00000290 ef e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 b3 c1 |..Y(...'....3H..|
-000002a0 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 41 4b 49 |.jB..~~1...f.AKI|
-000002b0 c6 cd 02 e3 83 f7 03 50 18 6d b4 c9 51 02 c0 ab |.......P.m..Q...|
-000002c0 87 bc e0 3e 4b 89 53 3a e2 65 89 97 02 c1 87 f1 |...>K.S:.e......|
-000002d0 67 d0 f2 06 28 4e 51 4e fd f0 01 be 41 3c 52 42 |g...(NQN....A<RB|
-000002e0 10 44 73 88 3e 44 24 bb 2e 77 01 77 6f a8 ac 14 |.Ds.>D$..w.wo...|
-000002f0 03 01 00 01 01 16 03 01 00 30 a3 da 45 22 96 83 |.........0..E"..|
-00000300 59 90 e9 6b ec 3b 77 50 05 89 e6 0c 61 d1 1d 2b |Y..k.;wP....a..+|
-00000310 da d4 49 bf b9 c6 dd ad c3 9c 82 bd 53 62 e8 57 |..I.........Sb.W|
-00000320 a4 6a e7 9f b1 d5 39 77 88 6d |.j....9w.m|
+00000250 b5 68 1a 41 03 56 6b dc 5a 89 16 03 01 00 91 0f |.h.A.Vk.Z.......|
+00000260 00 00 8d 00 8b 30 81 88 02 42 01 91 2d e9 99 a4 |.....0...B..-...|
+00000270 88 5c 03 9c ea 8b 64 07 f2 c9 e7 ad 5b a3 fb 27 |.\....d.....[..'|
+00000280 fd 19 9b 78 bd 7b 9d 0a cc 8a 61 c5 83 33 02 29 |...x.{....a..3.)|
+00000290 c3 66 24 9d 5f bc 03 d9 2a 49 aa 59 51 83 49 72 |.f$._...*I.YQ.Ir|
+000002a0 13 be ea 82 5a 5c 09 2f da 23 bc 18 02 42 01 0d |....Z\./.#...B..|
+000002b0 a1 15 4d fe 18 ec 90 d5 4e 9a 75 60 05 67 10 5e |..M.....N.u`.g.^|
+000002c0 3c 34 00 e8 18 33 8f 90 26 2e d3 a9 81 6c 43 17 |<4...3..&....lC.|
+000002d0 80 9e c5 bd 23 c9 24 96 a1 29 23 a4 13 3f ad d2 |....#.$..)#..?..|
+000002e0 45 19 0b 56 56 4b c1 f1 cc 70 c8 af 44 ff 34 96 |E..VVK...p..D.4.|
+000002f0 14 03 01 00 01 01 16 03 01 00 30 c4 0c 67 53 06 |..........0..gS.|
+00000300 49 b3 c9 5c 2e 72 f6 54 ba ad ac a8 80 55 17 01 |I..\.r.T.....U..|
+00000310 5c 44 71 7d ad 15 34 95 9a 7f 7b 95 0e 08 70 ce |\Dq}..4...{...p.|
+00000320 5a 33 f4 3b 4e 80 06 43 70 93 17 |Z3.;N..Cp..|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 a4 45 dd 99 df |..........0.E...|
-00000010 66 ae f5 c7 bd 1a eb 6a ff ac a6 38 14 81 b5 07 |f......j...8....|
-00000020 86 24 80 f1 09 59 ad 33 3d 43 ed 9e 43 b1 1e 9f |.$...Y.3=C..C...|
-00000030 bd 8c b3 e0 41 83 a1 34 91 c5 a1 |....A..4...|
+00000000 14 03 01 00 01 01 16 03 01 00 30 3b ba 6c 73 ec |..........0;.ls.|
+00000010 11 5b 44 46 1d bb 31 1b 1b e8 d8 51 4f 95 b0 40 |.[DF..1....QO..@|
+00000020 87 49 33 73 40 98 61 1c 94 02 48 9b 80 d3 6c af |.I3s@.a...H...l.|
+00000030 e2 31 63 11 a7 c8 db ed 7a a4 4d |.1c.....z.M|
>>> Flow 5 (client to server)
-00000000 17 03 01 00 20 ae e3 ae 7f 2d e3 a2 f7 1b 4e 69 |.... ....-....Ni|
-00000010 cb 18 c6 68 42 f8 de 61 92 4c fa d6 19 7c 8c 09 |...hB..a.L...|..|
-00000020 82 e2 f2 32 19 17 03 01 00 20 2a 77 65 1f c1 fd |...2..... *we...|
-00000030 5e 37 b7 15 f6 1f 4c 7f 5f 89 52 b4 32 27 4d 17 |^7....L._.R.2'M.|
-00000040 33 c6 e8 50 ac 70 c8 b9 2d 0a 15 03 01 00 20 e0 |3..P.p..-..... .|
-00000050 cb ce 07 80 55 a0 46 ca a7 25 4c 5f 9d 7c 73 37 |....U.F..%L_.|s7|
-00000060 de 72 6d 36 a8 e4 be fd 2a e7 f8 8d 14 80 b7 |.rm6....*......|
+00000000 17 03 01 00 20 2e f7 66 f0 ce 50 d7 38 7a d4 fd |.... ..f..P.8z..|
+00000010 e3 66 b1 76 76 59 ad bc b0 0a 75 1d f0 92 6e e3 |.f.vvY....u...n.|
+00000020 21 1d 13 dc ad 17 03 01 00 20 f1 b2 0f 3b 26 91 |!........ ...;&.|
+00000030 ed ff 9f fc 41 04 7e 47 17 02 af 0c 2b e8 b7 31 |....A.~G....+..1|
+00000040 ae 29 71 f9 a8 89 84 f3 e8 da 15 03 01 00 20 1f |.)q........... .|
+00000050 26 64 cf 34 c1 48 6b 79 61 e2 77 57 9d 27 14 45 |&d.4.Hkya.wW.'.E|
+00000060 46 24 ad 2d 35 57 db 2b 32 03 e2 68 b0 1a 5a |F$.-5W.+2..h..Z|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA b/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA
index c0be82491e2..0e420a64804 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 01 00 51 02 00 00 4d 03 01 53 04 f1 02 ed |....Q...M..S....|
-00000010 86 9c 56 84 5a d3 7d d7 f3 4e 6f 2c 69 0d f0 59 |..V.Z.}..No,i..Y|
-00000020 a5 d1 de 2d 03 2f dd 63 c3 ab fa 20 30 d6 5a 24 |...-./.c... 0.Z$|
-00000030 5c 31 67 36 8d 4c 43 e1 64 c4 8a 2c a5 fd 39 92 |\1g6.LC.d..,..9.|
-00000040 c5 6f 58 47 a3 fe 63 14 98 92 11 90 00 05 00 00 |.oXG..c.........|
+00000000 16 03 01 00 51 02 00 00 4d 03 01 b7 de 52 5a 07 |....Q...M....RZ.|
+00000010 43 b8 72 1d d9 6f 5c a5 70 da ee 27 b7 a9 50 9d |C.r..o\.p..'..P.|
+00000020 e7 75 ad 61 a5 2f 69 47 2a d8 2e 20 a8 b0 64 6b |.u.a./iG*.. ..dk|
+00000030 4d 25 ec 50 2b 8e a7 9b 0c f9 f5 3c 62 96 a3 53 |M%.P+......<b..S|
+00000040 a7 4b af 33 1e e7 f8 43 b9 be 6e e7 00 05 00 00 |.K.3...C..n.....|
00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
@@ -101,25 +102,25 @@
00000260 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce e6 |.9L.....K.../...|
00000270 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 f1 |.w.o#......:..V.|
00000280 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 35 |.T^F..;3..(....5|
-00000290 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 01 00 90 0f |..C.0oUN.p......|
-000002a0 00 00 8c 00 8a 30 81 87 02 42 00 c6 85 8e 06 b7 |.....0...B......|
-000002b0 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 81 39 |.....>.f#..B.d.9|
-000002c0 05 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b 5e 77 |.?.!.(.`kM=..K^w|
-000002d0 ef e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 b3 c1 |..Y(...'....3H..|
-000002e0 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 41 4b 49 |.jB..~~1...f.AKI|
-000002f0 c6 cd 02 e3 83 f7 03 50 18 6d b4 c9 51 02 c0 ab |.......P.m..Q...|
-00000300 87 bc e0 3e 4b 89 53 3a e2 65 89 97 02 c1 87 f1 |...>K.S:.e......|
-00000310 67 d0 f2 06 28 4e 51 4e fd f0 01 47 e7 c9 d9 23 |g...(NQN...G...#|
-00000320 21 6b 87 d2 55 e3 c9 f7 eb 86 d5 1e 50 df d5 14 |!k..U.......P...|
-00000330 03 01 00 01 01 16 03 01 00 24 95 62 42 be 90 39 |.........$.bB..9|
-00000340 68 ae f5 77 47 21 14 b9 ac ee 81 2d e3 9e c7 34 |h..wG!.....-...4|
-00000350 3a 00 5c c9 12 1d c0 5a 7c e7 ef e0 cd fd |:.\....Z|.....|
+00000290 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 01 00 91 0f |..C.0oUN.p......|
+000002a0 00 00 8d 00 8b 30 81 88 02 42 00 b5 1a 9d 48 90 |.....0...B....H.|
+000002b0 2f d9 1a 04 66 f7 3b 4d d7 ae d9 1e dd 3c fa 24 |/...f.;M.....<.$|
+000002c0 0f 24 97 b2 61 46 16 d9 a0 35 f9 f7 54 45 92 fd |.$..aF...5..TE..|
+000002d0 10 56 ab 26 d7 b5 10 80 8b 88 95 ef c6 73 1c d2 |.V.&.........s..|
+000002e0 ff e9 20 cd 18 a8 40 c4 4d 83 c2 e2 02 42 01 8c |.. ...@.M....B..|
+000002f0 d2 13 4c cc e5 38 37 17 6c 83 d6 ad c1 dc af ec |..L..87.l.......|
+00000300 8d 06 75 b8 08 ad 56 4a 8f b9 03 59 80 f8 81 d4 |..u...VJ...Y....|
+00000310 f3 91 89 eb 9c 27 5d e1 dc 6d ef d6 20 da e7 9c |.....']..m.. ...|
+00000320 71 75 cb 2a f9 e4 05 46 c8 85 ca 7b 9c 97 e8 6d |qu.*...F...{...m|
+00000330 14 03 01 00 01 01 16 03 01 00 24 9f 67 4e 22 04 |..........$.gN".|
+00000340 10 f4 28 55 3e 50 88 90 61 07 42 29 f5 9b f5 32 |..(U>P..a.B)...2|
+00000350 16 3d ea c1 8f aa a1 4c b5 72 26 d8 32 cd 50 |.=.....L.r&.2.P|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 24 ea 98 c0 fb 86 |..........$.....|
-00000010 87 7a 2e e1 c7 68 61 3e 5b cc da 1f d6 7b ab 5a |.z...ha>[....{.Z|
-00000020 a0 ae a2 cf d0 54 44 19 12 db 75 2b 8c 73 8c |.....TD...u+.s.|
+00000000 14 03 01 00 01 01 16 03 01 00 24 df 8d f1 07 6d |..........$....m|
+00000010 63 39 fc ba b1 67 3b 68 85 b9 37 7d d3 67 19 76 |c9...g;h..7}.g.v|
+00000020 34 a4 1b 86 31 bd fe 06 72 00 d8 2b f2 65 3d |4...1...r..+.e=|
>>> Flow 5 (client to server)
-00000000 17 03 01 00 1a f3 28 77 31 33 4c b3 7c 4b 75 61 |......(w13L.|Kua|
-00000010 38 69 6b ae c9 36 ab 2e 56 16 29 6a 9a 00 2f 15 |8ik..6..V.)j../.|
-00000020 03 01 00 16 6b ed 68 18 ed ff 44 39 9b 4a e4 a2 |....k.h...D9.J..|
-00000030 cd 79 ef 2a 3e 5a 4d b1 5d 56 |.y.*>ZM.]V|
+00000000 17 03 01 00 1a 60 cc 81 4f 8b 73 b3 7f 34 bf f1 |.....`..O.s..4..|
+00000010 7c d8 32 0a ef 2a 26 f9 b8 69 84 83 48 21 ee 15 ||.2..*&..i..H!..|
+00000020 03 01 00 16 23 7a 0c 65 3a 66 1a 75 03 e4 85 3f |....#z.e:f.u...?|
+00000030 83 cd 55 70 99 f4 44 dc 67 ba |..Up..D.g.|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA b/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA
index 3e6dbc271a9..7e33edc1897 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 01 00 59 02 00 00 55 03 01 53 04 f1 02 4f |....Y...U..S...O|
-00000010 73 06 2d 72 41 36 a1 b2 d3 50 97 55 8c c5 f1 43 |s.-rA6...P.U...C|
-00000020 37 1f 1a 2a fe 51 70 0b 2f 25 9e 20 50 61 86 80 |7..*.Qp./%. Pa..|
-00000030 9a 9c 6d 6f c9 ea 5c ce 0c b7 7c ce e3 be d0 e5 |..mo..\...|.....|
-00000040 be d0 c4 80 78 c3 c7 17 0c 2d 8e c8 c0 09 00 00 |....x....-......|
+00000000 16 03 01 00 59 02 00 00 55 03 01 dc a9 22 c2 a2 |....Y...U...."..|
+00000010 05 ba c4 66 9a 71 aa 0f 92 6a fc df b0 29 4d 36 |...f.q...j...)M6|
+00000020 39 2e f8 39 ed 8e f6 7f 8f 17 13 20 f8 9c f3 3d |9..9....... ...=|
+00000030 0a 41 8f 30 c7 5d cd 17 c5 ad 1c 52 45 a3 47 8c |.A.0.].....RE.G.|
+00000040 07 4c 48 e1 00 2b 32 38 01 c8 79 b7 c0 09 00 00 |.LH..+28..y.....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@@ -47,21 +48,21 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 01 00 d6 0c 00 00 d2 03 00 17 41 04 b1 |*............A..|
-00000280 0f 0f 4a 18 ed 25 32 b3 a3 19 ed 4b 61 b6 eb e4 |..J..%2....Ka...|
-00000290 d3 f7 77 13 ac 9f 60 c7 8d 6d cb f1 ee 99 1a 71 |..w...`..m.....q|
-000002a0 68 aa d3 a7 70 7f 38 d0 f6 23 ab 9a f6 dd 19 4f |h...p.8..#.....O|
-000002b0 ce 10 ef d5 cf 64 85 2f 75 f6 20 06 4b f0 b9 00 |.....d./u. .K...|
-000002c0 8b 30 81 88 02 42 01 00 b9 6b 80 91 59 0a 48 3f |.0...B...k..Y.H?|
-000002d0 72 16 96 8f 21 2c 28 e4 6d 03 74 66 35 16 7d ec |r...!,(.m.tf5.}.|
-000002e0 c7 08 9b 52 b5 05 d9 38 d8 b7 51 42 a7 4a 9f 9b |...R...8..QB.J..|
-000002f0 1a 37 14 de c5 f5 16 96 83 81 58 d3 a6 1e ce 8a |.7........X.....|
-00000300 bc 19 47 30 fe c5 85 55 02 42 01 4f 61 59 68 85 |..G0...U.B.OaYh.|
-00000310 c7 64 23 22 f6 83 53 cc 58 38 25 b5 ce 74 c1 68 |.d#"..S.X8%..t.h|
-00000320 9f 32 72 33 ea c9 62 e0 26 63 92 e3 5f 34 10 0b |.2r3..b.&c.._4..|
-00000330 3c d5 83 fe 9f 67 69 ef 33 6b 19 c1 ec d6 6c 35 |<....gi.3k....l5|
-00000340 89 33 17 d3 9d 93 e2 e5 6e 89 9a a1 16 03 01 00 |.3......n.......|
-00000350 0e 0d 00 00 06 03 01 02 40 00 00 0e 00 00 00 |........@......|
+00000270 2a 16 03 01 00 d5 0c 00 00 d1 03 00 17 41 04 89 |*............A..|
+00000280 95 9a 90 82 59 ab 29 bf 10 06 8c 6c 0d 67 cf b1 |....Y.)....l.g..|
+00000290 66 8b 5e 43 b8 46 56 3a 8d 30 92 35 28 82 f2 38 |f.^C.FV:.0.5(..8|
+000002a0 6e 19 5d 37 f0 ab fc 78 15 6a 6a 73 ca dc a6 f2 |n.]7...x.jjs....|
+000002b0 68 5d b3 ab 6d 68 44 3b 80 d2 d9 cd 78 0a ed 00 |h]..mhD;....x...|
+000002c0 8a 30 81 87 02 42 01 80 63 4a 22 4c 8e 66 4e 25 |.0...B..cJ"L.fN%|
+000002d0 e1 86 27 81 de eb b3 a0 c4 dc dc e2 a0 94 2a b6 |..'...........*.|
+000002e0 b3 e9 e7 42 e1 1d 1a c0 43 8d a1 d6 8d 77 84 06 |...B....C....w..|
+000002f0 ba 95 99 e3 54 80 59 4e 3c fb 0c f3 b7 d3 a8 d2 |....T.YN<.......|
+00000300 ce 49 97 fb e2 79 91 93 02 41 2b 2c b7 9f 81 ea |.I...y...A+,....|
+00000310 de 17 12 af 4d 20 bc a1 43 1d 60 a0 37 52 a2 7b |....M ..C.`.7R.{|
+00000320 a8 4c de fd 1d fe 37 3b 00 23 61 ce d2 80 47 43 |.L....7;.#a...GC|
+00000330 b0 3a f3 1f aa c7 07 b1 68 5b d8 f3 03 a9 56 5c |.:......h[....V\|
+00000340 63 ef 83 1d 9c 9c 8d 29 81 e9 3b 16 03 01 00 0e |c......)..;.....|
+00000350 0d 00 00 06 03 01 02 40 00 00 0e 00 00 00 |.......@......|
>>> Flow 3 (client to server)
00000000 16 03 01 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
@@ -100,29 +101,29 @@
00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 01 00 86 |..h.A.Vk.Z......|
-00000250 0f 00 00 82 00 80 20 2c 5a 08 3a 00 33 50 19 b2 |...... ,Z.:.3P..|
-00000260 0f ba 6c 76 7f 5c 92 e2 78 55 3e 32 32 bb 33 bc |..lv.\..xU>22.3.|
-00000270 ab a9 34 e0 83 cf 82 cd 9e 6b 3f 9d e6 49 61 29 |..4......k?..Ia)|
-00000280 8b b4 ed e8 12 cd a9 52 86 11 48 64 08 61 72 8d |.......R..Hd.ar.|
-00000290 d6 6a ac 42 cc e4 07 5f 08 56 9f 2f c5 35 d3 9b |.j.B..._.V./.5..|
-000002a0 e9 0d 91 82 c0 e9 bb 9f a9 8f df 96 85 08 9a 69 |...............i|
-000002b0 a4 93 b3 72 37 ba f9 b1 a4 0b b0 9f 43 6a 15 ec |...r7.......Cj..|
-000002c0 79 b8 fd 9c 1f 5f 0d 2c 56 33 c7 15 d5 4a b7 82 |y...._.,V3...J..|
-000002d0 ea 44 80 20 c5 80 14 03 01 00 01 01 16 03 01 00 |.D. ............|
-000002e0 30 c9 c0 7c d7 57 d3 00 ab 87 eb 78 56 6b a1 69 |0..|.W.....xVk.i|
-000002f0 1d fa ec ae 38 f3 ef 5d 49 19 0d 4b f0 73 63 af |....8..]I..K.sc.|
-00000300 89 b6 cb 76 cf fb b9 c1 99 98 06 0a 54 67 a0 6e |...v........Tg.n|
-00000310 e7 |.|
+00000250 0f 00 00 82 00 80 0e 80 9c 3a 6e 40 51 09 39 d4 |.........:n@Q.9.|
+00000260 40 58 10 da 7f 32 12 08 9e f0 4d 9a d7 20 a2 9c |@X...2....M.. ..|
+00000270 b0 95 3a 33 4e f8 b1 a3 74 62 ab 51 7d 23 d4 32 |..:3N...tb.Q}#.2|
+00000280 a2 af b8 5a 3b b0 23 e4 7a f1 eb 4d b7 bb 23 d5 |...Z;.#.z..M..#.|
+00000290 a9 0d b4 81 d2 b4 45 bd 15 52 ad 58 da 92 a2 c4 |......E..R.X....|
+000002a0 30 66 87 f2 ae c5 e4 8c fa ba a0 40 76 b8 3f 72 |0f.........@v.?r|
+000002b0 2a d9 95 2a 2d c6 05 3c 1e 2f 11 ef c5 3c 11 e4 |*..*-..<./...<..|
+000002c0 be 5a de 37 43 7f 74 52 6e ee 3c 39 cc f1 14 05 |.Z.7C.tRn.<9....|
+000002d0 2d 91 c2 3d c4 7c 14 03 01 00 01 01 16 03 01 00 |-..=.|..........|
+000002e0 30 cd 3c 92 f8 b9 36 7a e7 8a fb 0f 2f b8 2c 7b |0.<...6z..../.,{|
+000002f0 10 59 45 14 0a b0 6a 8c 31 b2 89 5b ac 19 dc 12 |.YE...j.1..[....|
+00000300 73 8c 8c 10 49 5a bf 9f bc 58 82 32 11 ba c5 38 |s...IZ...X.2...8|
+00000310 ff |.|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 20 db fd ed ed |..........0 ....|
-00000010 7c d5 bf 8f 06 3b 86 1b c1 60 7d a4 74 e9 a6 c9 ||....;...`}.t...|
-00000020 f5 7c c7 f4 65 91 06 d5 53 88 d7 57 a4 22 b6 1f |.|..e...S..W."..|
-00000030 f1 02 e9 79 36 e6 a1 22 51 3a 4c |...y6.."Q:L|
+00000000 14 03 01 00 01 01 16 03 01 00 30 da 45 99 fe 52 |..........0.E..R|
+00000010 4f cd d0 e6 30 19 f4 bd 80 6d 5c 8a 72 03 d3 88 |O...0....m\.r...|
+00000020 38 63 e9 c9 39 ee ab 3f 52 26 84 b0 4d cb 5c a4 |8c..9..?R&..M.\.|
+00000030 0d 51 c7 47 48 43 3a bf 89 c7 13 |.Q.GHC:....|
>>> Flow 5 (client to server)
-00000000 17 03 01 00 20 00 66 51 6a 14 ca ea e2 21 48 74 |.... .fQj....!Ht|
-00000010 c4 c1 6e b9 8b 23 af 7c 33 c9 00 f8 0b ec ab 35 |..n..#.|3......5|
-00000020 e7 42 0a d1 ae 17 03 01 00 20 00 1c 6d 60 75 5d |.B....... ..m`u]|
-00000030 b3 fb 40 2e e0 b7 0d 48 f4 87 ac d4 bf ea 01 0d |..@....H........|
-00000040 fe 10 0d 05 04 43 6b 19 ed f2 15 03 01 00 20 f8 |.....Ck....... .|
-00000050 03 ac 62 4b 1f db 2e d2 4e 00 c3 a4 57 3c 0a 62 |..bK....N...W<.b|
-00000060 05 a0 ef bd 2b 9b 9a 63 27 72 d7 d8 f1 8d 84 |....+..c'r.....|
+00000000 17 03 01 00 20 4d d9 1d 0d 3d 8b 73 91 b9 4e 5e |.... M...=.s..N^|
+00000010 35 71 4f 67 79 d2 f7 39 35 ea 23 d0 6d 64 de a5 |5qOgy..95.#.md..|
+00000020 59 fb 75 1f c9 17 03 01 00 20 ba bd 3c b4 d7 be |Y.u...... ..<...|
+00000030 24 64 68 1e 8c b2 bf 6f 78 9f ad 7f fa dd 89 a6 |$dh....ox.......|
+00000040 f9 e7 5e 70 db e9 db 3a 62 b2 15 03 01 00 20 2a |..^p...:b..... *|
+00000050 82 f4 8b 45 fc 76 35 6c 54 48 62 2f 52 55 f2 d9 |...E.v5lTHb/RU..|
+00000060 99 b2 b5 2d 5f a0 05 ab f1 93 58 75 4a 87 35 |...-_.....XuJ.5|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA b/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA
index 94e686004f9..9b1a5533acf 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 01 00 51 02 00 00 4d 03 01 53 04 f1 02 73 |....Q...M..S...s|
-00000010 ee 5f 70 a4 aa 0d be d7 46 a3 25 3f e3 5d ef 7b |._p.....F.%?.].{|
-00000020 73 49 7c b6 82 4d 99 2f 31 fc 8b 20 2d a3 33 7c |sI|..M./1.. -.3||
-00000030 a5 c3 85 86 ba 61 4d 05 b0 5e d3 5e 88 6e c3 4b |.....aM..^.^.n.K|
-00000040 95 d3 e9 67 f1 96 24 58 7a 6f e6 c5 00 05 00 00 |...g..$Xzo......|
+00000000 16 03 01 00 51 02 00 00 4d 03 01 90 e6 e1 c6 bd |....Q...M.......|
+00000010 86 08 db 33 94 f3 bd 0b 2d fc e0 ba 89 a7 c5 66 |...3....-......f|
+00000020 a5 19 78 33 2b b9 c4 22 d8 e0 63 20 2e 85 53 25 |..x3+.."..c ..S%|
+00000030 f2 22 e3 ca 79 94 9e 50 00 13 da 9d 21 33 49 27 |."..y..P....!3I'|
+00000040 9b 44 c5 10 bc e8 44 01 04 31 02 81 00 05 00 00 |.D....D..1......|
00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
@@ -101,24 +102,24 @@
00000260 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
00000270 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
00000280 35 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 01 00 86 |5..C.0oUN.p.....|
-00000290 0f 00 00 82 00 80 0f 4c d2 b2 f0 94 6d 61 d1 2c |.......L....ma.,|
-000002a0 db 6f 79 03 bd 40 b2 d2 1d 61 ef 83 1b 4a 0c 7b |.oy..@...a...J.{|
-000002b0 c5 73 1e 1a 81 e7 67 0a d6 aa 2d 04 04 cc 0e 4b |.s....g...-....K|
-000002c0 2e da 96 7f 15 6c 05 ee c4 53 7e 33 89 28 7d db |.....l...S~3.(}.|
-000002d0 a1 77 43 ba a3 51 a9 1c b9 f5 ec 9a 8d eb 2c 46 |.wC..Q........,F|
-000002e0 5c 33 59 6b 16 af de f4 9b 80 76 a3 22 30 5d bb |\3Yk......v."0].|
-000002f0 02 b9 77 96 8a db 36 9f 54 95 00 d8 58 e1 aa 04 |..w...6.T...X...|
-00000300 98 c9 0c 32 ae 62 81 12 0c f6 1b 76 c6 58 a7 8c |...2.b.....v.X..|
-00000310 0e d8 b7 8e ed 0f 14 03 01 00 01 01 16 03 01 00 |................|
-00000320 24 1d c0 20 02 2d da 69 54 29 8c ff af 5c 56 a8 |$.. .-.iT)...\V.|
-00000330 eb d0 09 95 29 8f 52 8c e2 7b 9f 36 3e 47 a0 33 |....).R..{.6>G.3|
-00000340 2e 63 a2 24 93 |.c.$.|
+00000290 0f 00 00 82 00 80 10 19 57 14 c3 ee 2d da cb de |........W...-...|
+000002a0 f3 70 c5 62 91 2f ad 62 dd 10 f1 65 20 a2 cf d5 |.p.b./.b...e ...|
+000002b0 cd 6d 5f e4 b3 3e 38 e8 d0 1a f7 f0 e7 7e b6 5d |.m_..>8......~.]|
+000002c0 c3 6c ad f6 0d 05 1e 41 35 2d 04 15 3c 36 96 00 |.l.....A5-..<6..|
+000002d0 e8 02 b2 01 b8 9f 21 4b 34 85 ef 5e 4c 87 ef 49 |......!K4..^L..I|
+000002e0 df d1 9a b6 b2 bd b8 90 fd 3f 31 93 0c dc c7 18 |.........?1.....|
+000002f0 ff f6 76 bd 5b 74 76 b3 62 87 6a df ff 63 15 d5 |..v.[tv.b.j..c..|
+00000300 94 d5 fe fd 4c 12 df f1 35 07 f1 8a f1 77 7a 35 |....L...5....wz5|
+00000310 cd 99 1d 2a d7 9a 14 03 01 00 01 01 16 03 01 00 |...*............|
+00000320 24 8d db 0c 87 b5 df fd 68 de fe 46 3e e4 41 b5 |$.......h..F>.A.|
+00000330 19 64 68 3c c4 e2 2b 43 50 e4 ee 52 75 34 d3 c1 |.dh<..+CP..Ru4..|
+00000340 51 18 c0 b2 5f |Q..._|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 24 99 e8 fb 65 f4 |..........$...e.|
-00000010 95 ae 8b 71 cc 5d a4 95 a7 27 98 fd 16 3f 7a 1a |...q.]...'...?z.|
-00000020 b6 bd bf 0a 58 72 77 97 1f 8e b1 dd 4b 12 12 |....Xrw.....K..|
+00000000 14 03 01 00 01 01 16 03 01 00 24 0b a4 04 46 60 |..........$...F`|
+00000010 15 fb 9a 9f 47 51 6d b4 4b c6 e7 2a 1b 98 b4 8a |....GQm.K..*....|
+00000020 8a 1a 03 cf f4 16 7d 80 70 27 e5 e8 d5 9f ad |......}.p'.....|
>>> Flow 5 (client to server)
-00000000 17 03 01 00 1a 42 70 c0 89 78 12 5c 91 7e 88 2d |.....Bp..x.\.~.-|
-00000010 2f 8f be f2 f2 12 9d 81 ae 78 08 38 5e 6d 1b 15 |/........x.8^m..|
-00000020 03 01 00 16 1a 64 b1 6f 8a ff d3 63 6a c7 b8 95 |.....d.o...cj...|
-00000030 3d b0 87 bc 62 e9 88 5b 26 bd |=...b..[&.|
+00000000 17 03 01 00 1a 6f 84 50 27 c7 f1 aa b0 04 7d 80 |.....o.P'.....}.|
+00000010 6d a7 20 8a 73 cf d9 de 9a d6 f5 e9 36 13 7c 15 |m. .s.......6.|.|
+00000020 03 01 00 16 e8 0b e0 a6 3b 1e 21 24 65 4e 49 b2 |........;.!$eNI.|
+00000030 2d a3 41 2b 98 23 4e d5 4b fd |-.A+.#N.K.|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES b/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES
index 30c4c6b831a..937c2909f90 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 01 00 59 02 00 00 55 03 01 53 04 f1 02 b2 |....Y...U..S....|
-00000010 e0 f6 f6 b5 c9 5b 28 d0 5d 58 1b 6f 4e 2b 9d 05 |.....[(.]X.oN+..|
-00000020 2a b9 b4 da 45 cf f3 10 b2 23 44 20 f8 4d 59 05 |*...E....#D .MY.|
-00000030 ad 27 f2 a0 ee 7f ec cc 20 dc e7 a2 1b 07 b3 a5 |.'...... .......|
-00000040 37 7e 61 3d d6 5c 03 cf cc f5 9b ca c0 09 00 00 |7~a=.\..........|
+00000000 16 03 01 00 59 02 00 00 55 03 01 f5 8f 8d 8e ca |....Y...U.......|
+00000010 30 6b fe 63 c9 84 57 c0 f1 c8 a5 d8 10 56 14 62 |0k.c..W......V.b|
+00000020 c8 02 b2 89 21 5c 09 67 86 d8 9b 20 dc 3f 55 54 |....!\.g... .?UT|
+00000030 33 29 47 45 d3 e0 87 1a 4b 1b 75 30 89 e0 4d 01 |3)GE....K.u0..M.|
+00000040 a1 6a 46 f7 8f 23 d6 74 fd 90 2f 53 c0 09 00 00 |.jF..#.t../S....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@@ -47,20 +48,20 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 01 00 d5 0c 00 00 d1 03 00 17 41 04 da |*............A..|
-00000280 5a fd 09 e5 d6 c0 70 41 5e 3a 87 eb df 0c ad 90 |Z.....pA^:......|
-00000290 22 8a 2f 90 81 0c 24 00 68 92 f3 d5 95 2f 93 43 |"./...$.h..../.C|
-000002a0 e9 58 2d 18 28 62 ee 33 5b 21 2e 49 87 21 4d 32 |.X-.(b.3[!.I.!M2|
-000002b0 32 19 b3 ba fe 2d 9a 85 12 0e a1 77 08 06 75 00 |2....-.....w..u.|
-000002c0 8a 30 81 87 02 42 01 91 14 fc 68 74 95 10 4b d4 |.0...B....ht..K.|
-000002d0 67 60 12 46 bb b0 f6 98 77 a3 41 b8 01 5c 49 54 |g`.F....w.A..\IT|
-000002e0 9e 3e 81 e7 97 a3 b9 73 6e 15 74 67 be e5 d9 eb |.>.....sn.tg....|
-000002f0 8b 87 c5 22 ab ab 58 28 4f d1 b6 80 94 1b f5 f7 |..."..X(O.......|
-00000300 12 43 ef 0a c7 3e 1a 76 02 41 7a 00 49 cb 9f 3b |.C...>.v.Az.I..;|
-00000310 91 6e 38 58 0a d3 d0 d1 ee 67 f0 b6 5d cd fa 23 |.n8X.....g..]..#|
-00000320 b6 98 43 af 9c 71 90 1e 1d 50 a2 6e 61 5b f2 92 |..C..q...P.na[..|
-00000330 b4 69 73 f2 3b 54 bf 1c 9d 05 19 97 e4 4e 41 9e |.is.;T.......NA.|
-00000340 f2 9a 76 77 9a 86 43 1f 1f 30 a2 16 03 01 00 04 |..vw..C..0......|
+00000270 2a 16 03 01 00 d5 0c 00 00 d1 03 00 17 41 04 22 |*............A."|
+00000280 8a 47 c6 d3 7a c4 30 a4 8e 41 11 ac b3 2d 2f 45 |.G..z.0..A...-/E|
+00000290 61 54 9b 1f 2e 03 5d 50 eb fc 5b 44 a0 a7 48 78 |aT....]P..[D..Hx|
+000002a0 ce 14 d5 39 a7 c4 ed f5 4d 8f da 9d 71 52 69 70 |...9....M...qRip|
+000002b0 7e 52 29 ad 80 8a 19 ad 4c 5d 1c f1 22 7e 1a 00 |~R).....L].."~..|
+000002c0 8a 30 81 87 02 42 00 97 8b 6d f7 87 c1 a9 a6 55 |.0...B...m.....U|
+000002d0 0f 61 c2 f2 e1 05 26 a8 83 16 1c 0b 69 3b 95 57 |.a....&.....i;.W|
+000002e0 76 5b eb 45 7a bd 6a f1 3e a0 93 49 fa 74 32 fd |v[.Ez.j.>..I.t2.|
+000002f0 dc 20 3a bb e3 ee 6d b8 56 aa e9 d2 7d 6a ec b7 |. :...m.V...}j..|
+00000300 0a bd aa dc d7 b0 69 65 02 41 4d 19 61 16 d8 5f |......ie.AM.a.._|
+00000310 1d c1 32 25 15 26 eb 88 5b c1 dd 9a 12 40 fa f1 |..2%.&..[....@..|
+00000320 81 5e 7d b8 2b 6e 60 63 1a 9e 86 cb d5 64 96 d4 |.^}.+n`c.....d..|
+00000330 75 fc 02 33 e0 66 60 b2 40 47 cf e6 6d 25 9c 83 |u..3.f`.@G..m%..|
+00000340 23 d3 4b e2 eb ac f1 56 44 f8 3f 16 03 01 00 04 |#.K....VD.?.....|
00000350 0e 00 00 00 |....|
>>> Flow 3 (client to server)
00000000 16 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
@@ -68,20 +69,20 @@
00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 01 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 01 00 30 88 60 65 b2 d7 51 1f ad 96 56 |.....0.`e..Q...V|
-00000060 4e 0a 20 eb b5 b0 1a dd 4c f6 1a cf d4 5c 47 c4 |N. .....L....\G.|
-00000070 9c 7c a0 36 dd d1 1b 96 91 99 c0 a7 2d 9a 7c 42 |.|.6........-.|B|
-00000080 51 d1 de 87 2b a4 |Q...+.|
+00000050 01 16 03 01 00 30 cc 86 f1 7e 6e a8 c9 b5 02 5f |.....0...~n...._|
+00000060 fb b2 3b ea 74 bf a8 da e4 6a 69 50 a2 5a 78 4f |..;.t....jiP.ZxO|
+00000070 35 e1 cc 87 c3 fb 1f 5e f6 a4 5c 63 cc 59 12 3e |5......^..\c.Y.>|
+00000080 07 c3 a8 d7 87 ba |......|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 86 6c b5 94 69 |..........0.l..i|
-00000010 2e e0 55 a2 4d a8 63 f2 5b 1f ae 34 21 c8 21 6a |..U.M.c.[..4!.!j|
-00000020 00 b6 56 ed 4e 2a b0 ff 01 2f da ce a1 c0 41 03 |..V.N*.../....A.|
-00000030 a9 1b 6e 2e e1 88 50 ba 62 14 88 |..n...P.b..|
+00000000 14 03 01 00 01 01 16 03 01 00 30 e8 b6 20 b9 c1 |..........0.. ..|
+00000010 07 38 38 bb 42 b2 b2 a1 c5 8d 92 62 db 67 ab fc |.88.B......b.g..|
+00000020 f6 64 3f 71 83 1d a0 86 bb 2d e3 4f 65 d5 44 52 |.d?q.....-.Oe.DR|
+00000030 4d f5 62 80 3c af 95 87 19 7c 20 |M.b.<....| |
>>> Flow 5 (client to server)
-00000000 17 03 01 00 20 a6 63 0a 2f a5 dc e1 fb cb 7b 1f |.... .c./.....{.|
-00000010 f2 da 74 c3 ff e9 f5 8b 9c 5f 0c d3 f7 1f 44 e6 |..t......_....D.|
-00000020 90 13 5c 48 50 17 03 01 00 20 c7 75 b5 ff bc 09 |..\HP.... .u....|
-00000030 34 f2 45 db 0d 22 08 8e f1 35 cd b6 0f b0 eb 2a |4.E.."...5.....*|
-00000040 b7 1a d0 8e 14 a4 54 84 f9 dc 15 03 01 00 20 e0 |......T....... .|
-00000050 36 3d aa b3 a9 b4 20 23 ca 9e 8c 5d fc a8 c8 b7 |6=.... #...]....|
-00000060 f5 c2 b6 d0 5a e2 ce a5 7b 68 a0 48 86 95 6a |....Z...{h.H..j|
+00000000 17 03 01 00 20 bd 65 61 28 e5 ea 1b 81 db 75 92 |.... .ea(.....u.|
+00000010 ad a7 3b 01 a3 23 0e 3b 60 10 8a 1e 04 91 fb 9e |..;..#.;`.......|
+00000020 7a cf 1f cf 9c 17 03 01 00 20 87 9c dc ed 0d 08 |z........ ......|
+00000030 56 40 23 8b c5 2c d8 7e 42 82 3c 0a c9 f3 77 6d |V@#..,.~B.<...wm|
+00000040 8d 9a 30 d1 9c c4 ae 04 fb b7 15 03 01 00 20 f7 |..0........... .|
+00000050 f0 12 0d e5 03 c1 80 4e 7e 21 d7 75 55 1c 91 89 |.......N~!.uU...|
+00000060 e7 e1 45 fc 7d d8 fc b1 d0 e7 dc e2 4c ba f4 |..E.}.......L..|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES b/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES
index 868f0ceb0e5..f8183f10353 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 01 00 59 02 00 00 55 03 01 53 04 f1 02 21 |....Y...U..S...!|
-00000010 67 b5 2b 34 fb 62 d7 36 4f cf 68 2e 29 39 d0 28 |g.+4.b.6O.h.)9.(|
-00000020 3a 02 32 82 8f 95 de 62 d6 03 77 20 e6 98 56 cd |:.2....b..w ..V.|
-00000030 96 24 d1 b9 4d eb 51 19 bb b7 71 f4 9c 29 32 d4 |.$..M.Q...q..)2.|
-00000040 e5 c6 0a 54 e0 4a 20 29 3e bd 06 0d c0 13 00 00 |...T.J )>.......|
+00000000 16 03 01 00 59 02 00 00 55 03 01 5c 69 d0 60 d6 |....Y...U..\i.`.|
+00000010 b3 f4 23 19 5e 3e 26 d8 29 ea c3 94 e4 ed 51 f6 |..#.^>&.).....Q.|
+00000020 58 a2 e3 9c 79 a1 0b 6d 29 90 32 20 23 5b 47 b1 |X...y..m).2 #[G.|
+00000030 8f 22 bc 06 aa ee f7 c3 97 ca 93 df b1 90 7d b4 |."............}.|
+00000040 8c c0 d9 54 35 ca 5b 11 98 37 84 ea c0 13 00 00 |...T5.[..7......|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 01 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
@@ -58,40 +59,40 @@
000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
-00000320 d9 16 03 01 00 cb 0c 00 00 c7 03 00 17 41 04 05 |.............A..|
-00000330 45 33 f8 4b e9 96 0e 4a fd ec 54 76 21 9b 24 8a |E3.K...J..Tv!.$.|
-00000340 75 0b 80 84 c7 30 2b 22 f0 85 57 a4 a9 79 d6 f6 |u....0+"..W..y..|
-00000350 6d 80 b0 71 d9 66 c9 6c dd 76 fc 32 d0 c6 bc 52 |m..q.f.l.v.2...R|
-00000360 2f f1 c9 62 17 53 76 ec be a6 1c 93 f2 b4 5d 00 |/..b.Sv.......].|
-00000370 80 72 d9 20 52 70 7c 03 b1 33 fa 51 23 cd 05 97 |.r. Rp|..3.Q#...|
-00000380 6f d6 89 2f 8d 2e 3a 17 32 eb f2 ff 6b 39 70 5e |o../..:.2...k9p^|
-00000390 21 41 8d 69 02 c8 9a 17 19 e4 48 9b 51 c3 7f 9b |!A.i......H.Q...|
-000003a0 8d 4a 83 97 07 0e 30 f1 8b 6b e9 92 12 01 d6 96 |.J....0..k......|
-000003b0 f2 1a a2 10 7f 59 87 16 1a fb 55 67 68 fc 78 c6 |.....Y....Ugh.x.|
-000003c0 57 ac 05 dd f3 6f 77 84 eb ae b0 33 2d 19 2c ba |W....ow....3-.,.|
-000003d0 b8 ae 9f 95 69 85 95 45 5e 37 f4 17 17 9b 03 c1 |....i..E^7......|
-000003e0 50 b1 36 42 bd 60 5c 8b d8 b6 f3 c8 34 c8 9d 9d |P.6B.`\.....4...|
-000003f0 75 16 03 01 00 04 0e 00 00 00 |u.........|
+00000320 d9 16 03 01 00 cb 0c 00 00 c7 03 00 17 41 04 a6 |.............A..|
+00000330 57 60 8d 63 4e 4d 3f 48 e0 5d ad 9a 9c f7 e6 8c |W`.cNM?H.]......|
+00000340 00 18 9c eb 34 ea f0 5c d5 77 3f af 81 a9 50 d9 |....4..\.w?...P.|
+00000350 05 cf b9 bf 88 5c 70 29 24 61 6f d8 77 11 21 57 |.....\p)$ao.w.!W|
+00000360 a0 4d e1 4b 8e 55 06 50 7f a2 30 c1 c2 b9 c6 00 |.M.K.U.P..0.....|
+00000370 80 68 7c e4 1a bc a4 1e 16 b9 3e 4a 59 39 a9 54 |.h|.......>JY9.T|
+00000380 6f c7 17 b2 f5 af b5 73 5b db cc 71 f2 1b aa dc |o......s[..q....|
+00000390 9d 64 3c 0f 82 e6 da 1a 6b 96 19 e2 f0 15 b0 df |.d<.....k.......|
+000003a0 8a 2d 96 09 63 52 f6 53 ef 12 d4 3b 35 b7 0b 43 |.-..cR.S...;5..C|
+000003b0 2c 6e 58 4c c8 2f b8 55 84 89 c9 39 81 7a 7a 7d |,nXL./.U...9.zz}|
+000003c0 88 68 db eb d7 81 aa 2e b2 25 ba 98 6c 46 b7 85 |.h.......%..lF..|
+000003d0 8a 21 17 b9 36 23 c0 84 94 af 3b 9b 04 5d ec 31 |.!..6#....;..].1|
+000003e0 f5 75 84 d8 77 d7 80 37 ae c3 5c 26 41 f6 72 af |.u..w..7..\&A.r.|
+000003f0 88 16 03 01 00 04 0e 00 00 00 |..........|
>>> Flow 3 (client to server)
00000000 16 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 01 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 01 00 30 ca d1 1b 08 27 9b 44 e7 e9 b4 |.....0....'.D...|
-00000060 90 16 4d 30 4e 65 5c 0d 47 ba 46 86 cf c9 80 e7 |..M0Ne\.G.F.....|
-00000070 64 31 f5 a1 9e dc 39 15 d3 be 16 4f c7 90 b6 62 |d1....9....O...b|
-00000080 5d 6d 7f 41 4e 3e |]m.AN>|
+00000050 01 16 03 01 00 30 d2 5b 27 5a f5 64 49 31 d5 aa |.....0.['Z.dI1..|
+00000060 a3 72 ae c9 af 0b aa 75 af ac f3 45 f4 e3 03 fa |.r.....u...E....|
+00000070 e8 97 88 7b 51 a9 ae 61 40 c8 11 74 3e d8 9a b6 |...{Q..a@..t>...|
+00000080 e7 6a 5e 71 84 7e |.j^q.~|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 98 81 24 8e cd |..........0..$..|
-00000010 b6 48 2f 80 de 8e 24 3c cd 02 67 80 34 97 d7 92 |.H/...$<..g.4...|
-00000020 78 c2 44 3d 5d 05 eb 88 76 79 46 7a c3 fa ca 73 |x.D=]...vyFz...s|
-00000030 45 82 ad c1 81 00 ca 40 c1 2f 13 |E......@./.|
+00000000 14 03 01 00 01 01 16 03 01 00 30 8d 63 fc 58 2e |..........0.c.X.|
+00000010 50 f7 60 2c 9f 5a 8e 58 29 6c a6 3a 8d 2b a7 2b |P.`,.Z.X)l.:.+.+|
+00000020 1c 12 8a 53 3f d5 60 79 12 c3 78 e3 aa 50 15 45 |...S?.`y..x..P.E|
+00000030 07 da 2d c7 a9 c3 45 07 48 00 78 |..-...E.H.x|
>>> Flow 5 (client to server)
-00000000 17 03 01 00 20 ee 19 59 67 67 a9 8b db 99 87 50 |.... ..Ygg.....P|
-00000010 01 e2 02 c1 d5 6d 36 79 af aa ec 1b 80 0e b6 5e |.....m6y.......^|
-00000020 5f fa 03 01 cc 17 03 01 00 20 ec e2 04 b7 3b a5 |_........ ....;.|
-00000030 f2 e0 13 1f 17 48 e7 6e d3 eb f0 fa 36 ef 6e 2e |.....H.n....6.n.|
-00000040 fb ea c8 39 c4 5f 4b 28 d4 50 15 03 01 00 20 c7 |...9._K(.P.... .|
-00000050 45 ff fb c7 07 0c d8 0e 35 a3 c5 31 47 b7 03 0e |E.......5..1G...|
-00000060 14 c8 29 fd 53 70 5f 15 ac d2 1c 4c 69 fb d6 |..).Sp_....Li..|
+00000000 17 03 01 00 20 40 91 8d e6 95 2f 97 c8 0c 94 5c |.... @..../....\|
+00000010 46 a7 d3 31 82 3d dc 7e 86 5b dd df 3f 3b 5b 9c |F..1.=.~.[..?;[.|
+00000020 d5 0d 52 5a 53 17 03 01 00 20 1d 18 da 6b e8 66 |..RZS.... ...k.f|
+00000030 ce 58 18 81 4b 69 8c f6 db 1a ee d0 78 fb f5 68 |.X..Ki......x..h|
+00000040 2c 99 48 47 65 15 2a ae ff 4e 15 03 01 00 20 68 |,.HGe.*..N.... h|
+00000050 aa 7f 75 33 45 7a 1a 33 18 35 5a 5b 14 b0 f6 83 |..u3Ez.3.5Z[....|
+00000060 97 85 3f b2 dc 78 68 eb 43 ef 92 7f 38 bd f8 |..?..xh.C...8..|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv10-RSA-RC4 b/libgo/go/crypto/tls/testdata/Client-TLSv10-RSA-RC4
index 395d53bbabb..b5deaeb011a 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv10-RSA-RC4
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv10-RSA-RC4
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 01 00 51 02 00 00 4d 03 01 53 04 f1 02 76 |....Q...M..S...v|
-00000010 e8 45 7f 57 f3 42 4b 33 0b 06 fa a6 fa c4 3d 84 |.E.W.BK3......=.|
-00000020 5a 45 dc 93 41 a5 8d 79 6e 8f 11 20 e7 c6 29 2b |ZE..A..yn.. ..)+|
-00000030 ff 4a 6e 63 67 a6 10 cb 49 19 46 1e 5e 0a d5 70 |.Jncg...I.F.^..p|
-00000040 96 88 9a 32 48 ef c3 4a 45 4c 6d e0 00 05 00 00 |...2H..JELm.....|
+00000000 16 03 01 00 51 02 00 00 4d 03 01 a9 b0 bf 24 3f |....Q...M.....$?|
+00000010 98 c6 0f 83 23 2b b6 e4 3f d5 5b 10 9a 6f b8 63 |....#+..?.[..o.c|
+00000020 4c 3c d6 4d 05 c0 08 85 f7 72 72 20 ab 85 8c ff |L<.M.....rr ....|
+00000030 f7 bb 95 ab 69 37 3d b6 79 cb 46 ad 4e 22 e7 c6 |....i7=.y.F.N"..|
+00000040 a5 9b 72 92 32 ff a5 f7 ed dc 30 41 00 05 00 00 |..r.2.....0A....|
00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
@@ -69,15 +70,15 @@
00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 01 00 01 |5..C.0oUN.p.....|
-00000090 01 16 03 01 00 24 cd c0 68 dc 2e 69 cc c7 5b c5 |.....$..h..i..[.|
-000000a0 3f bd 40 cf a0 0f 41 34 ce 16 37 10 26 c8 3f d1 |?.@...A4..7.&.?.|
-000000b0 46 3b ad 7b b0 31 f3 c5 36 e7 |F;.{.1..6.|
+00000090 01 16 03 01 00 24 4d 1d d7 8c d6 c7 65 a6 ce af |.....$M.....e...|
+000000a0 e7 59 0d 7e dc d9 96 1c ed 9c 57 94 84 b8 3f b5 |.Y.~......W...?.|
+000000b0 34 e1 61 a5 61 f3 5d 09 bc ff |4.a.a.]...|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 24 ea 77 6f 3c 42 |..........$.wo<B|
-00000010 12 16 51 de e8 b6 f9 85 06 d9 6d 05 75 50 2b 27 |..Q.......m.uP+'|
-00000020 93 b7 6b 65 e9 14 99 48 53 3e be e4 be 03 5d |..ke...HS>....]|
+00000000 14 03 01 00 01 01 16 03 01 00 24 13 81 89 61 5c |..........$...a\|
+00000010 fb 0a 9c a1 4b db 94 6b 8b 41 6e 63 d6 aa db 88 |....K..k.Anc....|
+00000020 03 b7 b5 19 b8 12 cf 5e 17 54 79 2f 03 91 7e |.......^.Ty/..~|
>>> Flow 5 (client to server)
-00000000 17 03 01 00 1a 9e ae ca 55 df c4 d9 47 04 55 dd |........U...G.U.|
-00000010 3b 33 e1 a6 16 6f a1 94 b1 9b 4d 0d cb 6c 3b 15 |;3...o....M..l;.|
-00000020 03 01 00 16 92 5d 76 07 e9 b7 31 29 09 c5 b1 09 |.....]v...1)....|
-00000030 2d 64 3d 85 8d f1 d1 40 54 b8 |-d=....@T.|
+00000000 17 03 01 00 1a b3 2b da ce 45 ec b2 9d 3b 18 d9 |......+..E...;..|
+00000010 7a cb 99 ea ff 4d 91 b5 48 df 6f 8b 2f 85 c7 15 |z....M..H.o./...|
+00000020 03 01 00 16 19 1c 72 74 36 cf 22 0f a0 a7 18 96 |......rt6.".....|
+00000030 3a 67 cb 22 16 f1 a8 7b 57 37 |:g."...{W7|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES b/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES
index 9f941f8ef18..a4a29306cb7 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 02 00 59 02 00 00 55 03 02 53 04 f1 02 1c |....Y...U..S....|
-00000010 d1 1c 6a 5f 7a 5c 26 69 92 cd ee c3 57 ed 96 90 |..j_z\&i....W...|
-00000020 e3 c5 f1 ee 8b ee 99 5f 46 2c e6 20 c8 50 6a a4 |......._F,. .Pj.|
-00000030 4b 93 e6 da ba 6d d4 87 f6 75 a8 9d 44 db b5 43 |K....m...u..D..C|
-00000040 df 12 57 de a4 f1 bc fb b8 7a 3f 6a c0 09 00 00 |..W......z?j....|
+00000000 16 03 02 00 59 02 00 00 55 03 02 5a 52 92 23 05 |....Y...U..ZR.#.|
+00000010 58 68 b2 1e 77 a2 a8 16 e9 88 85 ea 38 b3 63 c2 |Xh..w.......8.c.|
+00000020 40 f8 de 37 3c d4 b9 51 11 2d d1 20 12 fd 95 b3 |@..7<..Q.-. ....|
+00000030 2a 54 40 c0 23 3a 4e 4e f6 7b f8 77 04 6e e7 d7 |*T@.#:NN.{.w.n..|
+00000040 3b 9a 45 32 e0 af df aa ff bf 78 8b c0 09 00 00 |;.E2......x.....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 02 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@@ -47,21 +48,21 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 02 00 d4 0c 00 00 d0 03 00 17 41 04 7b |*............A.{|
-00000280 c4 00 37 35 51 de c3 f2 a4 95 2c 19 21 3e a6 94 |..75Q.....,.!>..|
-00000290 7b fd 04 d7 b7 1c 56 e6 af 3c ee 36 cb 55 e6 f0 |{.....V..<.6.U..|
-000002a0 e6 24 34 6b 8a 02 66 71 f9 e2 f5 a6 c9 d7 6c dc |.$4k..fq......l.|
-000002b0 65 59 ff 1c c9 ec a9 8b 07 d6 52 2c 01 3c c3 00 |eY........R,.<..|
-000002c0 89 30 81 86 02 41 74 89 1a 31 72 e6 8b c0 4a ce |.0...At..1r...J.|
-000002d0 8f 5a 49 a7 52 2d 6d b9 8b 50 17 62 2a 99 d6 3b |.ZI.R-m..P.b*..;|
-000002e0 02 85 41 4d 34 53 b5 09 bd e3 ac 16 c1 9b e9 83 |..AM4S..........|
-000002f0 cc 83 e3 9c 23 34 67 71 72 d4 05 a2 34 f7 08 29 |....#4gqr...4..)|
-00000300 62 43 2e cc bc 08 01 02 41 59 de 5a d0 dd d7 6b |bC......AY.Z...k|
-00000310 db 9c 35 29 79 f8 96 91 56 74 1f 18 7b ee 25 83 |..5)y...Vt..{.%.|
-00000320 f2 37 0e 77 ab 38 fb 5e 04 0b 09 d9 b4 1f 3f be |.7.w.8.^......?.|
-00000330 2e e3 60 e3 96 f3 29 c1 6d 8f 56 1b fd 62 14 48 |..`...).m.V..b.H|
-00000340 e3 d9 2a ea 2f be 93 d0 8b 31 16 03 02 00 04 0e |..*./....1......|
-00000350 00 00 00 |...|
+00000270 2a 16 03 02 00 d5 0c 00 00 d1 03 00 17 41 04 c3 |*............A..|
+00000280 55 86 65 95 83 02 4b 69 6e 95 f4 52 46 83 21 86 |U.e...Kin..RF.!.|
+00000290 9e 99 cf 81 d9 b8 20 7a 87 b3 07 48 14 04 20 d9 |...... z...H.. .|
+000002a0 6c 2e 22 5a b5 b4 ef de 15 b3 08 ef 1e 18 ea 67 |l."Z...........g|
+000002b0 eb 45 fd e1 27 43 ed 41 ea 05 7e f3 f9 ee 23 00 |.E..'C.A..~...#.|
+000002c0 8a 30 81 87 02 42 00 b0 9c 06 85 83 b2 bf 42 22 |.0...B........B"|
+000002d0 6e 57 7a 31 fe a9 d9 28 be 0a a9 80 49 a2 14 c1 |nWz1...(....I...|
+000002e0 a9 99 76 b7 f9 76 d0 3c d3 0c c7 42 34 d7 94 a9 |..v..v.<...B4...|
+000002f0 15 66 7e 6b 83 6e b2 b4 5b 22 c9 4e a0 96 db 2b |.f~k.n..[".N...+|
+00000300 ad 77 33 1e 4a 5c 2f 2e 02 41 26 0c 1a 5a b4 07 |.w3.J\/..A&..Z..|
+00000310 95 99 ec 0b 5b 2e bb db 0e d5 26 c4 b3 eb c2 30 |....[.....&....0|
+00000320 b0 7b c1 07 97 a0 99 3f db 4e b0 c4 b8 bb 5e be |.{.....?.N....^.|
+00000330 2a e4 b3 a4 5c ad d1 d7 7a 2d fb ae 73 ee 0c 1e |*...\...z-..s...|
+00000340 3b 64 e1 74 14 bc c0 1e 8b f3 26 16 03 02 00 04 |;d.t......&.....|
+00000350 0e 00 00 00 |....|
>>> Flow 3 (client to server)
00000000 16 03 02 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
@@ -69,21 +70,21 @@
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 02 00 01 |..h.A.Vk.Z......|
00000050 01 16 03 02 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
-00000060 00 00 00 00 00 00 b6 98 a2 a9 48 34 12 6b 0a 94 |..........H4.k..|
-00000070 89 fc 38 04 63 5a 6f 63 36 3e d9 35 12 64 8c 28 |..8.cZoc6>.5.d.(|
-00000080 99 a6 cf 2e 57 e3 14 6d 0a 8a ab f0 a6 58 37 7c |....W..m.....X7||
-00000090 96 04 d3 71 bc d4 |...q..|
+00000060 00 00 00 00 00 00 33 07 8a af e1 94 ef f9 08 3a |......3........:|
+00000070 33 5f b3 e6 42 07 85 af 40 e2 8b 34 53 62 1a 10 |3_..B...@..4Sb..|
+00000080 bb 08 7e 75 d4 21 12 2d 54 87 33 1c 4e 13 27 72 |..~u.!.-T.3.N.'r|
+00000090 3f 9e 9f cc de 47 |?....G|
>>> Flow 4 (server to client)
-00000000 14 03 02 00 01 01 16 03 02 00 40 c5 01 c9 0a b0 |..........@.....|
-00000010 d8 ca 5e c1 19 dc 37 6c 2e a0 b3 11 a8 87 65 5a |..^...7l......eZ|
-00000020 09 41 b9 fe 53 c4 c9 76 97 6d 7f ac c0 be d2 07 |.A..S..v.m......|
-00000030 84 e5 5b 78 37 34 ee da 3b cb 3e 82 52 79 91 44 |..[x74..;.>.Ry.D|
-00000040 b4 e4 1c ec 3a c0 c0 9d cd ff 13 |....:......|
+00000000 14 03 02 00 01 01 16 03 02 00 40 4f 47 0d 43 54 |..........@OG.CT|
+00000010 50 69 3a c8 21 a6 6e 28 78 cc 01 b4 5d eb f7 2b |Pi:.!.n(x...]..+|
+00000020 8b 7e 26 6e cf 56 98 65 ad bf 0f a0 b4 67 13 70 |.~&n.V.e.....g.p|
+00000030 de b5 b5 91 df d6 df 8c 53 c6 54 3d 5d 98 e4 25 |........S.T=]..%|
+00000040 47 a0 0f 91 c7 08 96 17 48 bd 0f |G.......H..|
>>> Flow 5 (client to server)
00000000 17 03 02 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 46 60 13 39 2b 2f 72 95 ed 0e aa |.....F`.9+/r....|
-00000020 69 6e b4 64 3e 83 43 d0 f9 7f 37 7c 1d b9 ce 11 |in.d>.C...7|....|
-00000030 d9 41 66 60 6d 15 03 02 00 30 00 00 00 00 00 00 |.Af`m....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 b1 26 d0 5d 08 98 |...........&.]..|
-00000050 eb 28 42 74 31 58 42 95 c5 ad 1a 92 0a f5 5f ed |.(Bt1XB......._.|
-00000060 45 98 e0 90 e5 a3 b6 8b 8d 18 |E.........|
+00000010 00 00 00 00 00 4e fe 12 d7 4b d7 3f 86 5a 2c f6 |.....N...K.?.Z,.|
+00000020 86 03 2a bd 1a 98 d7 bb 9f 59 6c 6d 4d 57 b0 50 |..*......YlmMW.P|
+00000030 d6 97 7e d4 b6 15 03 02 00 30 00 00 00 00 00 00 |..~......0......|
+00000040 00 00 00 00 00 00 00 00 00 00 65 8b b5 ae 86 90 |..........e.....|
+00000050 00 4e 1e 3f bc ac ed 49 f4 5e 73 49 e6 d8 37 83 |.N.?...I.^sI..7.|
+00000060 cf 4f e5 7b 5e c9 1d c8 c9 dc |.O.{^.....|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES b/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES
index fc723396a4f..103f1d8a11d 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 02 00 59 02 00 00 55 03 02 53 04 f1 02 fe |....Y...U..S....|
-00000010 17 8b 79 ad 93 2e d3 89 66 9b 5d 9b b4 03 3e ba |..y.....f.]...>.|
-00000020 65 2a f1 55 f9 3c 33 de 2c a7 47 20 fa 4f 82 11 |e*.U.<3.,.G .O..|
-00000030 96 81 d0 70 2e 65 b3 68 2e 3a 6d d7 6c 74 22 33 |...p.e.h.:m.lt"3|
-00000040 d4 ae 6c aa c8 f0 c7 20 8b 10 21 e7 c0 13 00 00 |..l.... ..!.....|
+00000000 16 03 02 00 59 02 00 00 55 03 02 e3 ed 49 27 a3 |....Y...U....I'.|
+00000010 28 c5 8c 30 27 c2 ed 57 9b f7 37 a1 6d 2b 88 c2 |(..0'..W..7.m+..|
+00000020 df a7 2d 01 01 00 9a 09 da c2 1f 20 ee 33 87 03 |..-........ .3..|
+00000030 28 93 1c 16 99 5b b1 e0 bf 87 e8 77 4a 72 c9 92 |(....[.....wJr..|
+00000040 8a bc b2 3e 24 e1 f6 e8 f4 3f a2 24 c0 13 00 00 |...>$....?.$....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 02 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
@@ -58,20 +59,20 @@
000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
-00000320 d9 16 03 02 00 cb 0c 00 00 c7 03 00 17 41 04 26 |.............A.&|
-00000330 56 18 02 e5 66 d4 aa 24 7e ae 39 e5 ca 78 6c c1 |V...f..$~.9..xl.|
-00000340 90 02 c3 c4 ad 79 2c 47 a8 bf 54 e2 8a 22 b6 ef |.....y,G..T.."..|
-00000350 99 d4 7a 7f 8f 78 6a 78 4e 14 2a 16 0d bb 54 38 |..z..xjxN.*...T8|
-00000360 59 1f 7a 53 1b c7 73 10 89 4b de c3 66 39 7a 00 |Y.zS..s..K..f9z.|
-00000370 80 3a 88 38 c8 15 07 ab 2f 0f 0d cb 19 07 84 ac |.:.8..../.......|
-00000380 24 fd 8b d2 9d 05 45 c6 11 c3 d6 84 58 95 5a 08 |$.....E.....X.Z.|
-00000390 b9 a4 2c c0 41 4e 34 e0 b2 24 98 94 b7 67 27 50 |..,.AN4..$...g'P|
-000003a0 ba 82 35 28 a9 bf 16 ee e3 7b 49 9c 4c 81 80 69 |..5(.....{I.L..i|
-000003b0 d7 aa ed 46 ea 9a 68 c4 97 b7 11 d4 35 91 74 5e |...F..h.....5.t^|
-000003c0 54 10 34 83 cd c4 06 18 49 7d 7a 28 c9 53 06 73 |T.4.....I}z(.S.s|
-000003d0 00 7b 04 b6 d8 36 a7 4b 67 7f 81 30 94 de 40 4d |.{...6.Kg..0..@M|
-000003e0 18 f8 c4 b7 02 00 44 8e bc 72 06 24 53 15 74 72 |......D..r.$S.tr|
-000003f0 8d 16 03 02 00 04 0e 00 00 00 |..........|
+00000320 d9 16 03 02 00 cb 0c 00 00 c7 03 00 17 41 04 f7 |.............A..|
+00000330 75 c1 b9 58 a0 7d 50 48 e9 85 79 db 89 76 4c d7 |u..X.}PH..y..vL.|
+00000340 84 5b 94 9a 15 d8 92 32 74 d2 3e ce 76 5a bd 0e |.[.....2t.>.vZ..|
+00000350 24 e7 a6 d0 77 5d 8e 3d 9f 94 7a ea 15 46 3c 5c |$...w].=..z..F<\|
+00000360 61 28 76 4a ff 81 97 2b 3a 0c b7 aa b4 0e cb 00 |a(vJ...+:.......|
+00000370 80 19 00 a8 fe 0a ea 35 30 51 a3 77 37 08 68 10 |.......50Q.w7.h.|
+00000380 5a e9 07 2d 83 67 77 4c 3a 25 14 1c 5b c1 2e 80 |Z..-.gwL:%..[...|
+00000390 30 6d ba 26 c1 f9 c6 3e fc 55 34 8c d2 9f 2b a6 |0m.&...>.U4...+.|
+000003a0 46 0c 9d 58 2c 9c 2b ce 6f 03 d7 49 4e df 21 ce |F..X,.+.o..IN.!.|
+000003b0 3f 8b 19 fe 3e 71 23 51 c3 ec 30 c8 3e 3c 3c 50 |?...>q#Q..0.><<P|
+000003c0 da 08 52 c0 10 9f e3 4a be e0 97 aa de 5e 13 22 |..R....J.....^."|
+000003d0 b2 77 ee 5d 2d d4 ff fb 7f c3 1e e7 51 fe fc 4b |.w.]-.......Q..K|
+000003e0 56 5b 8f 50 ad cc 34 7a a9 dd 24 0a d0 c7 b9 bf |V[.P..4z..$.....|
+000003f0 1a 16 03 02 00 04 0e 00 00 00 |..........|
>>> Flow 3 (client to server)
00000000 16 03 02 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
@@ -79,21 +80,21 @@
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 02 00 01 |..h.A.Vk.Z......|
00000050 01 16 03 02 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
-00000060 00 00 00 00 00 00 8a 87 81 38 35 c0 4c bb f8 12 |.........85.L...|
-00000070 fa 75 04 cd 1e 3a 61 96 93 c8 fb 07 d1 6d b4 55 |.u...:a......m.U|
-00000080 0f b5 0f 07 35 0a 96 ce 5c 6f 24 62 d3 68 e4 b0 |....5...\o$b.h..|
-00000090 5d be 81 37 c2 9c |]..7..|
+00000060 00 00 00 00 00 00 1e 0b cd 40 fa 0f ed fa 55 74 |.........@....Ut|
+00000070 4e ad 10 d1 b5 e1 41 8c c0 93 81 38 f3 83 f1 37 |N.....A....8...7|
+00000080 6a d4 6c ea ba 5b 9e 38 d3 c1 bb 41 45 fb f0 48 |j.l..[.8...AE..H|
+00000090 c1 06 31 64 e0 65 |..1d.e|
>>> Flow 4 (server to client)
-00000000 14 03 02 00 01 01 16 03 02 00 40 66 36 8d f8 8c |..........@f6...|
-00000010 7f db 38 e8 39 df f8 2f cb 88 9c 14 d9 89 10 b4 |..8.9../........|
-00000020 be 59 88 d7 f3 73 62 af a3 42 66 6e 74 38 64 9f |.Y...sb..Bfnt8d.|
-00000030 16 79 09 d7 14 7e 91 8a 70 73 63 28 30 58 fe cc |.y...~..psc(0X..|
-00000040 42 45 d6 37 fb 9e 8c c1 01 af 34 |BE.7......4|
+00000000 14 03 02 00 01 01 16 03 02 00 40 17 d1 79 f8 e0 |..........@..y..|
+00000010 d4 40 15 85 df 4d a6 d5 60 90 1f d6 52 58 e7 ae |.@...M..`...RX..|
+00000020 05 eb a2 ea ed c9 be ae b5 54 39 de 05 66 27 67 |.........T9..f'g|
+00000030 59 07 03 e7 10 f9 3f da d8 85 8b 2f 7b 33 9f f5 |Y.....?..../{3..|
+00000040 43 50 b9 9c 6e dd 01 ae d8 c9 1d |CP..n......|
>>> Flow 5 (client to server)
00000000 17 03 02 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 31 0b e3 9d 2a 05 83 19 7d 10 36 |.....1...*...}.6|
-00000020 23 dc da fe 00 ab d3 aa 8f ce 28 5f 08 fd b7 59 |#.........(_...Y|
-00000030 1e 00 2e 25 5a 15 03 02 00 30 00 00 00 00 00 00 |...%Z....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 10 91 fd fa 59 07 |..............Y.|
-00000050 df 2c 92 25 15 7b 7c 83 44 89 0d 4f 65 43 99 2e |.,.%.{|.D..OeC..|
-00000060 41 5d 51 c9 09 89 ed 02 08 bc |A]Q.......|
+00000010 00 00 00 00 00 65 81 63 71 55 1c 46 8a 60 46 d9 |.....e.cqU.F.`F.|
+00000020 7d 71 a2 62 b8 a8 3b 06 3d a2 f4 53 a4 46 a8 9e |}q.b..;.=..S.F..|
+00000030 b7 89 8a 42 ce 15 03 02 00 30 00 00 00 00 00 00 |...B.....0......|
+00000040 00 00 00 00 00 00 00 00 00 00 7a 78 a4 e7 2f 40 |..........zx../@|
+00000050 df 42 9b 76 7a 45 0a 86 40 af 3c 40 c6 69 ba e1 |.B.vzE..@.<@.i..|
+00000060 23 82 fa 44 fd 73 fc 5b f7 b9 |#..D.s.[..|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv11-RSA-RC4 b/libgo/go/crypto/tls/testdata/Client-TLSv11-RSA-RC4
index f7be3f7e93a..729391f68ca 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv11-RSA-RC4
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv11-RSA-RC4
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 02 00 51 02 00 00 4d 03 02 53 04 f1 02 d4 |....Q...M..S....|
-00000010 69 65 aa 96 3d 42 96 eb 9e 7d 8a 18 af 4c 7c 5d |ie..=B...}...L|]|
-00000020 fb 97 5f da 94 62 13 69 1f 66 06 20 aa 52 e3 08 |.._..b.i.f. .R..|
-00000030 35 0a 87 d5 ef 93 49 ab 1a 74 dd 90 bd 69 70 d1 |5.....I..t...ip.|
-00000040 e9 f1 44 17 3a dc 33 98 f5 e5 ab 93 00 05 00 00 |..D.:.3.........|
+00000000 16 03 02 00 51 02 00 00 4d 03 02 7e 38 ae 3c 50 |....Q...M..~8.<P|
+00000010 03 96 3d 54 2f cd 86 21 98 7f 87 43 d8 58 aa a3 |..=T/..!...C.X..|
+00000020 d5 9f e7 25 a6 ab 34 7f 10 5f 99 20 56 c5 a8 dd |...%..4.._. V...|
+00000030 37 17 0d 51 f1 0d c4 4e 76 0f 01 26 56 c9 0c 20 |7..Q...Nv..&V.. |
+00000040 28 ef cd ac 38 ea d3 7f 6f aa 7c b8 00 05 00 00 |(...8...o.|.....|
00000050 05 ff 01 00 01 00 16 03 02 02 be 0b 00 02 ba 00 |................|
00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
@@ -69,15 +70,15 @@
00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 02 00 01 |5..C.0oUN.p.....|
-00000090 01 16 03 02 00 24 07 9f dc df 2d c3 a6 88 06 28 |.....$....-....(|
-000000a0 21 e0 e0 d3 31 99 fc 89 b8 82 6e 95 f4 4b 9e e2 |!...1.....n..K..|
-000000b0 d9 36 5c 14 ce d7 db e2 78 4e |.6\.....xN|
+00000090 01 16 03 02 00 24 b9 df 85 a1 6d a7 14 b5 bc f5 |.....$....m.....|
+000000a0 c2 1d 40 fc 1e 19 f2 36 2d ec 6b 59 c5 6d ae c7 |..@....6-.kY.m..|
+000000b0 1c ad 7e a3 5b 4d 12 e5 58 5a |..~.[M..XZ|
>>> Flow 4 (server to client)
-00000000 14 03 02 00 01 01 16 03 02 00 24 81 72 75 80 d4 |..........$.ru..|
-00000010 1b 1a 32 00 89 bf 9e 79 30 b9 6b 67 e0 8e c7 eb |..2....y0.kg....|
-00000020 73 f2 e4 93 51 65 9b 5f 91 b1 b4 b1 f7 44 76 |s...Qe._.....Dv|
+00000000 14 03 02 00 01 01 16 03 02 00 24 a3 f3 22 a8 32 |..........$..".2|
+00000010 63 c3 88 5c 0f fb 2d 47 21 0d 62 e2 db aa ed ae |c..\..-G!.b.....|
+00000020 b6 5f e3 c8 98 fc 91 5e 04 83 cf c3 21 17 ce |._.....^....!..|
>>> Flow 5 (client to server)
-00000000 17 03 02 00 1a b2 91 39 63 c0 38 3c 4d 25 fd 14 |.......9c.8<M%..|
-00000010 b9 b6 e1 23 21 b4 8d 17 9e 1f d8 33 92 69 c2 15 |...#!......3.i..|
-00000020 03 02 00 16 4b 10 25 4d 9d 09 c2 11 96 be f7 5b |....K.%M.......[|
-00000030 c2 9b 99 fd 1f 8e af 0f 2c 51 |........,Q|
+00000000 17 03 02 00 1a f1 e4 46 c7 14 91 4b c6 25 fd aa |.......F...K.%..|
+00000010 5d dd 3f 61 ac 9c 79 68 bc e6 0f a1 e4 f3 73 15 |].?a..yh......s.|
+00000020 03 02 00 16 6b 8d 23 3c 99 b4 c2 23 3c 27 fd 41 |....k.#<...#<'.A|
+00000030 cc 04 e5 fc e7 f9 d9 81 0a b8 |..........|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN b/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN
index f09a4f106c1..9ecb065f092 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN
@@ -1,20 +1,20 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 8d 01 00 00 89 03 03 00 00 00 00 00 |................|
+00000000 16 03 01 00 99 01 00 00 95 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 46 33 74 00 00 |./.5.......F3t..|
-00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
-00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0a 00 |................|
-00000070 08 04 01 04 03 02 01 02 03 ff 01 00 01 00 00 10 |................|
-00000080 00 10 00 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 |.....proto2.prot|
-00000090 6f 31 |o1|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 4e |...../.5.......N|
+00000050 33 74 00 00 00 05 00 05 01 00 00 00 00 00 0a 00 |3t..............|
+00000060 08 00 06 00 17 00 18 00 19 00 0b 00 02 01 00 00 |................|
+00000070 0d 00 0e 00 0c 04 01 04 03 05 01 05 03 02 01 02 |................|
+00000080 03 ff 01 00 01 00 00 10 00 10 00 0e 06 70 72 6f |.............pro|
+00000090 74 6f 32 06 70 72 6f 74 6f 31 00 12 00 00 |to2.proto1....|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 66 02 00 00 62 03 03 77 a9 7d 9c 4b |....f...b..w.}.K|
-00000010 69 65 aa dc 95 cb 78 08 3d d2 1a 0a 45 69 23 73 |ie....x.=...Ei#s|
-00000020 4f 41 4f 24 12 2e 57 47 b7 53 64 20 82 9a f8 e7 |OAO$..WG.Sd ....|
-00000030 79 f8 13 2c 9d cd b5 cb cb 9a 95 56 0e e9 cb a8 |y..,.......V....|
-00000040 e4 a2 8a d6 bc dc fa 25 b3 57 cc cf c0 2f 00 00 |.......%.W.../..|
+00000000 16 03 03 00 66 02 00 00 62 03 03 56 83 34 0f 9e |....f...b..V.4..|
+00000010 dd 02 1c 4f 4f 09 d0 2c df e6 c1 d2 4a c0 6a e7 |...OO..,....J.j.|
+00000020 1e 65 51 c2 42 01 05 70 4a 6c 97 20 0f a8 fb d8 |.eQ.B..pJl. ....|
+00000030 2f 0f 75 21 17 f8 dd 63 28 4a 18 f6 b1 e5 6f 7c |/.u!...c(J....o||
+00000040 1d 09 d4 13 bf 66 3a bd c5 48 14 fc c0 2f 00 00 |.....f:..H.../..|
00000050 1a ff 01 00 01 00 00 0b 00 04 03 00 01 02 00 10 |................|
00000060 00 09 00 07 06 70 72 6f 74 6f 31 16 03 03 02 be |.....proto1.....|
00000070 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 |..........0...0.|
@@ -61,19 +61,19 @@
00000300 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 |...u....R...... |
00000310 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 |_..........W.p.&|
00000320 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 |mq..&n8P)l......|
-00000330 03 00 cd 0c 00 00 c9 03 00 17 41 04 1b 42 c3 ae |..........A..B..|
-00000340 44 19 d3 84 7c 6c 98 cb b9 22 a2 67 63 95 aa cc |D...|l...".gc...|
-00000350 bd e4 1e f8 08 e6 60 f3 bc 83 9f 81 da 9c 1c 8c |......`.........|
-00000360 ff 6f f4 3e 1e e5 3b f6 49 61 f9 70 43 7f c1 69 |.o.>..;.Ia.pC..i|
-00000370 de 73 98 4b bd 5c c3 78 24 18 a8 ec 04 01 00 80 |.s.K.\.x$.......|
-00000380 70 d2 5b e1 39 cf 4d 54 de d2 74 4e 5e a8 b3 ca |p.[.9.MT..tN^...|
-00000390 e1 f2 4e 76 3c 77 8b ef f7 d1 df b9 ad c1 70 39 |..Nv<w........p9|
-000003a0 c7 a3 1e 0f 7b 6c 78 2e c1 86 d2 67 36 d8 25 e0 |....{lx....g6.%.|
-000003b0 e8 e5 cc 35 a2 96 a1 b4 b7 06 68 1e aa c7 06 97 |...5......h.....|
-000003c0 b7 c2 83 ce c0 17 dd 4f 9e 6f 7a bd cd c7 6e 7f |.......O.oz...n.|
-000003d0 cb 80 d1 7d 06 2d f9 f1 fb 5f cc bb d8 62 5b f0 |...}.-..._...b[.|
-000003e0 27 12 57 d5 9b 55 aa 55 4b 9a 5a f6 a5 aa c1 82 |'.W..U.UK.Z.....|
-000003f0 39 11 6b dc 83 7f a8 47 28 5a 0f 3d 3f 0f c2 22 |9.k....G(Z.=?.."|
+00000330 03 00 cd 0c 00 00 c9 03 00 17 41 04 85 b7 f7 7c |..........A....||
+00000340 49 4e 97 14 07 51 bc 56 2d 3f cf 1d 29 08 ac 6a |IN...Q.V-?..)..j|
+00000350 b4 e7 0d 62 d8 fd 4d 03 29 0d f8 6c 36 6f 4d 5f |...b..M.)..l6oM_|
+00000360 b7 5a 8e 37 3e c2 d9 dc f4 15 52 e9 87 71 0f e5 |.Z.7>.....R..q..|
+00000370 4e a6 88 0e 54 35 e0 8b 50 91 e1 c4 04 01 00 80 |N...T5..P.......|
+00000380 51 eb f8 d6 52 ba f5 b5 0a 22 5f 91 fe f7 ee 43 |Q...R...."_....C|
+00000390 f8 af 52 b6 27 2c fc 14 e2 fb 41 61 ff 7c b9 be |..R.',....Aa.|..|
+000003a0 f9 78 be dc 18 32 8c 4d ef 46 c0 5a a7 91 6a 1b |.x...2.M.F.Z..j.|
+000003b0 47 78 46 39 47 81 8a 2d b4 cb fd bb 44 3e a7 b7 |GxF9G..-....D>..|
+000003c0 cc 4e df 17 7b 2b 38 49 fa 9d 9f 4e cd ed f2 16 |.N..{+8I...N....|
+000003d0 03 d9 68 cf c9 5a 08 32 f8 ed 02 30 54 61 f6 c0 |..h..Z.2...0Ta..|
+000003e0 f6 78 bc ad 04 9c 8e 90 7d 3d f5 35 86 aa 6e e9 |.x......}=.5..n.|
+000003f0 a2 9a d3 86 27 9f 2d 6e ea 6e ad 82 0e aa ef 97 |....'.-n.n......|
00000400 16 03 03 00 04 0e 00 00 00 |.........|
>>> Flow 3 (client to server)
00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
@@ -81,17 +81,17 @@
00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 35 9d |.....(........5.|
-00000060 92 e8 bf df 7f a7 77 1b cf 03 2a bf e2 6c 62 2b |......w...*..lb+|
-00000070 26 f0 fb 93 d3 df fd 55 84 d3 ed 88 31 cb |&......U....1.|
+00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 47 18 |.....(........G.|
+00000060 39 03 93 d9 5b 27 29 70 52 68 15 79 f2 60 e6 58 |9...[')pRh.y.`.X|
+00000070 d9 98 cd ce a1 8f 4d ee 2c f0 34 9f fa 73 |......M.,.4..s|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 c8 c0 78 09 73 |..........(..x.s|
-00000010 58 41 73 66 88 cf db f3 fe c6 57 ab 45 be 2e d8 |XAsf......W.E...|
-00000020 4e e5 ff 42 57 13 74 d2 cc c2 62 07 39 8b 06 46 |N..BW.t...b.9..F|
-00000030 1d 8f 88 |...|
+00000000 14 03 03 00 01 01 16 03 03 00 28 39 76 15 70 f1 |..........(9v.p.|
+00000010 73 c9 9a 1e 76 40 bc de de 49 be 3e 10 4d 6a 42 |s...v@...I.>.MjB|
+00000020 1b 9b bd 07 6b 19 ff f9 2c 19 3c c8 e7 06 fa c8 |....k...,.<.....|
+00000030 3d 52 b4 |=R.|
>>> Flow 5 (client to server)
-00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 10 c3 5f |..............._|
-00000010 3f c8 92 6c 7a a7 23 05 f3 d8 31 20 01 52 f1 99 |?..lz.#...1 .R..|
-00000020 33 c1 2a 15 03 03 00 1a 00 00 00 00 00 00 00 02 |3.*.............|
-00000030 cc ef eb 78 e4 e1 9d 90 05 6d 95 ac f2 49 ba 8e |...x.....m...I..|
-00000040 6b 8d |k.|
+00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 14 96 ec |................|
+00000010 f4 bb ae 45 81 0c 39 10 e2 3a 91 51 04 2c 01 a8 |...E..9..:.Q.,..|
+00000020 8b a3 25 15 03 03 00 1a 00 00 00 00 00 00 00 02 |..%.............|
+00000030 fe 1a 53 01 17 ad a1 30 0a 73 17 9f 39 b4 30 ac |..S....0.s..9.0.|
+00000040 91 ee |..|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch b/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch
index f24a70cc828..a22ffaeb499 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch
@@ -1,19 +1,20 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 86 01 00 00 82 03 03 00 00 00 00 00 |................|
+00000000 16 03 01 00 92 01 00 00 8e 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 3f 33 74 00 00 |./.5.......?3t..|
-00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
-00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0a 00 |................|
-00000070 08 04 01 04 03 02 01 02 03 ff 01 00 01 00 00 10 |................|
-00000080 00 09 00 07 06 70 72 6f 74 6f 33 |.....proto3|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 47 |...../.5.......G|
+00000050 33 74 00 00 00 05 00 05 01 00 00 00 00 00 0a 00 |3t..............|
+00000060 08 00 06 00 17 00 18 00 19 00 0b 00 02 01 00 00 |................|
+00000070 0d 00 0e 00 0c 04 01 04 03 05 01 05 03 02 01 02 |................|
+00000080 03 ff 01 00 01 00 00 10 00 09 00 07 06 70 72 6f |.............pro|
+00000090 74 6f 33 00 12 00 00 |to3....|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 69 84 d1 d3 44 |....Y...U..i...D|
-00000010 e9 66 08 48 bc 70 d8 ae 40 0b 17 69 e7 27 f6 7a |.f.H.p..@..i.'.z|
-00000020 d5 ee 86 74 54 9e a8 bb 79 76 89 20 57 53 1b 02 |...tT...yv. WS..|
-00000030 5b 70 81 a6 f1 53 bc 9d b7 42 5e ac 92 93 b5 20 |[p...S...B^.... |
-00000040 8a bb 36 cc 8f cb 7e a0 61 a2 e8 ef c0 2f 00 00 |..6...~.a..../..|
+00000000 16 03 03 00 59 02 00 00 55 03 03 94 d7 79 73 82 |....Y...U....ys.|
+00000010 87 7c 85 6e 8a 1b 7d bf 69 c9 98 0c 44 bd f6 78 |.|.n..}.i...D..x|
+00000020 d2 80 dc d8 7d 80 bb 91 4b d4 ed 20 fe 9f 2f 7b |....}...K.. ../{|
+00000030 f2 1a 44 36 cd ce af f1 b5 01 8a ac 18 e4 2b 23 |..D6..........+#|
+00000040 a8 ab 1a 32 23 8b 0b e2 81 a8 0a 40 c0 2f 00 00 |...2#......@./..|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
@@ -59,37 +60,37 @@
000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
-00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 04 |.............A..|
-00000330 be 27 08 6f 12 83 1b 04 76 fa 5f 16 d6 e3 64 76 |.'.o....v._...dv|
-00000340 ad 0a 77 37 71 64 44 4c 3f 1a be dc 85 ce 46 c8 |..w7qdDL?.....F.|
-00000350 29 a1 e2 24 78 66 1f 35 90 05 46 c0 91 d1 fd dd |)..$xf.5..F.....|
-00000360 b5 5b 87 d7 6d 9d 77 a7 f7 b3 df 68 27 fd 6d 04 |.[..m.w....h'.m.|
-00000370 01 00 80 7b 9b fd 0d 62 57 07 ef 97 f5 ff a9 00 |...{...bW.......|
-00000380 a0 89 35 5a 8a e6 e7 ae 7b 55 c5 dc 21 64 87 6e |..5Z....{U..!d.n|
-00000390 0f ab 85 6d 82 e8 83 fd 7d 3b 49 a7 ae 92 5f 6d |...m....};I..._m|
-000003a0 a3 42 ce ff ef a6 00 6a 33 32 1f 7b eb b7 c2 5c |.B.....j32.{...\|
-000003b0 2d 38 cf 10 4b 59 69 4d 15 e0 68 49 39 ba cb 2a |-8..KYiM..hI9..*|
-000003c0 d9 b9 f3 fe 33 01 4f 7e ac 69 02 35 a5 e0 33 8d |....3.O~.i.5..3.|
-000003d0 b3 74 34 14 45 9c 89 ad 41 2d d0 27 22 90 58 c6 |.t4.E...A-.'".X.|
-000003e0 e0 2c b4 6e 19 04 e4 46 26 ec 13 35 48 a6 3f 64 |.,.n...F&..5H.?d|
-000003f0 dc 85 2b 16 03 03 00 04 0e 00 00 00 |..+.........|
+00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 7d |.............A.}|
+00000330 75 a5 53 0b a5 4d a6 81 e0 df c4 11 c9 b5 31 ba |u.S..M........1.|
+00000340 9f 7b 51 04 57 c6 e0 b9 b0 bc 4f bc 71 74 8a 2e |.{Q.W.....O.qt..|
+00000350 d1 f6 39 36 94 4e c7 d3 a7 1b 2c b5 55 04 71 01 |..96.N....,.U.q.|
+00000360 9e 2b 42 1e 8b a4 40 b2 13 4f 03 1f 51 9e 5c 04 |.+B...@..O..Q.\.|
+00000370 01 00 80 68 05 c7 4a ca df 00 85 2b 53 f7 4f c3 |...h..J....+S.O.|
+00000380 b4 0f e8 f7 b8 30 b7 36 56 65 7b 03 6a 72 f1 aa |.....0.6Ve{.jr..|
+00000390 54 30 90 9e c7 dc fc 03 96 15 70 67 13 12 a4 f4 |T0........pg....|
+000003a0 42 f0 f9 a1 48 c0 44 44 77 0e ea fd cb b5 6e 19 |B...H.DDw.....n.|
+000003b0 89 94 a7 12 67 87 47 19 c3 00 2d c4 9b d4 dc 66 |....g.G...-....f|
+000003c0 fa ca d7 97 79 9b 28 7f 74 d4 37 c0 06 63 d4 9e |....y.(.t.7..c..|
+000003d0 a1 53 16 5a 8e d7 a5 cc 90 4d 63 f9 0c 18 85 7f |.S.Z.....Mc.....|
+000003e0 0e 35 3a 49 73 88 82 51 41 e5 2d 58 aa 38 3e bd |.5:Is..QA.-X.8>.|
+000003f0 3d d8 da 16 03 03 00 04 0e 00 00 00 |=...........|
>>> Flow 3 (client to server)
00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 88 0d |.....(..........|
-00000060 04 8b 8e 93 55 58 d6 75 ca 16 26 42 a3 60 20 67 |....UX.u..&B.` g|
-00000070 84 cf d7 b3 10 fe 63 6c 2f 40 64 0c d6 78 |......cl/@d..x|
+00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 a8 da |.....(..........|
+00000060 74 a6 d0 a5 26 86 f3 5f 89 a4 af ac 9c 1a 01 1f |t...&.._........|
+00000070 89 8a 1c fc cf 68 3e a5 a3 20 1a b3 78 af |.....h>.. ..x.|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 bd 6c 2f 70 b9 |..........(.l/p.|
-00000010 2f 9c 29 70 af 34 49 4c 5b 25 c3 14 b6 6d 28 81 |/.)p.4IL[%...m(.|
-00000020 ff 54 d9 71 8d 2c c7 38 dd 44 27 6b 54 1e 53 7b |.T.q.,.8.D'kT.S{|
-00000030 22 cb 65 |".e|
+00000000 14 03 03 00 01 01 16 03 03 00 28 1a f2 a9 e8 71 |..........(....q|
+00000010 b2 a6 ca 36 4a ea 55 f6 20 03 fd f7 90 c3 af 30 |...6J.U. ......0|
+00000020 d3 29 c3 d7 1b d6 4d 3e 61 55 94 0d 4e 3e 83 1a |.)....M>aU..N>..|
+00000030 97 dd 19 |...|
>>> Flow 5 (client to server)
-00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 7f 0d d7 |................|
-00000010 d9 4b 87 7b 36 fb 24 92 69 22 43 50 1e 46 fb c4 |.K.{6.$.i"CP.F..|
-00000020 86 64 6f 15 03 03 00 1a 00 00 00 00 00 00 00 02 |.do.............|
-00000030 37 d5 2d 0a be c5 a8 ae d4 bd 2b 09 34 18 a0 87 |7.-.......+.4...|
-00000040 08 a6 |..|
+00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 94 5b 5e |..............[^|
+00000010 51 a1 52 ee 19 78 78 ef 12 0d 9c 66 bf e2 48 cb |Q.R..xx....f..H.|
+00000020 f6 00 1e 15 03 03 00 1a 00 00 00 00 00 00 00 02 |................|
+00000030 cd 5d 31 58 d9 5a 12 65 5b c6 7e 4e e2 04 e7 1d |.]1X.Z.e[.~N....|
+00000040 b1 4c |.L|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA
index 20732703647..1470ba7a250 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 03 6f |....Y...U..S...o|
-00000010 c6 4b 55 27 fe e8 fe 4d 7c 0e d4 20 98 b8 7c 81 |.KU'...M|.. ..|.|
-00000020 3d 31 f8 35 66 2f 0a 0b f1 2c e3 20 86 4d 12 32 |=1.5f/...,. .M.2|
-00000030 73 e3 ba be 25 50 a4 a2 a1 7b f1 9a 76 7a 75 fb |s...%P...{..vzu.|
-00000040 e2 64 a2 12 ec f3 e7 9d 9a 24 6e 94 c0 09 00 00 |.d.......$n.....|
+00000000 16 03 03 00 59 02 00 00 55 03 03 a5 28 60 99 bf |....Y...U...(`..|
+00000010 c7 54 04 87 60 ad c5 32 f6 bf ed 11 47 de 4d ff |.T..`..2....G.M.|
+00000020 99 e1 8f 88 f6 af 10 6e 29 74 0a 20 1d 39 cb e0 |.......n)t. .9..|
+00000030 a5 11 fe 8e 23 11 83 c7 a6 53 fc 97 03 9d ff 7c |....#....S.....||
+00000040 cf 51 ba 41 64 61 38 22 5c c6 4a 04 c0 09 00 00 |.Q.Ada8"\.J.....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@@ -47,24 +48,23 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 a3 |*............A..|
-00000280 03 8c de d2 b0 68 c8 25 0e 85 ea d7 ae 13 0d 79 |.....h.%.......y|
-00000290 ec 59 0d b5 4d 51 96 d9 7f 64 36 fb 4c d5 6a 26 |.Y..MQ...d6.L.j&|
-000002a0 ae 0e 48 61 df 5c 2b d4 ff 09 41 15 c4 14 8e 1b |..Ha.\+...A.....|
-000002b0 84 a8 c8 cd ef 10 97 95 66 67 85 dd fd dc 2a 04 |........fg....*.|
-000002c0 03 00 8a 30 81 87 02 41 11 75 5d bc bd 08 28 d4 |...0...A.u]...(.|
-000002d0 5b 1b 45 7f 9c d3 8d 0b 91 fa f6 82 ba 59 bd 3e |[.E..........Y.>|
-000002e0 96 01 c6 1d 38 db fe 08 e7 56 89 fc 10 b0 37 6a |....8....V....7j|
-000002f0 3d d6 c9 50 16 53 f7 c2 a2 60 67 82 1f 74 b8 d5 |=..P.S...`g..t..|
-00000300 bc 02 ec 96 db 82 18 8c 87 02 42 01 0d df f7 b7 |..........B.....|
-00000310 05 3c 8c 56 f0 1d 33 18 cf c5 4c 80 7e 0b d9 f9 |.<.V..3...L.~...|
-00000320 f0 51 69 fe 5d b8 0b 64 c0 c7 0d f4 75 65 ae 07 |.Qi.]..d....ue..|
-00000330 9d cf f4 4b ad 52 f6 b8 10 26 18 bd d6 e2 0d a8 |...K.R...&......|
-00000340 80 10 50 34 15 cd 72 0b 7d a9 94 de 4c 16 03 03 |..P4..r.}...L...|
-00000350 00 30 0d 00 00 28 03 01 02 40 00 20 06 01 06 02 |.0...(...@. ....|
+00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 c4 |*............A..|
+00000280 0a 40 05 84 eb 90 3c 13 d0 90 af 69 fa 5c 20 75 |.@....<....i.\ u|
+00000290 e1 9b f2 30 f7 df cc 75 2c 35 7e 38 16 99 7d 57 |...0...u,5~8..}W|
+000002a0 6d d7 f0 93 2d 1d c8 03 89 6e 52 3b 20 e5 8a 5f |m...-....nR; .._|
+000002b0 6d ca 6e 6a ca 51 f8 a4 dc 1d ec 3e 73 c9 72 04 |m.nj.Q.....>s.r.|
+000002c0 03 00 8a 30 81 87 02 41 37 bf 0d 1d c1 9a 37 39 |...0...A7.....79|
+000002d0 4d 4a f8 17 50 5d 4c 78 d4 25 99 9d 81 48 98 a8 |MJ..P]Lx.%...H..|
+000002e0 ff 2d 3f 98 4b 9f d8 96 2b fa 37 cc e8 66 25 0e |.-?.K...+.7..f%.|
+000002f0 d3 5e 53 c5 3b ad 17 3f 21 ce d2 45 d8 93 95 6c |.^S.;..?!..E...l|
+00000300 25 f9 5a 10 9f 37 c8 14 a6 02 42 00 e6 bd 9a 89 |%.Z..7....B.....|
+00000310 8e 73 40 f4 90 e6 d8 e2 98 51 10 23 fb 98 e5 47 |.s@......Q.#...G|
+00000320 0c 2a 7a 2f 02 66 a8 20 e4 cb 4f ba 14 1d 9e 3a |.*z/.f. ..O....:|
+00000330 2f 09 47 44 02 e0 9f 30 21 71 f0 99 09 de 23 d2 |/.GD...0!q....#.|
+00000340 f5 f0 b2 93 70 a3 8f 79 b9 4f 88 0b 35 16 03 03 |....p..y.O..5...|
+00000350 00 2e 0d 00 00 26 03 01 02 40 00 1e 06 01 06 02 |.....&...@......|
00000360 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000370 03 02 03 03 02 01 02 02 02 03 01 01 00 00 0e 00 |................|
-00000380 00 00 |..|
+00000370 03 02 03 03 02 01 02 02 02 03 00 00 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|
@@ -104,31 +104,31 @@
00000230 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..|
00000240 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.|
00000250 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 92 0f |.h.A.Vk.Z.......|
-00000260 00 00 8e 04 03 00 8a 30 81 87 02 42 00 c6 85 8e |.......0...B....|
-00000270 06 b7 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 |.......>.f#..B.d|
-00000280 81 39 05 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b |.9.?.!.(.`kM=..K|
-00000290 5e 77 ef e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 |^w..Y(...'....3H|
-000002a0 b3 c1 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 41 |...jB..~~1...f.A|
-000002b0 4b 49 c6 cd 02 e3 83 f7 03 50 18 6d b4 c9 51 02 |KI.......P.m..Q.|
-000002c0 c0 ab 87 bc e0 3e 4b 89 53 3a e2 65 89 97 02 c1 |.....>K.S:.e....|
-000002d0 88 0d 64 db 8e 4f 73 4e ea 29 0b ed a0 f5 ce 3d |..d..OsN.).....=|
-000002e0 5f cc 20 ef 0a 22 02 82 f2 14 2a b7 42 68 bd c7 |_. .."....*.Bh..|
-000002f0 4d 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 |M..........@....|
-00000300 00 00 00 00 00 00 00 00 00 00 00 00 f0 cc 4f c7 |..............O.|
-00000310 b6 0f c9 38 4d 4b 97 2c 4f be 53 08 4c d6 5b 4e |...8MK.,O.S.L.[N|
-00000320 24 70 30 81 82 3a 7f 62 95 03 4d fc 54 78 ec 13 |$p0..:.b..M.Tx..|
-00000330 b2 a1 00 85 2b 04 e4 1d 7b 6e 87 60 |....+...{n.`|
+00000260 00 00 8e 05 03 00 8a 30 81 87 02 42 00 cc a4 ad |.......0...B....|
+00000270 0b ff 09 40 8f 2c a6 37 72 1d f7 d2 19 74 85 ad |...@.,.7r....t..|
+00000280 ac 33 b0 b8 5b 56 39 cf b0 ef 46 68 94 39 4c d0 |.3..[V9...Fh.9L.|
+00000290 f4 97 32 10 99 36 c5 95 c8 14 23 37 78 46 5c a9 |..2..6....#7xF\.|
+000002a0 20 95 65 47 ff 54 02 f1 aa 1d d7 bc 39 2d 02 41 | .eG.T......9-.A|
+000002b0 2e f9 d6 8c e8 c5 a9 6f 10 4f d6 5f 4e 88 e9 71 |.......o.O._N..q|
+000002c0 23 5b 6f b8 ab 19 d3 dd ec f3 32 e3 3b fa 41 a2 |#[o.......2.;.A.|
+000002d0 e8 ae dc 27 8d 4e 79 f4 47 ef c9 8f bf 0b 41 3b |...'.Ny.G.....A;|
+000002e0 94 16 cb 8f 1e b5 f3 4e 6e 42 46 35 1a 0c ca 79 |.......NnBF5...y|
+000002f0 4b 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 |K..........@....|
+00000300 00 00 00 00 00 00 00 00 00 00 00 00 64 1c d9 9f |............d...|
+00000310 34 ec c2 74 76 7a 9f cf 95 19 be 8d 6a 2f 25 96 |4..tvz......j/%.|
+00000320 df de 18 ca 0e c9 d4 2f e4 b0 34 10 5b 72 7a 18 |......./..4.[rz.|
+00000330 5c 64 d7 fc 2e 1b 28 10 ae a6 31 e9 |\d....(...1.|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 d5 2a 76 79 1c |..........@.*vy.|
-00000010 e7 d5 b1 5c 65 6b d1 45 73 53 4c 05 3a 6c 5d 81 |...\ek.EsSL.:l].|
-00000020 dd 2f f0 74 62 e4 8e f8 ed 21 99 c7 4f d6 28 40 |./.tb....!..O.(@|
-00000030 63 d9 6d e5 b0 04 73 27 7a 1d 08 19 31 10 da ef |c.m...s'z...1...|
-00000040 79 26 33 fb 45 23 be a4 7c 03 66 |y&3.E#..|.f|
+00000000 14 03 03 00 01 01 16 03 03 00 40 27 6f 24 a3 0c |..........@'o$..|
+00000010 6d d7 68 4a fb 43 b0 97 02 6c 22 7e 2f a1 f1 7a |m.hJ.C...l"~/..z|
+00000020 37 bf 38 82 dc a0 83 24 01 4b c0 4f 15 e1 7c 4c |7.8....$.K.O..|L|
+00000030 d4 cd b8 e2 71 af f5 20 7d f9 4a 48 4b f0 a1 f3 |....q.. }.JHK...|
+00000040 7b 02 29 18 c0 87 a5 dd c4 73 8e |{.)......s.|
>>> Flow 5 (client to server)
00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 e2 53 bd c0 ef 9e e6 44 94 ea 5d |......S.....D..]|
-00000020 f5 c5 a9 4b ed eb 1c 49 9f 79 44 f9 cd d7 de 02 |...K...I.yD.....|
-00000030 51 10 ae 87 7d 15 03 03 00 30 00 00 00 00 00 00 |Q...}....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 d3 95 13 7f 5f 58 |.............._X|
-00000050 ab d6 17 ea 01 2c 2a ea 5d 7c 44 61 4a 27 97 52 |.....,*.]|DaJ'.R|
-00000060 cc 9b 86 f6 37 42 2b 94 01 49 |....7B+..I|
+00000010 00 00 00 00 00 bf 7a e1 23 0d d0 13 6e 96 81 6d |......z.#...n..m|
+00000020 32 56 0f 75 7e 01 88 5f 6d e6 d6 ca ec 3c 17 e9 |2V.u~.._m....<..|
+00000030 44 a9 c0 1c a4 15 03 03 00 30 00 00 00 00 00 00 |D........0......|
+00000040 00 00 00 00 00 00 00 00 00 00 76 be 7a 77 29 01 |..........v.zw).|
+00000050 8e 13 02 66 81 43 a0 55 03 35 22 09 de ea 52 bb |...f.C.U.5"...R.|
+00000060 51 cc c1 09 0e 9b 4d bd 94 85 |Q.....M...|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA
index c3b753a7b44..95c5782ab0d 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 51 02 00 00 4d 03 03 53 04 f1 03 b0 |....Q...M..S....|
-00000010 43 00 97 24 a7 a8 ea b2 24 fe 96 24 a1 49 64 fd |C..$....$..$.Id.|
-00000020 1c a3 30 35 2d 85 a7 40 42 86 6b 20 af 27 7f ac |..05-..@B.k .'..|
-00000030 8b 16 89 6c 78 b7 f5 29 02 58 a6 8b 61 43 c2 b0 |...lx..).X..aC..|
-00000040 e0 a8 96 c8 fa 2b 26 ad 9a 5f 2d d6 00 05 00 00 |.....+&.._-.....|
+00000000 16 03 03 00 51 02 00 00 4d 03 03 79 e8 35 e3 d2 |....Q...M..y.5..|
+00000010 c0 5e 39 d1 46 da 9c 94 56 20 e2 06 d6 9b f6 dd |.^9.F...V ......|
+00000020 4f 7a c1 e8 34 a1 9f 8b c2 e1 fb 20 66 9c 5a 9a |Oz..4...... f.Z.|
+00000030 3d 22 ab 8e d8 81 03 94 68 a0 6c 72 d8 23 0b 4b |="......h.lr.#.K|
+00000040 fe 9d c7 49 a7 7c bd fa b5 7a 5e 5b 00 05 00 00 |...I.|...z^[....|
00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
@@ -57,10 +58,10 @@
000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 30 0d 00 |n8P)l........0..|
-00000320 00 28 03 01 02 40 00 20 06 01 06 02 06 03 05 01 |.(...@. ........|
+00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 2e 0d 00 |n8P)l...........|
+00000320 00 26 03 01 02 40 00 1e 06 01 06 02 06 03 05 01 |.&...@..........|
00000330 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-00000340 02 01 02 02 02 03 01 01 00 00 0e 00 00 00 |..............|
+00000340 02 01 02 02 02 03 00 00 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|
@@ -104,24 +105,24 @@
00000270 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 f1 |.w.o#......:..V.|
00000280 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 35 |.T^F..;3..(....5|
00000290 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 03 00 92 0f |..C.0oUN.p......|
-000002a0 00 00 8e 04 03 00 8a 30 81 87 02 42 00 c6 85 8e |.......0...B....|
-000002b0 06 b7 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 |.......>.f#..B.d|
-000002c0 81 39 05 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b |.9.?.!.(.`kM=..K|
-000002d0 5e 77 ef e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 |^w..Y(...'....3H|
-000002e0 b3 c1 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 41 |...jB..~~1...f.A|
-000002f0 4b 49 c6 cd 02 e3 83 f7 03 50 18 6d b4 c9 51 02 |KI.......P.m..Q.|
-00000300 c0 ab 87 bc e0 3e 4b 89 53 3a e2 65 89 97 02 c1 |.....>K.S:.e....|
-00000310 88 5a 97 82 3e 55 6b 7c d8 db b8 cc 1b 30 84 0a |.Z..>Uk|.....0..|
-00000320 7a 97 71 e4 10 bb a4 39 8c 2a cf f5 88 c7 d1 95 |z.q....9.*......|
-00000330 73 14 03 03 00 01 01 16 03 03 00 24 9f 1e f0 72 |s..........$...r|
-00000340 92 ea dc f7 56 96 37 e4 69 db db 66 1d f6 94 c4 |....V.7.i..f....|
-00000350 18 31 4f d0 5d c5 f4 53 21 aa 98 b1 dc 08 94 94 |.1O.]..S!.......|
+000002a0 00 00 8e 05 03 00 8a 30 81 87 02 41 19 c7 50 06 |.......0...A..P.|
+000002b0 42 82 f9 e5 ec 0b f7 65 7e b1 19 53 5f 23 ab 19 |B......e~..S_#..|
+000002c0 54 08 ec d2 a7 22 dd 83 7c 97 76 59 a5 6b f4 1d |T...."..|.vY.k..|
+000002d0 92 86 34 2d ce 71 bb 01 d2 8a 67 0e a8 fb 51 e4 |..4-.q....g...Q.|
+000002e0 69 9c 27 23 74 b9 fd 6f b6 5e 48 a0 cc 02 42 01 |i.'#t..o.^H...B.|
+000002f0 50 97 b7 95 14 f4 a6 f2 95 63 17 38 59 a1 51 95 |P........c.8Y.Q.|
+00000300 1e bc 99 fb fd 82 8b ab cb 4d 8e 17 a9 f8 e9 c2 |.........M......|
+00000310 9b 93 15 02 50 e6 c2 05 54 e7 8a ec 6f 93 1f 79 |....P...T...o..y|
+00000320 8d 67 e7 2d d6 65 ab 97 fd be 20 97 bd 6b c4 fc |.g.-.e.... ..k..|
+00000330 02 14 03 03 00 01 01 16 03 03 00 24 24 df 52 6e |...........$$.Rn|
+00000340 c1 35 48 fe 60 77 28 69 36 fe 96 a1 72 db a2 f5 |.5H.`w(i6...r...|
+00000350 d0 b7 c3 d9 67 e5 ee f2 d9 18 bf f0 35 80 06 c2 |....g.......5...|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 ee 68 c1 87 9f |..........$.h...|
-00000010 d7 90 94 f1 3b 6d 26 0b 3d 89 7a 45 3b 52 5d 3c |....;m&.=.zE;R]<|
-00000020 dd 7c c1 4e 57 3e a9 ee 91 be cf 2b a3 98 9d |.|.NW>.....+...|
+00000000 14 03 03 00 01 01 16 03 03 00 24 40 5b dc 01 59 |..........$@[..Y|
+00000010 33 6e 61 5a 6d fc c8 a5 f5 00 9b 55 77 c5 e6 f2 |3naZm......Uw...|
+00000020 c6 5c b6 2f 94 3c 72 5b b5 0c 3e 78 88 e6 44 |.\./.<r[..>x..D|
>>> Flow 5 (client to server)
-00000000 17 03 03 00 1a 88 33 3e 2b 22 6b 92 d0 bb 8a 1e |......3>+"k.....|
-00000010 9b f4 9e aa 91 8b 2b 95 ea 53 c8 03 0a 93 58 15 |......+..S....X.|
-00000020 03 03 00 16 c4 67 79 ba ec cf 90 b1 f9 ac ec 64 |.....gy........d|
-00000030 72 01 08 8f 3a 98 aa 66 25 00 |r...:..f%.|
+00000000 17 03 03 00 1a cd 2f 11 b1 3a e4 1c 31 95 9b c4 |....../..:..1...|
+00000010 37 20 9f 03 d3 45 a4 15 e1 09 1e 0c f6 5d d3 15 |7 ...E.......]..|
+00000020 03 03 00 16 d7 f6 a1 d0 ad 41 69 73 c0 40 22 f2 |.........Ais.@".|
+00000030 5f e8 c3 50 f9 35 fc 59 e0 3a |_..P.5.Y.:|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384 b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384
new file mode 100644
index 00000000000..52e3befe615
--- /dev/null
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384
@@ -0,0 +1,139 @@
+>>> Flow 1 (client to server)
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
+>>> Flow 2 (server to client)
+00000000 16 03 03 00 59 02 00 00 55 03 03 74 fe 19 af 4b |....Y...U..t...K|
+00000010 f3 d8 92 62 5a df 90 2c cc 09 fd 79 45 26 cd 52 |...bZ..,...yE&.R|
+00000020 9a e6 da 16 99 fe 1d 91 79 a7 a0 20 b3 13 e9 03 |........y.. ....|
+00000030 52 23 5f f0 55 59 f1 9e 00 a7 77 97 90 ed 2b fb |R#_.UY....w...+.|
+00000040 9c ab fe b1 db ea 16 95 95 68 b0 e9 c0 30 00 00 |.........h...0..|
+00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
+00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
+00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
+00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....|
+00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...|
+000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So|
+000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.|
+000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg|
+000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1|
+000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11|
+000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0|
+00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
+00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
+00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
+00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
+00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....|
+00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......|
+00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.|
+00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL|
+00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.|
+00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{|
+000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z|
+000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..|
+000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..|
+000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.|
+000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.|
+000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.|
+00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#|
+00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i|
+00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E|
+00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0|
+00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta|
+00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int|
+00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt|
+00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........|
+00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.|
+00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........|
+000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....|
+000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...|
+000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%|
+000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........|
+000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z|
+000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
+00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
+00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
+00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 22 |.............A."|
+00000330 84 e9 5e 6e 35 92 a3 83 73 0a d6 0d 1a c1 4d ab |..^n5...s.....M.|
+00000340 1f ab c2 dc 3f 53 a5 7d 38 c0 92 a4 82 e1 3c c5 |....?S.}8.....<.|
+00000350 24 60 20 a5 3b c5 65 ba 9c f1 b9 a5 b9 c2 70 73 |$` .;.e.......ps|
+00000360 19 74 a6 d1 0f 75 b4 75 e0 e8 60 20 e9 23 fe 04 |.t...u.u..` .#..|
+00000370 01 00 80 92 e0 56 3f 48 0d 10 23 48 b5 95 b6 91 |.....V?H..#H....|
+00000380 3e 8a 2e c7 02 e2 85 0e 59 c8 03 24 d9 1a 1a 25 |>.......Y..$...%|
+00000390 8e 12 bb 0b 83 ac 51 36 81 3f bc 0e be b9 3b 1d |......Q6.?....;.|
+000003a0 67 56 21 4d 24 36 84 05 61 e7 70 60 d5 8e ae 97 |gV!M$6..a.p`....|
+000003b0 b8 3a d3 b1 94 72 52 cd b0 0d dd 46 b1 15 3b 58 |.:...rR....F..;X|
+000003c0 c1 a4 63 2c 4c 31 f9 c7 4f 27 c1 0f f0 24 36 72 |..c,L1..O'...$6r|
+000003d0 e0 f8 51 12 86 c2 13 ed 6b 84 a8 15 c3 d0 39 55 |..Q.....k.....9U|
+000003e0 a4 60 50 88 c9 1e 60 60 aa 8d a5 31 3e 35 c3 f8 |.`P...``...1>5..|
+000003f0 2c 90 1c 16 03 03 00 2e 0d 00 00 26 03 01 02 40 |,..........&...@|
+00000400 00 1e 06 01 06 02 06 03 05 01 05 02 05 03 04 01 |................|
+00000410 04 02 04 03 03 01 03 02 03 03 02 01 02 02 02 03 |................|
+00000420 00 00 0e 00 00 00 |......|
+>>> Flow 3 (client to server)
+00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
+00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
+00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.|
+00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
+00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0|
+00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807|
+00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080|
+00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...|
+00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.|
+00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0|
+000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........|
+000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.|
+000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...|
+000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.|
+000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...|
+000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..|
+00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn|
+00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..|
+00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...|
+00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000|
+00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0|
+00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.|
+00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0|
+00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........|
+00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....|
+00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2|
+000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...|
+000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.|
+000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.|
+000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..|
+000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.|
+000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....|
+00000200 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
+00000210 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
+00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
+00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
+00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 88 |..h.A.Vk.Z......|
+00000250 0f 00 00 84 05 01 00 80 33 bb 8e 67 64 03 e7 7e |........3..gd..~|
+00000260 be a5 b1 bc cf 7a 07 24 01 17 c3 3d 4b 72 dd c3 |.....z.$...=Kr..|
+00000270 64 a7 36 e8 49 ab b6 87 ce d6 af 9e 07 22 76 e8 |d.6.I........"v.|
+00000280 0d 44 a3 36 c9 eb a4 49 85 cf 72 67 e8 2a a7 5b |.D.6...I..rg.*.[|
+00000290 d3 f2 46 af 53 48 c6 13 f7 0b 5b 9c c7 4d 3e 05 |..F.SH....[..M>.|
+000002a0 3c 0f 69 a7 40 3a e8 70 04 01 1c 29 b2 42 0f 5f |<.i.@:.p...).B._|
+000002b0 1c d5 b7 5c c2 17 07 7f bd a2 b3 9a 95 81 51 24 |...\..........Q$|
+000002c0 54 5c 42 d6 a4 76 c0 d7 54 d2 11 54 bf fd dc a0 |T\B..v..T..T....|
+000002d0 ee 95 26 64 59 a0 fc 51 14 03 03 00 01 01 16 03 |..&dY..Q........|
+000002e0 03 00 28 00 00 00 00 00 00 00 00 af f4 8a be d9 |..(.............|
+000002f0 ff f1 44 e4 41 ab 9b b3 d8 b0 3d 3f 6b c5 1d b6 |..D.A.....=?k...|
+00000300 1d 9e 35 f5 20 f4 2a af e8 35 77 |..5. .*..5w|
+>>> Flow 4 (server to client)
+00000000 14 03 03 00 01 01 16 03 03 00 28 ff 0d 47 63 2b |..........(..Gc+|
+00000010 bd 00 3a ad 82 e3 a7 b3 b0 84 4a 26 f4 30 78 20 |..:.......J&.0x |
+00000020 80 f2 2b 15 98 61 1c cb 8b 17 67 8a 11 96 aa 93 |..+..a....g.....|
+00000030 68 f7 fb |h..|
+>>> Flow 5 (client to server)
+00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 a6 8d 7b |...............{|
+00000010 99 5e a2 e1 95 bb 5f e4 01 f4 0e 20 52 b4 64 4e |.^...._.... R.dN|
+00000020 86 b1 3f 15 03 03 00 1a 00 00 00 00 00 00 00 02 |..?.............|
+00000030 61 98 eb d0 7c ac bd 00 ac 7a e1 32 20 3e 81 b6 |a...|....z.2 >..|
+00000040 9d d5 |..|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA
index 0037af61a03..23bf29d776e 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 02 fd |....Y...U..S....|
-00000010 41 bd ef ee f3 da fc 1a 31 8c 77 f2 e9 66 54 a0 |A.......1.w..fT.|
-00000020 f4 15 b1 1c 84 0d 6d 74 87 ac 7d 20 78 17 8b 08 |......mt..} x...|
-00000030 10 20 c9 44 e4 8a 43 af 4a c7 b8 3d 99 f2 f7 af |. .D..C.J..=....|
-00000040 bb a3 21 2f 40 cc ed b6 da a8 a1 d5 c0 09 00 00 |..!/@...........|
+00000000 16 03 03 00 59 02 00 00 55 03 03 b3 7f 4e e7 11 |....Y...U....N..|
+00000010 6d bc 56 ec 9c a8 61 08 d6 5a 2a 42 7b f1 94 0a |m.V...a..Z*B{...|
+00000020 29 35 8b 7e 23 a0 6c 59 23 cf 39 20 84 09 b6 5b |)5.~#.lY#.9 ...[|
+00000030 2f 46 80 3b 26 92 fd 81 e9 24 8c e2 b8 64 a2 03 |/F.;&....$...d..|
+00000040 3a 68 c3 7b 44 f8 28 41 e2 d3 6c 7c c0 09 00 00 |:h.{D.(A..l|....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@@ -47,24 +48,23 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 03 00 d8 0c 00 00 d4 03 00 17 41 04 a9 |*............A..|
-00000280 19 8b d9 9b 5c 7c 6a 7d 85 d2 70 4e 89 7e 0b 5b |....\|j}..pN.~.[|
-00000290 dd 5e a1 63 8d 15 bc 0b 0c 47 3d 4d e8 a7 56 88 |.^.c.....G=M..V.|
-000002a0 2e f6 7f e2 4d fc ed cc 03 ed a1 2d ac ae 81 a5 |....M......-....|
-000002b0 e2 6d 7f 9f a3 93 e9 10 c1 0e 48 1b f3 f4 38 04 |.m........H...8.|
-000002c0 03 00 8b 30 81 88 02 42 00 87 fe 7e 63 82 14 57 |...0...B...~c..W|
-000002d0 dc 7d e2 0f cc 97 2d ba 3c a7 56 4a 17 a8 09 6a |.}....-.<.VJ...j|
-000002e0 28 2e f2 66 1a 3f 2d 48 2b 6f 79 a1 60 cd 5e 10 |(..f.?-H+oy.`.^.|
-000002f0 0b 0a 28 f2 5f e4 3f 4f f9 c9 91 34 d9 dc bc fc |..(._.?O...4....|
-00000300 98 ea 77 0b 99 f8 a2 11 c4 bd 02 42 01 a0 b0 dc |..w........B....|
-00000310 db 5b c2 09 99 bd ee a0 b9 aa 31 b9 10 84 22 be |.[........1...".|
-00000320 5a 63 12 5a 43 00 8e c1 33 cc 91 bb c2 70 7a 63 |Zc.ZC...3....pzc|
-00000330 19 82 c0 74 48 a1 c7 3d 1f f1 6f 4a 6f 6a 8c 3f |...tH..=..oJoj.?|
-00000340 28 31 a8 0c 65 19 26 62 4b 7a 7c 4b ea 1a 16 03 |(1..e.&bKz|K....|
-00000350 03 00 30 0d 00 00 28 03 01 02 40 00 20 06 01 06 |..0...(...@. ...|
-00000360 02 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 |................|
-00000370 01 03 02 03 03 02 01 02 02 02 03 01 01 00 00 0e |................|
-00000380 00 00 00 |...|
+00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 0f |*............A..|
+00000280 4d b0 41 d4 dc 6b 8a 85 52 eb eb 18 4a 8f a7 e6 |M.A..k..R...J...|
+00000290 24 52 e5 86 be 57 d7 0a e7 23 84 a8 a9 6c 96 08 |$R...W...#...l..|
+000002a0 4b f7 47 32 79 d9 df 81 f6 05 40 63 3b 14 67 3b |K.G2y.....@c;.g;|
+000002b0 ea 01 a0 0d 43 1a 36 29 b3 51 7a e4 af 1b 67 04 |....C.6).Qz...g.|
+000002c0 03 00 8a 30 81 87 02 42 01 8e 57 8a b8 b7 5b 2f |...0...B..W...[/|
+000002d0 9c 31 74 d8 7d 68 d7 6e 83 73 5f fb d0 cd de 66 |.1t.}h.n.s_....f|
+000002e0 60 fa 0a 0a 15 0b 30 3b 08 b6 f1 3e 4f 20 13 62 |`.....0;...>O .b|
+000002f0 b5 ff 86 81 dc 42 a1 4c af c8 ff b3 24 81 d8 e1 |.....B.L....$...|
+00000300 d1 09 0c 32 11 92 5e dd 3f 87 02 41 76 a7 29 48 |...2..^.?..Av.)H|
+00000310 52 68 1c 72 4d d5 39 bf fa 61 ec b2 27 ce 10 4e |Rh.rM.9..a..'..N|
+00000320 86 12 3d 1e 04 9c 11 b7 b4 0c cf 98 9d 01 c3 93 |..=.............|
+00000330 cf 83 9e 92 9a ca fd 8f b1 9f 1b 20 c4 fb a4 46 |........... ...F|
+00000340 60 fc fd d5 33 b0 8f b5 b5 c8 a4 70 c5 16 03 03 |`...3......p....|
+00000350 00 2e 0d 00 00 26 03 01 02 40 00 1e 06 01 06 02 |.....&...@......|
+00000360 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
+00000370 03 02 03 03 02 01 02 02 02 03 00 00 0e 00 00 00 |................|
>>> Flow 3 (client to server)
00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
@@ -103,31 +103,31 @@
00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 88 |..h.A.Vk.Z......|
-00000250 0f 00 00 84 04 01 00 80 38 f2 16 e5 b5 86 16 62 |........8......b|
-00000260 86 e1 7d 01 f1 a8 e1 f7 e7 85 b1 a0 17 ee 84 25 |..}............%|
-00000270 cb 3c 46 61 1a 78 7b 1e ee 32 bc d9 6c fa 6b 76 |.<Fa.x{..2..l.kv|
-00000280 67 a7 9e c8 7a 4c e8 79 0d 22 27 ad e7 98 6a 98 |g...zL.y."'...j.|
-00000290 89 88 8b a9 69 5b 6f c6 00 48 9a 21 77 a9 7c 15 |....i[o..H.!w.|.|
-000002a0 ba 47 16 74 8d 6c 67 dc 6d f1 98 b6 61 e8 bc 08 |.G.t.lg.m...a...|
-000002b0 18 53 a6 93 bf fc 27 5e b7 4d d2 eb 68 e9 23 ee |.S....'^.M..h.#.|
-000002c0 d2 70 d2 55 2c c7 99 7d c0 66 b5 1c ea 38 71 5c |.p.U,..}.f...8q\|
-000002d0 a6 57 1f 52 e4 8e e8 51 14 03 03 00 01 01 16 03 |.W.R...Q........|
+00000250 0f 00 00 84 05 01 00 80 02 19 16 cc 97 ad 70 20 |..............p |
+00000260 bd 64 63 dd b6 81 a0 16 b3 46 4b 42 ff 21 58 2c |.dc......FKB.!X,|
+00000270 bb 2b 4c e1 4e d7 49 4d 5c 7c 63 32 3e ef e6 ad |.+L.N.IM\|c2>...|
+00000280 85 3f ab b4 5c 2a 37 76 8b 28 56 08 4f 08 b9 51 |.?..\*7v.(V.O..Q|
+00000290 71 14 07 27 47 45 11 a0 03 cf 72 7d 67 ef 31 8d |q..'GE....r}g.1.|
+000002a0 e7 db 36 76 b1 b3 f4 bf aa 6c c4 56 94 35 71 e1 |..6v.....l.V.5q.|
+000002b0 dd 88 6d 15 90 c8 70 ad d8 95 55 42 9b c1 45 19 |..m...p...UB..E.|
+000002c0 36 ce 87 c6 fd 94 8a d4 98 6e ec 18 d5 da 59 54 |6........n....YT|
+000002d0 80 a7 8c 90 ae 55 20 1c 14 03 03 00 01 01 16 03 |.....U .........|
000002e0 03 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 |..@.............|
-000002f0 00 00 00 5e e7 6e 1c a2 02 24 34 f0 a6 b6 27 ea |...^.n...$4...'.|
-00000300 69 d5 0e 2e a8 ad 5c ad 6c 06 78 68 39 92 27 f1 |i.....\.l.xh9.'.|
-00000310 e8 35 49 67 4d fb 5d 8a 31 2e 4e 3f 19 ed ea 30 |.5IgM.].1.N?...0|
-00000320 20 60 e1 | `.|
+000002f0 00 00 00 58 fe bc 5c ba b2 a9 96 77 2f 95 c9 10 |...X..\....w/...|
+00000300 fd 6d fc 6a 88 8c df 82 c3 a4 3d cc 28 f4 bf 7d |.m.j......=.(..}|
+00000310 4a f8 3d 97 36 e5 a0 76 92 94 da dd cc f5 e4 0e |J.=.6..v........|
+00000320 7a c4 2c |z.,|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 ee a8 82 bc 3f |..........@....?|
-00000010 bf ab a6 e4 30 e0 3d f1 2f 19 a2 ac 7a 81 57 f1 |....0.=./...z.W.|
-00000020 ee 67 3f 55 2b 30 fa 72 b5 10 03 ec 8d 0a 8f bb |.g?U+0.r........|
-00000030 24 f5 45 f5 4e 53 4b 93 a5 0d 42 6c 46 69 98 fb |$.E.NSK...BlFi..|
-00000040 63 c5 9f 95 65 d1 b6 f0 a4 15 bd |c...e......|
+00000000 14 03 03 00 01 01 16 03 03 00 40 81 ab 5a 66 a8 |..........@..Zf.|
+00000010 0f a5 d3 07 00 66 45 1f 31 a9 ef f7 a0 d9 23 46 |.....fE.1.....#F|
+00000020 f0 3e 50 18 99 e3 5a bd eb b7 1d 81 d5 95 d5 ee |.>P...Z.........|
+00000030 21 31 41 4b 19 92 b5 95 36 da 21 c0 4a 2a a0 1c |!1AK....6.!.J*..|
+00000040 a3 9f 8e a0 6f 9d 37 5e 12 11 03 |....o.7^...|
>>> Flow 5 (client to server)
00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 cb 4e bc d1 a9 58 ef c8 39 a9 36 |......N...X..9.6|
-00000020 f4 35 05 96 8e a4 50 bc f4 15 06 f9 fd 41 6d 1e |.5....P......Am.|
-00000030 5e 7c 82 63 94 15 03 03 00 30 00 00 00 00 00 00 |^|.c.....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 bd 77 87 a5 5a d4 |...........w..Z.|
-00000050 b8 59 e6 6b 0f dd ea f9 ed 18 b2 9f a9 61 b4 3a |.Y.k.........a.:|
-00000060 47 15 15 3b 83 ef e1 6d db a8 |G..;...m..|
+00000010 00 00 00 00 00 a9 51 94 19 72 ab 9f 3e 97 5e 99 |......Q..r..>.^.|
+00000020 2c ec 13 48 3e 10 54 5f 8a 85 88 4d 1a a8 f5 ed |,..H>.T_...M....|
+00000030 c3 4f a9 59 a3 15 03 03 00 30 00 00 00 00 00 00 |.O.Y.....0......|
+00000040 00 00 00 00 00 00 00 00 00 00 25 00 6d 2f a0 f6 |..........%.m/..|
+00000050 ce 8a 30 ba 53 da 97 c6 11 f3 d2 f3 9e 66 d6 dd |..0.S........f..|
+00000060 19 f3 ee 07 03 d3 e6 f1 30 32 |........02|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA
index df3eaa4406e..ff79aa236c5 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 51 02 00 00 4d 03 03 53 04 f1 02 1d |....Q...M..S....|
-00000010 0e dc 86 e5 a9 07 71 46 15 34 af 47 15 3f 03 9c |......qF.4.G.?..|
-00000020 fc d6 fd 44 7c f4 f1 c7 8d 6f f8 20 28 ea 3c dc |...D|....o. (.<.|
-00000030 b2 4c b7 ba 20 88 c4 db a5 73 ea 93 ab 3a 85 a6 |.L.. ....s...:..|
-00000040 8f 59 49 d9 a9 31 14 d5 a6 2b 4f d1 00 05 00 00 |.YI..1...+O.....|
+00000000 16 03 03 00 51 02 00 00 4d 03 03 b3 b2 22 69 e4 |....Q...M...."i.|
+00000010 1a a1 56 94 26 0c 43 b7 89 0c 34 ce dc 5a c8 ca |..V.&.C...4..Z..|
+00000020 e2 42 92 5c 75 9a b3 22 22 64 38 20 6d 2c 26 0b |.B.\u..""d8 m,&.|
+00000030 34 b6 b8 20 36 e2 58 e5 ee 1f e2 9f a0 75 f6 d9 |4.. 6.X......u..|
+00000040 0c e4 39 ce 3c 8e 2e f8 e8 d1 a2 16 00 05 00 00 |..9.<...........|
00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
@@ -57,10 +58,10 @@
000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 30 0d 00 |n8P)l........0..|
-00000320 00 28 03 01 02 40 00 20 06 01 06 02 06 03 05 01 |.(...@. ........|
+00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 2e 0d 00 |n8P)l...........|
+00000320 00 26 03 01 02 40 00 1e 06 01 06 02 06 03 05 01 |.&...@..........|
00000330 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-00000340 02 01 02 02 02 03 01 01 00 00 0e 00 00 00 |..............|
+00000340 02 01 02 02 02 03 00 00 0e 00 00 00 |............|
>>> Flow 3 (client to server)
00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
@@ -103,24 +104,24 @@
00000260 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
00000270 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
00000280 35 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 03 00 88 |5..C.0oUN.p.....|
-00000290 0f 00 00 84 04 01 00 80 2a 1f ae 48 9f 86 16 dc |........*..H....|
-000002a0 c2 55 1f 5f 95 81 ed 56 00 5d 35 46 e5 b6 57 d5 |.U._...V.]5F..W.|
-000002b0 a6 3e 32 38 8b e2 c6 1c b9 b1 38 b2 da 66 45 ed |.>28......8..fE.|
-000002c0 58 6a 7f 43 41 93 a5 09 da b9 04 ce 3f 13 8a 19 |Xj.CA.......?...|
-000002d0 13 e9 2c 1f c5 e7 35 b4 2d ea 7c 81 90 33 c0 66 |..,...5.-.|..3.f|
-000002e0 dc 41 8b 23 08 8f 69 d4 d6 a2 5f c1 bd 26 e6 2e |.A.#..i..._..&..|
-000002f0 7f c8 7c a8 2d d4 08 95 ce 6e 58 54 04 a2 a6 63 |..|.-....nXT...c|
-00000300 54 72 67 f2 7f 61 0a 6b 58 46 d4 88 95 38 37 f2 |Trg..a.kXF...87.|
-00000310 93 95 48 56 14 a7 b9 7c 14 03 03 00 01 01 16 03 |..HV...|........|
-00000320 03 00 24 64 bb 41 3a cb a2 2f 95 53 5c 2f f7 83 |..$d.A:../.S\/..|
-00000330 a2 35 18 f6 d0 8d 6f e2 54 ed 2f 07 10 f4 36 e2 |.5....o.T./...6.|
-00000340 3d e5 30 1d e3 63 01 |=.0..c.|
+00000290 0f 00 00 84 05 01 00 80 01 24 8d bb 05 61 2d 29 |.........$...a-)|
+000002a0 12 11 90 f5 57 21 be b7 29 76 55 63 94 8e 7b 4d |....W!..)vUc..{M|
+000002b0 3b 3d 89 5b 1f b9 e1 8c 36 68 6f 31 21 50 af e4 |;=.[....6ho1!P..|
+000002c0 9f ca a5 68 55 b9 eb 36 75 3a 0c be 11 30 28 c8 |...hU..6u:...0(.|
+000002d0 8b 82 93 9a 71 37 4d 4e 4f d2 0c 2f 13 36 ad c3 |....q7MNO../.6..|
+000002e0 df 8a 1b 59 b2 f9 8b a7 74 63 75 4a f4 9d e0 6b |...Y....tcuJ...k|
+000002f0 42 02 5a a9 6e a4 a8 24 d3 23 f7 09 ee b0 dc c4 |B.Z.n..$.#......|
+00000300 6f 87 58 72 e7 e3 87 b3 6b 15 ba 7f dd 9b 93 91 |o.Xr....k.......|
+00000310 5b 21 a0 31 31 bd 15 b5 14 03 03 00 01 01 16 03 |[!.11...........|
+00000320 03 00 24 fc 0e 7c e8 3e 8b b5 dc c9 3d 38 61 a1 |..$..|.>....=8a.|
+00000330 24 d6 77 1f 06 1f 30 32 ba dd 05 68 45 f1 4f 0d |$.w...02...hE.O.|
+00000340 2e 24 09 ad c1 e5 b7 |.$.....|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 0a 22 b6 bc da |..........$."...|
-00000010 34 38 53 8e 80 e2 25 7b 31 2f 70 8e 3a db e8 a3 |48S...%{1/p.:...|
-00000020 70 0e 88 22 b4 a8 be d4 a3 e3 cc 13 94 ef 47 |p.."..........G|
+00000000 14 03 03 00 01 01 16 03 03 00 24 d7 b6 b3 0a e6 |..........$.....|
+00000010 86 9a 25 e4 38 de d0 57 ff 93 0b f4 de 76 3d 00 |..%.8..W.....v=.|
+00000020 64 35 cf 70 f6 ea 74 2d b0 71 2d 92 e2 df eb |d5.p..t-.q-....|
>>> Flow 5 (client to server)
-00000000 17 03 03 00 1a b4 9c b1 57 ea 01 03 fe 01 e7 1e |........W.......|
-00000010 c4 a7 0f 25 14 99 00 4f 88 51 c1 98 6e 99 01 15 |...%...O.Q..n...|
-00000020 03 03 00 16 2e c4 11 8b 1a fc 37 81 18 33 e4 9f |..........7..3..|
-00000030 48 a3 29 e3 ad 9b 9b ec 9f 99 |H.).......|
+00000000 17 03 03 00 1a db bd 43 12 7c b5 83 b5 18 9d 6a |.......C.|.....j|
+00000010 70 3f 5a eb cb d0 ba d4 03 3e a0 7b 25 f0 41 15 |p?Z......>.{%.A.|
+00000020 03 03 00 16 f8 f2 a3 27 a5 c7 25 d9 6c 08 b1 96 |.......'..%.l...|
+00000030 38 22 38 df 16 fb e2 9f 61 a3 |8"8.....a.|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES b/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES
index 76445903bac..e700e16352a 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 02 a0 |....Y...U..S....|
-00000010 5f bd a4 8d 98 93 b8 da 08 86 9f b2 be 9a a4 91 |_...............|
-00000020 2b 3c 1f 18 f0 75 7c a9 a8 a0 f7 20 4a 89 9a d2 |+<...u|.... J...|
-00000030 34 3b d9 b1 c2 fd 61 bd 97 19 22 ce b9 d1 5b a7 |4;....a..."...[.|
-00000040 83 80 9c 19 d0 f5 a0 aa 4c ac 06 20 c0 09 00 00 |........L.. ....|
+00000000 16 03 03 00 59 02 00 00 55 03 03 21 9b eb 15 24 |....Y...U..!...$|
+00000010 46 b6 c1 85 f5 be c5 0d e2 6b 60 bc ee 73 b1 fb |F........k`..s..|
+00000020 34 6f f0 b8 f0 9e 1c 26 a4 4b 0f 20 cb 2b 84 a2 |4o.....&.K. .+..|
+00000030 cb a5 48 70 fe 84 25 b0 16 20 14 a1 83 21 fc f9 |..Hp..%.. ...!..|
+00000040 82 fc 9e 1a d1 3b 56 69 ab c5 0e 2c c0 09 00 00 |.....;Vi...,....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@@ -47,21 +48,21 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 3c |*............A.<|
-00000280 8f 35 1e 47 5d 7b ad 13 0c e9 5c c0 97 c7 83 06 |.5.G]{....\.....|
-00000290 49 0f 6c cf e5 4d 3b ed f7 1b c6 96 8d ba 54 35 |I.l..M;.......T5|
-000002a0 7f df 35 e3 6e 28 e9 71 f2 24 b5 ab 17 2b 4b 2b |..5.n(.q.$...+K+|
-000002b0 0c 8f 9f 48 89 73 8f 09 69 84 af 7f ec 43 7a 04 |...H.s..i....Cz.|
-000002c0 03 00 8a 30 81 87 02 41 79 84 43 0c 78 fa 7e e2 |...0...Ay.C.x.~.|
-000002d0 c5 51 c1 60 88 c4 4a 59 7d 02 fa dc 19 68 33 ed |.Q.`..JY}....h3.|
-000002e0 19 ef a1 df ef 6b 21 a6 98 aa ba a9 13 70 91 0f |.....k!......p..|
-000002f0 cc 6c 5c 1e 99 53 1b 42 51 6c 06 a7 3c c4 04 22 |.l\..S.BQl..<.."|
-00000300 5d 0d c1 30 ab e3 ec b4 54 02 42 01 15 15 1a 6e |]..0....T.B....n|
-00000310 6f f1 c6 b1 10 84 2c c8 04 de 2b 52 d5 b4 f7 c9 |o.....,...+R....|
-00000320 4f 6d 0e 0e 26 45 1d 7a 28 59 2b 8b f6 92 3a 23 |Om..&E.z(Y+...:#|
-00000330 7a 39 9c d5 4e cc 5d c5 45 92 9c d0 5f 33 12 e3 |z9..N.].E..._3..|
-00000340 2b 29 39 52 bb 16 aa e1 72 9e b5 fe 99 16 03 03 |+)9R....r.......|
-00000350 00 04 0e 00 00 00 |......|
+00000270 2a 16 03 03 00 d8 0c 00 00 d4 03 00 17 41 04 b6 |*............A..|
+00000280 3f 37 33 68 cb 79 c0 86 f4 9d 12 ac c4 9d 8c 9b |?73h.y..........|
+00000290 59 1c d4 a9 01 9f 2d cb 80 24 02 ec e0 ff d1 8c |Y.....-..$......|
+000002a0 bd 82 67 3f 47 58 1a 2e 6b 61 f6 8e 4e 27 7f 49 |..g?GX..ka..N'.I|
+000002b0 b5 45 f1 0b 9a 33 ff 53 ac 65 e2 82 7a 18 5c 04 |.E...3.S.e..z.\.|
+000002c0 03 00 8b 30 81 88 02 42 00 e1 2d ff 5d e7 77 f1 |...0...B..-.].w.|
+000002d0 12 d9 e4 c2 4d cd 9c b5 ee e4 fd 21 b2 d8 53 a9 |....M......!..S.|
+000002e0 42 e7 c5 9b 51 c3 59 37 a5 08 d4 e6 29 12 c5 56 |B...Q.Y7....)..V|
+000002f0 b8 fe f0 bb 77 87 a3 ee 09 b0 8c cd 1c 39 9e b5 |....w........9..|
+00000300 d9 15 63 53 cb d7 f1 55 5b 48 02 42 01 19 10 8a |..cS...U[H.B....|
+00000310 7a ee 95 b1 77 44 d4 a3 bf d1 f3 f1 b0 d8 c7 7e |z...wD.........~|
+00000320 42 c0 83 04 f5 f7 9c c0 ce 6a 98 47 9d 21 29 84 |B........j.G.!).|
+00000330 c8 be 6b 67 4e fc c6 26 ec 63 df 00 33 e6 d2 f7 |..kgN..&.c..3...|
+00000340 34 93 85 9b 1b 0f e0 89 42 b6 0b 94 1b 80 16 03 |4.......B.......|
+00000350 03 00 04 0e 00 00 00 |.......|
>>> Flow 3 (client to server)
00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
@@ -69,21 +70,21 @@
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
00000050 01 16 03 03 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
-00000060 00 00 00 00 00 00 20 a3 f8 5a e2 ea f3 09 19 3e |...... ..Z.....>|
-00000070 4a 54 69 70 06 5b 17 35 0f ed e7 30 3b 6f eb a1 |JTip.[.5...0;o..|
-00000080 cb 9c 35 81 10 2e 34 f7 12 a5 e4 63 20 b2 65 31 |..5...4....c .e1|
-00000090 19 da 30 43 39 59 |..0C9Y|
+00000060 00 00 00 00 00 00 50 73 9c 9f a8 d7 78 ac 06 14 |......Ps....x...|
+00000070 8f ae fc fb ef 7d 99 db b7 c9 91 dd f2 fe da 1b |.....}..........|
+00000080 aa 9e 7d e4 5c 2f 5f dd 74 aa fe 03 51 e7 cd 98 |..}.\/_.t...Q...|
+00000090 e9 21 19 c9 6f 59 |.!..oY|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 8d 4d 31 07 df |..........@.M1..|
-00000010 ab 41 f5 19 9c 1a 57 fc 33 ab 5f e6 bd 45 b9 fa |.A....W.3._..E..|
-00000020 7f db c0 df 72 f2 3b ef aa d4 5e 34 e6 3d 44 7c |....r.;...^4.=D||
-00000030 12 05 c7 57 da 54 b1 e3 66 f0 0a ab cd 15 a5 bf |...W.T..f.......|
-00000040 c5 c2 07 a9 d9 a7 2e 5e 29 da da |.......^)..|
+00000000 14 03 03 00 01 01 16 03 03 00 40 47 18 b5 1b 75 |..........@G...u|
+00000010 b8 a3 63 ab 77 d3 47 cb 14 26 b4 88 fe 15 db 22 |..c.w.G..&....."|
+00000020 76 3b 25 d3 68 8e f2 a7 d5 03 2b 82 7b b1 0f 10 |v;%.h.....+.{...|
+00000030 49 6a 3d 95 d0 4b 55 0e 14 eb bb a7 34 bb 57 b3 |Ij=..KU.....4.W.|
+00000040 5d fb 7e 15 80 5a fa f3 3a df 90 |].~..Z..:..|
>>> Flow 5 (client to server)
00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 dc 03 7b 29 2c 49 64 58 2d dc f7 |.......{),IdX-..|
-00000020 26 a1 3b ec 2d e8 30 c4 6c a3 ff e2 bc b5 a4 a6 |&.;.-.0.l.......|
-00000030 93 ce 14 bd da 15 03 03 00 30 00 00 00 00 00 00 |.........0......|
-00000040 00 00 00 00 00 00 00 00 00 00 a6 77 10 30 15 eb |...........w.0..|
-00000050 ed cf 73 5b 74 5d 09 52 4a 5b e2 f0 e4 67 f8 7a |..s[t].RJ[...g.z|
-00000060 5e 5e fc ba 7f 80 0a d2 f4 fb |^^........|
+00000010 00 00 00 00 00 70 74 e2 60 fc 3a 7a b7 5e 16 07 |.....pt.`.:z.^..|
+00000020 22 92 07 fe 92 53 c4 43 1b 8f 94 07 84 48 2b 50 |"....S.C.....H+P|
+00000030 ab 1d 6d 49 ed 15 03 03 00 30 00 00 00 00 00 00 |..mI.....0......|
+00000040 00 00 00 00 00 00 00 00 00 00 ce a8 ba 91 0b e4 |................|
+00000050 8c 38 23 9b 8b 2c 0a 0c 63 79 61 f4 b6 25 f7 41 |.8#..,..cya..%.A|
+00000060 04 9f b0 8f e0 e5 24 44 2f e9 |......$D/.|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM b/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM
index fb5af17f0c4..607ecdcb240 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 02 48 |....Y...U..S...H|
-00000010 03 36 01 05 56 6f f0 54 d2 c3 d3 41 c2 e2 69 7b |.6..Vo.T...A..i{|
-00000020 50 f8 03 ef 3f 5d 7c e6 9c cb fe 20 82 a0 81 fd |P...?]|.... ....|
-00000030 72 4b b8 e6 29 76 3b 0f 1d 0a b7 82 9d 0b cf a0 |rK..)v;.........|
-00000040 65 b1 56 53 c9 d5 58 7b f0 b6 2d cf c0 2b 00 00 |e.VS..X{..-..+..|
+00000000 16 03 03 00 59 02 00 00 55 03 03 91 8a 4f 94 29 |....Y...U....O.)|
+00000010 32 fa 66 7a 7f b8 a7 04 5c 34 b9 7e 12 83 35 1f |2.fz....\4.~..5.|
+00000020 93 b0 af e0 9f 71 07 5e 2f d7 ca 20 52 dc 0d e7 |.....q.^/.. R...|
+00000030 f8 16 db 90 9a 78 2f 03 0b f0 ae a7 2f c6 b4 4c |.....x/...../..L|
+00000040 62 e7 de 32 d5 68 61 f3 07 e4 60 d2 c0 2b 00 00 |b..2.ha...`..+..|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@@ -47,38 +48,38 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
-00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 86 |*............A..|
-00000280 36 b4 78 76 87 70 ed ae 0d 34 70 3d 16 e5 a4 db |6.xv.p...4p=....|
-00000290 ae 28 58 4c 01 5a 56 73 a7 0d 34 59 a7 04 75 69 |.(XL.ZVs..4Y..ui|
-000002a0 f2 55 24 40 b0 33 c6 93 ff ae e0 14 f5 4b ce a8 |.U$@.3.......K..|
-000002b0 e2 e6 9a 67 1d 66 fb 8f fd 56 59 e7 73 f2 2c 04 |...g.f...VY.s.,.|
-000002c0 03 00 8a 30 81 87 02 41 73 ab a8 3c 64 17 69 9f |...0...As..<d.i.|
-000002d0 4d b2 9b 55 12 60 33 94 cf f3 83 40 2b 7b 1b af |M..U.`3....@+{..|
-000002e0 5c f4 cd 02 66 fb 83 04 35 fd ab 74 98 1a 7d f6 |\...f...5..t..}.|
-000002f0 9e 50 98 c3 98 e8 56 9c f2 2a b0 30 9d 05 14 58 |.P....V..*.0...X|
-00000300 68 6a 88 04 49 07 78 bf 3a 02 42 01 be b2 05 9e |hj..I.x.:.B.....|
-00000310 67 da 1e e9 5a 36 98 52 21 9f 43 75 43 ba bb 9a |g...Z6.R!.CuC...|
-00000320 e6 e2 65 f4 e0 44 45 08 5a 1e 54 06 dd 5f 60 2e |..e..DE.Z.T.._`.|
-00000330 7d e7 55 08 d3 7b 4e 0a c7 da d4 27 34 d4 bd b0 |}.U..{N....'4...|
-00000340 12 2f 41 7a ed 71 32 ef ee 12 74 66 00 16 03 03 |./Az.q2...tf....|
-00000350 00 04 0e 00 00 00 |......|
+00000270 2a 16 03 03 00 d8 0c 00 00 d4 03 00 17 41 04 26 |*............A.&|
+00000280 c1 67 14 4b 9e b0 45 8c 27 bf a3 a2 78 5b 56 ad |.g.K..E.'...x[V.|
+00000290 d1 21 56 53 df 86 e9 91 de e3 f9 5d e6 f6 5d 79 |.!VS.......]..]y|
+000002a0 11 8b 60 f9 c2 9a c6 3f 6b 72 cd 7c d7 0e 13 64 |..`....?kr.|...d|
+000002b0 af e8 9f 40 35 e6 fb 04 0c 60 aa 19 61 dd 24 04 |...@5....`..a.$.|
+000002c0 03 00 8b 30 81 88 02 42 00 9d e1 02 5d 8b b1 45 |...0...B....]..E|
+000002d0 e5 c7 b6 94 27 df 36 31 fd 5e 47 fe c8 0f 5f 17 |....'.61.^G..._.|
+000002e0 b1 92 56 76 29 45 3d 90 be 91 6e 2c a7 b2 e1 33 |..Vv)E=...n,...3|
+000002f0 3b f9 3c bb 80 58 c2 d8 a8 59 82 16 dc 9e dd 60 |;.<..X...Y.....`|
+00000300 ff 82 b9 0c 5a ca ff f3 02 2c 02 42 00 a4 c0 d3 |....Z....,.B....|
+00000310 aa 1d 69 52 c0 06 fa 93 e8 50 da a4 2f 72 c9 4a |..iR.....P../r.J|
+00000320 2c 43 7f 95 05 f7 7a f3 4a 2e 2d ce 13 be 80 40 |,C....z.J.-....@|
+00000330 a4 3b b2 f0 73 8d f1 d4 7b a3 ff 01 e1 58 71 31 |.;..s...{....Xq1|
+00000340 fc d8 2f b3 ef 62 2e b7 ac f5 c4 bc b8 68 16 03 |../..b.......h..|
+00000350 03 00 04 0e 00 00 00 |.......|
>>> Flow 3 (client to server)
00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
-00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 87 7a |.....(.........z|
-00000060 82 d7 46 25 1d a6 bb c2 a8 a8 4e a5 d1 f8 02 db |..F%......N.....|
-00000070 33 33 ca 78 b6 d3 bd 77 8a 33 23 a7 95 fb |33.x...w.3#...|
+00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 83 cf |.....(..........|
+00000060 ef 50 c2 e7 da b9 74 7f 1c e0 b8 fb dc 39 c9 98 |.P....t......9..|
+00000070 0c a3 7d 8c c6 fa 6f f2 ee 44 a0 a0 03 18 |..}...o..D....|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 28 ce a1 9d 01 c0 |..........(.....|
-00000010 31 e5 d5 57 16 e1 a6 b3 8b 25 58 0f fa 2a de 3e |1..W.....%X..*.>|
-00000020 0c d9 06 11 a6 b0 d7 b0 33 ad 31 73 5b 26 b4 d2 |........3.1s[&..|
-00000030 12 56 c8 |.V.|
+00000000 14 03 03 00 01 01 16 03 03 00 28 73 c4 48 24 3d |..........(s.H$=|
+00000010 8f 5f f3 8c fc fd 63 be 64 39 d5 56 67 bd d7 c4 |._....c.d9.Vg...|
+00000020 0d 57 88 1a 45 a6 f3 ad 11 b2 5a 41 58 33 f3 d3 |.W..E.....ZAX3..|
+00000030 58 fa 21 |X.!|
>>> Flow 5 (client to server)
-00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 d5 04 4c |...............L|
-00000010 7b 35 b4 d7 90 ae fe 00 d2 f2 4b 76 f1 36 5e 24 |{5........Kv.6^$|
-00000020 4a aa 94 15 03 03 00 1a 00 00 00 00 00 00 00 02 |J...............|
-00000030 d3 1c 41 37 ab f6 17 79 f0 01 a4 19 a5 75 7a 8e |..A7...y.....uz.|
-00000040 a3 b2 |..|
+00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 65 5e 55 |.............e^U|
+00000010 32 be 00 77 6e 1d 8e 8f 95 33 24 3d 7a c2 b0 3f |2..wn....3$=z..?|
+00000020 ca aa 97 15 03 03 00 1a 00 00 00 00 00 00 00 02 |................|
+00000030 b2 71 6e 42 6a 0d cf c9 ac 14 a4 b5 9c c9 71 60 |.qnBj.........q`|
+00000040 d7 c2 |..|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA384 b/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA384
new file mode 100644
index 00000000000..df2f7376de8
--- /dev/null
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA384
@@ -0,0 +1,85 @@
+>>> Flow 1 (client to server)
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
+>>> Flow 2 (server to client)
+00000000 16 03 03 00 59 02 00 00 55 03 03 11 50 81 a7 ef |....Y...U...P...|
+00000010 3f bd a5 a9 41 11 e6 86 b2 a3 d8 bf 29 c3 d4 f4 |?...A.......)...|
+00000020 b6 20 2d cb 94 1b 0e dd 99 d1 0b 20 78 92 23 31 |. -........ x.#1|
+00000030 e3 fc 99 67 1f fd f3 2a fc 9c 4c 74 6e 32 e4 f8 |...g...*..Ltn2..|
+00000040 ed 6d 2e 6d ad a9 a9 bf 63 27 7e 44 c0 2c 00 00 |.m.m....c'~D.,..|
+00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
+00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
+00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
+00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0|
+00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
+000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
+000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
+000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
+000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506|
+000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063|
+000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A|
+00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some|
+00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...|
+00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit|
+00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...|
+00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..|
+00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.|
+00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.|
+00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d|
+00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i|
+00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.|
+000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#|
+000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.|
+000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.|
+000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=|
+000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.|
+000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^|
+00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......|
+00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y|
+00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.|
+00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3|
+00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
+00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
+00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
+00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 fc |*............A..|
+00000280 e6 25 27 3c 76 10 a8 9e d3 a4 a8 68 31 06 85 fc |.%'<v......h1...|
+00000290 35 2a 76 b3 ad 08 c5 70 ed 3d 61 e0 29 cc 47 52 |5*v....p.=a.).GR|
+000002a0 68 21 ab 48 19 f9 28 ba 54 8c 56 8e b0 7d 55 7f |h!.H..(.T.V..}U.|
+000002b0 75 f5 42 38 61 ff e2 06 98 1a ae fc bc a0 3a 04 |u.B8a.........:.|
+000002c0 03 00 8a 30 81 87 02 42 01 0c b2 7f c9 d3 1b 83 |...0...B........|
+000002d0 1e 24 a3 d7 1c 81 f0 02 ae ed 42 6f e9 d9 91 4d |.$........Bo...M|
+000002e0 16 5f aa 8e 5a de 3b 00 0e e6 2d fb 05 30 f3 cf |._..Z.;...-..0..|
+000002f0 31 a2 ec 99 87 ea 42 03 0a 57 82 e5 12 27 98 8a |1.....B..W...'..|
+00000300 c6 56 4b 9a 0b d7 37 5f 46 50 02 41 57 61 13 3c |.VK...7_FP.AWa.<|
+00000310 48 d0 b3 b0 d5 21 72 49 80 7b d7 ef 8f 0d a0 c5 |H....!rI.{......|
+00000320 88 a1 5d ca 61 6d fb 8b 51 15 5d e5 a2 61 c4 78 |..].am..Q.]..a.x|
+00000330 8f d9 e3 78 df 7d a0 8f 0c c0 cc 18 36 41 e6 bb |...x.}......6A..|
+00000340 6d e3 9d 04 c2 c4 d0 66 35 45 9a 08 b2 16 03 03 |m......f5E......|
+00000350 00 04 0e 00 00 00 |......|
+>>> Flow 3 (client to server)
+00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
+00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
+00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
+00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
+00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
+00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 a3 3f |.....(.........?|
+00000060 be 65 91 cd fe 37 43 e0 ea 6f 15 9d c2 aa 6a 02 |.e...7C..o....j.|
+00000070 20 b8 bc b5 c8 9a 1c d4 c4 e5 9b 2e 39 e7 | ...........9.|
+>>> Flow 4 (server to client)
+00000000 14 03 03 00 01 01 16 03 03 00 28 7c b7 1f 13 9e |..........(|....|
+00000010 21 d2 eb db 32 fc 36 d0 53 e1 11 04 ce d0 61 33 |!...2.6.S.....a3|
+00000020 1e 30 3d 91 c3 6a 0d 98 55 f5 e0 5c ca 77 fa 72 |.0=..j..U..\.w.r|
+00000030 63 6a be |cj.|
+>>> Flow 5 (client to server)
+00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 d9 db db |................|
+00000010 4b 3a ae 5c a4 dc 96 33 ed b5 a0 70 64 1f 96 2f |K:.\...3...pd../|
+00000020 b6 cd 1e 15 03 03 00 1a 00 00 00 00 00 00 00 02 |................|
+00000030 18 a0 d1 98 a6 71 c9 56 36 bd 1a 46 4b 5b 45 29 |.....q.V6..FK[E)|
+00000040 1f dd |..|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES b/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES
index 5336bbbad8f..994ebb1e37f 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 59 02 00 00 55 03 03 53 04 f1 02 41 |....Y...U..S...A|
-00000010 95 cc 56 30 65 46 24 75 d5 9e 3c a7 5b 6c 99 fe |..V0eF$u..<.[l..|
-00000020 86 35 23 42 3a 8f 4d 4c b9 98 7d 20 a7 46 43 72 |.5#B:.ML..} .FCr|
-00000030 66 bb b6 ad ff ad cf 63 37 fe 6b b4 78 94 08 49 |f......c7.k.x..I|
-00000040 54 06 ed f4 85 73 38 4a c6 fe b6 98 c0 13 00 00 |T....s8J........|
+00000000 16 03 03 00 59 02 00 00 55 03 03 e6 ae 89 0d 22 |....Y...U......"|
+00000010 e5 e0 cd 57 a3 ca 71 4f 17 2f 64 77 f8 30 89 ef |...W..qO./dw.0..|
+00000020 e8 19 70 ac dd 2c c5 9f 84 7d 1d 20 1c 59 3c fe |..p..,...}. .Y<.|
+00000030 a9 ec 10 dd 38 3b 43 fe 6b 09 e5 e4 83 d9 7a 78 |....8;C.k.....zx|
+00000040 86 08 33 da 9b e1 09 d8 c9 07 34 19 c0 13 00 00 |..3.......4.....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
@@ -58,20 +59,20 @@
000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
-00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 48 |.............A.H|
-00000330 68 d8 8a 10 b4 bf eb 8d d1 98 b0 a6 f4 47 5d 91 |h............G].|
-00000340 61 da 50 d9 85 7b 5d 90 02 2c 38 c9 af 81 d3 55 |a.P..{]..,8....U|
-00000350 07 62 b1 62 58 7f 39 94 d7 91 96 a8 1f 47 60 a5 |.b.bX.9......G`.|
-00000360 c0 04 f2 fb cb 15 75 a6 16 3f 94 53 7c ff dd 04 |......u..?.S|...|
-00000370 01 00 80 b9 82 fa 0b f8 8c 94 2c 6e 05 81 7d 80 |..........,n..}.|
-00000380 5d 9a 77 78 af c8 33 5d 89 7e 2e 3c e5 72 66 a8 |].wx..3].~.<.rf.|
-00000390 f1 5c 02 04 02 70 76 7b 45 ff 0d 29 a0 cb 0d db |.\...pv{E..)....|
-000003a0 7a 4c c4 13 19 cd 47 b2 f1 c9 43 4f 95 d2 f1 c6 |zL....G...CO....|
-000003b0 bc ae 31 4a 9d de 80 b2 a4 b7 b6 dd 8c 03 3e 2a |..1J..........>*|
-000003c0 46 5e d1 e7 5b c5 9e 06 58 f3 55 b2 77 09 f3 98 |F^..[...X.U.w...|
-000003d0 d5 7f 5a 74 64 7e 48 22 8f 7d a8 68 b6 1d 90 df |..Ztd~H".}.h....|
-000003e0 2c 91 d7 c5 07 3d d1 6f e9 c1 91 03 3c 23 5a 56 |,....=.o....<#ZV|
-000003f0 3b b2 c2 16 03 03 00 04 0e 00 00 00 |;...........|
+00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 77 |.............A.w|
+00000330 87 a7 ad f6 f8 34 82 05 ef bb 14 6d c7 8b 7b 2a |.....4.....m..{*|
+00000340 4d ca 41 65 58 3c 83 fa 4d ce 0c 74 46 85 fe 38 |M.AeX<..M..tF..8|
+00000350 95 80 ee 7c c2 bf f2 be a3 c6 bf f3 aa 07 23 40 |...|..........#@|
+00000360 7e cc 74 4a 4e 2e 69 af 6b e0 42 8a fc 41 be 04 |~.tJN.i.k.B..A..|
+00000370 01 00 80 99 ed a8 3a ef 93 1b 4c 17 80 9e cc eb |......:...L.....|
+00000380 da 39 fb c8 9a 73 e1 96 20 3e 41 fa 8b 1a b1 68 |.9...s.. >A....h|
+00000390 cd 47 bc 4b 7b 0c 14 da 87 d3 36 09 5e 37 33 88 |.G.K{.....6.^73.|
+000003a0 7f 88 07 87 46 ec e5 72 a8 59 92 07 fa 4d 02 dc |....F..r.Y...M..|
+000003b0 bf 3a f5 e4 77 0b a6 85 ce 43 ee 1b 90 30 7f ec |.:..w....C...0..|
+000003c0 88 79 f8 88 59 af 6b 7f 2d 88 de 92 cd c8 36 cf |.y..Y.k.-.....6.|
+000003d0 ba b9 08 6a c4 3d d7 9a 48 50 e1 67 d0 62 a5 b3 |...j.=..HP.g.b..|
+000003e0 b0 5f 2e 16 ee 4d 7d a2 cf d9 93 19 89 b7 64 0f |._...M}.......d.|
+000003f0 0f 8e 3d 16 03 03 00 04 0e 00 00 00 |..=.........|
>>> Flow 3 (client to server)
00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
@@ -79,21 +80,21 @@
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
00000050 01 16 03 03 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
-00000060 00 00 00 00 00 00 59 e6 92 05 27 ec 09 2c b0 a5 |......Y...'..,..|
-00000070 2a fb 7e f1 03 53 16 63 68 a1 86 13 bb da 98 27 |*.~..S.ch......'|
-00000080 6d 42 08 35 6a ec 58 61 2a 4d 44 ec ae c5 b9 d2 |mB.5j.Xa*MD.....|
-00000090 76 57 1f 75 9f 8d |vW.u..|
+00000060 00 00 00 00 00 00 f2 20 58 ec f1 88 a6 26 79 9d |....... X....&y.|
+00000070 2e 9b 02 b5 5e da e2 c1 c5 8d c8 93 6f 6d 07 4e |....^.......om.N|
+00000080 fa dd ee cb b1 ae c7 3b 09 b2 cc 64 7a cd 98 91 |.......;...dz...|
+00000090 cb f8 3c 34 3b ed |..<4;.|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 40 6e 03 d0 e6 98 |..........@n....|
-00000010 1f f5 39 7b 06 9f 95 f0 7a 88 35 7c 55 db c3 2f |..9{....z.5|U../|
-00000020 00 ef 5b d3 62 87 a2 94 da 2f f6 4a 89 c9 a8 3d |..[.b..../.J...=|
-00000030 3a 92 db 77 35 92 01 4b f5 c5 6b 95 09 9f cd 79 |:..w5..K..k....y|
-00000040 3c af 37 5b 27 bf 93 3e 04 55 71 |<.7['..>.Uq|
+00000000 14 03 03 00 01 01 16 03 03 00 40 4c a1 8d bd 49 |..........@L...I|
+00000010 33 d3 72 fb 2f 23 7e 11 29 fc d2 ff 9b 67 30 c8 |3.r./#~.)....g0.|
+00000020 be c1 bc 51 6e 92 a5 f4 9d e3 b3 f9 d2 d4 c4 a5 |...Qn...........|
+00000030 83 23 90 b3 17 00 35 18 c5 ef 8b 18 a3 cf ed 9d |.#....5.........|
+00000040 a9 52 c9 11 0a c9 55 c2 76 df 78 |.R....U.v.x|
>>> Flow 5 (client to server)
00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-00000010 00 00 00 00 00 bc c9 d0 8e 80 14 de 32 18 49 e8 |............2.I.|
-00000020 20 dc 5e 6c e4 6d 14 00 df 51 71 fb 86 95 16 4c | .^l.m...Qq....L|
-00000030 04 8e 71 e1 48 15 03 03 00 30 00 00 00 00 00 00 |..q.H....0......|
-00000040 00 00 00 00 00 00 00 00 00 00 b7 6d 30 72 61 53 |...........m0raS|
-00000050 d8 0a d4 1d ae e5 d4 22 46 c9 d5 4e 4a 86 f5 ac |......."F..NJ...|
-00000060 72 98 c6 db 38 29 97 2c 84 0b |r...8).,..|
+00000010 00 00 00 00 00 60 40 d0 bf 8f ef 05 2b 89 d7 bb |.....`@.....+...|
+00000020 27 d0 1f b2 cf c3 ff 8e be 69 16 a9 b3 03 e8 3c |'........i.....<|
+00000030 30 1d 58 39 4a 15 03 03 00 30 00 00 00 00 00 00 |0.X9J....0......|
+00000040 00 00 00 00 00 00 00 00 00 00 de 61 51 a1 3c fc |...........aQ.<.|
+00000050 1c 7b e6 f2 7d e0 aa 80 2d 9c e9 22 09 5c dd 8a |.{..}...-..".\..|
+00000060 55 cc c4 77 34 97 05 88 98 d3 |U..w4.....|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-RSA-RC4 b/libgo/go/crypto/tls/testdata/Client-TLSv12-RSA-RC4
index 0377f052ae6..73e34c0ce35 100644
--- a/libgo/go/crypto/tls/testdata/Client-TLSv12-RSA-RC4
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-RSA-RC4
@@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1a c0 2f |.............../|
-00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
-00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
-00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
-00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
-00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 51 02 00 00 4d 03 03 53 04 f1 02 9d |....Q...M..S....|
-00000010 2e 4e d9 17 4a 35 fa 9d 94 f6 45 0a f6 6b 5d 1c |.N..J5....E..k].|
-00000020 1e 15 19 8d 6d 94 cc 90 d9 39 94 20 8b 4b de 76 |....m....9. .K.v|
-00000030 d5 64 5d b7 19 df e7 eb 7e a0 22 c4 09 38 a0 12 |.d].....~."..8..|
-00000040 d5 59 10 c8 31 06 dc fc e4 9d d1 80 00 05 00 00 |.Y..1...........|
+00000000 16 03 03 00 51 02 00 00 4d 03 03 e8 ae 4c 97 41 |....Q...M....L.A|
+00000010 78 0f 08 84 d4 4a 80 6d a2 e1 d0 67 40 8f 01 8b |x....J.m...g@...|
+00000020 20 54 cb 28 16 52 04 fd 3c c2 84 20 30 96 f0 51 | T.(.R..<.. 0..Q|
+00000030 72 86 6a d8 47 b9 47 e3 a4 ad 97 77 a9 77 1a f9 |r.j.G.G....w.w..|
+00000040 ba 63 33 32 4f 43 09 1c e1 bd 1b 3b 00 05 00 00 |.c32OC.....;....|
00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
@@ -69,15 +70,15 @@
00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 03 00 01 |5..C.0oUN.p.....|
-00000090 01 16 03 03 00 24 37 14 b2 97 7b b5 f0 9a 38 05 |.....$7...{...8.|
-000000a0 22 35 69 9c 95 2f 86 4b 37 98 22 db 4e 9a 46 9c |"5i../.K7.".N.F.|
-000000b0 b9 81 74 72 58 18 53 0c 5c 3c |..trX.S.\<|
+00000090 01 16 03 03 00 24 54 8c 7f 71 03 7c 98 e5 97 65 |.....$T..q.|...e|
+000000a0 51 13 b2 9d 4a b8 c9 c1 e6 11 1b 50 c8 1b c0 46 |Q...J......P...F|
+000000b0 a7 cb 13 97 92 a0 51 d4 a9 e5 |......Q...|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 3c b3 e7 77 5a |..........$<..wZ|
-00000010 7c 36 5a 74 74 26 8d 5b 5a 09 96 60 e8 24 45 2f ||6Ztt&.[Z..`.$E/|
-00000020 c2 39 14 5e db 58 12 49 ad a8 b6 ea ef 58 16 |.9.^.X.I.....X.|
+00000000 14 03 03 00 01 01 16 03 03 00 24 37 ca ae 55 79 |..........$7..Uy|
+00000010 e7 0a 70 55 1e d1 76 61 57 46 d2 c0 d0 ed 3d 70 |..pU..vaWF....=p|
+00000020 1f 02 f2 06 5b 3e 50 ec 13 4b 67 e2 7c bd 45 |....[>P..Kg.|.E|
>>> Flow 5 (client to server)
-00000000 17 03 03 00 1a 6d 29 d7 ba 2f 85 02 b6 f0 82 64 |.....m)../.....d|
-00000010 6c 55 ae ab f6 fd 14 ff b8 38 f0 f8 a6 ea cc 15 |lU.......8......|
-00000020 03 03 00 16 10 c5 d9 41 7b e2 89 67 dc 29 8e f8 |.......A{..g.)..|
-00000030 b5 ab 32 91 44 2c 27 84 49 f7 |..2.D,'.I.|
+00000000 17 03 03 00 1a c4 13 68 ec e0 38 a1 07 35 da d7 |.......h..8..5..|
+00000010 c4 6b f9 5c ed a7 8a cb 96 7a 22 7c ca a5 30 15 |.k.\.....z"|..0.|
+00000020 03 03 00 16 f7 a7 8d 41 b0 c1 4b 61 60 b0 b2 ed |.......A..Ka`...|
+00000030 4a ab c3 54 d5 20 eb 67 b7 8f |J..T. .g..|
diff --git a/libgo/go/crypto/tls/testdata/Client-TLSv12-SCT b/libgo/go/crypto/tls/testdata/Client-TLSv12-SCT
new file mode 100644
index 00000000000..826c9f0a579
--- /dev/null
+++ b/libgo/go/crypto/tls/testdata/Client-TLSv12-SCT
@@ -0,0 +1,118 @@
+>>> Flow 1 (client to server)
+00000000 16 03 01 00 81 01 00 00 7d 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 00 00 1e c0 2f |.............../|
+00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
+00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6|
+00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
+00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
+00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
+00000080 01 00 00 12 00 00 |......|
+>>> Flow 2 (server to client)
+00000000 16 03 03 01 c6 02 00 01 c2 03 03 1b f6 69 c1 c2 |.............i..|
+00000010 36 77 72 32 69 95 c9 e7 db 9b 5d bd 59 ba 08 02 |6wr2i.....].Y...|
+00000020 1e 76 11 c4 8e 49 08 22 8e 8a 5a 20 44 ec d9 13 |.v...I."..Z D...|
+00000030 23 ad 05 45 48 29 00 c6 11 3d 5a 5c a1 ee 34 2b |#..EH)...=Z\..4+|
+00000040 58 ef 34 5b 7e 42 08 84 23 66 56 ee c0 2f 00 01 |X.4[~B..#fV../..|
+00000050 7a ff 01 00 01 00 00 0b 00 04 03 00 01 02 00 12 |z...............|
+00000060 01 69 01 67 00 75 00 a4 b9 09 90 b4 18 58 14 87 |.i.g.u.......X..|
+00000070 bb 13 a2 cc 67 70 0a 3c 35 98 04 f9 1b df b8 e3 |....gp.<5.......|
+00000080 77 cd 0e c8 0d dc 10 00 00 01 47 97 99 ee 16 00 |w.........G.....|
+00000090 00 04 03 00 46 30 44 02 20 1c 4b 82 5d 95 6e 67 |....F0D. .K.].ng|
+000000a0 5b db 04 95 4b f6 ce f4 32 3e 86 7a 7a 32 ab 18 |[...K...2>.zz2..|
+000000b0 60 74 de 08 da 05 91 4c 2f 02 20 73 54 1b 6e 7f |`t.....L/. sT.n.|
+000000c0 a1 b0 7d 11 bc e6 f3 85 2f 97 66 1a f7 8a e4 10 |..}...../.f.....|
+000000d0 25 8f 12 f4 6f 39 0f d2 9e 18 f0 00 76 00 68 f6 |%...o9......v.h.|
+000000e0 98 f8 1f 64 82 be 3a 8c ee b9 28 1d 4c fc 71 51 |...d..:...(.L.qQ|
+000000f0 5d 67 93 d4 44 d1 0a 67 ac bb 4f 4f fb c4 00 00 |]g..D..g..OO....|
+00000100 01 47 97 e1 b5 70 00 00 04 03 00 47 30 45 02 20 |.G...p.....G0E. |
+00000110 32 21 14 38 06 d8 72 2e 00 30 64 1a e2 e8 6d 4e |2!.8..r..0d...mN|
+00000120 5a e1 d9 42 1e 82 4b 96 25 89 d5 26 13 d3 9c fa |Z..B..K.%..&....|
+00000130 02 21 00 8f 12 28 64 51 4f 44 d5 8c 18 62 23 b2 |.!...(dQOD...b#.|
+00000140 43 93 33 05 f3 43 55 a1 d9 ee cd c5 71 35 91 dd |C.3..CU.....q5..|
+00000150 49 d1 0b 00 76 00 ee 4b bd b7 75 ce 60 ba e1 42 |I...v..K..u.`..B|
+00000160 69 1f ab e1 9e 66 a3 0f 7e 5f b0 72 d8 83 00 c4 |i....f..~_.r....|
+00000170 7b 89 7a a8 fd cb 00 00 01 48 5c 64 8a 87 00 00 |{.z......H\d....|
+00000180 04 03 00 47 30 45 02 20 29 89 d6 b0 53 d3 d2 e9 |...G0E. )...S...|
+00000190 91 bc f1 b5 40 be 1e 2e e7 5c b4 74 27 ed 8f 9b |....@....\.t'...|
+000001a0 02 e9 fa c2 4c ba a2 be 02 21 00 af 43 64 52 71 |....L....!..CdRq|
+000001b0 15 29 58 40 91 c7 08 16 96 03 a8 73 a5 65 a0 6c |.)X@.......s.e.l|
+000001c0 b8 48 56 5a b6 29 83 64 6d 2a 9d 16 03 03 02 be |.HVZ.).dm*......|
+000001d0 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 |..........0...0.|
+000001e0 02 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f |................|
+000001f0 b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 |..0...*.H.......|
+00000200 00 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 |.0E1.0...U....AU|
+00000210 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d |1.0...U....Some-|
+00000220 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 |State1!0...U....|
+00000230 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 |Internet Widgits|
+00000240 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 | Pty Ltd0...1004|
+00000250 32 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 |24090938Z..11042|
+00000260 34 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 |4090938Z0E1.0...|
+00000270 55 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 |U....AU1.0...U..|
+00000280 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f |..Some-State1!0.|
+00000290 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 |..U....Internet |
+000002a0 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 |Widgits Pty Ltd0|
+000002b0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......|
+000002c0 00 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 |.....0.......y..|
+000002d0 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 |....F...i..+.CZ.|
+000002e0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 |.-.zC...R..eL,x.|
+000002f0 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 |#........;~b.,.3|
+00000300 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 |...\zV.....X{&?.|
+00000310 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 |.....!.J..T.Z..B|
+00000320 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 |q......~.}}..9..|
+00000330 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d |..Q.|..L;2f.....|
+00000340 b8 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 |.q.....k..-y....|
+00000350 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 |....0..0...U....|
+00000360 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.|
+00000370 d3 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 |.&...90u..U.#.n0|
+00000380 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 |l......Z..(.i.#i|
+00000390 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 |..&...9.I.G0E1.0|
+000003a0 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...|
+000003b0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1|
+000003c0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern|
+000003d0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L|
+000003e0 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 |td...........0..|
+000003f0 03 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a |.U....0....0...*|
+00000400 86 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c |.H.............l|
+00000410 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d |E$.k.Y..R.......|
+00000420 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb |zdu.Z.f..+...f..|
+00000430 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 |O8.n`....A..%...|
+00000440 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db |z$.0.........1Y.|
+00000450 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 |...x.PV\..Z-Z_3.|
+00000460 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 |...u....R...... |
+00000470 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 |_..........W.p.&|
+00000480 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 |mq..&n8P)l......|
+00000490 03 00 cd 0c 00 00 c9 03 00 17 41 04 d7 61 5b 05 |..........A..a[.|
+000004a0 de 22 d3 3d 00 72 a5 be 0a c1 76 94 a1 34 41 6e |.".=.r....v..4An|
+000004b0 55 f2 74 91 d2 6f 5c 47 87 c8 4b eb ab ab 10 b9 |U.t..o\G..K.....|
+000004c0 f9 0a bc 63 03 5f 90 5b e3 6f e1 44 97 cc bf d2 |...c._.[.o.D....|
+000004d0 e8 0d f5 9c 2e 9d 07 2c b2 00 90 0b 04 01 00 80 |.......,........|
+000004e0 67 3d c7 73 42 b9 b2 fd 4b dd 02 57 87 95 20 75 |g=.sB...K..W.. u|
+000004f0 da c1 e7 d3 33 09 01 5d e9 32 d7 20 7f 92 a9 dd |....3..].2. ....|
+00000500 bb 17 c5 ee f2 07 b2 04 1d 5e 1f c2 41 66 3f 14 |.........^..Af?.|
+00000510 90 cd 84 ac 49 46 04 3e ce 89 7d 79 42 2a 8c 56 |....IF.>..}yB*.V|
+00000520 93 d3 9c 3b 57 38 9e 91 af 62 ad 86 40 29 3d 46 |...;W8...b..@)=F|
+00000530 c7 cc f4 3f a1 7d ee 53 3d 94 1c 85 b9 1d a9 5f |...?.}.S=......_|
+00000540 10 8e ee 38 5e 98 5d 39 31 79 83 cd f9 02 a8 a9 |...8^.]91y......|
+00000550 b8 82 21 33 40 ed 27 54 a3 6e 64 cb e9 ce dd e1 |..!3@.'T.nd.....|
+00000560 16 03 03 00 04 0e 00 00 00 |.........|
+>>> Flow 3 (client to server)
+00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
+00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
+00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
+00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
+00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......|
+00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 60 0e |.....(........`.|
+00000060 49 99 7a 9f 28 6e 46 03 a8 fd 0e b7 ed bb 9c ba |I.z.(nF.........|
+00000070 07 9c 4d cc 26 2b c2 70 a0 26 38 a0 f2 a0 |..M.&+.p.&8...|
+>>> Flow 4 (server to client)
+00000000 14 03 03 00 01 01 16 03 03 00 28 d2 ef 8f f4 7b |..........(....{|
+00000010 7a 9b c8 98 a4 36 f2 be 61 46 0e af f4 6f 63 71 |z....6..aF...ocq|
+00000020 6e bd 87 ea 1b f2 95 ad 36 7d a3 52 7f b2 b6 45 |n.......6}.R...E|
+00000030 3f 0b 62 |?.b|
+>>> Flow 5 (client to server)
+00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 53 a1 85 |.............S..|
+00000010 ce 3c c1 64 39 80 fb db 67 ec 48 20 7f e9 82 f4 |.<.d9...g.H ....|
+00000020 2d 69 0a 15 03 03 00 1a 00 00 00 00 00 00 00 02 |-i..............|
+00000030 ab 78 11 1b 80 55 23 db 07 c5 7f c3 5e 19 d8 b3 |.x...U#.....^...|
+00000040 f8 c6 |..|
diff --git a/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-3DES b/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-3DES
index a6c7a4196c7..20520f542d4 100644
--- a/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-3DES
+++ b/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-3DES
@@ -1,83 +1,78 @@
>>> Flow 1 (client to server)
-00000000 16 03 00 00 2f 01 00 00 2b 03 00 52 cc 57 59 d8 |..../...+..R.WY.|
-00000010 86 d6 07 ae e0 8d 63 b7 1e cb aa c6 67 32 c8 dd |......c.....g2..|
-00000020 68 03 d8 3d 37 18 72 c3 c0 f1 9d 00 00 04 00 0a |h..=7.r.........|
+00000000 16 03 00 00 2f 01 00 00 2b 03 00 10 71 68 59 99 |..../...+...qhY.|
+00000010 9c a6 e7 36 8b 0d 03 be f5 42 ab 7c d0 3b 76 3e |...6.....B.|.;v>|
+00000020 46 7c 6c a3 94 09 b7 1b 0e 42 27 00 00 04 00 0a |F|l......B'.....|
00000030 00 ff 01 00 |....|
>>> Flow 2 (server to client)
00000000 16 03 00 00 31 02 00 00 2d 03 00 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 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 00 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 00 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 00 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 00 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 00 00 84 10 00 00 80 75 e0 c9 76 d6 e9 34 |.........u..v..4|
-00000010 1d e3 31 9e db 3b 03 41 93 e8 db 73 7c e9 3f 6a |..1..;.A...s|.?j|
-00000020 d8 2a 7b 25 83 4f 45 de 3f 78 3f b6 53 a7 b4 6c |.*{%.OE.?x?.S..l|
-00000030 e3 87 c4 c3 70 55 71 79 55 dc 74 98 84 21 19 13 |....pUqyU.t..!..|
-00000040 be d5 8e 0a ff 2f 9f 7a 6b d4 6c ef 78 d1 cb 65 |...../.zk.l.x..e|
-00000050 32 4c 0c c5 29 b9 60 94 c6 79 56 a2 aa 2d d9 ad |2L..).`..yV..-..|
-00000060 51 2c 54 1b 28 23 33 54 cd 48 cb 80 13 45 3d 4a |Q,T.(#3T.H...E=J|
-00000070 8e 2f f2 da bd 68 3e 1b eb 73 f9 2d 35 6b b1 40 |./...h>..s.-5k.@|
-00000080 2e 6d 9d 1c e9 c1 02 80 37 14 03 00 00 01 01 16 |.m......7.......|
-00000090 03 00 00 40 f7 c3 dd a4 64 3d 81 24 de a2 81 7d |...@....d=.$...}|
-000000a0 e4 df 78 46 e7 ba 93 6c 36 43 05 96 fc 75 ef ec |..xF...l6C...u..|
-000000b0 a5 46 6d 47 a5 be 74 ad 15 93 d9 87 4f 1d e2 b3 |.FmG..t.....O...|
-000000c0 03 ff 2e 89 6e 50 f4 d6 a6 e2 b3 54 cb 74 07 f7 |....nP.....T.t..|
-000000d0 ca 1b 8c 0a |....|
+00000000 16 03 00 00 84 10 00 00 80 1b 62 18 c8 60 0b f7 |..........b..`..|
+00000010 4a b8 ec 98 56 eb aa 4b d9 05 c0 f1 be b9 a5 28 |J...V..K.......(|
+00000020 62 e8 3e 25 08 9f 28 dd 08 1f 04 80 5f 10 81 cf |b.>%..(....._...|
+00000030 aa 2f 55 cd f1 0f ec 5b 90 0a 1f 49 bc a3 96 38 |./U....[...I...8|
+00000040 c7 32 b6 0a da b3 a5 7a 76 28 82 19 30 f4 6b ae |.2.....zv(..0.k.|
+00000050 fb 81 cc b4 ad 92 f8 c6 20 da 27 89 45 f4 43 c2 |........ .'.E.C.|
+00000060 16 7e de 29 03 dc 90 dd 3a 23 58 4c 35 be 11 a5 |.~.)....:#XL5...|
+00000070 52 18 79 13 e6 b3 2d e6 8e f5 76 60 0c c1 92 bb |R.y...-...v`....|
+00000080 07 67 c5 24 12 1b aa d6 53 14 03 00 00 01 01 16 |.g.$....S.......|
+00000090 03 00 00 40 5f 64 da b6 24 19 07 44 32 85 f3 c0 |...@_d..$..D2...|
+000000a0 9b c6 2c ad b1 d1 0f 4b 52 20 2f ea 6f 15 80 44 |..,....KR /.o..D|
+000000b0 78 34 44 02 67 e0 2e b4 b8 df 7b 3f 21 dd 66 9b |x4D.g.....{?!.f.|
+000000c0 e7 5f 71 ff 5f 30 fb 5b 5a 19 f0 24 f8 21 bc 7c |._q._0.[Z..$.!.||
+000000d0 00 e1 1f e8 |....|
>>> Flow 4 (server to client)
-00000000 14 03 00 00 01 01 16 03 00 00 40 6d 3d d8 d5 cf |..........@m=...|
-00000010 05 7d 98 8c 28 28 e2 43 ab ad 4a fa ae bf ec c3 |.}..((.C..J.....|
-00000020 9c 0a 13 4d 28 a4 45 c4 b9 f2 bc c5 12 a2 68 91 |...M(.E.......h.|
-00000030 77 fa 72 f8 9e 4e b7 1f b4 02 02 e3 5d 57 b0 8b |w.r..N......]W..|
-00000040 d8 90 0c 9d e6 df 5b 90 92 a1 0d 17 03 00 00 18 |......[.........|
-00000050 91 48 8a e1 d6 bf 79 1c d5 0a 70 d5 94 20 25 78 |.H....y...p.. %x|
-00000060 d8 84 c8 6e 54 f0 99 01 17 03 00 00 28 74 19 90 |...nT.......(t..|
-00000070 41 44 53 27 bb fb 1f fd 71 34 20 61 a0 eb a4 7c |ADS'....q4 a...||
-00000080 fe 36 f8 4b d7 b0 27 d3 b9 36 e1 67 af 2d 0e 23 |.6.K..'..6.g.-.#|
-00000090 2b 76 a7 2f c3 15 03 00 00 18 db fc e9 fd 87 5f |+v./..........._|
-000000a0 92 a8 3d 4b 35 f5 c6 48 2c b4 42 50 c3 81 28 f0 |..=K5..H,.BP..(.|
-000000b0 2b 41 |+A|
+00000000 14 03 00 00 01 01 16 03 00 00 40 48 01 fc 08 a0 |..........@H....|
+00000010 fa 0e 63 58 25 18 06 3c 54 5c 60 ce 35 f6 ec b8 |..cX%..<T\`.5...|
+00000020 ed f8 97 c7 b0 5f 96 6b d1 10 53 e9 23 20 44 56 |....._.k..S.# DV|
+00000030 d7 ee 11 e1 6f b7 1e fb 33 94 7f f0 78 f5 2e 02 |....o...3...x...|
+00000040 37 7a 43 cf e7 c7 52 b3 c6 8d 8e 17 03 00 00 18 |7zC...R.........|
+00000050 f7 3c 05 79 4b 55 8c d7 2c 50 82 f0 61 34 f6 c7 |.<.yKU..,P..a4..|
+00000060 f3 71 e1 76 1d f0 65 b6 17 03 00 00 28 50 ce 6c |.q.v..e.....(P.l|
+00000070 96 97 70 88 b7 3c 74 a9 cb a3 0e ae 3a 7f 85 99 |..p..<t.....:...|
+00000080 58 36 10 7f 1a e8 f8 7d 83 75 24 7e b1 6a 8e b0 |X6.....}.u$~.j..|
+00000090 f1 cc 06 19 f7 15 03 00 00 18 2c 1d 87 1d ce 08 |..........,.....|
+000000a0 8f 10 09 6e bd fc ad e0 1d a7 47 d5 b9 8f 3e b8 |...n......G...>.|
+000000b0 b3 fa |..|
diff --git a/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-AES b/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-AES
index 4885b267da7..e0fe95658da 100644
--- a/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-AES
+++ b/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-AES
@@ -1,84 +1,79 @@
>>> Flow 1 (client to server)
-00000000 16 03 00 00 2f 01 00 00 2b 03 00 52 cc 57 59 30 |..../...+..R.WY0|
-00000010 e1 ee 8c 60 5b 40 dd 95 bd b4 84 87 2f 01 15 e7 |...`[@....../...|
-00000020 50 88 4c 82 6b 6d 93 8a 57 d0 27 00 00 04 00 2f |P.L.km..W.'..../|
+00000000 16 03 00 00 2f 01 00 00 2b 03 00 37 cd 49 a6 9f |..../...+..7.I..|
+00000010 e9 19 6a 39 cd 75 ce 6c f1 1b 96 d3 d4 f0 33 0c |..j9.u.l......3.|
+00000020 8f 53 b2 06 c4 0e 39 86 e3 98 7e 00 00 04 00 2f |.S....9...~..../|
00000030 00 ff 01 00 |....|
>>> Flow 2 (server to client)
00000000 16 03 00 00 31 02 00 00 2d 03 00 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 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 00 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 00 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 00 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 00 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 00 00 84 10 00 00 80 74 50 05 6f f5 83 c9 |.........tP.o...|
-00000010 f5 0c 5a 65 c7 4e c6 f3 87 96 d7 5d 3e 88 27 32 |..Ze.N.....]>.'2|
-00000020 89 12 ba ec db ef c0 85 70 84 ed b6 83 03 8f 44 |........p......D|
-00000030 f5 6f fa fa d0 1f 95 30 d1 ae a7 71 cf ee e9 b1 |.o.....0...q....|
-00000040 80 7b 34 a9 ea 1b 5e e5 71 40 3f e8 7d 30 d1 8b |.{4...^.q@?.}0..|
-00000050 11 f1 68 1f c8 25 f0 77 c5 af b3 92 6e d9 81 cc |..h..%.w....n...|
-00000060 f8 fd 82 95 cc 1f 4a b1 05 15 7a b3 a1 22 33 09 |......J...z.."3.|
-00000070 e7 a5 c2 89 7f 03 e0 91 b6 61 a3 a0 4e 17 0d 7a |.........a..N..z|
-00000080 13 01 c4 b6 50 c7 d9 81 15 14 03 00 00 01 01 16 |....P...........|
-00000090 03 00 00 40 56 da 56 ab e6 26 98 58 53 1f 36 b5 |...@V.V..&.XS.6.|
-000000a0 03 14 bd 42 29 ee 9c 7c e4 48 26 82 68 ae fd fe |...B)..|.H&.h...|
-000000b0 5e a4 43 22 75 95 7b c8 77 88 fd d6 d4 9b c9 b5 |^.C"u.{.w.......|
-000000c0 ee 3e a6 e8 c5 04 90 63 3f ac be 56 67 da 30 d4 |.>.....c?..Vg.0.|
-000000d0 64 fb a8 a0 |d...|
+00000000 16 03 00 00 84 10 00 00 80 4d 3f 93 aa 84 d8 ad |.........M?.....|
+00000010 93 2c 63 02 66 2f 96 88 b8 5c 09 1e 63 e2 e5 96 |.,c.f/...\..c...|
+00000020 26 d8 07 14 86 26 62 f4 0c 04 68 1c bf bb b1 53 |&....&b...h....S|
+00000030 97 96 43 59 4a 57 65 12 88 45 34 2b 86 2b 05 aa |..CYJWe..E4+.+..|
+00000040 9b 2b b9 aa 13 30 5c 91 c0 9f 03 8a 96 61 dd 87 |.+...0\......a..|
+00000050 ae e3 ad 6a 7b 8a 18 23 67 c9 df ad f2 47 eb 8b |...j{..#g....G..|
+00000060 7d 24 95 47 f1 4e b5 c6 15 b4 12 2a 42 df b3 99 |}$.G.N.....*B...|
+00000070 d1 b8 60 ce 6a cf 98 c1 13 a1 68 e6 92 ee 92 a2 |..`.j.....h.....|
+00000080 1d 2f 63 66 f3 b9 1b fc 33 14 03 00 00 01 01 16 |./cf....3.......|
+00000090 03 00 00 40 75 48 68 7d 8f f5 5a c0 cb 90 a5 9e |...@uHh}..Z.....|
+000000a0 94 bb eb 61 b5 36 aa ce 09 7a 11 ba 22 56 2a d7 |...a.6...z.."V*.|
+000000b0 91 a3 99 73 5b c5 b2 b7 b9 92 56 c6 cb fe 13 73 |...s[.....V....s|
+000000c0 28 30 03 26 62 63 7e 8a d2 58 c8 e7 52 03 26 67 |(0.&bc~..X..R.&g|
+000000d0 48 21 4f 21 |H!O!|
>>> Flow 4 (server to client)
-00000000 14 03 00 00 01 01 16 03 00 00 40 96 af fb 79 96 |..........@...y.|
-00000010 92 97 2d d0 67 46 1e 08 b5 35 65 ef dc bc 8e 57 |..-.gF...5e....W|
-00000020 53 b7 36 58 74 d7 88 b1 55 fc eb fa 2e f3 17 b7 |S.6Xt...U.......|
-00000030 62 58 a0 9d 99 e1 85 d4 33 e0 b4 1f 1d 94 f2 88 |bX......3.......|
-00000040 d5 9a 34 5b 74 cd d2 ff 87 bd 52 17 03 00 00 20 |..4[t.....R.... |
-00000050 c6 61 c2 28 ac d2 0c 08 7f f1 c2 62 af 37 7e 78 |.a.(.......b.7~x|
-00000060 e8 e2 a1 54 f2 3a 80 97 f8 47 64 f2 cd 94 dd 0b |...T.:...Gd.....|
-00000070 17 03 00 00 30 b8 40 8f a3 18 ff 03 84 d4 1c 28 |....0.@........(|
-00000080 82 ce d8 9a 81 3a dd 23 7c 65 d8 ca f7 f1 46 1b |.....:.#|e....F.|
-00000090 70 f0 d7 d9 54 a7 71 e6 4d d4 25 61 5a e4 30 d3 |p...T.q.M.%aZ.0.|
-000000a0 4a 42 ae 26 a5 15 03 00 00 20 c4 e8 ed 40 57 00 |JB.&..... ...@W.|
-000000b0 dc a5 0e 82 90 47 92 08 dd 7e 50 6b 30 66 5e 90 |.....G...~Pk0f^.|
-000000c0 73 7c 81 93 8d 24 b1 06 e7 39 |s|...$...9|
+00000000 14 03 00 00 01 01 16 03 00 00 40 84 8f 6e 80 35 |..........@..n.5|
+00000010 57 73 64 ef 29 bb 25 ff 5d 9d c7 55 38 b7 18 b3 |Wsd.).%.]..U8...|
+00000020 13 d1 ac 20 e0 1e f8 48 47 7a 40 2d bc a7 f2 af |... ...HGz@-....|
+00000030 ed a6 26 48 f4 51 b4 b6 56 60 9b c3 d9 43 00 95 |..&H.Q..V`...C..|
+00000040 86 be 6c 4e 49 6b f9 10 99 51 22 17 03 00 00 20 |..lNIk...Q".... |
+00000050 d4 7e dc 50 7b c2 26 ee 79 09 84 9f d7 e0 52 b1 |.~.P{.&.y.....R.|
+00000060 e8 9c 92 30 b7 34 06 c6 e5 86 57 a1 fb 8d 06 d6 |...0.4....W.....|
+00000070 17 03 00 00 30 93 0a 3d 64 26 3d a2 74 bc 8f d1 |....0..=d&=.t...|
+00000080 16 38 d0 6b 62 eb 82 b0 9a 50 68 aa 7e f7 45 32 |.8.kb....Ph.~.E2|
+00000090 43 cb 84 2d 95 39 6c bc c8 a0 2d aa ea fe f5 84 |C..-.9l...-.....|
+000000a0 c8 e4 8b 93 a1 15 03 00 00 20 03 7b 3e 43 1d 0a |......... .{>C..|
+000000b0 9b 9b e3 17 0f de be 75 e5 6e 2f 5b e8 8d a8 68 |.......u.n/[...h|
+000000c0 4e f0 82 49 00 dd b6 95 b4 22 |N..I....."|
diff --git a/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-RC4 b/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-RC4
index 1314b659bf0..39124c67ef1 100644
--- a/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-RC4
+++ b/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-RC4
@@ -1,79 +1,74 @@
>>> Flow 1 (client to server)
-00000000 16 03 00 00 2f 01 00 00 2b 03 00 52 cc 57 59 79 |..../...+..R.WYy|
-00000010 b9 3b ef df 53 fb 09 f6 01 e5 18 0a fc 3d 65 bb |.;..S........=e.|
-00000020 cf 9c 4c 77 b1 e8 6b 4f 5f c7 94 00 00 04 00 05 |..Lw..kO_.......|
+00000000 16 03 00 00 2f 01 00 00 2b 03 00 a7 1d 3d ed 0f |..../...+....=..|
+00000010 2c 7b 1f f1 c8 1c a9 17 ce 69 e2 73 a2 07 d2 91 |,{.......i.s....|
+00000020 e9 27 fa 70 11 6f 18 6d 2a 25 f1 00 00 04 00 05 |.'.p.o.m*%......|
00000030 00 ff 01 00 |....|
>>> Flow 2 (server to client)
00000000 16 03 00 00 31 02 00 00 2d 03 00 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 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 00 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 00 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 00 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 00 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 00 00 84 10 00 00 80 4d 66 7a f3 f8 ab 86 |.........Mfz....|
-00000010 43 4c 5f 7c 52 ca e7 3f ba 62 b3 82 88 16 7d ca |CL_|R..?.b....}.|
-00000020 3a 66 15 c0 36 55 2c ab bf 30 6b cd 9c d8 b9 48 |:f..6U,..0k....H|
-00000030 03 c9 d0 98 ab 0b a6 5b 39 c8 fe 82 8e bb f0 16 |.......[9.......|
-00000040 6f 96 62 81 f2 dc 52 02 c9 de e4 47 73 21 6e 1e |o.b...R....Gs!n.|
-00000050 3a 11 89 7a e2 6b 9e 04 64 72 15 ba 2d 10 a2 69 |:..z.k..dr..-..i|
-00000060 07 e6 ba 17 cf 54 d6 4e 5f 99 e8 59 8b 54 ce 8e |.....T.N_..Y.T..|
-00000070 6b 58 ba 83 68 46 4a 5f 43 3e 9b e1 32 a2 19 42 |kX..hFJ_C>..2..B|
-00000080 46 0f e4 47 1a 3b 16 5f e1 14 03 00 00 01 01 16 |F..G.;._........|
-00000090 03 00 00 3c 78 7e ee da 0d 38 0b 1a d6 d4 8e d5 |...<x~...8......|
-000000a0 6a c5 3a 0f 85 e7 37 a6 3c 8d 1e 4b da 02 94 bf |j.:...7.<..K....|
-000000b0 ae 2c 50 3b 4e 1c 0c 3c 4f cc d5 1c da 33 13 43 |.,P;N..<O....3.C|
-000000c0 37 64 44 ac 26 43 28 0b d0 c2 04 09 b5 0f 23 1d |7dD.&C(.......#.|
+00000000 16 03 00 00 84 10 00 00 80 25 85 a3 22 29 e4 fb |.........%..")..|
+00000010 53 b9 a3 6b ed 70 2b 35 7f db 08 35 b8 4c 95 cd |S..k.p+5...5.L..|
+00000020 00 ec 5e a1 2e ba e9 ac a6 d4 ef ca 74 a0 12 1b |..^.........t...|
+00000030 a7 ec 76 22 2c 63 71 1a 3a 50 94 ce 96 c4 d7 76 |..v",cq.:P.....v|
+00000040 1f 47 58 c7 57 98 af ea 7e 57 05 68 d3 f9 87 02 |.GX.W...~W.h....|
+00000050 35 72 35 66 08 b4 cf 48 24 15 92 d5 ba 46 8d 60 |5r5f...H$....F.`|
+00000060 5a 53 0b e4 9b 53 44 55 dc 77 d1 e4 e0 25 51 f6 |ZS...SDU.w...%Q.|
+00000070 f1 7c 96 0b 32 d4 8c 04 d3 3d e6 70 c7 d6 60 a7 |.|..2....=.p..`.|
+00000080 ae 69 22 69 41 1a 8d 12 67 14 03 00 00 01 01 16 |.i"iA...g.......|
+00000090 03 00 00 3c 32 dd 86 fd 5b 53 74 ea 01 45 5b 9e |...<2...[St..E[.|
+000000a0 32 d0 9d 27 e8 ce 4c d5 a1 c2 d3 2e 0a e9 e5 d2 |2..'..L.........|
+000000b0 04 8c 77 a3 ff e9 8b 02 14 16 af 54 db ec c4 98 |..w........T....|
+000000c0 72 50 f7 65 fa eb ac 11 07 81 d7 fa 4e 18 34 bc |rP.e........N.4.|
>>> Flow 4 (server to client)
-00000000 14 03 00 00 01 01 16 03 00 00 3c 23 29 64 62 23 |..........<#)db#|
-00000010 19 20 f8 2e 15 07 ee c8 f4 ab f0 3e 66 c3 ed 7b |. .........>f..{|
-00000020 7c a7 c2 7e c3 25 3c 8f f3 04 dc 37 e8 fc 0a 1d ||..~.%<....7....|
-00000030 fa 7a 09 d4 21 11 e3 24 21 4b 37 d1 85 cc 40 bf |.z..!..$!K7...@.|
-00000040 bd bd f8 59 6b cd 73 17 03 00 00 21 47 1d ac 54 |...Yk.s....!G..T|
-00000050 bd 58 a6 c0 04 e2 0c 6b 66 64 5a 85 09 0e 47 fc |.X.....kfdZ...G.|
-00000060 0b 57 ee f1 24 b6 89 57 46 be 6b 0d f2 15 03 00 |.W..$..WF.k.....|
-00000070 00 16 b4 f7 34 99 19 43 b6 b3 5a 8b c3 d2 67 2f |....4..C..Z...g/|
-00000080 3b 19 1c 31 d4 f9 bd 96 |;..1....|
+00000000 14 03 00 00 01 01 16 03 00 00 3c 29 af 2c 96 3a |..........<).,.:|
+00000010 be a0 91 a8 e4 66 6b 30 ba e2 80 fc a2 8a 09 b4 |.....fk0........|
+00000020 28 14 3b 36 c2 3b 3e 88 e2 10 da 93 af 71 9a 06 |(.;6.;>......q..|
+00000030 1c 8d 97 04 05 ec e2 69 cf 28 20 0f ec 4c a7 f3 |.......i.( ..L..|
+00000040 18 4e 6b 5b 88 9c a9 17 03 00 00 21 5e 0b b4 2d |.Nk[.......!^..-|
+00000050 a6 b5 0b 3a 86 de 8a e7 87 f3 4c f6 74 7e 0d 16 |...:......L.t~..|
+00000060 9b fc 0c 42 6b f4 9e 15 8b 6a c5 97 88 15 03 00 |...Bk....j......|
+00000070 00 16 f0 a4 e2 16 bf 81 05 ad 1d f5 1c 89 d9 ab |................|
+00000080 48 23 ab 96 ea 92 aa cd |H#......|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES b/libgo/go/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES
index 9b8cb4d9b62..f81ffc28c0e 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES
@@ -1,12 +1,13 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 76 01 00 00 72 03 01 53 04 f0 f9 4b |....v...r..S...K|
-00000010 30 a8 68 d0 79 13 14 69 ee 3b 5d 05 cb 71 63 43 |0.h.y..i.;]..qcC|
-00000020 4a 55 6b 05 25 53 19 ba e0 2f b1 00 00 04 c0 0a |JUk.%S.../......|
-00000030 00 ff 01 00 00 45 00 0b 00 04 03 00 01 02 00 0a |.....E..........|
-00000040 00 34 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 |.4.2............|
-00000050 00 09 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 |................|
-00000060 00 15 00 04 00 05 00 12 00 13 00 01 00 02 00 03 |................|
-00000070 00 0f 00 10 00 11 00 0f 00 01 01 |...........|
+00000000 16 03 01 00 7d 01 00 00 79 03 01 65 14 3f 40 e4 |....}...y..e.?@.|
+00000010 2f 74 65 7e d0 c8 87 03 59 61 9d c3 84 5e c9 62 |/te~....Ya...^.b|
+00000020 e6 46 b8 0c 4a 5e 3f 33 43 a5 dd 00 00 04 c0 0a |.F..J^?3C.......|
+00000030 00 ff 02 01 00 00 4b 00 0b 00 04 03 00 01 02 00 |......K.........|
+00000040 0a 00 3a 00 38 00 0e 00 0d 00 19 00 1c 00 0b 00 |..:.8...........|
+00000050 0c 00 1b 00 18 00 09 00 0a 00 1a 00 16 00 17 00 |................|
+00000060 08 00 06 00 07 00 14 00 15 00 04 00 05 00 12 00 |................|
+00000070 13 00 01 00 02 00 03 00 0f 00 10 00 11 00 0f 00 |................|
+00000080 01 01 |..|
>>> Flow 2 (server to client)
00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
@@ -49,36 +50,36 @@
00000260 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >|
00000270 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l|
00000280 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.|
-00000290 41 03 56 6b dc 5a 89 00 8b 30 81 88 02 42 00 c6 |A.Vk.Z...0...B..|
-000002a0 85 8e 06 b7 04 04 e9 cd 9e 3e cb 66 23 95 b4 42 |.........>.f#..B|
-000002b0 9c 64 81 39 05 3f b5 21 f8 28 af 60 6b 4d 3d ba |.d.9.?.!.(.`kM=.|
-000002c0 a1 4b 5e 77 ef e7 59 28 fe 1d c1 27 a2 ff a8 de |.K^w..Y(...'....|
-000002d0 33 48 b3 c1 85 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 |3H...jB..~~1...f|
-000002e0 02 42 00 ad 7d 06 35 ab ec 8d ac d4 ba 1b 49 5e |.B..}.5.......I^|
-000002f0 05 5f f0 97 93 82 b8 2b 8d 91 98 63 8e b4 14 62 |._.....+...c...b|
-00000300 db 1e c9 2b 30 f8 41 9b a6 e6 bc de 0e 68 30 21 |...+0.A......h0!|
-00000310 d8 ef 2f 05 42 da f2 e0 2c 06 33 1d 0d 9a 1a 75 |../.B...,.3....u|
-00000320 59 a7 3a bc 16 03 01 00 04 0e 00 00 00 |Y.:..........|
+00000290 41 03 56 6b dc 5a 89 00 8b 30 81 88 02 42 01 3e |A.Vk.Z...0...B.>|
+000002a0 79 81 6e 89 cd 3e 3f ec e4 b5 75 17 28 ee fb 09 |y.n..>?...u.(...|
+000002b0 21 19 6f 3c e6 ca 1e f2 18 b6 47 f8 37 05 1c 85 |!.o<......G.7...|
+000002c0 0f a4 b8 6b 40 04 50 77 e3 05 9b 24 b8 93 e8 4d |...k@.Pw...$...M|
+000002d0 ef 30 cd 51 90 58 a2 49 71 b3 3f b9 46 ab a9 72 |.0.Q.X.Iq.?.F..r|
+000002e0 02 42 01 58 ef 20 c1 0a 33 f8 fd 50 9e 65 f5 ef |.B.X. ..3..P.e..|
+000002f0 f4 91 49 2d d2 de 66 2b 97 69 7d b1 d0 ef d6 91 |..I-..f+.i}.....|
+00000300 0f fc 57 2b 73 b9 49 01 33 d2 1b 5b 9a 2c 51 35 |..W+s.I.3..[.,Q5|
+00000310 0e eb 38 53 fa 20 07 84 52 b3 43 24 09 5a 32 c0 |..8S. ..R.C$.Z2.|
+00000320 32 17 34 6c 16 03 01 00 04 0e 00 00 00 |2.4l.........|
>>> Flow 3 (client to server)
-00000000 16 03 01 00 46 10 00 00 42 41 04 08 28 cf bd 3c |....F...BA..(..<|
-00000010 3c cc 98 9e 73 3f 92 a7 cb 22 83 3b c7 61 46 0e |<...s?...".;.aF.|
-00000020 4d 7c 30 b5 06 85 2f 01 be b5 40 e2 64 1e 45 c1 |M|0.../...@.d.E.|
-00000030 9d 73 95 d5 65 92 0b 9b e7 6f c6 91 ab b6 fa be |.s..e....o......|
-00000040 61 83 a7 f2 eb f5 65 31 fe 24 7b 14 03 01 00 01 |a.....e1.${.....|
-00000050 01 16 03 01 00 30 15 d1 c4 ca 0b 01 84 13 5a ba |.....0........Z.|
-00000060 89 04 87 73 7c bb d8 89 7e 10 27 ba 6f 5d dc d3 |...s|...~.'.o]..|
-00000070 b5 ef 32 86 58 cc fb eb 5c 32 9e 95 ef 01 1c ac |..2.X...\2......|
-00000080 dc 8e df 7f fe 0a |......|
+00000000 16 03 01 00 46 10 00 00 42 41 04 31 74 f8 f6 18 |....F...BA.1t...|
+00000010 55 6a 9b 3b 78 0a 0e f0 c9 91 aa 8e 77 39 0a 88 |Uj.;x.......w9..|
+00000020 a4 d4 f6 04 9d de 89 18 b6 50 12 72 26 9c 8f e1 |.........P.r&...|
+00000030 f0 b2 e6 df ce 3b 46 be e9 2a 9a e3 7f d1 d5 92 |.....;F..*......|
+00000040 ff e3 ae 0a 2d a1 3b 07 f6 04 59 14 03 01 00 01 |....-.;...Y.....|
+00000050 01 16 03 01 00 30 02 4f df 41 30 97 6f f7 18 ca |.....0.O.A0.o...|
+00000060 05 35 17 a1 a2 a5 71 61 b1 d8 dd 9a c6 f3 54 53 |.5....qa......TS|
+00000070 84 f6 fb 93 1e 0e 9d e7 fe 35 85 9e 73 d0 2e a1 |.........5..s...|
+00000080 a7 63 d9 40 c6 ac |.c.@..|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 e8 48 86 81 3c |..........0.H..<|
-00000010 f5 25 5c 94 a9 06 c4 5c 71 62 b1 43 76 ec 2c 44 |.%\....\qb.Cv.,D|
-00000020 95 b5 8c 95 d2 ff 82 92 b6 fc 52 75 03 c6 a1 f0 |..........Ru....|
-00000030 99 6d b1 ed ec 68 6c d7 9f 18 50 17 03 01 00 20 |.m...hl...P.... |
-00000040 32 d9 26 8a 81 b8 9d a5 7b fd d5 4e 7a db 2e 29 |2.&.....{..Nz..)|
-00000050 58 9a 4f 6a 27 18 bc dc c2 49 b8 65 cb 8e 16 5a |X.Oj'....I.e...Z|
-00000060 17 03 01 00 30 c4 56 0a ad 9a 82 cb 3e 32 f1 7c |....0.V.....>2.||
-00000070 95 6e dd cd e9 4d f0 e5 2d c9 a3 f7 de bb d7 fd |.n...M..-.......|
-00000080 84 bb df 34 8c 64 1f 03 58 64 19 4a 5b 7a a8 81 |...4.d..Xd.J[z..|
-00000090 52 bb 51 0a 43 15 03 01 00 20 89 18 7a 40 ec 49 |R.Q.C.... ..z@.I|
-000000a0 52 d5 d3 20 ac 07 eb e9 4a 78 23 cf e7 21 32 74 |R.. ....Jx#..!2t|
-000000b0 ec 40 8d a8 f4 33 1c ae 93 cf |.@...3....|
+00000000 14 03 01 00 01 01 16 03 01 00 30 07 7e 4e 9c 19 |..........0.~N..|
+00000010 f0 35 cd 02 b7 a6 0a 1a b1 a8 11 a3 f9 b1 35 7b |.5............5{|
+00000020 96 7f e6 e1 00 c6 6d 9e e6 8a bb a2 b8 bd a3 9d |......m.........|
+00000030 05 22 1b f1 f5 28 4a 00 6e f1 71 17 03 01 00 20 |."...(J.n.q.... |
+00000040 ad c7 4c dc f4 81 1a 39 3d 86 5e 8e f5 0d a3 33 |..L....9=.^....3|
+00000050 88 32 e7 be 8b 6a 8d 44 29 7b 47 fd e5 33 01 1e |.2...j.D){G..3..|
+00000060 17 03 01 00 30 61 47 ee ae 89 25 ac 85 3b 8a 84 |....0aG...%..;..|
+00000070 47 61 ea 3e 4c 70 57 07 d6 f1 1c 21 cb 44 7e de |Ga.>LpW....!.D~.|
+00000080 b5 01 9e fb fe ad bc be 74 c0 65 a0 6b c1 0c 8c |........t.e.k...|
+00000090 2b 00 24 c6 b7 15 03 01 00 20 b7 8b 6b e5 77 ab |+.$...... ..k.w.|
+000000a0 f6 50 9e 88 4d 56 a8 25 8d 02 db cb 68 8b 3f 62 |.P..MV.%....h.?b|
+000000b0 be aa 02 24 75 b1 e5 4b 18 c9 |...$u..K..|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-3DES b/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-3DES
index c0e6241c07e..55cb487d12a 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-3DES
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-3DES
@@ -1,79 +1,74 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 36 01 00 00 32 03 01 52 cc 57 59 13 |....6...2..R.WY.|
-00000010 8b e6 5b a3 1d cb 94 ef 48 e4 59 7e 20 6d 07 67 |..[.....H.Y~ m.g|
-00000020 1e 28 6d 31 a2 e7 96 b3 7d 32 cc 00 00 04 00 0a |.(m1....}2......|
+00000000 16 03 01 00 36 01 00 00 32 03 01 35 4a e8 32 84 |....6...2..5J.2.|
+00000010 51 68 04 7e d0 0f 43 94 c7 5d 44 d2 95 a3 12 63 |Qh.~..C..]D....c|
+00000020 77 c5 ce 78 5a 25 a3 81 df c4 6b 00 00 04 00 0a |w..xZ%....k.....|
00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........|
>>> Flow 2 (server to client)
00000000 16 03 01 00 31 02 00 00 2d 03 01 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 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 01 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 01 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 01 00 86 10 00 00 82 00 80 2e af d2 61 f6 |..............a.|
-00000010 e2 b8 24 da 28 17 55 99 fd 11 bd 7a ab 98 dd f2 |..$.(.U....z....|
-00000020 f6 5f e0 11 6b 12 61 6f 86 48 b2 6e db f0 dd d5 |._..k.ao.H.n....|
-00000030 07 88 e5 95 f4 2d 6b 0c d0 09 1a 5e 5f 50 1f dc |.....-k....^_P..|
-00000040 f2 e7 02 7d 5e a0 70 29 80 ef 87 aa cc 95 3f 2e |...}^.p)......?.|
-00000050 24 d1 40 b6 62 53 1d 25 31 87 1e 2f 77 d3 e1 1c |$.@.bS.%1../w...|
-00000060 c4 99 89 bc 99 09 e9 ad 1f ce 09 e6 36 1c 3e 97 |............6.>.|
-00000070 be 62 69 a0 4e 14 20 9c 82 2a 3e fc 7e 9b c4 7a |.bi.N. ..*>.~..z|
-00000080 5a f7 ad 1a 03 17 2a f8 7a 5f 44 14 03 01 00 01 |Z.....*.z_D.....|
-00000090 01 16 03 01 00 28 49 6b da 73 07 ad 85 9a 0e fb |.....(Ik.s......|
-000000a0 dd e0 69 ef c9 22 2d 86 91 51 26 63 d0 24 7d 16 |..i.."-..Q&c.$}.|
-000000b0 3c db 9b 00 c9 7e 64 e2 69 02 85 7d f7 47 |<....~d.i..}.G|
+00000000 16 03 01 00 86 10 00 00 82 00 80 1f 4d 12 64 f2 |............M.d.|
+00000010 72 22 86 4a 16 05 3f d2 1b e5 ed a7 f1 19 c4 6d |r".J..?........m|
+00000020 1d 3a 5c f6 46 8f b9 4d 9e c4 d4 19 95 0a 63 9f |.:\.F..M......c.|
+00000030 8a 41 1f fc d5 98 45 ca 69 33 37 64 d5 c8 0e 5a |.A....E.i37d...Z|
+00000040 12 9f 06 54 8a 61 8b 13 f0 d8 fb b9 97 fb cd 1d |...T.a..........|
+00000050 bd 6c 88 cc 98 57 c3 66 3a 86 04 c9 b9 21 c6 f2 |.l...W.f:....!..|
+00000060 f3 43 7d 4e bf 28 d5 a2 d7 39 e0 78 cb eb b4 af |.C}N.(...9.x....|
+00000070 21 0e ae 4c 16 9b b3 49 5f 81 02 55 59 97 d9 d2 |!..L...I_..UY...|
+00000080 c4 e2 4c be 0a a6 41 62 48 1d 66 14 03 01 00 01 |..L...AbH.f.....|
+00000090 01 16 03 01 00 28 9d e0 c3 31 82 c2 48 5d fb 47 |.....(...1..H].G|
+000000a0 85 60 d4 17 d2 4f 4d 3c 64 db e4 49 1f a9 66 93 |.`...OM<d..I..f.|
+000000b0 72 6c 32 06 a5 0c 1f db 64 6d 54 71 fd 30 |rl2.....dmTq.0|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 28 dc 60 83 43 6c |..........(.`.Cl|
-00000010 37 79 ab 6e 92 1f 66 d0 b1 12 ce c1 64 9d 2b 68 |7y.n..f.....d.+h|
-00000020 c7 1a e5 1f 8c 80 08 d2 86 3e a1 2c e3 7e f4 64 |.........>.,.~.d|
-00000030 e7 96 b2 17 03 01 00 18 8d b5 7c 03 78 cf dc 09 |..........|.x...|
-00000040 95 06 4b a6 82 f9 30 d2 6b 26 cb 0a 9a 9d 47 9f |..K...0.k&....G.|
-00000050 17 03 01 00 28 30 a9 55 dd b9 4d 6a 76 00 39 96 |....(0.U..Mjv.9.|
-00000060 a3 94 6a df e5 af 1e a2 eb bb e4 ac 95 2c f7 93 |..j..........,..|
-00000070 ef d1 b5 13 d8 e2 06 1a ad 5c 00 dd 0c 15 03 01 |.........\......|
-00000080 00 18 a5 62 e4 8b 51 1d 28 46 bc 8a c8 50 a3 32 |...b..Q.(F...P.2|
-00000090 6b 7b f1 b6 19 43 63 1f 7d 38 |k{...Cc.}8|
+00000000 14 03 01 00 01 01 16 03 01 00 28 94 66 8f ad 8f |..........(.f...|
+00000010 9f 00 72 f6 af 51 47 67 63 df 3f dd 17 09 0a c5 |..r..QGgc.?.....|
+00000020 bf f8 4d 66 39 f9 b5 47 01 f8 e8 6d ed b4 17 39 |..Mf9..G...m...9|
+00000030 ff 0a ca 17 03 01 00 18 68 93 94 51 12 b9 17 0b |........h..Q....|
+00000040 d1 a0 22 fc cc c4 76 1a 1e 02 c6 20 5e 74 83 4c |.."...v.... ^t.L|
+00000050 17 03 01 00 28 08 bd 86 07 84 90 78 bd 1d 90 ce |....(......x....|
+00000060 09 80 bb d8 de fd 39 82 4b c4 0d 06 f3 65 f5 5b |......9.K....e.[|
+00000070 3d c3 fd 69 80 1f 51 ce 1d 98 f1 05 fa 15 03 01 |=..i..Q.........|
+00000080 00 18 ed 48 04 21 85 77 d7 b6 29 e3 25 af ea ec |...H.!.w..).%...|
+00000090 3e 41 82 a0 ca 7d 44 79 8a 0b |>A...}Dy..|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-AES b/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-AES
index 1670997b0d0..46713022890 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-AES
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-AES
@@ -1,82 +1,77 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 36 01 00 00 32 03 01 52 cc 57 59 5d |....6...2..R.WY]|
-00000010 0d 77 24 3e b3 32 3d ba 0f b0 aa 1d e3 13 06 f6 |.w$>.2=.........|
-00000020 0f be 3c 92 ba 93 bd a6 6d 69 53 00 00 04 00 2f |..<.....miS..../|
+00000000 16 03 01 00 36 01 00 00 32 03 01 8c 5a 87 31 6a |....6...2...Z.1j|
+00000010 8c 7a d5 26 4b 94 17 27 fc a2 c0 5f b5 bc 3f 10 |.z.&K..'..._..?.|
+00000020 80 0e e0 1e 36 80 4b 91 61 77 d4 00 00 04 00 2f |....6.K.aw...../|
00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........|
>>> Flow 2 (server to client)
00000000 16 03 01 00 31 02 00 00 2d 03 01 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 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 01 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 01 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 01 00 86 10 00 00 82 00 80 20 e6 80 f7 48 |........... ...H|
-00000010 7e 7d 08 08 54 e1 b4 e3 98 27 5f 90 9d 3b e3 c2 |~}..T....'_..;..|
-00000020 c8 8b dc 9e ff 75 fa fc 60 e1 9e 67 7c c4 08 27 |.....u..`..g|..'|
-00000030 cc 6f 15 6c bc 7c 96 de 83 8f 98 6d 4a c7 b7 20 |.o.l.|.....mJ.. |
-00000040 8c 19 47 5a ff 76 92 0a df df 66 d2 b6 9d 2d 06 |..GZ.v....f...-.|
-00000050 fb ac 07 cf 38 08 f1 fd 0d fe 07 d7 69 3e 8a 79 |....8.......i>.y|
-00000060 dc 2d ab bb f7 18 3c 51 14 6e c6 70 95 a2 59 b1 |.-....<Q.n.p..Y.|
-00000070 39 04 9f ae f3 5f fb a7 2b d3 5a c0 96 d9 4d 2a |9...._..+.Z...M*|
-00000080 2a 6c 6d 39 ee fc ce 76 1a 92 1b 14 03 01 00 01 |*lm9...v........|
-00000090 01 16 03 01 00 30 10 20 90 7b 0e e6 c2 05 81 c3 |.....0. .{......|
-000000a0 bc da 84 67 dd 5f 97 e2 74 c4 35 4e bf d2 1b 90 |...g._..t.5N....|
-000000b0 2f e0 af dd 6b f5 52 db 36 cd 3e e1 e6 bd 99 30 |/...k.R.6.>....0|
-000000c0 ed c6 bc c2 38 b6 |....8.|
+00000000 16 03 01 00 86 10 00 00 82 00 80 31 f5 2e e4 c7 |...........1....|
+00000010 f5 76 d6 f7 2d 1b 8d 4d a9 2a 43 84 b2 0b 08 d6 |.v..-..M.*C.....|
+00000020 4d d9 9a eb 4b 01 49 6e 11 45 43 0d 31 a7 c3 66 |M...K.In.EC.1..f|
+00000030 da 1c 92 68 fb 3d 36 27 94 2f 67 ae 3d 31 a3 8f |...h.=6'./g.=1..|
+00000040 01 5a d9 17 92 bc 20 7c cb ae b4 ca 4c ce d4 a9 |.Z.... |....L...|
+00000050 2c 1d fe fc 3c a9 14 31 1d 65 08 d8 6e 8d ac 9d |,...<..1.e..n...|
+00000060 21 ee 63 4a e2 da 3c 0e b1 34 8f 6e 20 dd d4 d4 |!.cJ..<..4.n ...|
+00000070 d8 16 27 5d 02 54 e6 ec 5f 43 84 5b 21 24 ef 5d |..'].T.._C.[!$.]|
+00000080 45 c4 2b 2c 98 7d 50 dc 0b fc 76 14 03 01 00 01 |E.+,.}P...v.....|
+00000090 01 16 03 01 00 30 ef 50 ea 3c e3 b7 a8 5b 9a d2 |.....0.P.<...[..|
+000000a0 11 69 0f d0 5e 79 c8 cb 68 4a ac 16 ef b4 de 1f |.i..^y..hJ......|
+000000b0 21 0b 8e 91 cb 70 3f 02 bd 45 c1 34 02 e0 66 8a |!....p?..E.4..f.|
+000000c0 00 ea 6c 5a 96 41 |..lZ.A|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 30 5d 0c a2 18 13 |..........0]....|
-00000010 40 a1 84 ce c5 d8 4e fc a4 8a 14 b5 94 18 b1 86 |@.....N.........|
-00000020 da 6a 7d 26 08 d6 a0 f8 78 5b 42 7e f8 83 54 56 |.j}&....x[B~..TV|
-00000030 36 a4 91 37 67 5a d7 68 37 c4 4f 17 03 01 00 20 |6..7gZ.h7.O.... |
-00000040 fd aa 5e cf 4b 12 c5 be a4 a2 65 5d 6e 65 46 5f |..^.K.....e]neF_|
-00000050 d2 fe 46 e7 77 2d 9c 1e 0b 39 40 48 c2 2f be 21 |..F.w-...9@H./.!|
-00000060 17 03 01 00 30 03 af 9e 6b d6 76 ed 9e 1d 8b 8b |....0...k.v.....|
-00000070 2e 2a 5d da c4 73 95 ac 0e 6f 69 cb 63 df 50 27 |.*]..s...oi.c.P'|
-00000080 30 de 2e 55 86 85 ad 3e 33 22 49 72 f2 e2 9f 8f |0..U...>3"Ir....|
-00000090 ba cf 4e 30 34 15 03 01 00 20 4c 4c 97 61 70 ea |..N04.... LL.ap.|
-000000a0 ae fc a2 e9 c6 c2 b6 2e 4d 85 f6 ae 2b 56 46 82 |........M...+VF.|
-000000b0 9d d8 a5 82 17 fa 3e 62 67 7e |......>bg~|
+00000000 14 03 01 00 01 01 16 03 01 00 30 99 2c 65 32 5f |..........0.,e2_|
+00000010 53 37 d8 c2 98 87 f4 68 b6 d7 52 6a 14 c7 df 6e |S7.....h..Rj...n|
+00000020 bb ce ae 31 d4 04 24 4d e9 c2 39 7b 68 a7 fa 90 |...1..$M..9{h...|
+00000030 c1 30 14 a2 20 c0 8d e1 2a dc 22 17 03 01 00 20 |.0.. ...*.".... |
+00000040 41 c5 03 05 20 53 e9 fa 0a 26 38 ab 84 6a 5e 36 |A... S...&8..j^6|
+00000050 1b 03 80 2f c3 5c 0b 2c bd 7f 79 68 bb ab 4d 70 |.../.\.,..yh..Mp|
+00000060 17 03 01 00 30 a1 04 3e f4 a2 54 7a e7 09 0f 20 |....0..>..Tz... |
+00000070 38 f8 9e bb 1b 61 28 bf 46 e8 75 56 b4 c3 93 b9 |8....a(.F.uV....|
+00000080 8c 18 3e 8e af 9f 59 1a 96 be db 61 80 56 c6 09 |..>...Y....a.V..|
+00000090 3c 21 02 37 d2 15 03 01 00 20 13 d1 81 7d ca 04 |<!.7..... ...}..|
+000000a0 2b c3 fc fa 06 5b b4 98 59 27 0d 07 2a 39 3c 6f |+....[..Y'..*9<o|
+000000b0 8d 64 83 17 0f ba ec 22 21 36 |.d....."!6|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-RC4 b/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-RC4
index d653561f9d4..b5cb479c283 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-RC4
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-RC4
@@ -1,76 +1,71 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 36 01 00 00 32 03 01 52 cc 57 59 cf |....6...2..R.WY.|
-00000010 00 a1 49 a4 37 69 74 d8 a7 93 ea 8d e7 50 b7 b3 |..I.7it......P..|
-00000020 8c ec e5 56 fb dc 5f 1a 2e ab 18 00 00 04 00 05 |...V.._.........|
+00000000 16 03 01 00 36 01 00 00 32 03 01 c5 fc 32 c0 09 |....6...2....2..|
+00000010 47 0b a9 f3 72 c9 6c 3a e0 94 33 48 35 ac b9 3b |G...r.l:..3H5..;|
+00000020 da 5f 8b 6e 0c 54 c3 16 f0 39 bd 00 00 04 00 05 |._.n.T...9......|
00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........|
>>> Flow 2 (server to client)
00000000 16 03 01 00 31 02 00 00 2d 03 01 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 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 01 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 01 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 01 00 86 10 00 00 82 00 80 b1 96 7b 6f f5 |.............{o.|
-00000010 a0 cb 0d 60 9b 64 d3 f5 17 76 47 7b bc a5 0e 96 |...`.d...vG{....|
-00000020 53 af 68 0c 96 22 f7 28 0c 24 37 9c 51 69 ed b2 |S.h..".(.$7.Qi..|
-00000030 47 14 ba 33 c5 79 6b 96 f2 ab 3c 02 5c 37 a4 97 |G..3.yk...<.\7..|
-00000040 23 fc 7f d3 95 2d 85 99 1a 10 1b 38 e5 f1 83 55 |#....-.....8...U|
-00000050 4a ab 60 f8 89 0a 6a c4 eb 45 f5 b0 f4 f8 09 31 |J.`...j..E.....1|
-00000060 6e f0 25 30 fd 5e 68 61 bc cb 0d 9e 05 73 0a f4 |n.%0.^ha.....s..|
-00000070 a5 2e d9 d5 4e 08 f6 3b 8d 2d 21 f5 79 b6 97 55 |....N..;.-!.y..U|
-00000080 b9 99 03 49 ea 96 36 49 21 56 bf 14 03 01 00 01 |...I..6I!V......|
-00000090 01 16 03 01 00 24 f0 4f 30 06 c3 25 01 93 34 ab |.....$.O0..%..4.|
-000000a0 93 8f 59 26 83 6e 8a fd 5a a6 cf af ad b1 a2 83 |..Y&.n..Z.......|
-000000b0 28 ff c2 66 5f ac e5 a5 a5 03 |(..f_.....|
+00000000 16 03 01 00 86 10 00 00 82 00 80 6a ad 7f e3 26 |...........j...&|
+00000010 71 da 48 af 11 63 de 2e e8 50 f9 6a be 04 3d 17 |q.H..c...P.j..=.|
+00000020 d1 29 fe 2c 7f b6 26 c1 7e 0b 18 1c 41 62 5c 91 |.).,..&.~...Ab\.|
+00000030 ee 26 9c 92 f5 d1 e9 29 e1 ca a7 01 6a 41 b9 00 |.&.....)....jA..|
+00000040 34 1d 5b c6 28 0e 1a 8f 32 c5 03 e7 a1 8f 89 1b |4.[.(...2.......|
+00000050 af 13 22 2b 5b e8 76 2d 00 ac da 27 75 95 75 e7 |.."+[.v-...'u.u.|
+00000060 00 00 39 2c bf f2 01 57 e6 29 e3 26 b1 6b ae c5 |..9,...W.).&.k..|
+00000070 8d ce d2 36 b2 94 1f 9c 30 5e b2 16 3d 20 cf 4d |...6....0^..= .M|
+00000080 88 f5 ac 4c 27 e3 f5 86 ef 9e dc 14 03 01 00 01 |...L'...........|
+00000090 01 16 03 01 00 24 48 d8 80 c4 37 22 31 99 53 30 |.....$H...7"1.S0|
+000000a0 5b 00 07 7e 87 2e 59 9a d9 0c 42 9e dd ed da 89 |[..~..Y...B.....|
+000000b0 1a 1f cb ab 55 0c ba d9 a9 c0 |....U.....|
>>> Flow 4 (server to client)
-00000000 14 03 01 00 01 01 16 03 01 00 24 9d b4 ea d8 be |..........$.....|
-00000010 b5 9f 00 fd b5 99 04 12 6b 7a 3f b8 52 d7 52 a9 |........kz?.R.R.|
-00000020 e9 bd 5b 63 ad b0 53 ac 46 80 be 48 6e dd ee 17 |..[c..S.F..Hn...|
-00000030 03 01 00 21 07 ac c4 fb 21 e4 b8 6b 64 3b b5 27 |...!....!..kd;.'|
-00000040 29 67 a1 10 2e d2 71 d5 59 5e fc 1d 84 31 15 6e |)g....q.Y^...1.n|
-00000050 4d 4b dc a9 3a 15 03 01 00 16 25 22 a5 78 23 5a |MK..:.....%".x#Z|
-00000060 69 6f 99 a1 b3 1c 8d bf f3 bd 1b c8 1c 57 15 75 |io...........W.u|
+00000000 14 03 01 00 01 01 16 03 01 00 24 ae 00 c8 14 67 |..........$....g|
+00000010 4b b5 21 96 98 91 d6 27 40 9b 5e a5 86 53 56 f3 |K.!....'@.^..SV.|
+00000020 f6 dc 7e b2 49 78 4b 4d 57 7c 62 a5 f2 16 8f 17 |..~.IxKMW|b.....|
+00000030 03 01 00 21 34 e3 48 58 1c 67 fb 3a 46 28 5d a1 |...!4.HX.g.:F(].|
+00000040 19 66 58 b1 bb fb e7 17 71 07 3f 0a d0 7c c9 24 |.fX.....q.?..|.$|
+00000050 c7 ef 41 af 62 15 03 01 00 16 dd dc 16 dc 16 cc |..A.b...........|
+00000060 0d f3 2c 29 00 c0 4f 01 68 05 92 a0 f7 ad e2 63 |..,)..O.h......c|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv11-RSA-RC4 b/libgo/go/crypto/tls/testdata/Server-TLSv11-RSA-RC4
index 9237db07863..dc5e765e543 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv11-RSA-RC4
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv11-RSA-RC4
@@ -1,76 +1,71 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 36 01 00 00 32 03 02 52 cc 57 59 bd |....6...2..R.WY.|
-00000010 cd 9d 1e 17 38 43 a5 e3 e7 30 e4 2b 2a ef f7 5b |....8C...0.+*..[|
-00000020 81 91 0c 0b 52 f8 2d 2c 61 d3 13 00 00 04 00 05 |....R.-,a.......|
+00000000 16 03 01 00 36 01 00 00 32 03 02 ff e1 a1 04 0b |....6...2.......|
+00000010 c2 dc fb 7d 07 61 44 9b 00 67 fe 38 73 f5 fc 4e |...}.aD..g.8s..N|
+00000020 35 94 0a d5 c1 d0 e7 54 dc 44 1f 00 00 04 00 05 |5......T.D......|
00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........|
>>> Flow 2 (server to client)
00000000 16 03 02 00 31 02 00 00 2d 03 02 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 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 02 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 02 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 02 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 02 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 02 00 86 10 00 00 82 00 80 71 2b 19 25 86 |...........q+.%.|
-00000010 a0 ff ba d5 1c a6 0c 8b 6b 0a b8 e9 42 93 2f 55 |........k...B./U|
-00000020 a8 ee 62 fa ed bc 6d e2 9d e3 76 a6 73 d7 99 58 |..b...m...v.s..X|
-00000030 cc 0b 14 42 96 7c b6 c7 8f 21 16 cf 71 9b 2b b9 |...B.|...!..q.+.|
-00000040 e0 34 57 76 22 d5 87 8a ce 1f ea 26 6e 1e e6 ca |.4Wv"......&n...|
-00000050 55 3b 20 cd cf 42 26 b1 51 3e 8c 1d a2 ae c4 63 |U; ..B&.Q>.....c|
-00000060 f5 ce 27 3c 1e c3 e0 e3 b1 16 c1 8a 62 bd 21 7f |..'<........b.!.|
-00000070 38 b5 b7 3a 3c bb 03 37 e1 a5 ff f1 29 e2 21 0a |8..:<..7....).!.|
-00000080 8c 20 02 e0 c0 82 97 9d 18 6d f8 14 03 02 00 01 |. .......m......|
-00000090 01 16 03 02 00 24 bc 19 16 6e fd 0b db 9e d5 1d |.....$...n......|
-000000a0 65 b6 57 1c 58 b5 6a ac f7 4f f0 cd a1 a9 0c c0 |e.W.X.j..O......|
-000000b0 df e6 eb d5 00 f7 fd 43 bb 27 |.......C.'|
+00000000 16 03 02 00 86 10 00 00 82 00 80 4c e0 4d 6a 19 |...........L.Mj.|
+00000010 a2 72 2a 3d 41 14 a7 b3 0a 25 11 bf c9 9f cf 8c |.r*=A....%......|
+00000020 3c 0b 01 49 aa f1 59 4b 60 ac e5 72 9b ec 20 41 |<..I..YK`..r.. A|
+00000030 2f 7e ef bf e0 fe 13 c0 1d fd 51 c5 08 c6 9a 9e |/~........Q.....|
+00000040 74 88 c7 e3 36 99 73 fd 00 2d a2 6a bd 25 f2 d7 |t...6.s..-.j.%..|
+00000050 24 fd fd ab 0c e0 18 38 ba 7b f0 c9 c0 58 a6 d0 |$......8.{...X..|
+00000060 4e e2 59 70 aa f4 52 34 12 a0 ec a4 53 1e 8b ee |N.Yp..R4....S...|
+00000070 3e bf a4 87 da 02 4c 95 bd 10 af e8 88 c9 ce 87 |>.....L.........|
+00000080 3c 9e 91 70 91 a0 85 18 84 e4 e0 14 03 02 00 01 |<..p............|
+00000090 01 16 03 02 00 24 c5 c0 27 71 49 ad ed 37 e6 5d |.....$..'qI..7.]|
+000000a0 1b 78 3e 74 15 b7 61 e5 f3 af 1e d0 a2 85 b3 13 |.x>t..a.........|
+000000b0 6e 5e 9a c7 3d 47 32 4d 1b 8d |n^..=G2M..|
>>> Flow 4 (server to client)
-00000000 14 03 02 00 01 01 16 03 02 00 24 cf 4f e4 27 b0 |..........$.O.'.|
-00000010 3d 17 34 b1 3c 37 6e c5 2b 3d 4a c3 46 50 44 b4 |=.4.<7n.+=J.FPD.|
-00000020 de 77 18 10 4f 60 b3 4e dc 06 fd 25 ec 05 15 17 |.w..O`.N...%....|
-00000030 03 02 00 21 a5 c9 32 f2 21 fb 94 7e 0d 15 65 fd |...!..2.!..~..e.|
-00000040 3e fe e4 c1 a5 e9 88 72 b2 f1 26 39 a6 48 59 97 |>......r..&9.HY.|
-00000050 65 e3 f0 cb 46 15 03 02 00 16 4b 02 ec cd ca 30 |e...F.....K....0|
-00000060 42 cf 3d a0 4a fa 8e 79 bb ed b0 59 40 9b 2c 1a |B.=.J..y...Y@.,.|
+00000000 14 03 02 00 01 01 16 03 02 00 24 31 22 76 4d 43 |..........$1"vMC|
+00000010 7a 8a 58 2c 7d 1c 41 39 bf 08 7e 82 17 55 52 b3 |z.X,}.A9..~..UR.|
+00000020 81 bd 7a f8 3c bf 9c 2b f0 9b 3f 65 f5 42 15 17 |..z.<..+..?e.B..|
+00000030 03 02 00 21 b1 cc e5 56 16 70 58 0b 91 3c 8c 46 |...!...V.pX..<.F|
+00000040 0e 3b b6 fe 32 5d 2e b0 8c 6a 1c a0 82 c9 43 81 |.;..2]...j....C.|
+00000050 cf 07 25 47 c9 15 03 02 00 16 53 91 04 70 ba 03 |..%G......S..p..|
+00000060 53 69 57 86 3b 2f 8b 97 37 7c b8 85 46 b6 72 42 |SiW.;/..7|..F.rB|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN b/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN
index 106244d5a22..cbfeb42eb06 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN
@@ -1,122 +1,109 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 01 8a 01 00 01 86 03 03 34 54 69 f3 d7 |...........4Ti..|
-00000010 20 9d 1d 74 db 72 e9 2f 51 7c c2 82 0a 9b cb 6d | ..t.r./Q|.....m|
-00000020 90 b4 8e a2 1f 2f c7 66 74 8f 33 00 00 d6 c0 30 |...../.ft.3....0|
-00000030 c0 2c c0 28 c0 24 c0 14 c0 0a c0 22 c0 21 c0 20 |.,.(.$.....".!. |
-00000040 00 a5 00 a3 00 a1 00 9f 00 6b 00 6a 00 69 00 68 |.........k.j.i.h|
-00000050 00 39 00 38 00 37 00 36 00 88 00 87 00 86 00 85 |.9.8.7.6........|
-00000060 c0 32 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d |.2...*.&.......=|
-00000070 00 35 00 84 c0 2f c0 2b c0 27 c0 23 c0 13 c0 09 |.5.../.+.'.#....|
-00000080 c0 1f c0 1e c0 1d 00 a4 00 a2 00 a0 00 9e 00 67 |...............g|
-00000090 00 40 00 3f 00 3e 00 33 00 32 00 31 00 30 00 9a |.@.?.>.3.2.1.0..|
-000000a0 00 99 00 98 00 97 00 45 00 44 00 43 00 42 c0 31 |.......E.D.C.B.1|
-000000b0 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c 00 3c 00 2f |.-.).%.......<./|
-000000c0 00 96 00 41 00 07 c0 11 c0 07 c0 0c c0 02 00 05 |...A............|
-000000d0 00 04 c0 12 c0 08 c0 1c c0 1b c0 1a 00 16 00 13 |................|
-000000e0 00 10 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f |................|
-000000f0 00 0c 00 09 00 14 00 11 00 0e 00 0b 00 08 00 06 |................|
-00000100 00 03 00 ff 01 00 00 87 00 0b 00 04 03 00 01 02 |................|
-00000110 00 0a 00 3a 00 38 00 0e 00 0d 00 19 00 1c 00 0b |...:.8..........|
-00000120 00 0c 00 1b 00 18 00 09 00 0a 00 1a 00 16 00 17 |................|
-00000130 00 08 00 06 00 07 00 14 00 15 00 04 00 05 00 12 |................|
-00000140 00 13 00 01 00 02 00 03 00 0f 00 10 00 11 00 23 |...............#|
-00000150 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 |..... ..........|
-00000160 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-00000170 02 01 02 02 02 03 00 0f 00 01 01 00 10 00 10 00 |................|
-00000180 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 6f 31 |..proto2.proto1|
+00000000 16 03 01 01 4c 01 00 01 48 03 03 44 3b 24 ee 2f |....L...H..D;$./|
+00000010 63 3d ca bd 3e c5 bf a2 24 f1 59 c3 54 dc f0 43 |c=..>...$.Y.T..C|
+00000020 15 c4 51 f2 29 ea 1b ce 2c fe af 00 00 b6 c0 30 |..Q.)...,......0|
+00000030 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 |.,.(.$..........|
+00000040 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 |...k.j.i.h.9.8.7|
+00000050 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a |.6.........2...*|
+00000060 c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f |.&.......=.5.../|
+00000070 c0 2b c0 27 c0 23 c0 13 c0 09 00 a4 00 a2 00 a0 |.+.'.#..........|
+00000080 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 |...g.@.?.>.3.2.1|
+00000090 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 |.0.........E.D.C|
+000000a0 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c |.B.1.-.).%......|
+000000b0 00 3c 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c |.<./...A........|
+000000c0 c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 |................|
+000000d0 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f 00 0c |................|
+000000e0 00 09 00 ff 01 00 00 69 00 0b 00 04 03 00 01 02 |.......i........|
+000000f0 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 |................|
+00000100 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a |................|
+00000110 00 23 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 |.#..... ........|
+00000120 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 |................|
+00000130 03 03 02 01 02 02 02 03 00 0f 00 01 01 00 10 00 |................|
+00000140 10 00 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 6f |....proto2.proto|
+00000150 31 |1|
>>> Flow 2 (server to client)
00000000 16 03 03 00 42 02 00 00 3e 03 03 00 00 00 00 00 |....B...>.......|
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 00 c0 14 00 00 |................|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 30 00 00 |.............0..|
00000030 16 00 23 00 00 ff 01 00 01 00 00 10 00 09 00 07 |..#.............|
-00000040 06 70 72 6f 74 6f 31 16 03 03 02 be 0b 00 02 ba |.proto1.........|
-00000050 00 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 |......0...0.....|
-00000060 02 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d |..............0.|
-00000070 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 |..*.H........0E1|
-00000080 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.|
-00000090 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat|
-000000a0 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte|
-000000b0 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty|
-000000c0 20 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 | Ltd0...10042409|
-000000d0 30 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 |0938Z..110424090|
-000000e0 39 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 |938Z0E1.0...U...|
-000000f0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So|
-00000100 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.|
-00000110 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg|
-00000120 69 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d |its Pty Ltd0..0.|
-00000130 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d |..*.H...........|
-00000140 00 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf |.0.......y......|
-00000150 46 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a |F...i..+.CZ..-.z|
-00000160 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 |C...R..eL,x.#...|
-00000170 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c |.....;~b.,.3...\|
-00000180 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 |zV.....X{&?.....|
-00000190 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 |.!.J..T.Z..Bq...|
-000001a0 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 |...~.}}..9....Q.|
-000001b0 7c e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d ||..L;2f......q..|
-000001c0 db db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 |...k..-y........|
-000001d0 30 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad |0..0...U........|
-000001e0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-000001f0 88 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 |.90u..U.#.n0l...|
-00000200 ad e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e |...Z..(.i.#i..&.|
-00000210 18 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 |..9.I.G0E1.0...U|
-00000220 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 |....AU1.0...U...|
-00000230 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 |.Some-State1!0..|
-00000240 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 |.U....Internet W|
-00000250 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 |idgits Pty Ltd..|
-00000260 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 |.........0...U..|
-00000270 04 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 |..0....0...*.H..|
-00000280 0d 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b |...........lE$.k|
-00000290 b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 |.Y..R.......zdu.|
-000002a0 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e |Z.f..+...f..O8.n|
-000002b0 60 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 |`....A..%...z$.0|
-000002c0 1d ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 |.........1Y....x|
-000002d0 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 |.PV\..Z-Z_3....u|
-000002e0 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c |....R...... _...|
-000002f0 a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b |.......W.p.&mq..|
-00000300 26 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 cd 0c |&n8P)l..........|
-00000310 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 |......A...7...Q.|
-00000320 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 |5uq..T[....g..$ |
-00000330 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f |>.V...(^.+-O....|
-00000340 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 |lK[.V.2B.X..I..h|
-00000350 1a 41 03 56 6b dc 5a 89 04 01 00 80 2d a0 6e 47 |.A.Vk.Z.....-.nG|
-00000360 93 a2 19 17 32 f5 42 58 93 f6 4f d4 e9 4d a4 0f |....2.BX..O..M..|
-00000370 fe 4e d7 2c 62 b6 fb 83 37 a3 09 60 4b 69 e2 4c |.N.,b...7..`Ki.L|
-00000380 fc b8 4c d1 a6 9a 89 a0 c5 76 f5 62 b7 e8 eb c2 |..L......v.b....|
-00000390 fa 0f 0e 61 86 bc 70 da 13 72 8d 87 94 16 9a 8d |...a..p..r......|
-000003a0 5f 80 82 92 77 37 4f 9e 55 5d dc 35 42 a3 75 5c |_...w7O.U].5B.u\|
-000003b0 ec a4 58 78 66 97 97 da 49 67 2e b6 7e 11 de fb |..Xxf...Ig..~...|
-000003c0 e3 8f e8 bf 1d 91 1e 91 20 1b 2a df c6 58 e4 82 |........ .*..X..|
-000003d0 ce 37 dd 6f a5 ac 51 3d 65 db 3f f5 16 03 03 00 |.7.o..Q=e.?.....|
-000003e0 04 0e 00 00 00 |.....|
+00000040 06 70 72 6f 74 6f 31 16 03 03 02 71 0b 00 02 6d |.proto1....q...m|
+00000050 00 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 |..j..g0..c0.....|
+00000060 02 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d |.......s......0.|
+00000070 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 |..*.H........0+1|
+00000080 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 |.0...U....Google|
+00000090 20 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 | TESTING1.0...U.|
+000000a0 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 |...Go Root0...15|
+000000b0 30 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 |0101000000Z..250|
+000000c0 31 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 |101000000Z0&1.0.|
+000000d0 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 |..U....Google TE|
+000000e0 53 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 |STING1.0...U....|
+000000f0 47 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |Go0..0...*.H....|
+00000100 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af |........0.......|
+00000110 87 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 |... ..el..D..;E.|
+00000120 e3 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a |..m..cM...jb5..J|
+00000130 f9 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 |..|..%^zd1f.....|
+00000140 af c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 |..k.v.._A.nV....|
+00000150 c1 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da |.<.9!f=+........|
+00000160 b7 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 |.......!P.....k.|
+00000170 4b 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 |K......l..D..!..|
+00000180 7d 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 |}..M........G...|
+00000190 03 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d |.......0..0...U.|
+000001a0 0f 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d |..........0...U.|
+000001b0 25 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 |%..0...+........|
+000001c0 08 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 |.+.......0...U..|
+000001d0 01 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 |.....0.0...U....|
+000001e0 04 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e |...P..o...TMn.i^|
+000001f0 06 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf |..0...U.#..0....|
+00000200 3d b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 |=..f..@....xH.A0|
+00000210 19 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d |...U....0...exam|
+00000220 70 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 |ple.golang0...*.|
+00000230 48 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af |H.............|.|
+00000240 91 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 |.U...Y1.H@.-....|
+00000250 a0 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 |....|..0}<.v.O=.|
+00000260 fa ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc |..-3$k.{.gY.!...|
+00000270 77 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 |w...n.-.5.d_">c.|
+00000280 6b be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 |k....m...1..8.;.|
+00000290 87 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 |.,...Qv..O......|
+000002a0 40 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 |@.Q......F.F.O..|
+000002b0 f9 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 |...A4......9....|
+000002c0 00 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d |.........A...7..|
+000002d0 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
+000002e0 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
+000002f0 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
+00000300 a6 b5 68 1a 41 03 56 6b dc 5a 89 05 01 00 80 40 |..h.A.Vk.Z.....@|
+00000310 93 b2 1f 79 3d 56 c0 ae 94 87 c0 a7 28 ef 1d 15 |...y=V......(...|
+00000320 be 4b fb 66 e0 60 2c a3 57 ee 56 7d d6 89 b8 8e |.K.f.`,.W.V}....|
+00000330 8f 0f 3f 1b c6 9f a4 1d 34 60 b6 9c e9 9b a9 27 |..?.....4`.....'|
+00000340 d0 45 7b 04 71 2d db 9c 67 1b d5 d4 fe 19 69 59 |.E{.q-..g.....iY|
+00000350 71 8a 35 75 33 a8 c9 f2 4d c4 8f 40 17 a7 25 53 |q.5u3...M..@..%S|
+00000360 57 c5 cd ee df a9 3b a3 61 ab e2 a2 ca de 5c 08 |W.....;.a.....\.|
+00000370 3d 5b a2 ef cd c8 bc 16 1f 1d 0f 83 9e b7 20 f5 |=[............ .|
+00000380 89 3f 09 ba 2e da 12 34 81 e5 2f 8d 3c 90 89 16 |.?.....4../.<...|
+00000390 03 03 00 04 0e 00 00 00 |........|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 f3 fc ea d8 50 |....F...BA.....P|
-00000010 e6 15 b0 e7 11 c7 6d ee 09 ad 80 d5 54 eb 4f 62 |......m.....T.Ob|
-00000020 7d bb a7 2d 28 0c 66 33 42 09 cf 2b 58 f8 58 41 |}..-(.f3B..+X.XA|
-00000030 bd 46 51 0a f0 7d 8c 0c 98 9e 26 77 20 fd 5e c1 |.FQ..}....&w .^.|
-00000040 a9 b3 e5 c3 6c 05 97 e3 81 fd db 14 03 03 00 01 |....l...........|
-00000050 01 16 03 03 00 40 02 2a 28 41 e3 9c 5d 45 d4 45 |.....@.*(A..]E.E|
-00000060 51 8c 7a c0 ba b1 8e a4 84 2c f3 83 cd c4 55 5c |Q.z......,....U\|
-00000070 d6 5c 6f 72 ab 89 7a c6 d7 9c 2a 54 f0 c4 20 ee |.\or..z...*T.. .|
-00000080 37 74 9b b6 8c f7 e4 37 2c eb d4 9f 5c 5e 55 a0 |7t.....7,...\^U.|
-00000090 e2 5a fe 1e c8 67 |.Z...g|
+00000000 16 03 03 00 46 10 00 00 42 41 04 8b a2 de a6 1e |....F...BA......|
+00000010 d9 22 3c 03 4a be 49 2f 40 e3 1e e0 b4 76 7f 78 |."<.J.I/@....v.x|
+00000020 96 22 8d 8d c9 45 3b d8 7a ce e3 16 3d 37 ec 80 |."...E;.z...=7..|
+00000030 aa 3f d5 19 de c1 2c 7b 7f eb 3c fc 5d c3 52 3b |.?....,{..<.].R;|
+00000040 d4 22 25 1c c7 1f 39 c5 23 bd 73 14 03 03 00 01 |."%...9.#.s.....|
+00000050 01 16 03 03 00 28 c8 53 0a ad c2 f6 7e 18 08 a3 |.....(.S....~...|
+00000060 29 27 20 1c 6c 1d 6c d8 8f 05 31 de e6 ab 7f 22 |)' .l.l...1...."|
+00000070 93 6a fb ef b0 f8 43 a9 d3 4f 9d 04 b5 9a |.j....C..O....|
>>> Flow 4 (server to client)
-00000000 16 03 03 00 72 04 00 00 6e 00 00 00 00 00 68 00 |....r...n.....h.|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 |...............e|
-00000020 ea 8b c0 ef ba 59 31 75 33 96 f1 f8 c9 e1 ef 30 |.....Y1u3......0|
-00000030 00 a3 a9 1d ab c8 4b 29 94 f2 c8 c8 8d 03 57 ab |......K)......W.|
-00000040 56 df 0f 4e 0d 30 13 09 c9 e4 fa 51 4e b3 26 ad |V..N.0.....QN.&.|
-00000050 43 9f ae 62 d5 59 23 05 9b 69 8f 5b a8 ba 39 f1 |C..b.Y#..i.[..9.|
-00000060 90 84 35 bf 8f 8d d5 39 93 98 ee b9 75 03 3f 91 |..5....9....u.?.|
-00000070 e8 56 0b cb 44 a6 7a 14 03 03 00 01 01 16 03 03 |.V..D.z.........|
-00000080 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
-00000090 00 00 f9 a0 8e 23 34 f1 61 15 a8 4e ae c4 f3 2a |.....#4.a..N...*|
-000000a0 a6 f8 ee 1b 65 c4 c0 ff 93 14 74 ed 82 ae 48 a8 |....e.....t...H.|
-000000b0 42 fb a9 24 5d dd fd 98 b8 65 73 03 88 99 e1 ed |B..$]....es.....|
-000000c0 02 95 17 03 03 00 40 00 00 00 00 00 00 00 00 00 |......@.........|
-000000d0 00 00 00 00 00 00 00 b9 b3 f5 41 84 3b 2a a9 c3 |..........A.;*..|
-000000e0 9c e3 d4 38 90 76 c1 8c f0 4f 10 1b 04 b5 07 fe |...8.v...O......|
-000000f0 79 3d 7b 77 a4 17 0f 4e df 64 70 70 9e 34 8e b6 |y={w...N.dpp.4..|
-00000100 db b2 b6 fd 41 fe b3 15 03 03 00 30 00 00 00 00 |....A......0....|
-00000110 00 00 00 00 00 00 00 00 00 00 00 00 02 73 de fe |.............s..|
-00000120 fa 4b 69 6d 30 69 79 96 7e 4f 2f 04 67 36 96 27 |.Kim0iy.~O/.g6.'|
-00000130 67 23 2b dc 7a c4 6c 34 ea fc 79 fd |g#+.z.l4..y.|
+00000000 16 03 03 00 82 04 00 00 7e 00 00 00 00 00 78 50 |........~.....xP|
+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 61 8e d9 64 ac a2 ee 3b 69 31 79 e1 |o...a..d...;i1y.|
+00000040 53 0a 92 1d aa 23 09 c2 49 02 2d 0d 1d c1 63 d6 |S....#..I.-...c.|
+00000050 21 56 c7 24 02 28 d5 f1 11 b0 e7 1b 4a 7c 55 af |!V.$.(......J|U.|
+00000060 1b c8 32 4c 5b 33 94 b0 ed b0 2f 52 c4 52 81 ee |..2L[3..../R.R..|
+00000070 60 6f 66 fb f5 db dd f9 1e 30 11 d4 ca 75 0e 2b |`of......0...u.+|
+00000080 ff d0 e5 f2 68 a4 e7 14 03 03 00 01 01 16 03 03 |....h...........|
+00000090 00 28 00 00 00 00 00 00 00 00 67 3b 4a ba f3 27 |.(........g;J..'|
+000000a0 c8 45 94 68 36 5a 40 e1 dc 67 9b d4 45 58 e9 24 |.E.h6Z@..g..EX.$|
+000000b0 31 85 3a f8 5d cb 84 8e 64 05 17 03 03 00 25 00 |1.:.]...d.....%.|
+000000c0 00 00 00 00 00 00 01 35 d9 ba 0a e2 3e fd a2 80 |.......5....>...|
+000000d0 10 0e 38 7b ad 85 85 48 6a 2a ab 2a 46 c3 59 96 |..8{...Hj*.*F.Y.|
+000000e0 fd 75 11 5d 15 03 03 00 1a 00 00 00 00 00 00 00 |.u.]............|
+000000f0 02 0b 4d a5 89 4d 86 47 14 60 27 f8 09 bc c9 4d |..M..M.G.`'....M|
+00000100 00 31 cb |.1.|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch b/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch
index db5881b7685..af75445dc55 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch
@@ -1,121 +1,108 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 01 8a 01 00 01 86 03 03 0a a8 82 53 61 |..............Sa|
-00000010 68 e0 83 91 71 36 f9 c1 19 ff e8 09 fc 21 9f 03 |h...q6.......!..|
-00000020 31 f3 87 4a 04 8c 3d c2 6e 00 32 00 00 d6 c0 30 |1..J..=.n.2....0|
-00000030 c0 2c c0 28 c0 24 c0 14 c0 0a c0 22 c0 21 c0 20 |.,.(.$.....".!. |
-00000040 00 a5 00 a3 00 a1 00 9f 00 6b 00 6a 00 69 00 68 |.........k.j.i.h|
-00000050 00 39 00 38 00 37 00 36 00 88 00 87 00 86 00 85 |.9.8.7.6........|
-00000060 c0 32 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d |.2...*.&.......=|
-00000070 00 35 00 84 c0 2f c0 2b c0 27 c0 23 c0 13 c0 09 |.5.../.+.'.#....|
-00000080 c0 1f c0 1e c0 1d 00 a4 00 a2 00 a0 00 9e 00 67 |...............g|
-00000090 00 40 00 3f 00 3e 00 33 00 32 00 31 00 30 00 9a |.@.?.>.3.2.1.0..|
-000000a0 00 99 00 98 00 97 00 45 00 44 00 43 00 42 c0 31 |.......E.D.C.B.1|
-000000b0 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c 00 3c 00 2f |.-.).%.......<./|
-000000c0 00 96 00 41 00 07 c0 11 c0 07 c0 0c c0 02 00 05 |...A............|
-000000d0 00 04 c0 12 c0 08 c0 1c c0 1b c0 1a 00 16 00 13 |................|
-000000e0 00 10 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f |................|
-000000f0 00 0c 00 09 00 14 00 11 00 0e 00 0b 00 08 00 06 |................|
-00000100 00 03 00 ff 01 00 00 87 00 0b 00 04 03 00 01 02 |................|
-00000110 00 0a 00 3a 00 38 00 0e 00 0d 00 19 00 1c 00 0b |...:.8..........|
-00000120 00 0c 00 1b 00 18 00 09 00 0a 00 1a 00 16 00 17 |................|
-00000130 00 08 00 06 00 07 00 14 00 15 00 04 00 05 00 12 |................|
-00000140 00 13 00 01 00 02 00 03 00 0f 00 10 00 11 00 23 |...............#|
-00000150 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 |..... ..........|
-00000160 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-00000170 02 01 02 02 02 03 00 0f 00 01 01 00 10 00 10 00 |................|
-00000180 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 6f 31 |..proto2.proto1|
+00000000 16 03 01 01 4c 01 00 01 48 03 03 1d 1a f7 e5 ad |....L...H.......|
+00000010 a4 5c fd 61 b4 c2 25 33 c7 b9 fc fb 2b a5 4b fe |.\.a..%3....+.K.|
+00000020 16 84 55 4b 9f 68 73 61 b8 92 4d 00 00 b6 c0 30 |..UK.hsa..M....0|
+00000030 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 |.,.(.$..........|
+00000040 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 |...k.j.i.h.9.8.7|
+00000050 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a |.6.........2...*|
+00000060 c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f |.&.......=.5.../|
+00000070 c0 2b c0 27 c0 23 c0 13 c0 09 00 a4 00 a2 00 a0 |.+.'.#..........|
+00000080 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 |...g.@.?.>.3.2.1|
+00000090 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 |.0.........E.D.C|
+000000a0 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c |.B.1.-.).%......|
+000000b0 00 3c 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c |.<./...A........|
+000000c0 c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 |................|
+000000d0 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f 00 0c |................|
+000000e0 00 09 00 ff 01 00 00 69 00 0b 00 04 03 00 01 02 |.......i........|
+000000f0 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 |................|
+00000100 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a |................|
+00000110 00 23 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 |.#..... ........|
+00000120 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 |................|
+00000130 03 03 02 01 02 02 02 03 00 0f 00 01 01 00 10 00 |................|
+00000140 10 00 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 6f |....proto2.proto|
+00000150 31 |1|
>>> Flow 2 (server to client)
00000000 16 03 03 00 35 02 00 00 31 03 03 00 00 00 00 00 |....5...1.......|
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 00 c0 14 00 00 |................|
-00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 be 0b |..#.............|
-00000040 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 02 |.........0...0..|
-00000050 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f b8 |................|
-00000060 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 |.0...*.H........|
-00000070 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 |0E1.0...U....AU1|
-00000080 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 |.0...U....Some-S|
-00000090 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 |tate1!0...U....I|
-000000a0 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 |nternet Widgits |
-000000b0 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 32 |Pty Ltd0...10042|
-000000c0 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 34 |4090938Z..110424|
-000000d0 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 55 |090938Z0E1.0...U|
-000000e0 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 |....AU1.0...U...|
-000000f0 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 |.Some-State1!0..|
-00000100 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 |.U....Internet W|
-00000110 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 81 |idgits Pty Ltd0.|
-00000120 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 |.0...*.H........|
-00000130 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 17 |....0.......y...|
-00000140 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 03 |...F...i..+.CZ..|
-00000150 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 |-.zC...R..eL,x.#|
-00000160 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 |........;~b.,.3.|
-00000170 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 cd |..\zV.....X{&?..|
-00000180 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 71 |....!.J..T.Z..Bq|
-00000190 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e |......~.}}..9...|
-000001a0 db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d b8 |.Q.|..L;2f......|
-000001b0 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 01 |q.....k..-y.....|
-000001c0 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 04 |...0..0...U.....|
-000001d0 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de d3 |.....Z..(.i.#i..|
-000001e0 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 6c |&...90u..U.#.n0l|
-000001f0 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.|
-00000200 d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 09 |.&...9.I.G0E1.0.|
-00000210 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
-00000220 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
-00000230 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
-00000240 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
-00000250 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 |d...........0...|
-00000260 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a 86 |U....0....0...*.|
-00000270 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c 45 |H.............lE|
-00000280 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a |$.k.Y..R.......z|
-00000290 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f |du.Z.f..+...f..O|
-000002a0 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 7a |8.n`....A..%...z|
-000002b0 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db 95 |$.0.........1Y..|
-000002c0 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 |..x.PV\..Z-Z_3..|
-000002d0 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f |..u....R...... _|
-000002e0 f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d |..........W.p.&m|
-000002f0 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 03 |q..&n8P)l.......|
-00000300 00 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d |.........A...7..|
-00000310 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
-00000320 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
-00000330 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
-00000340 a6 b5 68 1a 41 03 56 6b dc 5a 89 04 01 00 80 b9 |..h.A.Vk.Z......|
-00000350 0f 79 8a 16 f4 da 8f 27 b4 16 fc c0 51 db ae d1 |.y.....'....Q...|
-00000360 af 79 77 d5 d5 a2 13 05 45 20 cc eb ac ed cb 30 |.yw.....E .....0|
-00000370 32 2e 2c bd fa 1c 4d b5 32 a6 37 43 c8 5c 2d f8 |2.,...M.2.7C.\-.|
-00000380 6e 85 f5 cd 54 92 29 ad 13 7d d5 9e 8c 1d b7 d0 |n...T.)..}......|
-00000390 c1 c7 3d e8 ba 4a 0f 9a a6 3e 25 5f 27 62 b1 00 |..=..J...>%_'b..|
-000003a0 91 d9 23 48 3f 10 fe c5 e3 07 9a 58 57 6d cc 10 |..#H?......XWm..|
-000003b0 3b f8 1a d5 6e 8b 1f 03 6f 82 84 98 b5 f7 71 5d |;...n...o.....q]|
-000003c0 c2 ad 60 14 c1 88 07 5a 3d 99 fd a8 c9 9a 03 16 |..`....Z=.......|
-000003d0 03 03 00 04 0e 00 00 00 |........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 30 00 00 |.............0..|
+00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 71 0b |..#...........q.|
+00000040 00 02 6d 00 02 6a 00 02 67 30 82 02 63 30 82 01 |..m..j..g0..c0..|
+00000050 cc a0 03 02 01 02 02 09 00 a2 73 00 0c 81 00 cb |..........s.....|
+00000060 f3 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |.0...*.H........|
+00000070 30 2b 31 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f |0+1.0...U....Goo|
+00000080 67 6c 65 20 54 45 53 54 49 4e 47 31 10 30 0e 06 |gle TESTING1.0..|
+00000090 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+000000a0 0d 31 35 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.150101000000Z..|
+000000b0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 26 31 |250101000000Z0&1|
+000000c0 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 |.0...U....Google|
+000000d0 20 54 45 53 54 49 4e 47 31 0b 30 09 06 03 55 04 | TESTING1.0...U.|
+000000e0 03 13 02 47 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |...Go0..0...*.H.|
+000000f0 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....|
+00000100 81 00 af 87 88 f6 20 1b 95 65 6c 14 ab 44 05 af |...... ..el..D..|
+00000110 3b 45 14 e3 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 |;E...m..cM...jb5|
+00000120 86 c0 4a f9 18 7c f6 aa 25 5e 7a 64 31 66 00 ba |..J..|..%^zd1f..|
+00000130 f4 8e 92 af c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 |.....k.v.._A.nV.|
+00000140 97 1b 97 c1 3c 12 39 21 66 3d 2b 16 d1 bc db 1c |....<.9!f=+.....|
+00000150 c0 a7 da b7 ca ad ba da cb d5 21 50 ec de 8d ab |..........!P....|
+00000160 d1 6b 81 4b 89 02 f3 c4 be c1 6c 89 b1 44 84 bd |.k.K......l..D..|
+00000170 21 d1 04 7d 9d 16 4d f9 82 15 f6 ef fa d6 09 47 |!..}..M........G|
+00000180 f2 fb 02 03 01 00 01 a3 81 93 30 81 90 30 0e 06 |..........0..0..|
+00000190 03 55 1d 0f 01 01 ff 04 04 03 02 05 a0 30 1d 06 |.U...........0..|
+000001a0 03 55 1d 25 04 16 30 14 06 08 2b 06 01 05 05 07 |.U.%..0...+.....|
+000001b0 03 01 06 08 2b 06 01 05 05 07 03 02 30 0c 06 03 |....+.......0...|
+000001c0 55 1d 13 01 01 ff 04 02 30 00 30 19 06 03 55 1d |U.......0.0...U.|
+000001d0 0e 04 12 04 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e |......P..o...TMn|
+000001e0 cb 69 5e 06 f4 30 1b 06 03 55 1d 23 04 14 30 12 |.i^..0...U.#..0.|
+000001f0 80 10 bf 3d b6 a9 66 f2 b8 40 cf ea b4 03 78 48 |...=..f..@....xH|
+00000200 1a 41 30 19 06 03 55 1d 11 04 12 30 10 82 0e 65 |.A0...U....0...e|
+00000210 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 |xample.golang0..|
+00000220 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 81 00 |.*.H............|
+00000230 92 7c af 91 55 12 18 96 59 31 a6 48 40 d5 2d d5 |.|..U...Y1.H@.-.|
+00000240 ee bb 02 a0 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da |.......|..0}<.v.|
+00000250 4f 3d c0 fa ae 2d 33 24 6b 03 7b 1b 67 59 11 21 |O=...-3$k.{.gY.!|
+00000260 b5 11 bc 77 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 |...w...n.-.5.d_"|
+00000270 3e 63 10 6b be ff 14 86 6d 0d f0 15 31 a8 14 38 |>c.k....m...1..8|
+00000280 1e 3b 84 87 2c cb 98 ed 51 76 b9 b1 4f dd db 9b |.;..,...Qv..O...|
+00000290 84 04 86 40 fa 51 dd ba b4 8d eb e3 46 de 46 b9 |...@.Q......F.F.|
+000002a0 4f 86 c7 f9 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 |O.....A4......9.|
+000002b0 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 1e 18 |............A...|
+000002c0 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f |7...Q.5uq..T[...|
+000002d0 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b |.g..$ >.V...(^.+|
+000002e0 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 |-O....lK[.V.2B.X|
+000002f0 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 05 01 |..I..h.A.Vk.Z...|
+00000300 00 80 36 d2 96 c8 27 66 d8 bd 6c 28 29 30 b3 be |..6...'f..l()0..|
+00000310 0a bb b2 fe 9d c3 59 47 34 cf de fe f4 ab 5d 79 |......YG4.....]y|
+00000320 24 a9 9d c9 b5 e9 50 6a 3b 96 e3 29 cb d7 37 06 |$.....Pj;..)..7.|
+00000330 19 08 88 15 29 c2 55 03 62 75 1d 35 c2 8e 25 a2 |....).U.bu.5..%.|
+00000340 86 20 bf 18 46 15 81 f2 74 4b bb dd 3d e3 a5 f6 |. ..F...tK..=...|
+00000350 28 18 41 89 c8 39 13 f9 c0 88 fd cc f0 6e 9e 3d |(.A..9.......n.=|
+00000360 cb 29 ad 26 5b d1 e6 11 5c 64 7d b6 df d7 39 87 |.).&[...\d}...9.|
+00000370 24 df 9f 62 17 ef f2 b3 3a b3 88 a4 f0 91 ea f2 |$..b....:.......|
+00000380 5d c9 16 03 03 00 04 0e 00 00 00 |]..........|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 76 aa 4e b9 f9 |....F...BA.v.N..|
-00000010 68 85 81 74 7c d9 f9 64 7f bd 09 83 08 5b 4f 76 |h..t|..d.....[Ov|
-00000020 6e be 79 b6 4e 97 17 63 e4 b5 1c 77 e5 85 76 8a |n.y.N..c...w..v.|
-00000030 5d 9f f1 21 88 ec f9 a7 7c 41 af f9 c5 fe 11 81 |]..!....|A......|
-00000040 11 51 8e a7 20 33 5f cf e7 90 90 14 03 03 00 01 |.Q.. 3_.........|
-00000050 01 16 03 03 00 40 44 3e 32 01 71 ac 5a b5 1f 2c |.....@D>2.q.Z..,|
-00000060 37 d9 4b 70 72 91 89 d4 d7 c2 c3 e7 ff dc 72 2a |7.Kpr.........r*|
-00000070 ba f5 30 b0 e9 dd 48 10 3d cd 98 48 a3 e3 ca de |..0...H.=..H....|
-00000080 15 0e 90 8e e5 04 14 74 42 b8 b0 12 cc 68 7b 7d |.......tB....h{}|
-00000090 6c 43 72 60 05 0d |lCr`..|
+00000000 16 03 03 00 46 10 00 00 42 41 04 b0 22 15 73 fc |....F...BA..".s.|
+00000010 1c fd 24 4a 36 69 8a be ac bd 72 30 bb 6b e1 9b |..$J6i....r0.k..|
+00000020 42 e8 56 7a 86 b1 8d cb 9c 3e 2d 63 13 57 a8 13 |B.Vz.....>-c.W..|
+00000030 71 3b a2 01 86 af f8 76 40 0b 44 4f 0a 0f 5a da |q;.....v@.DO..Z.|
+00000040 31 36 3b 13 c0 10 6c 96 64 a7 24 14 03 03 00 01 |16;...l.d.$.....|
+00000050 01 16 03 03 00 28 10 2d 45 93 5c 37 34 d9 2a a0 |.....(.-E.\74.*.|
+00000060 b6 37 13 bc a6 1f 0c ce 2e 55 c1 ad 36 b8 60 72 |.7.......U..6.`r|
+00000070 81 cb 1a 7a 5b 26 49 ad 77 ef 62 e8 fc 00 |...z[&I.w.b...|
>>> Flow 4 (server to client)
-00000000 16 03 03 00 72 04 00 00 6e 00 00 00 00 00 68 00 |....r...n.....h.|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 |...............e|
-00000020 ea 8b c0 ef ba 12 45 17 61 24 cd d2 4c 22 bb 3b |......E.a$..L".;|
-00000030 e3 0e d0 ff 83 e9 7c b7 8f 10 3c 16 1c fc c2 44 |......|...<....D|
-00000040 ef 45 f8 27 30 56 db ea eb ae f5 b6 17 b2 ef f9 |.E.'0V..........|
-00000050 96 0d 2d db e4 59 23 0a fc fa e3 13 48 57 e5 b3 |..-..Y#.....HW..|
-00000060 3a d1 f5 5e ca ef d7 3f 7b b5 f4 69 85 c3 bd da |:..^...?{..i....|
-00000070 fd 9c 50 05 2f 86 ce 14 03 03 00 01 01 16 03 03 |..P./...........|
-00000080 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.@..............|
-00000090 00 00 60 25 1c ed 6f c6 a5 bd b2 29 39 4e 09 d1 |..`%..o....)9N..|
-000000a0 64 cc 75 cd df 91 a8 90 9d 03 aa 92 07 f2 d0 8a |d.u.............|
-000000b0 60 bb 3e 85 21 22 fe f8 dc 52 3c 4e 82 77 14 14 |`.>.!"...R<N.w..|
-000000c0 0f 1f 17 03 03 00 40 00 00 00 00 00 00 00 00 00 |......@.........|
-000000d0 00 00 00 00 00 00 00 0b 87 12 62 3e e5 3e 7d 74 |..........b>.>}t|
-000000e0 0d ac c4 a9 df 67 1c 5a ad 3e 01 34 03 88 2f 39 |.....g.Z.>.4../9|
-000000f0 f7 3c 06 e4 f6 81 43 66 b1 1b ed a5 e5 b6 a8 43 |.<....Cf.......C|
-00000100 7f 36 2f b2 da 45 9a 15 03 03 00 30 00 00 00 00 |.6/..E.....0....|
-00000110 00 00 00 00 00 00 00 00 00 00 00 00 fa 63 4e c5 |.............cN.|
-00000120 77 89 71 56 e3 0a cf 98 da 2f 89 8f 74 8e 76 24 |w.qV...../..t.v$|
-00000130 e2 40 a5 9f 29 1b b2 11 ef 7a 55 7f |.@..)....zU.|
+00000000 16 03 03 00 82 04 00 00 7e 00 00 00 00 00 78 50 |........~.....xP|
+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 61 05 33 d2 9d 95 89 7b 28 54 50 50 |o...a.3....{(TPP|
+00000040 b3 3c 99 5c 82 ab cf 88 24 e8 48 81 db 4a 22 79 |.<.\....$.H..J"y|
+00000050 0b fa 33 50 ed 82 a1 7c 33 0e f2 ff 6d a7 d6 88 |..3P...|3...m...|
+00000060 29 65 74 e3 27 33 94 97 66 0c 86 ce fc ca 0e 2a |)et.'3..f......*|
+00000070 96 fa fe 19 a3 01 64 d9 4d 8e 58 95 5b 74 a6 aa |......d.M.X.[t..|
+00000080 f4 9f c1 34 97 2d e5 14 03 03 00 01 01 16 03 03 |...4.-..........|
+00000090 00 28 00 00 00 00 00 00 00 00 4d 56 6d d5 6f cc |.(........MVm.o.|
+000000a0 3d d4 85 32 3c 07 ea 3c 52 61 88 8e dd d5 d3 d0 |=..2<..<Ra......|
+000000b0 f9 4e 1b b1 c1 d1 67 cb 1a e8 17 03 03 00 25 00 |.N....g.......%.|
+000000c0 00 00 00 00 00 00 01 c3 43 ab 0c ab 59 30 e9 d4 |........C...Y0..|
+000000d0 eb 65 c2 7f 9a 5a 1e 09 06 a4 9d 69 bb 3f 0b 06 |.e...Z.....i.?..|
+000000e0 87 b8 09 39 15 03 03 00 1a 00 00 00 00 00 00 00 |...9............|
+000000f0 02 c2 6f f4 88 f0 7a 59 a6 49 3e 44 a3 7b 6e 36 |..o...zY.I>D.{n6|
+00000100 ae 66 87 |.f.|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA b/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA
index 0ab8b8d74c5..344d9737b25 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA
@@ -1,91 +1,98 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 ca 01 00 00 c6 03 03 53 04 f1 3f 5f |...........S..?_|
-00000010 f4 ef 1f b3 41 0b 54 e4 4d 56 0a 31 22 b8 5c 73 |....A.T.MV.1".\s|
-00000020 a3 cb b5 b2 9d 43 f1 83 bc d3 bd 00 00 32 c0 30 |.....C.......2.0|
-00000030 c0 2c c0 28 c0 24 c0 14 c0 0a c0 22 c0 21 00 a3 |.,.(.$.....".!..|
-00000040 00 9f 00 6b 00 6a 00 39 00 38 00 88 00 87 c0 32 |...k.j.9.8.....2|
-00000050 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d 00 35 |...*.&.......=.5|
-00000060 01 00 00 6b 00 0b 00 04 03 00 01 02 00 0a 00 34 |...k...........4|
-00000070 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 00 09 |.2..............|
-00000080 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 00 15 |................|
-00000090 00 04 00 05 00 12 00 13 00 01 00 02 00 03 00 0f |................|
-000000a0 00 10 00 11 00 0d 00 22 00 20 06 01 06 02 06 03 |.......". ......|
-000000b0 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 |................|
-000000c0 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 01 |...............|
+00000000 16 03 01 01 34 01 00 01 30 03 03 78 08 b2 d4 18 |....4...0..x....|
+00000010 8e b1 6b a2 d2 e0 c6 41 02 c5 93 f1 b9 60 94 e8 |..k....A.....`..|
+00000020 f2 64 6c 97 50 2d 24 a3 cd c0 36 00 00 b6 c0 30 |.dl.P-$...6....0|
+00000030 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 |.,.(.$..........|
+00000040 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 |...k.j.i.h.9.8.7|
+00000050 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a |.6.........2...*|
+00000060 c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f |.&.......=.5.../|
+00000070 c0 2b c0 27 c0 23 c0 13 c0 09 00 a4 00 a2 00 a0 |.+.'.#..........|
+00000080 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 |...g.@.?.>.3.2.1|
+00000090 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 |.0.........E.D.C|
+000000a0 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c |.B.1.-.).%......|
+000000b0 00 3c 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c |.<./...A........|
+000000c0 c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 |................|
+000000d0 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f 00 0c |................|
+000000e0 00 09 00 ff 01 00 00 51 00 0b 00 04 03 00 01 02 |.......Q........|
+000000f0 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 |................|
+00000100 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a |................|
+00000110 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 05 02 |... ............|
+00000120 05 03 04 01 04 02 04 03 03 01 03 02 03 03 02 01 |................|
+00000130 02 02 02 03 00 0f 00 01 01 |.........|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 2a 02 00 00 26 03 03 00 00 00 00 00 |....*...&.......|
+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 00 00 00 00 00 00 00 00 00 c0 0a 00 16 |................|
-00000030 03 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 |..............0.|
-00000040 02 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb |..0..b.....-G...|
-00000050 f4 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b |.0...*.H.=..0E1.|
-00000060 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000070 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000080 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-00000090 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000a0 4c 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 |Ltd0...121122150|
-000000b0 36 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 |632Z..2211201506|
-000000c0 33 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |32Z0E1.0...U....|
-000000d0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000e0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-000000f0 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000100 74 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 |ts Pty Ltd0..0..|
-00000110 07 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 |.*.H.=....+...#.|
-00000120 81 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e |............Hs6~|
-00000130 c3 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 |..V.".=S.;M!=.ku|
-00000140 e6 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 |......&.....r2|.|
-00000150 64 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a |d/....h#.~..%.H:|
-00000160 69 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 |i.(m.7...b....pb|
-00000170 83 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b |....d1...1...h..|
-00000180 23 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 |#.vd?.\....XX._p|
-00000190 dd 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 |............0f[f|
-000001a0 9a 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce |. .'...;0...*.H.|
-000001b0 3d 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f |=......0...B...O|
-000001c0 eb e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 |..E.H}.......Gp.|
-000001d0 5e 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee |^../...M.a@.....|
-000001e0 0b 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 |.~.~.v..;~.?....|
-000001f0 59 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 |Y.G-|..N....o..B|
-00000200 01 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 |.M..g..-...?..%.|
-00000210 33 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e |3.......7z..z...|
-00000220 dd d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 |...i..|V..1x+..x|
-00000230 0d ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 |.....N6$1{j.9...|
-00000240 8f 2a 16 03 03 00 d8 0c 00 00 d4 03 00 17 41 04 |.*............A.|
-00000250 1e 18 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 |..7...Q.5uq..T[.|
-00000260 2e 8f 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e |...g..$ >.V...(^|
-00000270 f8 2b 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 |.+-O....lK[.V.2B|
-00000280 e9 58 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 |.X..I..h.A.Vk.Z.|
-00000290 04 03 00 8b 30 81 88 02 42 00 c6 85 8e 06 b7 04 |....0...B.......|
-000002a0 04 e9 cd 9e 3e cb 66 23 95 b4 42 9c 64 81 39 05 |....>.f#..B.d.9.|
-000002b0 3f b5 21 f8 28 af 60 6b 4d 3d ba a1 4b 5e 77 ef |?.!.(.`kM=..K^w.|
-000002c0 e7 59 28 fe 1d c1 27 a2 ff a8 de 33 48 b3 c1 85 |.Y(...'....3H...|
-000002d0 6a 42 9b f9 7e 7e 31 c2 e5 bd 66 02 42 00 ad 7d |jB..~~1...f.B..}|
-000002e0 06 35 ab ec 8d ac d4 ba 1b 49 5e 05 5f f0 97 93 |.5.......I^._...|
-000002f0 82 b8 2b 8d 91 98 63 8e b4 14 62 db 1e c9 2b 64 |..+...c...b...+d|
-00000300 e9 e6 bf 15 5b 67 c2 40 90 c6 1f b7 92 db 4b f6 |....[g.@......K.|
-00000310 f4 db ae 82 f1 4f 02 75 52 40 38 10 ff 35 f0 16 |.....O.uR@8..5..|
-00000320 03 03 00 04 0e 00 00 00 |........|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 0a 00 00 |................|
+00000030 05 ff 01 00 01 00 16 03 03 02 0e 0b 00 02 0a 00 |................|
+00000040 02 07 00 02 04 30 82 02 00 30 82 01 62 02 09 00 |.....0...0..b...|
+00000050 b8 bf 2d 47 a0 d2 eb f4 30 09 06 07 2a 86 48 ce |..-G....0...*.H.|
+00000060 3d 04 01 30 45 31 0b 30 09 06 03 55 04 06 13 02 |=..0E1.0...U....|
+00000070 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
+00000080 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
+00000090 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
+000000a0 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 32 |ts Pty Ltd0...12|
+000000b0 31 31 32 32 31 35 30 36 33 32 5a 17 0d 32 32 31 |1122150632Z..221|
+000000c0 31 32 30 31 35 30 36 33 32 5a 30 45 31 0b 30 09 |120150632Z0E1.0.|
+000000d0 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
+000000e0 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
+000000f0 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
+00000100 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
+00000110 64 30 81 9b 30 10 06 07 2a 86 48 ce 3d 02 01 06 |d0..0...*.H.=...|
+00000120 05 2b 81 04 00 23 03 81 86 00 04 00 c4 a1 ed be |.+...#..........|
+00000130 98 f9 0b 48 73 36 7e c3 16 56 11 22 f2 3d 53 c3 |...Hs6~..V.".=S.|
+00000140 3b 4d 21 3d cd 6b 75 e6 f6 b0 dc 9a df 26 c1 bc |;M!=.ku......&..|
+00000150 b2 87 f0 72 32 7c b3 64 2f 1c 90 bc ea 68 23 10 |...r2|.d/....h#.|
+00000160 7e fe e3 25 c0 48 3a 69 e0 28 6d d3 37 00 ef 04 |~..%.H:i.(m.7...|
+00000170 62 dd 0d a0 9c 70 62 83 d8 81 d3 64 31 aa 9e 97 |b....pb....d1...|
+00000180 31 bd 96 b0 68 c0 9b 23 de 76 64 3f 1a 5c 7f e9 |1...h..#.vd?.\..|
+00000190 12 0e 58 58 b6 5f 70 dd 9b d8 ea d5 d7 f5 d5 cc |..XX._p.........|
+000001a0 b9 b6 9f 30 66 5b 66 9a 20 e2 27 e5 bf fe 3b 30 |...0f[f. .'...;0|
+000001b0 09 06 07 2a 86 48 ce 3d 04 01 03 81 8c 00 30 81 |...*.H.=......0.|
+000001c0 88 02 42 01 88 a2 4f eb e2 45 c5 48 7d 1b ac f5 |..B...O..E.H}...|
+000001d0 ed 98 9d ae 47 70 c0 5e 1b b6 2f bd f1 b6 4d b7 |....Gp.^../...M.|
+000001e0 61 40 d3 11 a2 ce ee 0b 7e 92 7e ff 76 9d c3 3b |a@......~.~.v..;|
+000001f0 7e a5 3f ce fa 10 e2 59 ec 47 2d 7c ac da 4e 97 |~.?....Y.G-|..N.|
+00000200 0e 15 a0 6f d0 02 42 01 4d fc be 67 13 9c 2d 05 |...o..B.M..g..-.|
+00000210 0e bd 3f a3 8c 25 c1 33 13 83 0d 94 06 bb d4 37 |..?..%.3.......7|
+00000220 7a f6 ec 7a c9 86 2e dd d7 11 69 7f 85 7c 56 de |z..z......i..|V.|
+00000230 fb 31 78 2b e4 c7 78 0d ae cb be 9e 4e 36 24 31 |.1x+..x.....N6$1|
+00000240 7b 6a 0f 39 95 12 07 8f 2a 16 03 03 00 d8 0c 00 |{j.9....*.......|
+00000250 00 d4 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 35 |.....A...7...Q.5|
+00000260 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >|
+00000270 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l|
+00000280 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.|
+00000290 41 03 56 6b dc 5a 89 05 03 00 8b 30 81 88 02 42 |A.Vk.Z.....0...B|
+000002a0 00 91 b4 4a f2 9d 13 a1 6d 3b ee 46 2f 3b 97 50 |...J....m;.F/;.P|
+000002b0 b9 3e 28 7a 51 7a 8b 3b a6 16 03 d6 1f 92 0a ec |.>(zQz.;........|
+000002c0 5b 9b b5 48 98 ce d8 22 bd 7d eb cb 14 7b 14 73 |[..H...".}...{.s|
+000002d0 2d 5f 01 8c dc 5a 63 34 92 4e 59 4a 90 f9 b1 c9 |-_...Zc4.NYJ....|
+000002e0 d8 18 02 42 01 89 e4 e4 39 d0 52 d1 70 19 fe d7 |...B....9.R.p...|
+000002f0 c6 70 10 36 94 1e 45 fd b4 03 37 79 c7 db cf 6d |.p.6..E...7y...m|
+00000300 33 5d 80 fe 04 de d1 78 bf c4 dd cf 91 82 57 14 |3].....x......W.|
+00000310 14 09 e3 2d dd d2 78 9c 53 cc 1f f7 40 6c 4a 59 |...-..x.S...@lJY|
+00000320 49 a8 a1 06 24 18 16 03 03 00 04 0e 00 00 00 |I...$..........|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 d8 94 c4 05 26 |....F...BA.....&|
-00000010 76 29 2d 0e ec 47 b6 50 d5 a3 da 2a ba 02 11 37 |v)-..G.P...*...7|
-00000020 3d ef e6 2a db d0 47 47 a7 9a 5f 43 2d 98 78 26 |=..*..GG.._C-.x&|
-00000030 81 e2 f1 ba fe f7 66 c6 61 cb c1 b7 60 62 34 a5 |......f.a...`b4.|
-00000040 78 67 50 3d 9a 0e 4a 8c 8f d7 10 14 03 03 00 01 |xgP=..J.........|
-00000050 01 16 03 03 00 40 5e 46 b0 5d 30 f6 da 8f 9e 67 |.....@^F.]0....g|
-00000060 f5 3e bd fe c9 b8 53 b2 10 d5 7c 0e 34 e3 93 6d |.>....S...|.4..m|
-00000070 0e 8e 8a 2b df fb 9a 0f a5 23 55 e7 0a 4b e2 d3 |...+.....#U..K..|
-00000080 db 15 e8 52 74 26 78 b3 b0 56 65 63 ac ae 1e c0 |...Rt&x..Vec....|
-00000090 0b f4 92 56 a9 04 |...V..|
+00000000 16 03 03 00 46 10 00 00 42 41 04 66 37 3a ce 68 |....F...BA.f7:.h|
+00000010 23 0f b2 d0 cb 20 24 26 37 d5 84 46 4a 2e 59 80 |#.... $&7..FJ.Y.|
+00000020 87 b3 10 7e 36 fd af 7c 99 07 99 dd 18 af 6d 7c |...~6..|......m||
+00000030 b5 b2 b7 93 45 95 d9 98 1a 13 5b a2 12 e8 b7 95 |....E.....[.....|
+00000040 ed a1 3a 6d aa 8f fc b6 b5 b4 41 14 03 03 00 01 |..:m......A.....|
+00000050 01 16 03 03 00 40 b0 12 69 00 a4 3a 6d bd 56 40 |.....@..i..:m.V@|
+00000060 6e 9d 5e a8 1b 0f 59 c5 09 48 b2 07 d8 bc 7b 02 |n.^...Y..H....{.|
+00000070 70 61 f6 1b a9 27 55 8c 16 4d 69 4c ca 31 30 9f |pa...'U..MiL.10.|
+00000080 d3 62 ba d4 1b 11 ee 0a a0 f3 61 be c6 64 c3 dc |.b........a..d..|
+00000090 97 50 47 27 ed 09 |.PG'..|
>>> 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 16 a9 63 0a 99 |.............c..|
-00000020 21 8a fc 5c b3 ee 05 71 4e 75 c0 d9 40 54 0d 3e |!..\...qNu..@T.>|
-00000030 4e 5d 44 b7 4b 5d a9 e7 5a 30 ed b6 d5 08 50 b1 |N]D.K]..Z0....P.|
-00000040 e8 8c 54 eb 1b 39 7a f9 3b ac 2e 17 03 03 00 40 |..T..9z.;......@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 09 34 9a eb 7c |............4..||
+00000020 6a 6d 6a 02 7b 50 14 b8 f7 b0 93 30 ea 0b 61 4a |jmj.{P.....0..aJ|
+00000030 0b 75 10 39 41 78 46 9d ba 8e d3 e9 e4 ab dc 1f |.u.9AxF.........|
+00000040 c9 43 95 e8 f9 d6 3a d3 5d 7d 09 17 03 03 00 40 |.C....:.]}.....@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 96 03 20 2b 20 c4 c1 9a 76 7b f3 96 bd 33 ed e6 |.. + ...v{...3..|
-00000070 38 48 ea 53 d5 e0 62 b5 7e 1a 36 a8 dd 9f 2d 4b |8H.S..b.~.6...-K|
-00000080 06 0d ae f6 bc 99 14 b3 93 14 27 63 e2 a0 c8 76 |..........'c...v|
+00000060 b4 64 88 d5 53 f9 1e 47 d4 d8 c4 fa 0e c2 76 a6 |.d..S..G......v.|
+00000070 ed 5c 17 ba ea 76 72 cb c5 73 a3 c5 44 21 3c 40 |.\...vr..s..D!<@|
+00000080 33 27 09 37 73 3b 0e a3 7b 95 72 10 8d 74 85 19 |3'.7s;..{.r..t..|
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 48 af e1 e4 11 e1 b7 03 19 b0 e3 |.....H..........|
-000000b0 e6 a9 66 d8 ac af aa 03 f6 0d 51 df 9a 27 78 3a |..f.......Q..'x:|
-000000c0 56 5a 03 1a 4c |VZ..L|
+000000a0 00 00 00 00 00 b3 c0 05 e9 ec 05 06 52 ef 09 b7 |............R...|
+000000b0 52 29 04 88 ed 11 bb bd 36 a3 0f ce 2c 55 a2 87 |R)......6...,U..|
+000000c0 7e 2b 0c aa 83 |~+...|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA b/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA
index 88abb15a7e6..10624c02591 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA
@@ -1,101 +1,104 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 ca 01 00 00 c6 03 03 53 04 f1 3f cc |...........S..?.|
-00000010 41 74 00 07 cb ae 3b 30 79 48 51 60 41 a3 8c ab |At....;0yHQ`A...|
-00000020 dc 76 f9 74 52 1e c5 fb a9 69 c2 00 00 32 c0 30 |.v.tR....i...2.0|
-00000030 c0 2c c0 28 c0 24 c0 14 c0 0a c0 22 c0 21 00 a3 |.,.(.$.....".!..|
-00000040 00 9f 00 6b 00 6a 00 39 00 38 00 88 00 87 c0 32 |...k.j.9.8.....2|
-00000050 c0 2e c0 2a c0 26 c0 0f c0 05 00 9d 00 3d 00 35 |...*.&.......=.5|
-00000060 01 00 00 6b 00 0b 00 04 03 00 01 02 00 0a 00 34 |...k...........4|
-00000070 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 00 09 |.2..............|
-00000080 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 00 15 |................|
-00000090 00 04 00 05 00 12 00 13 00 01 00 02 00 03 00 0f |................|
-000000a0 00 10 00 11 00 0d 00 22 00 20 06 01 06 02 06 03 |.......". ......|
-000000b0 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 |................|
-000000c0 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 01 |...............|
+00000000 16 03 01 01 34 01 00 01 30 03 03 10 5e c8 3f c6 |....4...0...^.?.|
+00000010 fe 44 c4 f0 13 c5 bd ad 06 21 65 e5 a8 40 b5 1d |.D.......!e..@..|
+00000020 21 07 99 34 5b ef 70 85 29 92 7d 00 00 b6 c0 30 |!..4[.p.).}....0|
+00000030 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 |.,.(.$..........|
+00000040 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 |...k.j.i.h.9.8.7|
+00000050 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a |.6.........2...*|
+00000060 c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f |.&.......=.5.../|
+00000070 c0 2b c0 27 c0 23 c0 13 c0 09 00 a4 00 a2 00 a0 |.+.'.#..........|
+00000080 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 |...g.@.?.>.3.2.1|
+00000090 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 |.0.........E.D.C|
+000000a0 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c |.B.1.-.).%......|
+000000b0 00 3c 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c |.<./...A........|
+000000c0 c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 |................|
+000000d0 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f 00 0c |................|
+000000e0 00 09 00 ff 01 00 00 51 00 0b 00 04 03 00 01 02 |.......Q........|
+000000f0 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 |................|
+00000100 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a |................|
+00000110 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 05 02 |... ............|
+00000120 05 03 04 01 04 02 04 03 03 01 03 02 03 03 02 01 |................|
+00000130 02 02 02 03 00 0f 00 01 01 |.........|
>>> Flow 2 (server to client)
-00000000 16 03 03 00 2a 02 00 00 26 03 03 00 00 00 00 00 |....*...&.......|
+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 00 00 00 00 00 00 00 00 00 c0 14 00 16 |................|
-00000030 03 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 |..............0.|
-00000040 02 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 |..0.............|
-00000050 bb a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d |......0...*.H...|
-00000060 01 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 |.....0E1.0...U..|
-00000070 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 |..AU1.0...U....S|
-00000080 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 |ome-State1!0...U|
-00000090 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 |....Internet Wid|
-000000a0 67 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d |gits Pty Ltd0...|
-000000b0 31 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 |100424090938Z..1|
-000000c0 31 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b |10424090938Z0E1.|
-000000d0 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-000000e0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-000000f0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-00000100 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-00000110 4c 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d |Ltd0..0...*.H...|
-00000120 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 |.........0......|
-00000130 bb 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b |.y......F...i..+|
-00000140 07 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 |.CZ..-.zC...R..e|
-00000150 4c 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 |L,x.#........;~b|
-00000160 a5 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 |.,.3...\zV.....X|
-00000170 7b 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f |{&?......!.J..T.|
-00000180 5a bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 |Z..Bq......~.}}.|
-00000190 04 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 |.9....Q.|..L;2f.|
-000001a0 cf af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 |.....q.....k..-y|
-000001b0 02 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 |........0..0...U|
-000001c0 1d 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 |..........Z..(.i|
-000001d0 ce 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d |.#i..&...90u..U.|
-000001e0 23 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db |#.n0l......Z..(.|
-000001f0 69 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 |i.#i..&...9.I.G0|
-00000200 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 |E1.0...U....AU1.|
-00000210 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 |0...U....Some-St|
-00000220 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e |ate1!0...U....In|
-00000230 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 |ternet Widgits P|
-00000240 74 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 |ty Ltd..........|
-00000250 ca 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 |.0...U....0....0|
-00000260 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 |...*.H..........|
-00000270 81 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 |...lE$.k.Y..R...|
-00000280 14 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae |....zdu.Z.f..+..|
-00000290 12 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 |.f..O8.n`....A..|
-000002a0 25 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 |%...z$.0........|
-000002b0 d7 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d |.1Y....x.PV\..Z-|
-000002c0 5a 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd |Z_3....u....R...|
-000002d0 98 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 |... _..........W|
-000002e0 e9 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 |.p.&mq..&n8P)l..|
-000002f0 bd d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 |..............A.|
-00000300 1e 18 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 |..7...Q.5uq..T[.|
-00000310 2e 8f 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e |...g..$ >.V...(^|
-00000320 f8 2b 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 |.+-O....lK[.V.2B|
-00000330 e9 58 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 |.X..I..h.A.Vk.Z.|
-00000340 04 01 00 80 9d 84 09 35 73 fb f6 ea 94 7b 49 fb |.......5s....{I.|
-00000350 c2 70 b1 11 64 5b 93 9f d9 8c f5 56 98 f6 d3 66 |.p..d[.....V...f|
-00000360 a6 1d 18 56 88 87 71 3f b0 38 9d 44 1f ad 2c 0d |...V..q?.8.D..,.|
-00000370 3a a7 e8 d4 3e 33 3c 41 20 f3 3f 5c e5 fb e3 23 |:...>3<A .?\...#|
-00000380 12 48 ff d2 c4 30 7c 8a 51 3f 9f 19 6e 34 d7 60 |.H...0|.Q?..n4.`|
-00000390 7d 12 8a aa 90 0f 50 d9 0b 9a b2 d7 66 b1 c6 84 |}.....P.....f...|
-000003a0 af 5c e2 5e 16 3e 36 61 73 84 64 89 b3 c1 6d 50 |.\.^.>6as.d...mP|
-000003b0 33 55 c7 e1 c5 a5 4c 32 5c 95 dc 07 43 60 49 11 |3U....L2\...C`I.|
-000003c0 e9 98 cc ba 16 03 03 00 04 0e 00 00 00 |.............|
+00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 14 00 00 |................|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 |........A...7...|
+000002c0 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..|
+000002d0 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..|
+000002e0 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.|
+000002f0 b5 68 1a 41 03 56 6b dc 5a 89 05 01 00 80 6a 4b |.h.A.Vk.Z.....jK|
+00000300 b1 7d 23 cd 0e cb 26 02 d4 ee 90 f2 e0 4a 47 3d |.}#...&......JG=|
+00000310 b3 36 90 8d 01 42 98 92 ad 75 87 71 02 70 02 a8 |.6...B...u.q.p..|
+00000320 0c b0 06 ee bd 6a 1f 3f 6c 4b 4b 6b 75 41 23 b4 |.....j.?lKKkuA#.|
+00000330 f9 c2 a6 60 e2 de 55 b6 d4 85 62 e9 8f 20 70 ed |...`..U...b.. p.|
+00000340 9a b8 bb dd 1f 19 87 e9 ad b3 30 3f 7c 63 51 f1 |..........0?|cQ.|
+00000350 59 ab d1 a0 a1 80 22 56 ca 68 52 f8 0f 80 c6 a6 |Y....."V.hR.....|
+00000360 9e 12 51 ed 29 d0 6d c2 1a e5 37 dc 76 e3 f3 53 |..Q.).m...7.v..S|
+00000370 1b 07 0b ea a6 11 af dc 54 d3 ee 25 cc 27 16 03 |........T..%.'..|
+00000380 03 00 04 0e 00 00 00 |.......|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 28 02 84 d5 b4 |....F...BA.(....|
-00000010 58 07 47 d5 a0 d6 0b 1d 37 91 e6 34 a4 ad 0b ad |X.G.....7..4....|
-00000020 22 01 82 77 a7 32 86 78 83 3a da 75 2f e5 68 7a |"..w.2.x.:.u/.hz|
-00000030 de e4 05 e0 02 47 40 4e 38 d2 2c c3 7b da 53 73 |.....G@N8.,.{.Ss|
-00000040 19 cb 8b 73 34 72 4d 33 71 39 c8 14 03 03 00 01 |...s4rM3q9......|
-00000050 01 16 03 03 00 40 10 63 43 76 83 bd 36 e4 1e 4d |.....@.cCv..6..M|
-00000060 7e 13 b0 ac aa c8 ec 90 31 df 84 46 49 68 39 5a |~.......1..FIh9Z|
-00000070 05 8b 73 32 86 15 3a 18 57 d8 e2 2c 2d 05 89 93 |..s2..:.W..,-...|
-00000080 37 b8 dd 73 33 92 ff a7 b2 53 27 94 b7 25 56 64 |7..s3....S'..%Vd|
-00000090 a1 d3 2c f7 6b 71 |..,.kq|
+00000000 16 03 03 00 46 10 00 00 42 41 04 2d 4b 0c 6b 65 |....F...BA.-K.ke|
+00000010 82 32 95 8b 77 ec f0 f2 b2 ba d1 38 74 ed 82 49 |.2..w......8t..I|
+00000020 fb ce 8f 66 97 9d b6 97 d8 ae f5 19 af ad 47 b9 |...f..........G.|
+00000030 db 7b d2 c9 4e 10 68 14 ed 23 a5 98 94 f9 2a 00 |.{..N.h..#....*.|
+00000040 b6 44 b3 44 01 29 6c 56 da bb a8 14 03 03 00 01 |.D.D.)lV........|
+00000050 01 16 03 03 00 40 f4 fd de d6 20 2e 18 80 4e 73 |.....@.... ...Ns|
+00000060 af dd 97 42 08 3b 51 80 e9 26 00 48 6b 8b 21 99 |...B.;Q..&.Hk.!.|
+00000070 a8 60 1f 64 51 d0 5a 90 8b b0 69 b8 6b 29 59 21 |.`.dQ.Z...i.k)Y!|
+00000080 b1 13 19 13 07 01 e1 2c c3 6b 17 2d 01 a5 be d6 |.......,.k.-....|
+00000090 b0 0d 3d 6a 8c fe |..=j..|
>>> 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 21 5c 31 b1 4b |...........!\1.K|
-00000020 96 96 30 8f 79 35 3a 3a 2d 26 67 d0 70 48 be 30 |..0.y5::-&g.pH.0|
-00000030 f8 3e e8 c1 cb 1d d5 89 f6 9c 72 bb 1c f9 4d 90 |.>........r...M.|
-00000040 9c d7 c6 fa 40 76 a5 61 46 61 24 17 03 03 00 40 |....@v.aFa$....@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 84 e2 7f e3 b4 |................|
+00000020 53 d7 d0 30 c4 e5 ea 09 df ba 33 b0 02 34 eb 2e |S..0......3..4..|
+00000030 b2 ec 47 0d e7 20 76 12 fa 53 3b 44 86 e1 e1 63 |..G.. v..S;D...c|
+00000040 06 29 57 98 ce 87 18 ad 02 17 01 17 03 03 00 40 |.)W............@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 94 8a 14 04 06 b9 30 a0 67 fd b2 4c 84 f4 10 93 |......0.g..L....|
-00000070 7d d4 2b 23 f0 e9 62 93 c2 20 a2 f2 7c 07 21 4b |}.+#..b.. ..|.!K|
-00000080 94 ba 7b 7d cb 77 da 85 93 bd 53 ee ca db 9b 3e |..{}.w....S....>|
+00000060 b0 3a f5 90 90 30 9c b3 39 5b b4 56 f6 b9 30 7e |.:...0..9[.V..0~|
+00000070 8e a8 2d 60 47 b6 57 8a 20 61 02 f2 8e 43 c2 01 |..-`G.W. a...C..|
+00000080 ee f0 be 5a 93 52 2f ea 03 2a 4f 01 ea 9e 1c a2 |...Z.R/..*O.....|
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 17 3f 53 8d b3 35 b4 84 ed bb 12 |......?S..5.....|
-000000b0 cf 73 25 25 7c c3 d3 bb 1f 5a 6b 73 9a 8a b1 a2 |.s%%|....Zks....|
-000000c0 ba 99 f8 0e 43 |....C|
+000000a0 00 00 00 00 00 c0 7e 61 51 a1 76 15 8a 7e 20 5f |......~aQ.v..~ _|
+000000b0 d4 a4 c6 3e 6c 50 18 c6 63 88 d0 ac 4c fa 31 b3 |...>lP..c...L.1.|
+000000c0 e7 c9 77 11 7a |..w.z|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven b/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
index 547f79834d9..56c3c822e35 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven
@@ -1,62 +1,57 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 65 |....\...X..R.WYe|
-00000010 ae b3 ec a4 7a 05 f7 ec 39 22 7d 8c 91 96 6b e0 |....z...9"}...k.|
-00000020 69 81 ff 88 28 17 60 ac 94 19 ff 00 00 04 00 05 |i...(.`.........|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
+00000000 16 03 01 00 5a 01 00 00 56 03 03 80 13 c8 83 43 |....Z...V......C|
+00000010 94 79 15 01 6e 0a 9f c5 0f e7 f6 d8 b1 94 de b4 |.y..n...........|
+00000020 57 8c 4f a8 08 48 ee 9b b4 d2 43 00 00 04 00 05 |W.O..H....C.....|
+00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......|
00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
+00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............|
>>> Flow 2 (server to client)
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 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 0f 0d 00 |n8P)l...........|
-00000300 00 0b 02 01 40 00 04 04 01 04 03 00 00 16 03 03 |....@...........|
-00000310 00 04 0e 00 00 00 |......|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 17 0d 00 00 13 02 01 40 00 0c 04 01 04 03 05 01 |.......@........|
+000002c0 05 03 02 01 02 03 00 00 16 03 03 00 04 0e 00 00 |................|
+000002d0 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|
@@ -91,32 +86,32 @@
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 47 5a 2f b8 78 46 |..........GZ/.xF|
-00000220 9f 3c fc ab 8b 35 c9 77 da c3 96 78 31 7c 2b 4f |.<...5.w...x1|+O|
-00000230 56 be 0f 33 bd 17 bc 1c 86 5a ae b3 0f 8b 18 2f |V..3.....Z...../|
-00000240 48 0d e0 0a 20 d3 53 96 88 d2 8a 7d b6 58 13 44 |H... .S....}.X.D|
-00000250 a5 e8 19 6d 02 df a6 1b 79 c5 54 c2 ef 4d 41 4f |...m....y.T..MAO|
-00000260 04 1c eb 37 55 b7 2b f4 7c 6d 37 9c f1 89 a0 2c |...7U.+.|m7....,|
-00000270 0f ba 10 09 e4 a1 ee 0a 7e 9a fd 2c 32 63 1c 55 |........~..,2c.U|
-00000280 85 38 de d0 7b 5f 46 03 1f cc 4d 69 51 97 d8 d7 |.8..{_F...MiQ...|
-00000290 88 6f ba 43 04 b0 42 09 61 5e 16 03 03 00 92 0f |.o.C..B.a^......|
-000002a0 00 00 8e 04 03 00 8a 30 81 87 02 41 14 3d 4c 71 |.......0...A.=Lq|
-000002b0 c2 32 4a 20 ee b7 69 17 55 e8 99 55 11 76 51 7a |.2J ..i.U..U.vQz|
-000002c0 74 55 e7 e8 c3 3b b3 70 db 1c 8e f6 8a d4 99 40 |tU...;.p.......@|
-000002d0 6e da 04 fd 7a 47 41 d6 ae c0 63 ad fd 91 a8 58 |n...zGA...c....X|
-000002e0 24 b9 ac 2f 7a 4c bf 5b 24 12 cb 3a f3 02 42 00 |$../zL.[$..:..B.|
-000002f0 90 f9 48 97 0e d4 33 99 09 9f 1d a8 97 16 60 82 |..H...3.......`.|
-00000300 85 cc 5a 5d 79 f7 2f 03 2a c0 b8 12 61 ac 9f 88 |..Z]y./.*...a...|
-00000310 1d 0d 9e 0a ee 28 a8 5a e2 42 b7 94 e2 e6 0e 13 |.....(.Z.B......|
-00000320 c8 64 dc 4e d3 6b 10 d6 83 41 9c dc d4 53 c3 08 |.d.N.k...A...S..|
-00000330 19 14 03 03 00 01 01 16 03 03 00 24 ef bd e3 23 |...........$...#|
-00000340 10 23 ae 6e b5 12 eb 9c 21 78 db 36 fd bf 7f ee |.#.n....!x.6....|
-00000350 6f c8 00 2d b6 35 cc 2f 38 73 ae a4 34 cf 0d df |o..-.5./8s..4...|
+00000210 03 03 00 86 10 00 00 82 00 80 88 00 24 23 a5 c7 |............$#..|
+00000220 03 2d 86 37 91 f1 71 a9 5f fb 97 49 88 04 9b 0e |.-.7..q._..I....|
+00000230 89 da 65 d0 56 71 e7 76 22 ef 8e 11 0e 6b 50 3d |..e.Vq.v"....kP=|
+00000240 64 3f f7 9b e4 45 01 d9 12 cb da fe 10 da 4e b5 |d?...E........N.|
+00000250 b8 6a b5 bc 74 19 d3 4f a9 bb ee 54 37 e4 70 d0 |.j..t..O...T7.p.|
+00000260 b6 e7 35 96 70 fe a5 2b 14 ac fb c6 1a fa 7d 12 |..5.p..+......}.|
+00000270 87 1b 63 9d 72 30 4d 2c 1a c9 29 32 72 b6 13 53 |..c.r0M,..)2r..S|
+00000280 96 05 de 78 bc f0 1a 74 e2 31 b9 ea db 62 62 6e |...x...t.1...bbn|
+00000290 a0 a6 b2 c0 3e 2a 94 0d 6a f7 16 03 03 00 92 0f |....>*..j.......|
+000002a0 00 00 8e 04 03 00 8a 30 81 87 02 42 01 71 5b 3b |.......0...B.q[;|
+000002b0 a3 35 58 c0 b6 08 09 4f ac af 89 e0 b3 d5 3d 45 |.5X....O......=E|
+000002c0 1f 49 7f 4a c9 bc 9d 0e 50 3a f5 79 bc 54 5d a9 |.I.J....P:.y.T].|
+000002d0 62 ed 85 c5 f3 47 36 03 cc f1 cd 33 c3 70 2a a6 |b....G6....3.p*.|
+000002e0 7c d9 6e 0c db 0d 1b 4f 6a 39 ba 77 bd ea 02 41 ||.n....Oj9.w...A|
+000002f0 00 f2 b7 06 df 2f 81 7e 98 24 46 06 59 4e 86 6a |...../.~.$F.YN.j|
+00000300 b7 4f b6 4b 95 40 88 f0 8f f8 bd 16 f5 d5 82 7e |.O.K.@.........~|
+00000310 82 51 6f 05 49 43 59 cd 1d 40 69 67 ff 65 a8 68 |.Qo.ICY..@ig.e.h|
+00000320 39 2f a1 ad a7 6a ef 5c d5 69 5e 16 50 bb 2a b2 |9/...j.\.i^.P.*.|
+00000330 2f 14 03 03 00 01 01 16 03 03 00 24 55 f6 74 21 |/..........$U.t!|
+00000340 b4 08 a0 7f a2 dc 86 44 e3 f8 e3 0d e1 d6 5c 1c |.......D......\.|
+00000350 22 1e 41 2b 30 cc 34 0f a4 a1 7c a0 27 21 01 e0 |".A+0.4...|.'!..|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 a7 50 0f 50 b4 |..........$.P.P.|
-00000010 1c c3 4d f3 7a 64 df 65 ac 35 22 13 46 cc ec 36 |..M.zd.e.5".F..6|
-00000020 e6 d2 f3 67 94 6a 18 85 9f 4a 3c 44 a3 58 b0 17 |...g.j...J<D.X..|
-00000030 03 03 00 21 51 0a 41 8c fd 50 e3 54 8b 6a 1f 83 |...!Q.A..P.T.j..|
-00000040 a5 37 98 e1 5b 1e ec 03 1d c7 0e 28 6d 79 3f 34 |.7..[......(my?4|
-00000050 de 1c 38 6d 7e 15 03 03 00 16 06 fc b1 7d ad 70 |..8m~........}.p|
-00000060 1a de d4 b7 b5 e7 a2 6d 1b 9a b0 31 0c cc 7b 70 |.......m...1..{p|
+00000000 14 03 03 00 01 01 16 03 03 00 24 6f 6b e7 fb f7 |..........$ok...|
+00000010 52 83 b3 6f ba 1b d7 e8 cb 0a 05 ee 90 04 2b c7 |R..o..........+.|
+00000020 c2 bd 0d 8e ee 42 88 40 ae 01 4a d0 07 4b f4 17 |.....B.@..J..K..|
+00000030 03 03 00 21 e0 8b bd 80 04 18 9c be 12 07 d4 4d |...!...........M|
+00000040 58 d9 ec c3 f0 67 b5 b3 d1 78 25 e7 2e dd a0 0a |X....g...x%.....|
+00000050 ac 0f a1 90 59 15 03 03 00 16 76 30 22 0b 00 83 |....Y.....v0"...|
+00000060 c4 31 29 1c ca 44 cb 9f 0e 48 17 21 43 f6 af 47 |.1)..D...H.!C..G|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven b/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven
index 04a5b117cd6..862e0be09ee 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven
@@ -1,62 +1,57 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 6b |....\...X..R.WYk|
-00000010 11 07 04 39 77 20 c2 b4 3f cb 0a c9 53 fe 5b 3e |...9w ..?...S.[>|
-00000020 5f 58 2c 7e 30 69 e1 8e 6c 9d c8 00 00 04 00 05 |_X,~0i..l.......|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
+00000000 16 03 01 00 5a 01 00 00 56 03 03 b0 80 f6 7c 13 |....Z...V.....|.|
+00000010 30 5d 57 f0 11 3b 30 4b 0e 01 50 9a 44 0b 89 6f |0]W..;0K..P.D..o|
+00000020 b6 f1 a3 34 b4 f1 b9 bf fe 66 a5 00 00 04 00 05 |...4.....f......|
+00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......|
00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
+00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............|
>>> Flow 2 (server to client)
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 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 0f 0d 00 |n8P)l...........|
-00000300 00 0b 02 01 40 00 04 04 01 04 03 00 00 16 03 03 |....@...........|
-00000310 00 04 0e 00 00 00 |......|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 17 0d 00 00 13 02 01 40 00 0c 04 01 04 03 05 01 |.......@........|
+000002c0 05 03 02 01 02 03 00 00 16 03 03 00 04 0e 00 00 |................|
+000002d0 00 |.|
>>> Flow 3 (client to server)
00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0|
00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0|
@@ -90,32 +85,32 @@
000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..|
000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.|
000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....|
-00000200 16 03 03 00 86 10 00 00 82 00 80 44 89 7d aa 26 |...........D.}.&|
-00000210 30 ce 6b db 25 70 b0 1e 16 fa 5b 3a dd 4a 4b bd |0.k.%p....[:.JK.|
-00000220 ec ee 50 9d 21 ba 52 b5 51 4f a8 65 d8 2e 41 e2 |..P.!.R.QO.e..A.|
-00000230 e1 dc f3 1a df 58 4f 87 7a d3 e1 e1 1c 13 b2 0b |.....XO.z.......|
-00000240 b7 43 b7 92 f2 df 19 bb 79 71 e0 71 44 ab 19 2f |.C......yq.qD../|
-00000250 37 11 ac 62 50 b6 f1 53 fe aa b4 bc 29 8e 0b 4c |7..bP..S....)..L|
-00000260 0b 12 8d d5 84 a9 fa a9 ea 16 aa c3 0d da 32 c8 |..............2.|
-00000270 e0 4c 9f 99 f8 69 cd a8 c3 b1 76 42 67 f3 ff 15 |.L...i....vBg...|
-00000280 52 95 43 66 da 49 43 25 9d e5 eb 16 03 03 00 88 |R.Cf.IC%........|
-00000290 0f 00 00 84 04 01 00 80 01 d5 0e 1c 75 97 89 52 |............u..R|
-000002a0 1a f0 cc ef 93 6e 71 b2 b1 38 8c 50 11 f7 a3 02 |.....nq..8.P....|
-000002b0 71 c4 d5 6f 8d 01 83 06 2e ea 5a 10 8a 0d d0 fc |q..o......Z.....|
-000002c0 b6 a2 63 af 4f 99 b5 eb ab fd 01 c2 fb 26 fc fd |..c.O........&..|
-000002d0 ad 2c b3 63 b3 87 a6 f5 14 ea 7d e7 fe a8 e7 7e |.,.c......}....~|
-000002e0 20 ab b9 f6 c3 58 bd c0 f3 96 eb 83 dc 42 6c 0d | ....X.......Bl.|
-000002f0 5e e8 09 55 c7 b8 24 05 dd e1 7c af 9f 2c 22 6c |^..U..$...|..,"l|
-00000300 fa b8 94 13 3b f1 09 e1 38 59 fc a1 8c cb aa ca |....;...8Y......|
-00000310 f8 e0 2a 9c 36 f9 c3 2b 14 03 03 00 01 01 16 03 |..*.6..+........|
-00000320 03 00 24 d0 12 7c cc d2 3e 37 1f f4 7d b4 c0 fc |..$..|..>7..}...|
-00000330 19 f6 c8 ea 62 12 e0 0d af 62 d4 69 f7 96 5a c0 |....b....b.i..Z.|
-00000340 97 d3 bb b0 a3 f7 3f |......?|
+00000200 16 03 03 00 86 10 00 00 82 00 80 98 61 16 34 c4 |............a.4.|
+00000210 c6 0a 47 c1 de 87 b1 b7 70 1b 24 8d 7e 35 90 35 |..G.....p.$.~5.5|
+00000220 f7 a5 6f c7 c9 91 ad 46 4c 50 e5 7e 61 7c 49 66 |..o....FLP.~a|If|
+00000230 e9 fe 1e 2c 30 fa 22 03 36 8f 44 27 a7 d2 14 84 |...,0.".6.D'....|
+00000240 d0 1f 21 ca 40 35 d1 7d 31 3f e1 73 de 69 bc da |..!.@5.}1?.s.i..|
+00000250 a5 96 8a b5 50 2b 4b 87 5a b3 fb e1 11 0a 29 59 |....P+K.Z.....)Y|
+00000260 13 2e e3 c2 05 d3 23 e8 09 0c 42 f6 8e 26 67 89 |......#...B..&g.|
+00000270 24 0f 08 2f 3d 24 2b 0c a2 98 38 02 5c 95 9f ce |$../=$+...8.\...|
+00000280 e3 75 ba 05 b5 f8 f0 07 e9 a1 44 16 03 03 00 88 |.u........D.....|
+00000290 0f 00 00 84 04 01 00 80 04 c0 bc 4b 23 59 ed 26 |...........K#Y.&|
+000002a0 8d 90 35 da 5b 55 88 e7 12 10 7b d7 1c 27 d1 c4 |..5.[U....{..'..|
+000002b0 d8 1b e2 e7 54 ad a4 be 00 6b 5b 61 2d ec 97 0c |....T....k[a-...|
+000002c0 a5 9b ae ab 13 fa 94 53 1c 65 28 21 7d b5 c5 be |.......S.e(!}...|
+000002d0 22 62 91 78 fc e3 de 84 5c 4e 0d f5 73 5e 20 49 |"b.x....\N..s^ I|
+000002e0 5a e2 f9 d3 2f 36 23 91 31 5b ee c7 0b 6f b3 35 |Z.../6#.1[...o.5|
+000002f0 2f 8a 51 84 3c fe 78 34 1f 8c 68 d3 fc 4f c6 5e |/.Q.<.x4..h..O.^|
+00000300 7b fe b2 81 79 91 37 ee 7f f1 9b a4 88 5f 1b 44 |{...y.7......_.D|
+00000310 dc e9 36 bb d1 45 bb 1f 14 03 03 00 01 01 16 03 |..6..E..........|
+00000320 03 00 24 12 e7 8a 31 36 26 9f fe 45 95 cf 41 56 |..$...16&..E..AV|
+00000330 b4 69 ef e4 22 14 5a 4d c8 79 a7 18 7b 68 a8 02 |.i..".ZM.y..{h..|
+00000340 75 ea 42 fe c4 a1 32 |u.B...2|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 cd 20 85 1e 74 |..........$. ..t|
-00000010 18 b2 71 48 d5 10 61 c6 b0 18 26 83 c2 7f f1 b1 |..qH..a...&.....|
-00000020 2f b5 35 d0 47 a8 99 9a 9a a5 62 64 fb f9 29 17 |/.5.G.....bd..).|
-00000030 03 03 00 21 22 7b ed 61 e3 9b 6d 98 b9 23 98 e3 |...!"{.a..m..#..|
-00000040 55 11 b8 0f 7e 2b e1 c1 d4 f1 83 79 c3 f8 03 f0 |U...~+.....y....|
-00000050 02 5c 61 24 d7 15 03 03 00 16 14 2b a3 5a 56 f0 |.\a$.......+.ZV.|
-00000060 92 da d0 e6 32 91 d8 30 7a b4 d0 a2 93 f5 01 ea |....2..0z.......|
+00000000 14 03 03 00 01 01 16 03 03 00 24 ae 6d 7b ac b6 |..........$.m{..|
+00000010 62 5c 40 65 6b 0e 5c 12 68 61 14 90 54 3e 24 78 |b\@ek.\.ha..T>$x|
+00000020 be 85 17 a0 9b de a0 00 e9 80 1b a9 0f e4 d7 17 |................|
+00000030 03 03 00 21 86 06 17 6b 62 02 a7 a0 71 fe c0 e4 |...!...kb...q...|
+00000040 44 00 54 dd cc a9 70 cf bc 92 0d 40 07 62 f5 39 |D.T...p....@.b.9|
+00000050 2a 30 ab 7f cd 15 03 03 00 16 6f 8d c9 d4 62 02 |*0........o...b.|
+00000060 da 64 4c 89 32 86 9f 29 24 05 ed cc 77 9d e5 55 |.dL.2..)$...w..U|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven b/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
index 562fe1aaa0a..5de6dd82ec0 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven
@@ -1,81 +1,76 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 1b |....\...X..R.WY.|
-00000010 08 fe f7 8a bf 07 84 2b 60 a6 13 2d 15 13 f8 b6 |.......+`..-....|
-00000020 d4 b6 3b f2 7a 98 ff 32 a0 68 7c 00 00 04 00 05 |..;.z..2.h|.....|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
+00000000 16 03 01 00 5a 01 00 00 56 03 03 52 b6 c5 b4 e3 |....Z...V..R....|
+00000010 35 ce 4e b2 9c e0 38 09 e7 fe 00 a2 1a 0a 43 eb |5.N...8.......C.|
+00000020 df 98 6a 34 71 f9 d0 f8 5d e7 5e 00 00 04 00 05 |..j4q...].^.....|
+00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......|
00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
+00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............|
>>> Flow 2 (server to client)
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 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 0f 0d 00 |n8P)l...........|
-00000300 00 0b 02 01 40 00 04 04 01 04 03 00 00 16 03 03 |....@...........|
-00000310 00 04 0e 00 00 00 |......|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 17 0d 00 00 13 02 01 40 00 0c 04 01 04 03 05 01 |.......@........|
+000002c0 05 03 02 01 02 03 00 00 16 03 03 00 04 0e 00 00 |................|
+000002d0 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 6b 51 48 d3 18 7d 30 e0 0c |.......kQH..}0..|
-00000020 20 8d f3 e4 39 47 30 0e a5 85 79 f9 8b 11 50 9e | ...9G0...y...P.|
-00000030 81 71 5c 26 c6 bb cb aa d5 00 d1 89 79 b1 77 2d |.q\&........y.w-|
-00000040 eb 9b 86 7c 52 c6 f7 b7 10 b0 b6 94 22 51 b8 12 |...|R......."Q..|
-00000050 3c 09 35 8e 1b cc f4 3b b7 b8 78 ab 89 59 41 49 |<.5....;..x..YAI|
-00000060 21 31 eb f0 f8 94 63 3d e6 96 8f b6 63 95 05 dd |!1....c=....c...|
-00000070 46 b3 00 8a d6 83 75 99 1b 5a 48 0a 23 b5 10 c1 |F.....u..ZH.#...|
-00000080 95 b5 bc 15 72 b5 f5 a0 62 e2 1d c0 ff d2 87 a5 |....r...b.......|
-00000090 97 5c 33 49 a7 26 35 14 03 03 00 01 01 16 03 03 |.\3I.&5.........|
-000000a0 00 24 61 38 1f 9d fb d9 65 2e 02 07 fb be f9 85 |.$a8....e.......|
-000000b0 8d 15 34 c0 d1 0e 4e 10 3c 25 60 2f ac 04 21 66 |..4...N.<%`/..!f|
-000000c0 04 9d 9a 60 31 72 |...`1r|
+00000010 86 10 00 00 82 00 80 2e 8e cb 6c f5 db 45 5b f0 |..........l..E[.|
+00000020 67 7d b1 ac 87 c2 d6 e9 ea 37 40 15 2a ea a1 af |g}.......7@.*...|
+00000030 ed 71 68 18 9c 6c 84 20 52 3e 38 94 8e d9 cd b3 |.qh..l. R>8.....|
+00000040 15 73 8b db d7 ff 1d 8a ed a6 f4 00 7d d0 0a 1e |.s..........}...|
+00000050 9a 1b 5c 59 f6 a0 29 62 03 a1 c6 bf 8a 57 14 06 |..\Y..)b.....W..|
+00000060 9a e8 03 72 bc cd cd 6f 6d e2 ce a8 41 7a f0 65 |...r...om...Az.e|
+00000070 42 0c 7b dd 93 d7 ab 37 f8 2a b3 c4 72 95 61 e1 |B.{....7.*..r.a.|
+00000080 75 98 f5 99 69 ef 0a d0 00 41 0f 05 87 13 d3 7d |u...i....A.....}|
+00000090 ba 74 34 43 9a 6c d0 14 03 03 00 01 01 16 03 03 |.t4C.l..........|
+000000a0 00 24 87 7e 7d 48 ca 17 9c ad 30 b8 6a 05 2f d3 |.$.~}H....0.j./.|
+000000b0 fc 18 2e df fd f5 0e 38 c3 06 57 4c 27 66 02 af |.......8..WL'f..|
+000000c0 6d 78 4d 2e b6 dc |mxM...|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 fe 0e 3e 84 af |..........$..>..|
-00000010 e5 6b 10 ed 41 9c 2b e0 ba e0 2b 53 61 36 1b 40 |.k..A.+...+Sa6.@|
-00000020 35 de 3a c7 c3 5c df 74 67 f7 05 74 84 f5 e1 17 |5.:..\.tg..t....|
-00000030 03 03 00 21 d3 8d 81 85 b7 1f 30 bd 89 33 f9 81 |...!......0..3..|
-00000040 89 f7 af d1 be b0 c1 46 e3 df 32 f6 dc 2f 4d 82 |.......F..2../M.|
-00000050 0a 84 9f 5b 03 15 03 03 00 16 13 af 37 91 82 67 |...[........7..g|
-00000060 b0 7c 5e 0e ec 8e cc 31 a0 ea a5 72 a4 2b 0b 73 |.|^....1...r.+.s|
+00000000 14 03 03 00 01 01 16 03 03 00 24 cf ee f6 28 ea |..........$...(.|
+00000010 df e2 7e 9a 75 e0 f9 b4 c4 c2 57 3a 54 26 db 7f |..~.u.....W:T&..|
+00000020 c4 19 6d b6 d6 c7 b1 05 7f 92 21 9e 51 1a 0a 17 |..m.......!.Q...|
+00000030 03 03 00 21 87 48 77 c4 eb 7c 5d 13 3b f4 8d 08 |...!.Hw..|].;...|
+00000040 f9 35 c3 d2 e5 c0 8c ea 15 c9 2d c5 e0 70 fd 7c |.5........-..p.||
+00000050 de 93 4f 8c 8d 15 03 03 00 16 d4 8a d5 6a fc db |..O..........j..|
+00000060 c7 1d 1f 76 64 b9 31 68 72 cc 58 de 9f 2a a6 45 |...vd.1hr.X..*.E|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES b/libgo/go/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES
index aacbb86705a..3b7238ad299 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES
@@ -1,15 +1,15 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 9c 01 00 00 98 03 03 53 04 f0 f9 09 |...........S....|
-00000010 13 56 01 37 84 b1 32 59 4c 73 b1 8e bb 02 1a 32 |.V.7..2YLs.....2|
-00000020 db ab 8c e6 ed ad 7f 52 9a 59 39 00 00 04 c0 0a |.......R.Y9.....|
-00000030 00 ff 01 00 00 6b 00 0b 00 04 03 00 01 02 00 0a |.....k..........|
-00000040 00 34 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 |.4.2............|
-00000050 00 09 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 |................|
-00000060 00 15 00 04 00 05 00 12 00 13 00 01 00 02 00 03 |................|
-00000070 00 0f 00 10 00 11 00 0d 00 22 00 20 06 01 06 02 |.........". ....|
-00000080 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000090 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-000000a0 01 |.|
+00000000 16 03 01 00 a1 01 00 00 9d 03 03 0f b7 07 5f c7 |.............._.|
+00000010 18 b8 39 6d 92 b3 90 ed bf 5c 48 7c 6a 56 ee e9 |..9m.....\H|jV..|
+00000020 7a 5b 5f 71 a4 f0 7f 47 57 73 78 00 00 04 c0 0a |z[_q...GWsx.....|
+00000030 00 ff 02 01 00 00 6f 00 0b 00 04 03 00 01 02 00 |......o.........|
+00000040 0a 00 3a 00 38 00 0e 00 0d 00 19 00 1c 00 0b 00 |..:.8...........|
+00000050 0c 00 1b 00 18 00 09 00 0a 00 1a 00 16 00 17 00 |................|
+00000060 08 00 06 00 07 00 14 00 15 00 04 00 05 00 12 00 |................|
+00000070 13 00 01 00 02 00 03 00 0f 00 10 00 11 00 0d 00 |................|
+00000080 20 00 1e 06 01 06 02 06 03 05 01 05 02 05 03 04 | ...............|
+00000090 01 04 02 04 03 03 01 03 02 03 03 02 01 02 02 02 |................|
+000000a0 03 00 0f 00 01 01 |......|
>>> Flow 2 (server to client)
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 |................|
@@ -52,38 +52,38 @@
00000260 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >|
00000270 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l|
00000280 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.|
-00000290 41 03 56 6b dc 5a 89 04 03 00 8b 30 81 88 02 42 |A.Vk.Z.....0...B|
-000002a0 00 c6 85 8e 06 b7 04 04 e9 cd 9e 3e cb 66 23 95 |...........>.f#.|
-000002b0 b4 42 9c 64 81 39 05 3f b5 21 f8 28 af 60 6b 4d |.B.d.9.?.!.(.`kM|
-000002c0 3d ba a1 4b 5e 77 ef e7 59 28 fe 1d c1 27 a2 ff |=..K^w..Y(...'..|
-000002d0 a8 de 33 48 b3 c1 85 6a 42 9b f9 7e 7e 31 c2 e5 |..3H...jB..~~1..|
-000002e0 bd 66 02 42 00 ad 7d 06 35 ab ec 8d ac d4 ba 1b |.f.B..}.5.......|
-000002f0 49 5e 05 5f f0 97 93 82 b8 2b 8d 91 98 63 8e b4 |I^._.....+...c..|
-00000300 14 62 db 1e c9 2c 13 ae b7 d3 17 38 23 2f f6 7f |.b...,.....8#/..|
-00000310 0c 4d d3 33 d2 79 d1 77 ee cb b1 c2 fc 34 b8 69 |.M.3.y.w.....4.i|
-00000320 f9 10 8b 61 89 85 16 03 03 00 04 0e 00 00 00 |...a...........|
+00000290 41 03 56 6b dc 5a 89 05 03 00 8b 30 81 88 02 42 |A.Vk.Z.....0...B|
+000002a0 00 d3 cf 21 cd 3c 2e 11 f5 f8 1d c8 c1 57 4b f8 |...!.<.......WK.|
+000002b0 1a c0 2b 1d 47 0f 2d a5 ac a1 c8 83 5d 76 87 05 |..+.G.-.....]v..|
+000002c0 2b 0d 36 d5 57 9f b9 8a a0 a2 94 67 6a cd 29 db |+.6.W......gj.).|
+000002d0 04 b0 6b 06 d9 f7 17 9f 1c 60 92 e7 4e 50 48 7f |..k......`..NPH.|
+000002e0 dc d0 02 42 01 56 fd 38 bd 05 a5 16 6d 91 d1 ce |...B.V.8....m...|
+000002f0 bb 8c 45 b2 76 2f 92 9c 8b 94 57 7d de 53 8b 7b |..E.v/....W}.S.{|
+00000300 80 26 6c 4a 43 4b a6 c9 46 49 08 ab c7 57 f3 d9 |.&lJCK..FI...W..|
+00000310 fa 1d 55 fe 91 de 8a 0d 8b d1 44 96 87 85 cb 02 |..U.......D.....|
+00000320 76 9c 00 ad 5f b8 16 03 03 00 04 0e 00 00 00 |v..._..........|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 dd 22 68 a1 4e |....F...BA.."h.N|
-00000010 04 1b 47 f9 c5 7d 04 1d d8 fe 84 fa be 31 2e a7 |..G..}.......1..|
-00000020 f8 e5 b8 14 92 44 99 11 0e 34 97 fc e5 b1 91 cf |.....D...4......|
-00000030 a4 d1 3f b4 71 94 c6 06 16 f0 98 c0 3e 05 f9 2f |..?.q.......>../|
-00000040 0a 97 78 3d ef dc fa a2 d7 ee 7d 14 03 03 00 01 |..x=......}.....|
-00000050 01 16 03 03 00 40 90 bf 7f e9 c9 6e d1 80 f5 12 |.....@.....n....|
-00000060 6d c5 b7 c5 15 4b 18 a5 d3 18 1e f8 8c 4d 7e 6d |m....K.......M~m|
-00000070 03 60 29 7c 45 7c b2 ca 8c 07 71 70 aa 23 fa 6e |.`)|E|....qp.#.n|
-00000080 d9 0b 0a 32 4c 9e e5 00 f9 19 9b b6 8d dc d3 67 |...2L..........g|
-00000090 3d 0f bb b8 4b 9e |=...K.|
+00000000 16 03 03 00 46 10 00 00 42 41 04 0b dc ea 22 05 |....F...BA....".|
+00000010 44 c2 09 47 65 31 3b 0b e1 05 1a 87 8c 2d 3b 56 |D..Ge1;......-;V|
+00000020 49 34 27 3e d6 3b 93 e2 12 7f 5d 7b dc 85 c8 96 |I4'>.;....]{....|
+00000030 4c 8c f9 18 6f 15 cf db 6e 2c 14 6a c9 dd 1c 70 |L...o...n,.j...p|
+00000040 7e 05 c4 17 71 76 df 10 ee 8c b1 14 03 03 00 01 |~...qv..........|
+00000050 01 16 03 03 00 40 ff 12 88 36 3c 00 17 d1 b9 41 |.....@...6<....A|
+00000060 7a 12 25 94 4c 90 65 62 d8 09 ab f9 b4 ee c3 de |z.%.L.eb........|
+00000070 46 2f cb ee 18 76 4f 76 8e dd 89 fc 7a 21 3b 5f |F/...vOv....z!;_|
+00000080 ff ac 1c 03 aa be 96 82 82 ea 2e 22 2a 80 b3 86 |..........."*...|
+00000090 38 e4 4d 90 91 46 |8.M..F|
>>> 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 a1 6e e5 d1 ca |............n...|
-00000020 03 f4 77 dc ec ee 5d f0 22 5e 7f 55 1a 8d ad 45 |..w...]."^.U...E|
-00000030 09 f1 3b b2 61 36 dc 3d 2a 1e 1f e5 a7 84 76 a9 |..;.a6.=*.....v.|
-00000040 41 5b 86 03 ac 22 18 20 9b a9 29 17 03 03 00 40 |A[...". ..)....@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 e5 c1 f0 6a db |..............j.|
+00000020 05 98 ed 33 94 73 7f 13 7f 78 17 7f d1 9e c5 a7 |...3.s...x......|
+00000030 62 7f 85 14 2c 7d b2 8e ef 75 a9 df 92 cc 22 20 |b...,}...u...." |
+00000040 66 08 85 22 d3 ea 5c 4c 4c c8 d7 17 03 03 00 40 |f.."..\LL......@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 f5 cb 28 1e b5 bc 82 7f 82 38 54 14 e8 b9 6d 3b |..(......8T...m;|
-00000070 bc 99 d6 0e f9 00 96 99 a8 92 2e 86 9d 62 4e 90 |.............bN.|
-00000080 27 52 58 45 20 93 90 a1 f3 a8 89 2b e7 21 24 16 |'RXE ......+.!$.|
+00000060 f2 20 07 d2 13 ca ed 01 c9 7b 91 14 01 2c 08 f5 |. .......{...,..|
+00000070 8a 69 94 bc 19 9a d9 65 6b 15 04 b4 45 17 ec 6f |.i.....ek...E..o|
+00000080 85 de 31 dc a2 de 8b 4d 53 57 66 4a 29 21 5a 20 |..1....MSWfJ)!Z |
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 a8 2a ab 8f b0 ce 49 8b fd a5 c9 |......*....I....|
-000000b0 11 b2 04 83 18 f3 1d 6c 82 34 1d df dd 2f 45 3b |.......l.4.../E;|
-000000c0 27 8a 0f 16 69 |'...i|
+000000a0 00 00 00 00 00 55 15 f7 89 8d 75 57 7e 92 db ec |.....U....uW~...|
+000000b0 32 ec 07 5c 83 32 36 59 61 f1 9d a6 7a eb 76 c1 |2..\.26Ya...z.v.|
+000000c0 c7 96 3f 4d 0a |..?M.|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicket b/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicket
index e3e62f22423..20a0731091a 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicket
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicket
@@ -1,87 +1,83 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 60 01 00 00 5c 03 03 52 cc 57 59 7e |....`...\..R.WY~|
-00000010 43 5c 3b fd 50 ab 61 3f 64 a4 f9 bd ba 8c 28 e1 |C\;.P.a?d.....(.|
-00000020 f9 a1 45 7e 48 9e 62 af 25 de 0e 00 00 04 00 05 |..E~H.b.%.......|
-00000030 00 ff 01 00 00 2f 00 23 00 00 00 0d 00 22 00 20 |...../.#.....". |
+00000000 16 03 01 00 5e 01 00 00 5a 03 03 f0 0a 06 d0 65 |....^...Z......e|
+00000010 1c c3 90 ac dc 61 42 e5 b8 a9 17 fb e7 c3 1e bd |.....aB.........|
+00000020 d9 09 5a 63 71 e2 f9 58 db 26 6e 00 00 04 00 05 |..Zcq..X.&n.....|
+00000030 00 ff 01 00 00 2d 00 23 00 00 00 0d 00 20 00 1e |.....-.#..... ..|
00000040 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................|
-00000050 04 03 03 01 03 02 03 03 02 01 02 02 02 03 01 01 |................|
-00000060 00 0f 00 01 01 |.....|
+00000050 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................|
+00000060 00 01 01 |...|
>>> Flow 2 (server to client)
00000000 16 03 03 00 35 02 00 00 31 03 03 00 00 00 00 00 |....5...1.......|
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 00 00 05 00 00 |................|
-00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 be 0b |..#.............|
-00000040 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 02 |.........0...0..|
-00000050 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f b8 |................|
-00000060 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 |.0...*.H........|
-00000070 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 |0E1.0...U....AU1|
-00000080 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 |.0...U....Some-S|
-00000090 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 |tate1!0...U....I|
-000000a0 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 |nternet Widgits |
-000000b0 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 32 |Pty Ltd0...10042|
-000000c0 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 34 |4090938Z..110424|
-000000d0 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 55 |090938Z0E1.0...U|
-000000e0 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 |....AU1.0...U...|
-000000f0 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 |.Some-State1!0..|
-00000100 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 |.U....Internet W|
-00000110 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 81 |idgits Pty Ltd0.|
-00000120 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 |.0...*.H........|
-00000130 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 17 |....0.......y...|
-00000140 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 03 |...F...i..+.CZ..|
-00000150 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 |-.zC...R..eL,x.#|
-00000160 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 |........;~b.,.3.|
-00000170 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 cd |..\zV.....X{&?..|
-00000180 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 71 |....!.J..T.Z..Bq|
-00000190 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e |......~.}}..9...|
-000001a0 db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d b8 |.Q.|..L;2f......|
-000001b0 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 01 |q.....k..-y.....|
-000001c0 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 04 |...0..0...U.....|
-000001d0 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de d3 |.....Z..(.i.#i..|
-000001e0 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 6c |&...90u..U.#.n0l|
-000001f0 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.|
-00000200 d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 09 |.&...9.I.G0E1.0.|
-00000210 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
-00000220 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
-00000230 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
-00000240 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
-00000250 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 |d...........0...|
-00000260 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a 86 |U....0....0...*.|
-00000270 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c 45 |H.............lE|
-00000280 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a |$.k.Y..R.......z|
-00000290 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f |du.Z.f..+...f..O|
-000002a0 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 7a |8.n`....A..%...z|
-000002b0 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db 95 |$.0.........1Y..|
-000002c0 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 |..x.PV\..Z-Z_3..|
-000002d0 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f |..u....R...... _|
-000002e0 f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d |..........W.p.&m|
-000002f0 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 03 |q..&n8P)l.......|
-00000300 00 04 0e 00 00 00 |......|
+00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 71 0b |..#...........q.|
+00000040 00 02 6d 00 02 6a 00 02 67 30 82 02 63 30 82 01 |..m..j..g0..c0..|
+00000050 cc a0 03 02 01 02 02 09 00 a2 73 00 0c 81 00 cb |..........s.....|
+00000060 f3 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |.0...*.H........|
+00000070 30 2b 31 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f |0+1.0...U....Goo|
+00000080 67 6c 65 20 54 45 53 54 49 4e 47 31 10 30 0e 06 |gle TESTING1.0..|
+00000090 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+000000a0 0d 31 35 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.150101000000Z..|
+000000b0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 26 31 |250101000000Z0&1|
+000000c0 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 |.0...U....Google|
+000000d0 20 54 45 53 54 49 4e 47 31 0b 30 09 06 03 55 04 | TESTING1.0...U.|
+000000e0 03 13 02 47 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |...Go0..0...*.H.|
+000000f0 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....|
+00000100 81 00 af 87 88 f6 20 1b 95 65 6c 14 ab 44 05 af |...... ..el..D..|
+00000110 3b 45 14 e3 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 |;E...m..cM...jb5|
+00000120 86 c0 4a f9 18 7c f6 aa 25 5e 7a 64 31 66 00 ba |..J..|..%^zd1f..|
+00000130 f4 8e 92 af c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 |.....k.v.._A.nV.|
+00000140 97 1b 97 c1 3c 12 39 21 66 3d 2b 16 d1 bc db 1c |....<.9!f=+.....|
+00000150 c0 a7 da b7 ca ad ba da cb d5 21 50 ec de 8d ab |..........!P....|
+00000160 d1 6b 81 4b 89 02 f3 c4 be c1 6c 89 b1 44 84 bd |.k.K......l..D..|
+00000170 21 d1 04 7d 9d 16 4d f9 82 15 f6 ef fa d6 09 47 |!..}..M........G|
+00000180 f2 fb 02 03 01 00 01 a3 81 93 30 81 90 30 0e 06 |..........0..0..|
+00000190 03 55 1d 0f 01 01 ff 04 04 03 02 05 a0 30 1d 06 |.U...........0..|
+000001a0 03 55 1d 25 04 16 30 14 06 08 2b 06 01 05 05 07 |.U.%..0...+.....|
+000001b0 03 01 06 08 2b 06 01 05 05 07 03 02 30 0c 06 03 |....+.......0...|
+000001c0 55 1d 13 01 01 ff 04 02 30 00 30 19 06 03 55 1d |U.......0.0...U.|
+000001d0 0e 04 12 04 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e |......P..o...TMn|
+000001e0 cb 69 5e 06 f4 30 1b 06 03 55 1d 23 04 14 30 12 |.i^..0...U.#..0.|
+000001f0 80 10 bf 3d b6 a9 66 f2 b8 40 cf ea b4 03 78 48 |...=..f..@....xH|
+00000200 1a 41 30 19 06 03 55 1d 11 04 12 30 10 82 0e 65 |.A0...U....0...e|
+00000210 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 |xample.golang0..|
+00000220 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 81 00 |.*.H............|
+00000230 92 7c af 91 55 12 18 96 59 31 a6 48 40 d5 2d d5 |.|..U...Y1.H@.-.|
+00000240 ee bb 02 a0 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da |.......|..0}<.v.|
+00000250 4f 3d c0 fa ae 2d 33 24 6b 03 7b 1b 67 59 11 21 |O=...-3$k.{.gY.!|
+00000260 b5 11 bc 77 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 |...w...n.-.5.d_"|
+00000270 3e 63 10 6b be ff 14 86 6d 0d f0 15 31 a8 14 38 |>c.k....m...1..8|
+00000280 1e 3b 84 87 2c cb 98 ed 51 76 b9 b1 4f dd db 9b |.;..,...Qv..O...|
+00000290 84 04 86 40 fa 51 dd ba b4 8d eb e3 46 de 46 b9 |...@.Q......F.F.|
+000002a0 4f 86 c7 f9 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 |O.....A4......9.|
+000002b0 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 6e 2e 79 82 3a |...........n.y.:|
-00000010 c4 68 72 f5 a2 42 3d 71 f9 ec 22 8c 0b fa f0 82 |.hr..B=q..".....|
-00000020 82 c0 cb fc 52 0a 51 03 04 8c eb 4a 4e 4f b6 49 |....R.Q....JNO.I|
-00000030 ef 94 65 21 3c f7 9d 46 85 6e 35 d5 17 6b ff a3 |..e!<..F.n5..k..|
-00000040 5e 4d c1 36 1a 2f 68 f5 06 d4 2d 73 4f 1c 3b 7b |^M.6./h...-sO.;{|
-00000050 c1 fa 4e 7e 7c f9 6c 13 a6 f4 3a 43 e9 aa be 22 |..N~|.l...:C..."|
-00000060 85 6f 2f 7c 5b b0 08 e2 86 b2 ae cb a9 12 d8 32 |.o/|[..........2|
-00000070 80 1d e4 2e 5d c3 66 d1 19 e5 89 33 2a 88 24 40 |....].f....3*.$@|
-00000080 2a 6d 6b b5 f1 92 4b 66 06 b8 49 14 03 03 00 01 |*mk...Kf..I.....|
-00000090 01 16 03 03 00 24 16 49 e2 a0 67 31 cf 0d 72 cb |.....$.I..g1..r.|
-000000a0 ac 16 2c 80 37 71 69 f7 5f c4 d3 00 19 b7 4b fb |..,.7qi._.....K.|
-000000b0 e5 e9 74 8e 30 b3 1c c5 ae e6 |..t.0.....|
+00000000 16 03 03 00 86 10 00 00 82 00 80 87 06 ba d7 1f |................|
+00000010 68 0c f2 a6 51 b4 ae af 8c c5 5d d4 bd f1 82 6d |h...Q.....]....m|
+00000020 1d dd ce 69 be 07 62 13 af 06 71 3a 47 a9 bd f7 |...i..b...q:G...|
+00000030 bb 27 f0 38 df 88 01 40 29 c9 bb 7b 5d 6d 28 bd |.'.8...@)..{]m(.|
+00000040 c8 28 e6 6d ff 5c c9 d3 c6 f5 06 17 e5 e5 1c 5b |.(.m.\.........[|
+00000050 a1 18 7a 34 92 0a 39 20 5a 22 44 6c cc 5c 8c 83 |..z4..9 Z"Dl.\..|
+00000060 d0 19 4c bb 4e dc e2 64 ec b2 b8 3f 18 3f 9d 65 |..L.N..d...?.?.e|
+00000070 5b 89 26 ae f6 fd 54 71 c4 45 e9 56 6a 28 42 a9 |[.&...Tq.E.Vj(B.|
+00000080 5b 9f 12 69 a4 08 83 53 95 04 18 14 03 03 00 01 |[..i...S........|
+00000090 01 16 03 03 00 24 55 80 0f 43 c3 08 45 99 c9 1b |.....$U..C..E...|
+000000a0 fd fe dd e8 48 f2 89 99 86 ef f7 fd 5f 2a 4b 0b |....H......._*K.|
+000000b0 33 0e 5f 17 bb b7 a2 3c 9d 30 |3._....<.0|
>>> Flow 4 (server to client)
-00000000 16 03 03 00 72 04 00 00 6e 00 00 00 00 00 68 00 |....r...n.....h.|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 |...............e|
-00000020 ea 4b d1 ef ba 06 38 1e e1 88 82 3a cd 03 ac 3b |.K....8....:...;|
-00000030 39 0a e0 19 fd af 6c 57 30 df 31 6e f7 92 38 4b |9.....lW0.1n..8K|
-00000040 5d 77 90 39 ff 32 51 f5 ed 12 d7 b0 7c 4d 6c c5 |]w.9.2Q.....|Ml.|
-00000050 76 e4 72 48 3e 59 23 fe 0d 15 df f4 ba ea b9 67 |v.rH>Y#........g|
-00000060 16 23 8f 7d 15 b6 11 f1 ab d7 d4 cd a3 21 82 92 |.#.}.........!..|
-00000070 2a 12 cf 95 f3 60 b2 14 03 03 00 01 01 16 03 03 |*....`..........|
-00000080 00 24 89 ad 87 04 4f 08 dc 2a 71 37 fb f1 95 d1 |.$....O..*q7....|
-00000090 2e 3c c2 6e 0f 38 5d e4 0e c3 f7 27 d0 46 a3 c1 |.<.n.8]....'.F..|
-000000a0 a8 3b 06 ed 96 ec 17 03 03 00 21 30 d4 9f 0b 49 |.;........!0...I|
-000000b0 9f a2 a8 a1 2c 0a 79 93 56 2d 8a ee 85 ed 62 42 |....,.y.V-....bB|
-000000c0 8c 18 fe 7a 09 3a 24 c4 5e ed 7d 2a 15 03 03 00 |...z.:$.^.}*....|
-000000d0 16 a0 24 0a 8b 90 4c fc 99 ba 67 bb 04 1e 59 69 |..$...L...g...Yi|
-000000e0 c2 98 49 b5 00 0b e0 |..I....|
+00000000 16 03 03 00 82 04 00 00 7e 00 00 00 00 00 78 50 |........~.....xP|
+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 b5 83 61 c4 74 90 94 e5 6c fd 70 64 57 3a |o,..a.t...l.pdW:|
+00000040 25 78 bf 9f a0 7c 51 bc 2a 69 1e b3 fd 71 34 b7 |%x...|Q.*i...q4.|
+00000050 9a ef cb 49 37 f8 5d 5e 7c cf 6d fc 13 c1 52 79 |...I7.]^|.m...Ry|
+00000060 8e ed c3 84 01 33 94 10 65 34 64 5e b4 9c 07 46 |.....3..e4d^...F|
+00000070 5b 9e d7 5e 55 df fd c0 e9 d2 e8 d3 c6 42 18 ef |[..^U........B..|
+00000080 a5 6c be e8 d2 49 c6 14 03 03 00 01 01 16 03 03 |.l...I..........|
+00000090 00 24 66 94 4b b5 3f 5d 59 db 36 c1 dd 55 8c ee |.$f.K.?]Y.6..U..|
+000000a0 de a4 bc d0 12 44 31 3e e4 e7 4a 51 e3 62 69 ab |.....D1>..JQ.bi.|
+000000b0 14 78 85 49 a3 97 17 03 03 00 21 dd 96 5d 21 e0 |.x.I......!..]!.|
+000000c0 2e 3d 33 dd 6c df bb 41 d7 bd 50 c7 1c 6f 97 34 |.=3.l..A..P..o.4|
+000000d0 6a 6e d6 1d 27 81 2d f7 fb 32 85 02 15 03 03 00 |jn..'.-..2......|
+000000e0 16 5e 4e 62 15 97 a7 a3 9b 1b 50 44 85 fb 28 66 |.^Nb......PD..(f|
+000000f0 aa 66 54 45 c9 dc 61 |.fTE..a|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable b/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable
index 30f00268155..a8f7edfa2c0 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable
@@ -1,87 +1,83 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 60 01 00 00 5c 03 03 54 23 54 02 17 |....`...\..T#T..|
-00000010 f3 53 13 3d 48 88 c3 19 b9 d1 3d 33 7f f5 99 56 |.S.=H.....=3...V|
-00000020 04 71 1b d9 d5 64 8a 0d 4a 54 00 00 00 04 00 05 |.q...d..JT......|
-00000030 00 ff 01 00 00 2f 00 23 00 00 00 0d 00 22 00 20 |...../.#.....". |
+00000000 16 03 01 00 5e 01 00 00 5a 03 03 62 f6 20 66 23 |....^...Z..b. f#|
+00000010 d5 71 0a c0 57 92 2e 80 b6 06 0c 54 5b 1c 77 a0 |.q..W......T[.w.|
+00000020 ce 0b b2 52 4a b9 f2 c6 97 33 42 00 00 04 00 05 |...RJ....3B.....|
+00000030 00 ff 01 00 00 2d 00 23 00 00 00 0d 00 20 00 1e |.....-.#..... ..|
00000040 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................|
-00000050 04 03 03 01 03 02 03 03 02 01 02 02 02 03 01 01 |................|
-00000060 00 0f 00 01 01 |.....|
+00000050 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................|
+00000060 00 01 01 |...|
>>> Flow 2 (server to client)
00000000 16 03 03 00 35 02 00 00 31 03 03 00 00 00 00 00 |....5...1.......|
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 00 00 05 00 00 |................|
-00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 be 0b |..#.............|
-00000040 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 02 |.........0...0..|
-00000050 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f b8 |................|
-00000060 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 |.0...*.H........|
-00000070 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 |0E1.0...U....AU1|
-00000080 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 |.0...U....Some-S|
-00000090 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 |tate1!0...U....I|
-000000a0 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 |nternet Widgits |
-000000b0 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 32 |Pty Ltd0...10042|
-000000c0 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 34 |4090938Z..110424|
-000000d0 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 55 |090938Z0E1.0...U|
-000000e0 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 |....AU1.0...U...|
-000000f0 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 |.Some-State1!0..|
-00000100 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 |.U....Internet W|
-00000110 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 81 |idgits Pty Ltd0.|
-00000120 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00 |.0...*.H........|
-00000130 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 17 |....0.......y...|
-00000140 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 03 |...F...i..+.CZ..|
-00000150 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 |-.zC...R..eL,x.#|
-00000160 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 |........;~b.,.3.|
-00000170 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 cd |..\zV.....X{&?..|
-00000180 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 71 |....!.J..T.Z..Bq|
-00000190 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e |......~.}}..9...|
-000001a0 db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d b8 |.Q.|..L;2f......|
-000001b0 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 01 |q.....k..-y.....|
-000001c0 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 04 |...0..0...U.....|
-000001d0 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de d3 |.....Z..(.i.#i..|
-000001e0 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 6c |&...90u..U.#.n0l|
-000001f0 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.|
-00000200 d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 09 |.&...9.I.G0E1.0.|
-00000210 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
-00000220 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
-00000230 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
-00000240 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
-00000250 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 |d...........0...|
-00000260 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a 86 |U....0....0...*.|
-00000270 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c 45 |H.............lE|
-00000280 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a |$.k.Y..R.......z|
-00000290 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f |du.Z.f..+...f..O|
-000002a0 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 7a |8.n`....A..%...z|
-000002b0 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db 95 |$.0.........1Y..|
-000002c0 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 |..x.PV\..Z-Z_3..|
-000002d0 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f |..u....R...... _|
-000002e0 f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d |..........W.p.&m|
-000002f0 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 03 |q..&n8P)l.......|
-00000300 00 04 0e 00 00 00 |......|
+00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 71 0b |..#...........q.|
+00000040 00 02 6d 00 02 6a 00 02 67 30 82 02 63 30 82 01 |..m..j..g0..c0..|
+00000050 cc a0 03 02 01 02 02 09 00 a2 73 00 0c 81 00 cb |..........s.....|
+00000060 f3 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |.0...*.H........|
+00000070 30 2b 31 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f |0+1.0...U....Goo|
+00000080 67 6c 65 20 54 45 53 54 49 4e 47 31 10 30 0e 06 |gle TESTING1.0..|
+00000090 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
+000000a0 0d 31 35 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.150101000000Z..|
+000000b0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 26 31 |250101000000Z0&1|
+000000c0 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 |.0...U....Google|
+000000d0 20 54 45 53 54 49 4e 47 31 0b 30 09 06 03 55 04 | TESTING1.0...U.|
+000000e0 03 13 02 47 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |...Go0..0...*.H.|
+000000f0 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....|
+00000100 81 00 af 87 88 f6 20 1b 95 65 6c 14 ab 44 05 af |...... ..el..D..|
+00000110 3b 45 14 e3 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 |;E...m..cM...jb5|
+00000120 86 c0 4a f9 18 7c f6 aa 25 5e 7a 64 31 66 00 ba |..J..|..%^zd1f..|
+00000130 f4 8e 92 af c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 |.....k.v.._A.nV.|
+00000140 97 1b 97 c1 3c 12 39 21 66 3d 2b 16 d1 bc db 1c |....<.9!f=+.....|
+00000150 c0 a7 da b7 ca ad ba da cb d5 21 50 ec de 8d ab |..........!P....|
+00000160 d1 6b 81 4b 89 02 f3 c4 be c1 6c 89 b1 44 84 bd |.k.K......l..D..|
+00000170 21 d1 04 7d 9d 16 4d f9 82 15 f6 ef fa d6 09 47 |!..}..M........G|
+00000180 f2 fb 02 03 01 00 01 a3 81 93 30 81 90 30 0e 06 |..........0..0..|
+00000190 03 55 1d 0f 01 01 ff 04 04 03 02 05 a0 30 1d 06 |.U...........0..|
+000001a0 03 55 1d 25 04 16 30 14 06 08 2b 06 01 05 05 07 |.U.%..0...+.....|
+000001b0 03 01 06 08 2b 06 01 05 05 07 03 02 30 0c 06 03 |....+.......0...|
+000001c0 55 1d 13 01 01 ff 04 02 30 00 30 19 06 03 55 1d |U.......0.0...U.|
+000001d0 0e 04 12 04 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e |......P..o...TMn|
+000001e0 cb 69 5e 06 f4 30 1b 06 03 55 1d 23 04 14 30 12 |.i^..0...U.#..0.|
+000001f0 80 10 bf 3d b6 a9 66 f2 b8 40 cf ea b4 03 78 48 |...=..f..@....xH|
+00000200 1a 41 30 19 06 03 55 1d 11 04 12 30 10 82 0e 65 |.A0...U....0...e|
+00000210 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 |xample.golang0..|
+00000220 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 81 00 |.*.H............|
+00000230 92 7c af 91 55 12 18 96 59 31 a6 48 40 d5 2d d5 |.|..U...Y1.H@.-.|
+00000240 ee bb 02 a0 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da |.......|..0}<.v.|
+00000250 4f 3d c0 fa ae 2d 33 24 6b 03 7b 1b 67 59 11 21 |O=...-3$k.{.gY.!|
+00000260 b5 11 bc 77 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 |...w...n.-.5.d_"|
+00000270 3e 63 10 6b be ff 14 86 6d 0d f0 15 31 a8 14 38 |>c.k....m...1..8|
+00000280 1e 3b 84 87 2c cb 98 ed 51 76 b9 b1 4f dd db 9b |.;..,...Qv..O...|
+00000290 84 04 86 40 fa 51 dd ba b4 8d eb e3 46 de 46 b9 |...@.Q......F.F.|
+000002a0 4f 86 c7 f9 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 |O.....A4......9.|
+000002b0 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 27 e9 a4 f7 e7 |...........'....|
-00000010 df 25 de 84 8c 1f d6 e6 c3 11 28 55 9a c1 91 37 |.%........(U...7|
-00000020 84 f5 ba f8 80 0d ca 50 cb 1e 72 f7 97 6f c2 b2 |.......P..r..o..|
-00000030 04 4d 13 7c e0 6e a0 1f 91 e1 38 1b a2 c0 55 16 |.M.|.n....8...U.|
-00000040 7f 29 fc ed 1c 1a cf 72 14 c3 00 c1 dd 36 36 af |.).....r.....66.|
-00000050 a6 e4 a8 be ba ec 13 d0 1e d0 1d fd e1 5b 27 fd |.............['.|
-00000060 9a da 2e 12 c8 b0 b9 c2 b9 76 ec 7f 3c 98 b6 63 |.........v..<..c|
-00000070 bc da f0 07 7a 3d e7 61 f4 2f 12 80 3b f9 3b cc |....z=.a./..;.;.|
-00000080 05 c8 2f 7e 28 b2 73 bf 97 61 29 14 03 03 00 01 |../~(.s..a).....|
-00000090 01 16 03 03 00 24 17 59 a9 45 53 46 33 96 50 dd |.....$.Y.ESF3.P.|
-000000a0 3e 23 aa 91 38 f8 56 4a 2f 1a f2 b1 44 9b ce 17 |>#..8.VJ/...D...|
-000000b0 6b 8a 89 76 bc 67 b8 8b ba 90 |k..v.g....|
+00000000 16 03 03 00 86 10 00 00 82 00 80 5b 43 6f db 52 |...........[Co.R|
+00000010 56 e3 d9 4b 1e c8 95 8b 78 a6 19 00 44 9c 44 b4 |V..K....x...D.D.|
+00000020 f7 fe d4 3f 69 ea 9c 67 d3 48 b8 c5 93 bc 22 f1 |...?i..g.H....".|
+00000030 a9 0e 81 82 d0 cf dc 0b ea f0 02 67 92 8d 72 40 |...........g..r@|
+00000040 25 bb f3 88 53 c0 2f ba 38 ef da d1 7c 73 84 ec |%...S./.8...|s..|
+00000050 61 96 b9 d4 93 06 4a 06 7b 6d 40 e7 bb 15 59 6e |a.....J.{m@...Yn|
+00000060 ad 31 71 eb cf 84 57 3b 0c ad aa 70 02 63 24 a9 |.1q...W;...p.c$.|
+00000070 7c a1 9a 6d b7 e0 4c d5 67 4c ce 53 9d b6 31 de ||..m..L.gL.S..1.|
+00000080 69 b9 f5 ca a8 e3 ea d6 f5 a3 f3 14 03 03 00 01 |i...............|
+00000090 01 16 03 03 00 24 66 ae 13 67 70 20 f5 f5 76 03 |.....$f..gp ..v.|
+000000a0 11 6e 32 a6 73 a2 70 42 ab 4f 16 93 d2 fa a1 ac |.n2.s.pB.O......|
+000000b0 4e b2 08 4a a9 b5 20 aa 80 b6 |N..J.. ...|
>>> Flow 4 (server to client)
-00000000 16 03 03 00 72 04 00 00 6e 00 00 00 00 00 68 00 |....r...n.....h.|
-00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 65 |...............e|
-00000020 ea 4b d1 ef ba 2d db 0c ba 9a d4 20 76 57 c8 ec |.K...-..... vW..|
-00000030 dc 2d 77 fb fb 3b 93 5f 53 e0 14 4f 90 fb d6 55 |.-w..;._S..O...U|
-00000040 57 8c 8d 0d 25 ea 5d 0d f2 91 e5 12 22 12 ec 7b |W...%.]....."..{|
-00000050 5f b6 6e fd 07 59 23 24 fc b1 97 ca ea 56 a5 c2 |_.n..Y#$.....V..|
-00000060 a0 e4 9e 99 64 f2 64 d0 75 7a 46 63 e3 dc 21 ed |....d.d.uzFc..!.|
-00000070 78 56 e9 e1 ab 66 80 14 03 03 00 01 01 16 03 03 |xV...f..........|
-00000080 00 24 fc 14 68 07 17 1f df b7 84 cb fd c1 e0 e4 |.$..h...........|
-00000090 f2 1a ea 34 b5 00 7f 70 be c8 1c 0a d6 55 e3 57 |...4...p.....U.W|
-000000a0 50 4e 6d 7d 8a 5d 17 03 03 00 21 24 27 50 40 c1 |PNm}.]....!$'P@.|
-000000b0 c5 bd c7 9f 95 d9 ba 2e 7b 0e db ea a7 31 81 05 |........{....1..|
-000000c0 75 43 b1 63 cf b8 55 92 ef 76 98 a9 15 03 03 00 |uC.c..U..v......|
-000000d0 16 d7 ea 3c 79 e7 a6 2f 61 39 ec 4e 95 86 48 5e |...<y../a9.N..H^|
-000000e0 75 a0 9e 41 42 89 67 |u..AB.g|
+00000000 16 03 03 00 82 04 00 00 7e 00 00 00 00 00 78 50 |........~.....xP|
+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 b5 83 61 bd 50 da 49 7f 8b 8f 58 57 00 a1 |o,..a.P.I...XW..|
+00000040 11 0d 4a 9d 8a 39 dd 85 23 c0 eb 9d 1a 45 93 92 |..J..9..#....E..|
+00000050 e7 af 15 a3 a4 48 da f9 a4 d8 8e cb 6c 3d 44 77 |.....H......l=Dw|
+00000060 f9 c4 83 89 85 33 94 c1 c6 20 9a 73 44 83 89 5e |.....3... .sD..^|
+00000070 59 ee 05 c6 7e 8d e9 7d 7b f8 84 46 b6 7d 43 ec |Y...~..}{..F.}C.|
+00000080 f1 af 1f 0f 35 b4 1c 14 03 03 00 01 01 16 03 03 |....5...........|
+00000090 00 24 8c 0d bd bc 34 93 ed ad 80 21 6d 08 e4 0e |.$....4....!m...|
+000000a0 67 4f 99 8d df 2a 2d 4f 13 39 82 be a1 d2 1f 75 |gO...*-O.9.....u|
+000000b0 73 c8 b2 ce 41 0c 17 03 03 00 21 d8 c2 50 d6 11 |s...A.....!..P..|
+000000c0 bc 86 58 68 0e 60 4a 47 a5 d0 12 7e a3 b5 be 64 |..Xh.`JG...~...d|
+000000d0 e6 b1 bc 62 70 85 d4 7c cd fe 67 cf 15 03 03 00 |...bp..|..g.....|
+000000e0 16 e4 1c d5 f4 f7 d0 f5 b2 b3 2b 3d b0 7d c0 23 |..........+=.}.#|
+000000f0 e2 5c a5 c7 a4 23 fa |.\...#.|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-3DES b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-3DES
index 5995b3314c4..74576264d85 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-3DES
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-3DES
@@ -1,83 +1,77 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 68 |....\...X..R.WYh|
-00000010 11 72 a6 ec 6b 0a 47 1d 10 06 ec 75 af 07 38 a0 |.r..k.G....u..8.|
-00000020 30 9e 91 12 e1 9b 19 46 0d d4 45 00 00 04 00 0a |0......F..E.....|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
+00000000 16 03 01 00 5a 01 00 00 56 03 03 ac 1d 0b 6e f3 |....Z...V.....n.|
+00000010 25 04 00 97 a0 79 39 c5 ef 95 8b e3 c1 87 0d 1c |%....y9.........|
+00000020 0b c3 39 3e ff 23 0e 3c 28 8f 75 00 00 04 00 0a |..9>.#.<(.u.....|
+00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......|
00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
+00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............|
>>> Flow 2 (server to client)
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 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 7a c0 73 ec cb |...........z.s..|
-00000010 cf c2 a8 86 c0 7e 03 63 57 a1 ce 42 37 6d 78 54 |.....~.cW..B7mxT|
-00000020 29 f5 3e cc 57 c7 0d d9 69 e1 52 5c 3b 6b c4 c7 |).>.W...i.R\;k..|
-00000030 20 6d 59 ee c0 07 81 74 74 9f 62 41 64 f0 4d c8 | mY....tt.bAd.M.|
-00000040 9b aa 1a b9 da 56 07 f5 6c 1c 59 8c d3 f9 08 d9 |.....V..l.Y.....|
-00000050 08 f4 16 93 5d 9a e5 6f fb 9f ba 3d 3c d6 81 ad |....]..o...=<...|
-00000060 02 12 a7 28 b6 81 6a 77 c3 e9 d7 c7 54 d6 77 83 |...(..jw....T.w.|
-00000070 77 de 71 fb b3 f3 2d c4 a5 b1 e5 de aa 0e 21 bd |w.q...-.......!.|
-00000080 91 a2 dc 7f f7 6f 90 82 54 b1 e7 14 03 03 00 01 |.....o..T.......|
-00000090 01 16 03 03 00 30 8f ee bf fb c8 5c 54 f5 29 23 |.....0.....\T.)#|
-000000a0 d4 55 f6 98 a1 6e d5 43 e7 81 b2 36 f2 98 d8 1b |.U...n.C...6....|
-000000b0 0d 76 cb 14 ba 32 d7 36 30 e6 ab 42 80 95 f6 8a |.v...2.60..B....|
-000000c0 60 64 a0 6b 90 81 |`d.k..|
+00000000 16 03 03 00 86 10 00 00 82 00 80 15 75 c5 63 e0 |............u.c.|
+00000010 c3 a5 89 dd b3 bf 03 1d bd 62 86 2e 10 98 79 cb |.........b....y.|
+00000020 40 3d 9b 36 7e 55 65 d7 80 0a c5 24 ff ad 98 d5 |@=.6~Ue....$....|
+00000030 d4 d9 4e 1b ed 50 0a fa 8a 3e f3 01 c4 e3 47 f7 |..N..P...>....G.|
+00000040 bd 81 fc 33 0b 61 6b b5 3f 38 9b 24 cd 7d 46 66 |...3.ak.?8.$.}Ff|
+00000050 18 87 ea 67 04 b7 ad 23 ac 64 4e 21 cd 29 9f 60 |...g...#.dN!.).`|
+00000060 0e c1 ca 3d 25 d6 d5 2b e2 60 dc b5 57 be c0 b8 |...=%..+.`..W...|
+00000070 b6 35 25 96 5b 36 55 53 86 b7 90 ef 6c bf 45 2a |.5%.[6US....l.E*|
+00000080 3d a0 af 08 f0 8a 9c d0 d8 6b 88 14 03 03 00 01 |=........k......|
+00000090 01 16 03 03 00 30 c5 0f b8 12 c6 5a 42 6a d8 3f |.....0.....ZBj.?|
+000000a0 f5 49 e4 9a 5d b7 93 90 e7 09 1f 68 40 9d 33 a9 |.I..]......h@.3.|
+000000b0 21 fa 9c 12 c7 7c d4 bf 91 c2 f8 ac 27 b9 8b b6 |!....|......'...|
+000000c0 34 6e f3 c0 fb 83 |4n....|
>>> Flow 4 (server to client)
00000000 14 03 03 00 01 01 16 03 03 00 30 00 00 00 00 00 |..........0.....|
-00000010 00 00 00 2c 21 52 34 63 ac e3 a3 66 45 00 41 0c |...,!R4c...fE.A.|
-00000020 93 5d 6a 74 5a 25 dc 69 1d 76 73 0c f4 42 6a 18 |.]jtZ%.i.vs..Bj.|
-00000030 5b 62 23 e7 fe 41 cf d4 9b 86 35 17 03 03 00 30 |[b#..A....5....0|
-00000040 00 00 00 00 00 00 00 00 7d 5d ce 43 85 5c 6b 89 |........}].C.\k.|
-00000050 c9 a5 0e 22 69 8e b9 4a 77 4c c0 4e cc 79 d9 7e |..."i..JwL.N.y.~|
-00000060 a3 c8 d3 db 5c 53 f8 92 4d c4 5a 88 72 58 05 11 |....\S..M.Z.rX..|
-00000070 15 03 03 00 20 00 00 00 00 00 00 00 00 1d 63 8b |.... .........c.|
-00000080 a7 74 fb 76 1d 47 31 93 1f ec 8c e2 18 8e 21 dd |.t.v.G1.......!.|
-00000090 87 97 9f 1c ca |.....|
+00000010 00 00 00 c1 a2 65 c1 36 63 85 cd ca 5a eb 50 ab |.....e.6c...Z.P.|
+00000020 bb ec 43 30 37 8f 71 b9 b7 2d 1b bb a2 88 fa d5 |..C07.q..-......|
+00000030 b4 a5 c5 4b 19 71 53 46 7d bb d0 17 03 03 00 30 |...K.qSF}......0|
+00000040 00 00 00 00 00 00 00 00 6a a1 3d c6 35 a0 58 c4 |........j.=.5.X.|
+00000050 ef 12 f2 59 1e 02 42 33 42 5f fe 87 a2 1a ce b7 |...Y..B3B_......|
+00000060 0d d2 36 7c 7f 1a 4c 79 1f 38 34 58 b3 05 fb 96 |..6|..Ly.84X....|
+00000070 15 03 03 00 20 00 00 00 00 00 00 00 00 a1 89 42 |.... ..........B|
+00000080 bc 58 1f 2f 9b c4 d7 e2 d1 ce 1c c9 e0 a5 47 be |.X./..........G.|
+00000090 63 0c a4 bf 26 |c...&|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES
index a152a96a849..4ca860d2c26 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES
@@ -1,87 +1,81 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 d0 |....\...X..R.WY.|
-00000010 38 05 36 7e e3 1e 93 2a 5a bf dc c2 f8 0a 03 6f |8.6~...*Z......o|
-00000020 1a fc 21 74 e5 8b 2a c3 9e 2c 26 00 00 04 00 2f |..!t..*..,&..../|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
+00000000 16 03 01 00 5a 01 00 00 56 03 03 be 9a 2f 46 66 |....Z...V..../Ff|
+00000010 a3 b3 10 62 63 b6 32 cb de 1e eb 76 13 50 60 d0 |...bc.2....v.P`.|
+00000020 ee 40 a9 cd 50 ae d8 86 10 37 8b 00 00 04 00 2f |.@..P....7...../|
+00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......|
00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
+00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............|
>>> Flow 2 (server to client)
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 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 4b b4 28 bc 78 |...........K.(.x|
-00000010 41 34 f3 49 e8 74 07 74 42 ae 2e 55 9e 9a ce e5 |A4.I.t.tB..U....|
-00000020 4a 1b e7 55 c7 64 c4 9c b3 dd 20 d6 f8 8e 67 b3 |J..U.d.... ...g.|
-00000030 7a 5c 3b 34 e4 1a f6 bd 65 fc 21 cd 9a de 64 77 |z\;4....e.!...dw|
-00000040 09 a5 92 e5 a4 f5 18 7b 23 5b 8b c1 95 23 97 6f |.......{#[...#.o|
-00000050 76 55 04 34 22 7d 43 71 db cd eb f8 36 36 44 4b |vU.4"}Cq....66DK|
-00000060 ae e3 cc ec 64 88 7b e1 ea d6 ab 49 35 94 a5 04 |....d.{....I5...|
-00000070 1e 83 c5 cf 21 bb ca 33 5f d4 bf 1d d3 4d 07 59 |....!..3_....M.Y|
-00000080 b4 39 b2 4b 7b 05 43 70 0d ba 7a 14 03 03 00 01 |.9.K{.Cp..z.....|
-00000090 01 16 03 03 00 40 74 4b 7d b2 53 49 ea 86 90 c3 |.....@tK}.SI....|
-000000a0 64 6b 64 31 1a 2a 3f 1a 37 1e 56 b8 dd 12 6d 56 |dkd1.*?.7.V...mV|
-000000b0 2a 61 92 5b 39 e7 e1 be 71 70 4b 9b b3 f0 71 e7 |*a.[9...qpK...q.|
-000000c0 47 2e 2e 17 c3 0a 66 9f 69 74 30 2d f0 a0 7f 84 |G.....f.it0-....|
-000000d0 25 db c1 81 ee cf |%.....|
+00000000 16 03 03 00 86 10 00 00 82 00 80 61 b4 31 93 2b |...........a.1.+|
+00000010 d5 e8 06 74 b1 f6 d6 5f a3 92 78 b6 cf bf 7f ea |...t..._..x.....|
+00000020 a2 07 1e 90 94 68 5b 19 ae d4 e3 11 78 96 58 fd |.....h[.....x.X.|
+00000030 96 18 f2 09 58 dc 39 a1 d9 9e 83 f0 24 45 6e 6b |....X.9.....$Enk|
+00000040 e6 5e e7 cb 94 42 00 10 64 d5 d2 bc 80 23 bd fe |.^...B..d....#..|
+00000050 5c 3e 3a 80 ff 38 b8 dc ff 25 ba b0 0a cc ef 94 |\>:..8...%......|
+00000060 a1 31 bd 04 93 91 86 6e 8b fd a1 9d 01 ee 91 a6 |.1.....n........|
+00000070 44 8b 21 55 52 67 3e b1 e4 6e bd 1f 07 85 e1 97 |D.!URg>..n......|
+00000080 7f 55 70 00 5f f4 4b e6 50 45 f7 14 03 03 00 01 |.Up._.K.PE......|
+00000090 01 16 03 03 00 40 71 ff ab 6d 79 3c da dc 5b 34 |.....@q..my<..[4|
+000000a0 48 39 48 08 e3 29 cb 53 21 fd 67 93 0b f8 81 47 |H9H..).S!.g....G|
+000000b0 40 7f 23 50 5f 94 db 2b 7b 7e 9f 0b bf 38 59 d9 |@.#P_..+{~...8Y.|
+000000c0 6b 57 8f 1e 83 eb 93 2c 62 12 31 c6 f5 21 f2 22 |kW.....,b.1..!."|
+000000d0 7a 82 e9 e6 ec 38 |z....8|
>>> 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 f3 4d 5a fc 21 |............MZ.!|
-00000020 30 b5 a1 86 9d e2 ea 38 ac 54 57 fa 5a 54 97 b8 |0......8.TW.ZT..|
-00000030 bb 4d 64 09 ef ce a1 75 0c 50 8d ff 5c c2 e9 47 |.Md....u.P..\..G|
-00000040 95 93 53 c0 bd dc c5 9c e0 59 17 17 03 03 00 40 |..S......Y.....@|
+00000010 00 00 00 00 00 00 00 00 00 00 00 45 87 33 41 c1 |...........E.3A.|
+00000020 b8 e7 4c 11 1c 1b 7b 55 51 85 06 01 c1 b6 87 6b |..L...{UQ......k|
+00000030 01 b3 56 c4 5a 37 ea b6 3a c4 b0 da 1b 5c 15 d4 |..V.Z7..:....\..|
+00000040 03 5a 57 e9 9a 56 16 a5 fa 77 1c 17 03 03 00 40 |.ZW..V...w.....@|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 69 c5 48 6e 45 cf 98 1b 2c 23 40 d1 ab a3 c2 e2 |i.HnE...,#@.....|
-00000070 10 7b b1 c8 21 3c f0 eb 96 bd 4f 78 b2 4a 7b 18 |.{..!<....Ox.J{.|
-00000080 4c b1 a6 67 bf 06 40 01 d0 8d 91 be 17 d8 0c 71 |L..g..@........q|
+00000060 6f 2e 7c ba 3d 85 4c 7b 1f 13 a5 d6 97 e6 67 f4 |o.|.=.L{......g.|
+00000070 24 d5 a8 d4 26 41 64 0a fd b3 2e a0 a2 7a 2b 54 |$...&Ad......z+T|
+00000080 a4 1d 6e fe 4c c4 73 e3 76 d0 3a 60 52 df b0 53 |..n.L.s.v.:`R..S|
00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
-000000a0 00 00 00 00 00 20 84 80 3d 70 fe ae ee d7 2f e9 |..... ..=p..../.|
-000000b0 bf 65 30 bf 0b dd 98 ea bb ba 12 14 98 53 7f d5 |.e0..........S..|
-000000c0 56 ce 06 3c d0 |V..<.|
+000000a0 00 00 00 00 00 8b 0a 6d 14 3b 84 bc 7d c6 8d 9d |.......m.;..}...|
+000000b0 d5 27 32 84 4b 14 75 42 0f aa 5e 88 ba fa a2 c7 |.'2.K.uB..^.....|
+000000c0 16 93 8a c4 fd |.....|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM
index 0ddfe022f22..7a26ebd82a7 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM
@@ -1,93 +1,87 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 9c 01 00 00 98 03 03 53 04 f1 30 73 |...........S..0s|
-00000010 a1 ea 8c d2 90 1c c6 d6 0d 3c af 58 21 65 90 25 |.........<.X!e.%|
-00000020 5e fa f4 27 22 65 c9 68 90 b9 04 00 00 04 c0 2f |^..'"e.h......./|
-00000030 00 ff 01 00 00 6b 00 0b 00 04 03 00 01 02 00 0a |.....k..........|
+00000000 16 03 01 00 9a 01 00 00 96 03 03 16 dc f8 f5 3a |...............:|
+00000010 13 32 e6 1f bd f6 3c 66 b7 4c 67 17 ee b2 2a ba |.2....<f.Lg...*.|
+00000020 68 5b 8e b1 7c 8f 71 d6 6c 30 e1 00 00 04 c0 2f |h[..|.q.l0...../|
+00000030 00 ff 01 00 00 69 00 0b 00 04 03 00 01 02 00 0a |.....i..........|
00000040 00 34 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 |.4.2............|
00000050 00 09 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 |................|
00000060 00 15 00 04 00 05 00 12 00 13 00 01 00 02 00 03 |................|
-00000070 00 0f 00 10 00 11 00 0d 00 22 00 20 06 01 06 02 |.........". ....|
+00000070 00 0f 00 10 00 11 00 0d 00 20 00 1e 06 01 06 02 |......... ......|
00000080 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000090 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-000000a0 01 |.|
+00000090 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............|
>>> Flow 2 (server to client)
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 00 00 00 00 00 00 00 00 00 c0 2f 00 00 |............./..|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 cd 0c 00 |n8P)l...........|
-00000300 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 35 |.....A...7...Q.5|
-00000310 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >|
-00000320 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l|
-00000330 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.|
-00000340 41 03 56 6b dc 5a 89 04 01 00 80 a2 54 61 84 29 |A.Vk.Z......Ta.)|
-00000350 3e 97 4b 97 9a 9f 5c c0 49 6d 86 d2 79 8e 95 a1 |>.K...\.Im..y...|
-00000360 0a 5a 36 73 34 bb 05 73 35 47 e1 2b 5d f3 ef 36 |.Z6s4..s5G.+]..6|
-00000370 a8 32 e2 7e ef aa 3f 1f b3 64 60 d4 06 2e 98 e3 |.2.~..?..d`.....|
-00000380 11 e2 60 3c d6 20 17 63 b2 6f a0 cd 21 01 2b 4e |..`<. .c.o..!.+N|
-00000390 b2 a8 55 04 39 37 5c 6c 71 66 4d a3 eb 1b 83 67 |..U.97\lqfM....g|
-000003a0 6b 15 a0 56 9a f1 a2 79 92 29 ce 58 3c 10 4d 65 |k..V...y.).X<.Me|
-000003b0 1f 22 e3 ea d8 74 aa 01 7e ca f3 89 23 41 4d bd |."...t..~...#AM.|
-000003c0 df 77 4e 59 54 97 74 ad 07 ea c0 16 03 03 00 04 |.wNYT.t.........|
-000003d0 0e 00 00 00 |....|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 |........A...7...|
+000002c0 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..|
+000002d0 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..|
+000002e0 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.|
+000002f0 b5 68 1a 41 03 56 6b dc 5a 89 05 01 00 80 40 b3 |.h.A.Vk.Z.....@.|
+00000300 66 ee 53 3c 80 f4 da d1 de e6 fe 50 c8 89 60 d5 |f.S<.......P..`.|
+00000310 e4 80 73 39 91 79 6c cf 89 bb a5 da e4 c7 e5 0d |..s9.yl.........|
+00000320 13 a6 76 24 65 1a a2 b8 cb 95 c2 c6 9d 66 74 57 |..v$e........ftW|
+00000330 9e 90 4f 48 77 88 3a b4 f3 fa 88 ab 61 22 d3 40 |..OHw.:.....a".@|
+00000340 08 c4 0a 69 19 ed c3 ea d8 15 79 12 d5 ac 8d af |...i......y.....|
+00000350 41 7d 87 4b a9 ff f8 cb 24 55 88 38 34 11 a5 bd |A}.K....$U.84...|
+00000360 c1 d6 e5 86 d5 64 b5 f2 df c8 03 f2 a2 6b ff f4 |.....d.......k..|
+00000370 a8 38 e0 18 04 d4 cd bd e0 cc 63 fc 3f 8b 16 03 |.8........c.?...|
+00000380 03 00 04 0e 00 00 00 |.......|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 46 10 00 00 42 41 04 45 65 ce f7 b9 |....F...BA.Ee...|
-00000010 52 e3 fb 13 db 91 f2 65 43 84 57 f5 1a 19 a0 e6 |R......eC.W.....|
-00000020 89 2d bb 2c 83 6b 62 f6 6f 1f 26 ae 59 67 bd dc |.-.,.kb.o.&.Yg..|
-00000030 c4 9e 0b dc 7d 6e f8 6b 95 8c 61 47 3d cd d1 df |....}n.k..aG=...|
-00000040 82 45 30 81 c3 a3 49 5d 85 59 70 14 03 03 00 01 |.E0...I].Yp.....|
-00000050 01 16 03 03 00 28 3f aa 85 33 f9 c6 95 a0 56 ff |.....(?..3....V.|
-00000060 1c f1 5a ba 6e 41 50 0c ab 92 e1 e2 8e 89 1c f1 |..Z.nAP.........|
-00000070 fa 54 1b f1 f5 00 01 12 6d c4 96 78 b6 87 |.T......m..x..|
+00000000 16 03 03 00 46 10 00 00 42 41 04 de de ff 8c df |....F...BA......|
+00000010 d8 4c 72 af 29 3c 4d e0 ed 0f 34 cc fd 2d 52 63 |.Lr.)<M...4..-Rc|
+00000020 94 e8 74 f1 0b 18 69 28 ed 1e f7 62 4e 4f 2c 14 |..t...i(...bNO,.|
+00000030 61 4b 9f 55 d8 70 59 8f 4b a8 ab c6 d2 cd aa 59 |aK.U.pY.K......Y|
+00000040 8a ef 9b b3 f6 ba 52 e5 51 bb a1 14 03 03 00 01 |......R.Q.......|
+00000050 01 16 03 03 00 28 44 1c eb 89 59 bb ad fb 9f 3f |.....(D...Y....?|
+00000060 56 06 54 ae 27 6d e4 47 3c 0c 60 30 db 0e d6 0e |V.T.'m.G<.`0....|
+00000070 9d 0d a9 a0 e7 25 26 6e 99 d0 8f e0 1b 9d |.....%&n......|
>>> 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 94 5c be 46 05 d6 d0 b0 3a 56 dc 2c 10 |....\.F....:V.,.|
-00000020 0f 6f 5d 33 33 7f a5 4e 74 84 bf 63 87 c4 f4 49 |.o]33..Nt..c...I|
-00000030 bc 6b ab 17 03 03 00 25 00 00 00 00 00 00 00 01 |.k.....%........|
-00000040 7e 4f f9 ae ae fe 6b a0 4a f8 0f 0b b4 b6 65 b6 |~O....k.J.....e.|
-00000050 be 24 5f 94 6d d1 db 54 11 07 b9 ce 01 15 03 03 |.$_.m..T........|
-00000060 00 1a 00 00 00 00 00 00 00 02 a8 1c d6 62 ac fd |.............b..|
-00000070 77 ba 23 92 5d 34 f1 17 c7 e1 1c 99 |w.#.]4......|
+00000010 00 00 00 92 90 01 f0 70 fa 57 2e 40 d3 4c ef 6a |.......p.W.@.L.j|
+00000020 03 0c 56 65 f7 c0 3b d0 8a db 48 c9 ae 58 3e 7c |..Ve..;...H..X>||
+00000030 d1 48 67 17 03 03 00 25 00 00 00 00 00 00 00 01 |.Hg....%........|
+00000040 9e 35 a0 13 73 da 3f 26 ff 1d 90 08 e9 cc 40 7e |.5..s.?&......@~|
+00000050 82 f3 5e 6e b4 8e 5a 39 7f a4 09 60 b2 15 03 03 |..^n..Z9...`....|
+00000060 00 1a 00 00 00 00 00 00 00 02 04 95 9b 2d 17 1c |.............-..|
+00000070 6a bc 26 f7 6c 8e f1 c0 0e 82 4a 44 |j.&.l.....JD|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA384 b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA384
new file mode 100644
index 00000000000..d59645c52db
--- /dev/null
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA384
@@ -0,0 +1,87 @@
+>>> Flow 1 (client to server)
+00000000 16 03 01 00 9a 01 00 00 96 03 03 5d 6b 2a ff 74 |...........]k*.t|
+00000010 88 f1 68 8d 1b eb c3 84 34 b5 19 0a 7d f1 9a 0f |..h.....4...}...|
+00000020 4d c3 0a d7 98 b8 72 e0 73 e4 38 00 00 04 c0 30 |M.....r.s.8....0|
+00000030 00 ff 01 00 00 69 00 0b 00 04 03 00 01 02 00 0a |.....i..........|
+00000040 00 34 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 |.4.2............|
+00000050 00 09 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 |................|
+00000060 00 15 00 04 00 05 00 12 00 13 00 01 00 02 00 03 |................|
+00000070 00 0f 00 10 00 11 00 0d 00 20 00 1e 06 01 06 02 |......... ......|
+00000080 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
+00000090 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............|
+>>> Flow 2 (server to client)
+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 00 00 00 00 00 00 00 00 00 c0 30 00 00 |.............0..|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 |........A...7...|
+000002c0 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..|
+000002d0 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..|
+000002e0 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.|
+000002f0 b5 68 1a 41 03 56 6b dc 5a 89 05 01 00 80 22 6b |.h.A.Vk.Z....."k|
+00000300 87 4b f8 ba f2 09 91 ee ce 81 67 d4 fd d8 b5 07 |.K........g.....|
+00000310 fe c3 88 96 ca e3 3a f0 87 cc ae 44 94 8e 8f 70 |......:....D...p|
+00000320 79 cd de a2 26 4e 17 45 d7 ea 0f 95 a6 c9 7b 17 |y...&N.E......{.|
+00000330 68 7c f5 e8 6c d5 87 6d 5a 7e 53 af 95 0c 42 91 |h|..l..mZ~S...B.|
+00000340 c0 07 18 75 fd 74 1c ad ef df f8 41 b1 ad fc 36 |...u.t.....A...6|
+00000350 19 31 cf c8 3f 36 55 dd 54 ac 44 a9 3a d1 ae 23 |.1..?6U.T.D.:..#|
+00000360 0a 18 bf b7 6f c7 bc a6 70 50 5e 50 dd da ff 5b |....o...pP^P...[|
+00000370 67 7d 0a f5 70 a0 8c 88 d9 38 d4 bf a9 c3 16 03 |g}..p....8......|
+00000380 03 00 04 0e 00 00 00 |.......|
+>>> Flow 3 (client to server)
+00000000 16 03 03 00 46 10 00 00 42 41 04 d0 f7 11 ae 9f |....F...BA......|
+00000010 ec 2e ac 8e 97 6c 58 0e 57 32 8e ac fa 3e af 36 |.....lX.W2...>.6|
+00000020 22 e1 41 2b d3 d1 9c c2 1d 51 c0 e4 20 b3 4c 85 |".A+.....Q.. .L.|
+00000030 b8 bd f2 d1 c6 2f 7d 83 c7 43 d9 31 36 1a 83 ca |...../}..C.16...|
+00000040 c6 89 f8 ba 8c d1 7e 99 04 6e 92 14 03 03 00 01 |......~..n......|
+00000050 01 16 03 03 00 28 32 67 c1 6e 5e 1e 4b 51 1b 70 |.....(2g.n^.KQ.p|
+00000060 54 b9 1d 69 79 38 bd fa 7c 6b 58 71 af 72 08 2d |T..iy8..|kXq.r.-|
+00000070 55 df 24 be 5b 41 0a ef 0e 90 cf d9 62 81 |U.$.[A......b.|
+>>> 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 87 2a 3e 09 54 54 c3 58 c0 5b 7b 91 00 |....*>.TT.X.[{..|
+00000020 c4 07 98 9e de 1f f8 04 bb d7 42 04 55 7d 18 a4 |..........B.U}..|
+00000030 41 7c a6 17 03 03 00 25 00 00 00 00 00 00 00 01 |A|.....%........|
+00000040 ab 23 05 51 b4 60 a2 77 01 58 be a6 9f 89 2b b5 |.#.Q.`.w.X....+.|
+00000050 77 6b 19 23 67 f7 89 f1 ef d6 1b f5 e7 15 03 03 |wk.#g...........|
+00000060 00 1a 00 00 00 00 00 00 00 02 8a bf f0 fb 9f 56 |...............V|
+00000070 36 f1 92 49 a9 e5 40 87 f9 87 9e 4d |6..I..@....M|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-RC4 b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-RC4
index b703a8f766c..13163d68f68 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-RC4
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-RC4
@@ -1,79 +1,73 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 5c 01 00 00 58 03 03 52 cc 57 59 c9 |....\...X..R.WY.|
-00000010 c3 13 fc 18 8a ee c2 0e 88 ff fb 4a 16 f2 eb eb |...........J....|
-00000020 d4 f8 b3 5b cd bb 25 0e 0b cb 48 00 00 04 00 05 |...[..%...H.....|
-00000030 00 ff 01 00 00 2b 00 0d 00 22 00 20 06 01 06 02 |.....+...". ....|
+00000000 16 03 01 00 5a 01 00 00 56 03 03 8a fe f5 09 70 |....Z...V......p|
+00000010 8e 6b e3 2b 12 ff d1 b2 ae 15 bf 47 0e ca 5c b5 |.k.+.......G..\.|
+00000020 bb 0e ad af e5 a6 7e 36 c5 a4 c3 00 00 04 00 05 |......~6........|
+00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......|
00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
-00000050 03 02 03 03 02 01 02 02 02 03 01 01 00 0f 00 01 |................|
-00000060 01 |.|
+00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............|
>>> Flow 2 (server to client)
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 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 35 b3 60 ba 14 |...........5.`..|
-00000010 5f 19 24 a0 24 de 4e 85 a9 64 78 3a 51 24 64 70 |_.$.$.N..dx:Q$dp|
-00000020 88 55 6d c3 11 b8 d3 9f bc 7a 33 f8 3c 48 93 2f |.Um......z3.<H./|
-00000030 66 69 11 33 39 37 7a 36 a3 1c ef b0 81 71 7d 25 |fi.397z6.....q}%|
-00000040 35 da 2c 42 e2 ab d3 b7 07 8b 4a 0d 6d 77 bd ae |5.,B......J.mw..|
-00000050 02 51 7c a5 0d a6 03 4c 3c d0 ce 89 2c 83 6c de |.Q|....L<...,.l.|
-00000060 40 15 cc 72 c7 95 c8 6d ee 05 86 da 3e c6 7c d4 |@..r...m....>.|.|
-00000070 44 82 f4 24 03 22 40 00 64 27 53 15 41 8c 01 e9 |D..$."@.d'S.A...|
-00000080 39 32 fa 8e 2d f9 b4 89 34 15 d6 14 03 03 00 01 |92..-...4.......|
-00000090 01 16 03 03 00 24 f5 61 8b 24 bf b4 82 3a cf 49 |.....$.a.$...:.I|
-000000a0 99 a0 b1 1b a7 a7 a3 92 7c 84 85 e0 64 a3 3d bd |........|...d.=.|
-000000b0 38 98 7d 97 a8 b9 2a 35 a9 09 |8.}...*5..|
+00000000 16 03 03 00 86 10 00 00 82 00 80 1c f7 2c 18 38 |.............,.8|
+00000010 d9 41 b5 ab b7 35 2b 75 2d 66 ba c8 70 c2 19 1c |.A...5+u-f..p...|
+00000020 f2 6d d9 a9 a8 40 8e b5 2c 75 99 06 a5 25 be 0d |.m...@..,u...%..|
+00000030 b4 b0 9b aa fc 6b 12 a5 b3 e7 02 60 aa 25 e9 7f |.....k.....`.%..|
+00000040 6b f5 c4 7a 1d 16 a5 d1 76 cc d5 a1 18 68 91 c3 |k..z....v....h..|
+00000050 57 b8 10 f2 b8 81 f3 1b 74 ef 6c 37 3e 81 41 09 |W.......t.l7>.A.|
+00000060 2a c5 15 e6 cc bb 74 4c 01 7a b9 82 5c e2 7f b7 |*.....tL.z..\...|
+00000070 ac 2d 76 30 18 30 c2 19 8c 5f f2 80 41 89 bb 47 |.-v0.0..._..A..G|
+00000080 28 3d 61 cc 3c 06 a8 76 93 57 71 14 03 03 00 01 |(=a.<..v.Wq.....|
+00000090 01 16 03 03 00 24 46 34 1f cc eb 53 c7 d2 04 28 |.....$F4...S...(|
+000000a0 b6 3d 3f 39 06 70 56 b7 db eb 53 9c 66 c3 45 9f |.=?9.pV...S.f.E.|
+000000b0 69 ca 58 8f e7 ba a7 e6 5a 97 |i.X.....Z.|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 c9 0b 84 e6 39 |..........$....9|
-00000010 f2 e0 f3 ac 9f 0f 17 92 5f 6d de 94 18 c4 60 d9 |........_m....`.|
-00000020 66 c3 0d 1a ae c2 8f 46 8f 7f f0 58 0e 4a 9b 17 |f......F...X.J..|
-00000030 03 03 00 21 8b 73 a1 6a 7e d9 7e 4f 1d cc b2 7d |...!.s.j~.~O...}|
-00000040 3c 83 3f 52 f8 08 77 01 4c 65 11 6d 50 25 9a cc |<.?R..w.Le.mP%..|
-00000050 e3 54 27 72 59 15 03 03 00 16 3d c8 ab 14 51 fa |.T'rY.....=...Q.|
-00000060 97 f1 ef 5f b4 4f 44 58 d4 93 3b ae e5 61 1f a3 |..._.ODX..;..a..|
+00000000 14 03 03 00 01 01 16 03 03 00 24 78 c3 02 89 60 |..........$x...`|
+00000010 e7 72 9f 51 87 14 ca 2e 0d 79 98 eb 1e 39 62 f9 |.r.Q.....y...9b.|
+00000020 fc a5 c9 2c f8 0c 04 16 60 70 90 b7 31 f8 30 17 |...,....`p..1.0.|
+00000030 03 03 00 21 6a b7 24 73 a7 0d 17 04 d7 54 a8 ea |...!j.$s.....T..|
+00000040 28 4e f2 0a ef 87 d5 a9 b8 84 81 46 8e 97 d1 ae |(N.........F....|
+00000050 3c cc b1 6b 72 15 03 03 00 16 1a bb 2f df ae 3e |<..kr......./..>|
+00000060 a7 89 69 3e 35 f2 f6 cd 35 60 29 3a 6f be 32 0d |..i>5...5`):o.2.|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-Resume b/libgo/go/crypto/tls/testdata/Server-TLSv12-Resume
index c495d4adc60..8cacd218408 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-Resume
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-Resume
@@ -1,36 +1,37 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 e8 01 00 00 e4 03 03 52 cc 57 59 c3 |...........R.WY.|
-00000010 8b df 97 05 d8 5f 16 22 b4 b1 e7 cb 7d 2f 9b 58 |....._."....}/.X|
-00000020 a3 f4 d7 2c a4 c1 9d 49 ed 4b ba 20 90 da 90 3e |...,...I.K. ...>|
-00000030 36 19 7a db 56 43 26 f7 dc 42 57 33 22 ed 9d a4 |6.z.VC&..BW3"...|
-00000040 9d 53 da f8 9d 4e 60 66 71 a0 2e 2e 00 04 00 05 |.S...N`fq.......|
-00000050 00 ff 01 00 00 97 00 23 00 68 00 00 00 00 00 00 |.......#.h......|
-00000060 00 00 00 00 00 00 00 00 00 00 65 ea 4b d1 ef ba |..........e.K...|
-00000070 06 38 1e e1 88 82 3a cd 03 ac 3b 39 0a e0 19 fd |.8....:...;9....|
-00000080 af 6c 57 30 df 31 6e f7 92 38 4b 5d 77 90 39 ff |.lW0.1n..8K]w.9.|
-00000090 32 51 f5 ed 12 d7 b0 7c 4d 6c c5 76 e4 72 48 3e |2Q.....|Ml.v.rH>|
-000000a0 59 23 fe 0d 15 df f4 ba ea b9 67 16 23 8f 7d 15 |Y#........g.#.}.|
-000000b0 b6 11 f1 ab d7 d4 cd a3 21 82 92 2a 12 cf 95 f3 |........!..*....|
-000000c0 60 b2 00 0d 00 22 00 20 06 01 06 02 06 03 05 01 |`....". ........|
-000000d0 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-000000e0 02 01 02 02 02 03 01 01 00 0f 00 01 01 |.............|
+00000000 16 03 01 00 f6 01 00 00 f2 03 03 53 1e 13 2e bd |...........S....|
+00000010 ad 66 fd 77 1a ad 5f 4d cb bd 2e ca b5 c2 45 1d |.f.w.._M......E.|
+00000020 7c 83 9d 62 3e 39 9c ce 78 99 e7 20 b4 06 b0 ec ||..b>9..x.. ....|
+00000030 cf b7 52 6e 38 10 31 37 b2 e6 58 0f fa e3 b0 cb |..Rn8.17..X.....|
+00000040 20 a4 d2 4b f3 7d 92 e6 7e 13 37 08 00 04 00 05 | ..K.}..~.7.....|
+00000050 00 ff 01 00 00 a5 00 23 00 78 50 46 ad c1 db a8 |.......#.xPF....|
+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 b5 83 61 |...........o,..a|
+00000080 c4 74 90 94 e5 6c fd 70 64 57 3a 25 78 bf 9f a0 |.t...l.pdW:%x...|
+00000090 7c 51 bc 2a 69 1e b3 fd 71 34 b7 9a ef cb 49 37 ||Q.*i...q4....I7|
+000000a0 f8 5d 5e 7c cf 6d fc 13 c1 52 79 8e ed c3 84 01 |.]^|.m...Ry.....|
+000000b0 33 94 10 65 34 64 5e b4 9c 07 46 5b 9e d7 5e 55 |3..e4d^...F[..^U|
+000000c0 df fd c0 e9 d2 e8 d3 c6 42 18 ef a5 6c be e8 d2 |........B...l...|
+000000d0 49 c6 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 |I.... ..........|
+000000e0 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
+000000f0 02 01 02 02 02 03 00 0f 00 01 01 |...........|
>>> 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 00 00 00 00 00 00 00 00 20 90 da 90 3e |........... ...>|
-00000030 36 19 7a db 56 43 26 f7 dc 42 57 33 22 ed 9d a4 |6.z.VC&..BW3"...|
-00000040 9d 53 da f8 9d 4e 60 66 71 a0 2e 2e 00 05 00 00 |.S...N`fq.......|
+00000020 00 00 00 00 00 00 00 00 00 00 00 20 b4 06 b0 ec |........... ....|
+00000030 cf b7 52 6e 38 10 31 37 b2 e6 58 0f fa e3 b0 cb |..Rn8.17..X.....|
+00000040 20 a4 d2 4b f3 7d 92 e6 7e 13 37 08 00 05 00 00 | ..K.}..~.7.....|
00000050 05 ff 01 00 01 00 14 03 03 00 01 01 16 03 03 00 |................|
-00000060 24 11 12 ff 28 10 14 4c e5 0e ad a7 fa f3 92 fb |$...(..L........|
-00000070 13 7d ae f2 b2 4a 6b a1 9e 67 cf a8 f7 8c 6f a0 |.}...Jk..g....o.|
-00000080 6c 30 0e 18 55 |l0..U|
+00000060 24 24 31 13 8c 45 4f 8a fc 71 50 94 b0 6f 02 5e |$$1..EO..qP..o.^|
+00000070 da d3 a3 13 8b c8 53 fb 54 8d ef 90 f7 55 b1 be |......S.T....U..|
+00000080 37 30 05 e5 5d |70..]|
>>> Flow 3 (client to server)
-00000000 14 03 03 00 01 01 16 03 03 00 24 0d 46 41 8b 24 |..........$.FA.$|
-00000010 36 01 a9 fd 8b ec fc e6 b1 83 96 df 0d 3e 53 54 |6............>ST|
-00000020 58 b8 43 f2 a6 25 5e 1a ae 19 9e d2 28 44 92 |X.C..%^.....(D.|
+00000000 14 03 03 00 01 01 16 03 03 00 24 ed dd e4 a5 09 |..........$.....|
+00000010 0d 7c cb e4 90 9c a1 1c 21 f4 13 bd 45 8f f4 d8 |.|......!...E...|
+00000020 7e e2 89 7a 0d f4 75 99 66 8c 05 a3 1a e2 2b |~..z..u.f.....+|
>>> Flow 4 (server to client)
-00000000 17 03 03 00 21 c4 fb f6 53 bb 3e 04 cc 0b a0 03 |....!...S.>.....|
-00000010 fa 49 96 da b5 8d b2 f2 e5 d8 f3 5c 27 57 4f 9c |.I.........\'WO.|
-00000020 30 00 34 fc 52 92 15 03 03 00 16 a3 02 7a 50 d2 |0.4.R........zP.|
-00000030 c6 b3 fc 69 8f e4 94 ae ab 22 ad 05 1d 15 69 b9 |...i....."....i.|
-00000040 a5 |.|
+00000000 17 03 03 00 21 69 fa 9e 98 fb 7a 95 b1 8e e5 74 |....!i....z....t|
+00000010 03 02 d7 3d 69 c4 b8 c9 5b 49 e3 30 32 e3 c5 6a |...=i...[I.02..j|
+00000020 fa 20 98 bd 01 ed 15 03 03 00 16 c9 b1 20 1f 30 |. ........... .0|
+00000030 c1 2f 15 75 cd 82 45 de 1a 81 cd dc 10 05 1c 45 |./.u..E........E|
+00000040 dc |.|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-ResumeDisabled b/libgo/go/crypto/tls/testdata/Server-TLSv12-ResumeDisabled
index db833f65559..912c1787a1e 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-ResumeDisabled
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-ResumeDisabled
@@ -1,87 +1,83 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 e8 01 00 00 e4 03 03 54 23 54 02 a5 |...........T#T..|
-00000010 10 11 0f 6d e5 2d 2f e8 bb 52 b1 38 3f 65 01 43 |...m.-/..R.8?e.C|
-00000020 36 cc 48 f6 09 22 a1 85 20 28 3c 20 35 8b fe 7a |6.H..".. (< 5..z|
-00000030 41 3b 59 3a 5d b9 b3 21 f0 62 e9 0d 7b af f5 5d |A;Y:]..!.b..{..]|
-00000040 fa 65 1a 40 c8 ca cd 74 8c ef d2 fb 00 04 00 05 |.e.@...t........|
-00000050 00 ff 01 00 00 97 00 23 00 68 00 00 00 00 00 00 |.......#.h......|
-00000060 00 00 00 00 00 00 00 00 00 00 65 ea 4b d1 ef ba |..........e.K...|
-00000070 2d db 0c ba 9a d4 20 76 57 c8 ec dc 2d 77 fb fb |-..... vW...-w..|
-00000080 3b 93 5f 53 e0 14 4f 90 fb d6 55 57 8c 8d 0d 25 |;._S..O...UW...%|
-00000090 ea 5d 0d f2 91 e5 12 22 12 ec 7b 5f b6 6e fd 07 |.]....."..{_.n..|
-000000a0 59 23 24 fc b1 97 ca ea 56 a5 c2 a0 e4 9e 99 64 |Y#$.....V......d|
-000000b0 f2 64 d0 75 7a 46 63 e3 dc 21 ed 78 56 e9 e1 ab |.d.uzFc..!.xV...|
-000000c0 66 80 00 0d 00 22 00 20 06 01 06 02 06 03 05 01 |f....". ........|
-000000d0 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
-000000e0 02 01 02 02 02 03 01 01 00 0f 00 01 01 |.............|
+00000000 16 03 01 00 f6 01 00 00 f2 03 03 aa 0c c2 75 42 |..............uB|
+00000010 62 2a 1d 14 a0 cc a1 e4 a7 19 77 50 80 2b f8 05 |b*........wP.+..|
+00000020 0b fa 60 3a a7 a7 84 d3 e1 68 26 20 68 97 0c ae |..`:.....h& h...|
+00000030 7b 1d bc 13 14 a8 f6 c1 e1 96 1f 54 18 2c cb 99 |{..........T.,..|
+00000040 17 7d be 45 6a 39 53 c6 50 c7 8c 75 00 04 00 05 |.}.Ej9S.P..u....|
+00000050 00 ff 01 00 00 a5 00 23 00 78 50 46 ad c1 db a8 |.......#.xPF....|
+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 b5 83 61 |...........o,..a|
+00000080 bd 50 da 49 7f 8b 8f 58 57 00 a1 11 0d 4a 9d 8a |.P.I...XW....J..|
+00000090 39 dd 85 23 c0 eb 9d 1a 45 93 92 e7 af 15 a3 a4 |9..#....E.......|
+000000a0 48 da f9 a4 d8 8e cb 6c 3d 44 77 f9 c4 83 89 85 |H......l=Dw.....|
+000000b0 33 94 c1 c6 20 9a 73 44 83 89 5e 59 ee 05 c6 7e |3... .sD..^Y...~|
+000000c0 8d e9 7d 7b f8 84 46 b6 7d 43 ec f1 af 1f 0f 35 |..}{..F.}C.....5|
+000000d0 b4 1c 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 |..... ..........|
+000000e0 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................|
+000000f0 02 01 02 02 02 03 00 0f 00 01 01 |...........|
>>> Flow 2 (server to client)
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 00 00 00 00 00 00 00 00 00 00 05 00 00 |................|
-00000030 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................|
-00000040 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
-00000050 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
-00000060 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.|
-00000070 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..|
-00000080 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State|
-00000090 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter|
-000000a0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty |
-000000b0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090|
-000000c0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909|
-000000d0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....|
-000000e0 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
-000000f0 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
-00000100 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
-00000110 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..|
-00000120 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............|
-00000130 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F|
-00000140 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC|
-00000150 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....|
-00000160 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z|
-00000170 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......|
-00000180 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....|
-00000190 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.||
-000001a0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...|
-000001b0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0|
-000001c0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........|
-000001d0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...|
-000001e0 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....|
-000001f0 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..|
-00000200 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.|
-00000210 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....|
-00000220 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...|
-00000230 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi|
-00000240 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...|
-00000250 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...|
-00000260 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...|
-00000270 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.|
-00000280 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z|
-00000290 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`|
-000002a0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.|
-000002b0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.|
-000002c0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.|
-000002d0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....|
-000002e0 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&|
-000002f0 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........|
-00000300 00 00 |..|
+00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.|
+00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......|
+00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..|
+00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.|
+00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google |
+00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..|
+00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150|
+000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501|
+000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..|
+000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES|
+000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G|
+000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....|
+000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........|
+00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..|
+00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.|
+00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......|
+00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....|
+00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........|
+00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K|
+00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}|
+00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....|
+00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..|
+00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%|
+000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........|
+000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...|
+000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....|
+000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.|
+000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=|
+000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.|
+00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp|
+00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H|
+00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..|
+00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....|
+00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..|
+00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w|
+00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k|
+00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..|
+00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@|
+00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...|
+000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....|
+000002b0 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 ae 02 dd 1f 1a |................|
-00000010 86 83 f5 2f 82 46 4b 29 58 aa a1 b3 56 8b 4e 40 |.../.FK)X...V.N@|
-00000020 ef 23 65 67 ad 48 e5 e1 fd ae dd bf 68 fd bd a6 |.#eg.H......h...|
-00000030 13 a0 7e 05 ab f7 20 e1 6a 4e d1 37 93 08 1d c9 |..~... .jN.7....|
-00000040 37 e0 b5 34 28 bf 20 45 45 da 0f 7e 51 a7 c6 ae |7..4(. EE..~Q...|
-00000050 61 6c 07 1b 73 ef da 6e 25 c4 ed be e3 3f da ae |al..s..n%....?..|
-00000060 cd 3c 17 9c 2e ee fb 47 9d b3 a1 b2 c3 5d e0 83 |.<.....G.....]..|
-00000070 74 20 37 2d 72 d6 d0 4d 58 0e 26 1c 50 22 95 08 |t 7-r..MX.&.P"..|
-00000080 7d e0 5f 86 99 9e 2c 2e a7 a0 7f 14 03 03 00 01 |}._...,.........|
-00000090 01 16 03 03 00 24 a2 ab 41 25 a5 cf 04 18 1d 98 |.....$..A%......|
-000000a0 88 6c 59 21 86 33 54 f4 35 b4 21 6e a5 29 d5 6e |.lY!.3T.5.!n.).n|
-000000b0 3d 08 72 b0 af 46 b5 8f 6b 86 |=.r..F..k.|
+00000000 16 03 03 00 86 10 00 00 82 00 80 ac 10 32 61 b0 |.............2a.|
+00000010 03 e3 1e 2f 89 91 5f d6 4c e0 82 a7 82 41 67 d3 |.../.._.L....Ag.|
+00000020 5f b3 68 2d c0 d1 6f 03 7b 79 94 cc bb 35 6c 8a |_.h-..o.{y...5l.|
+00000030 bf 1c 83 ff 88 91 5c 04 64 cc a0 df 0b 08 8c 0f |......\.d.......|
+00000040 72 13 17 9f 27 14 8d 9a af 17 70 41 44 9f 89 8c |r...'.....pAD...|
+00000050 fa e4 66 33 4d bd 2f 93 2a 1e 85 a1 af 9e 27 12 |..f3M./.*.....'.|
+00000060 59 a4 13 67 56 85 c2 86 47 f8 c5 49 8f a4 c2 6e |Y..gV...G..I...n|
+00000070 04 78 0f 11 2b fb 7e 34 b8 eb 25 93 71 ab 9f f5 |.x..+.~4..%.q...|
+00000080 93 df 2b c3 1e 9e 6a 9e e3 57 aa 14 03 03 00 01 |..+...j..W......|
+00000090 01 16 03 03 00 24 e0 13 15 10 4c db f3 b6 de d2 |.....$....L.....|
+000000a0 68 02 f5 ea 1f 8e 58 70 4a 5a 78 d9 66 c5 74 77 |h.....XpJZx.f.tw|
+000000b0 a0 3a ec d8 b7 42 e3 a5 d4 62 |.:...B...b|
>>> Flow 4 (server to client)
-00000000 14 03 03 00 01 01 16 03 03 00 24 59 20 4d c2 17 |..........$Y M..|
-00000010 8b 3c 9b 33 d9 f9 ef fb 80 18 1f 67 a7 58 12 89 |.<.3.......g.X..|
-00000020 4e 73 0f 2d 7b e6 c4 a6 79 73 01 da 22 e8 54 17 |Ns.-{...ys..".T.|
-00000030 03 03 00 21 36 ca 64 0f 4a 12 a5 50 3d 97 bb 39 |...!6.d.J..P=..9|
-00000040 02 fc ed d1 82 6a 9a 2e 21 79 f6 e1 b3 cc 32 db |.....j..!y....2.|
-00000050 0f 5d b3 fb a5 15 03 03 00 16 51 f4 be 57 7a df |.]........Q..Wz.|
-00000060 f1 f2 bd b5 51 5e 45 80 be 0b 9a 0c d1 19 3c 79 |....Q^E.......<y|
+00000000 14 03 03 00 01 01 16 03 03 00 24 e9 c1 1f 5b e6 |..........$...[.|
+00000010 c1 d5 8a 14 eb c6 41 c1 77 6d 59 83 b6 95 34 f9 |......A.wmY...4.|
+00000020 7b a1 c9 9d 58 a5 b2 1b 33 6e 04 ab e0 03 61 17 |{...X...3n....a.|
+00000030 03 03 00 21 67 8b 55 43 d7 a7 05 c9 1f a0 d3 65 |...!g.UC.......e|
+00000040 30 36 07 8f d8 52 7e 40 79 31 2e 1c 1a c2 a6 fe |06...R~@y1......|
+00000050 e0 39 4d a0 5d 15 03 03 00 16 b8 94 fb 17 e5 1d |.9M.]...........|
+00000060 2e 28 95 cf 02 85 8e 11 2e 16 b1 53 72 aa a4 94 |.(.........Sr...|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI b/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI
index 61b17a11da2..aee57421a23 100644
--- a/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI
@@ -1,12 +1,12 @@
>>> Flow 1 (client to server)
-00000000 16 03 01 00 70 01 00 00 6c 03 03 52 cc 57 59 2d |....p...l..R.WY-|
-00000010 77 aa 75 35 fa ff 2a a2 bf 91 5e e3 7f 38 7d 7a |w.u5..*...^..8}z|
-00000020 e3 93 d3 e8 8b 09 bb 06 c8 6d 91 00 00 04 00 2f |.........m...../|
-00000030 00 ff 01 00 00 3f 00 00 00 10 00 0e 00 00 0b 73 |.....?.........s|
-00000040 6e 69 74 65 73 74 2e 63 6f 6d 00 0d 00 22 00 20 |nitest.com...". |
+00000000 16 03 01 00 6e 01 00 00 6a 03 03 be 99 22 5c d2 |....n...j...."\.|
+00000010 02 c7 a6 be f3 33 7a d4 76 1f cf 1e 39 0b 25 7c |.....3z.v...9.%||
+00000020 32 70 e4 8c 49 a6 87 b9 c1 2f 6d 00 00 04 00 2f |2p..I..../m..../|
+00000030 00 ff 01 00 00 3d 00 00 00 10 00 0e 00 00 0b 73 |.....=.........s|
+00000040 6e 69 74 65 73 74 2e 63 6f 6d 00 0d 00 20 00 1e |nitest.com... ..|
00000050 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................|
-00000060 04 03 03 01 03 02 03 03 02 01 02 02 02 03 01 01 |................|
-00000070 00 0f 00 01 01 |.....|
+00000060 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................|
+00000070 00 01 01 |...|
>>> Flow 2 (server to client)
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 |................|
@@ -46,31 +46,19 @@
00000230 2c 65 25 d6 52 b6 e3 18 45 bd cc 16 03 03 00 04 |,e%.R...E.......|
00000240 0e 00 00 00 |....|
>>> Flow 3 (client to server)
-00000000 16 03 03 00 86 10 00 00 82 00 80 0d f2 bf 75 a9 |..............u.|
-00000010 aa db f3 25 55 d4 20 59 63 54 d1 70 82 f9 61 c5 |...%U. YcT.p..a.|
-00000020 b7 ae 3f 75 71 75 9d c5 01 a1 ed b1 07 66 9f 3f |..?uqu.......f.?|
-00000030 cf c6 e6 ad 44 03 fd 18 6f 53 24 ce 76 01 bd fe |....D...oS$.v...|
-00000040 e2 51 f7 df 8a 23 3a 21 c4 00 15 ff d0 e0 ff c8 |.Q...#:!........|
-00000050 8b 89 33 c6 8e e0 ce 97 ef b4 c6 f9 b0 ea 38 89 |..3...........8.|
-00000060 79 98 34 9e f7 bc c6 fd d2 5d 56 84 5c d2 9a ce |y.4......]V.\...|
-00000070 ae de 09 bc 24 25 fc 09 0c bc 0e 91 0d 6b 36 ae |....$%.......k6.|
-00000080 ce 6b cd 14 ec b6 3c fa d6 df fc 14 03 03 00 01 |.k....<.........|
-00000090 01 16 03 03 00 40 ad 21 13 2b 33 7a 4a 0d fb 0f |.....@.!.+3zJ...|
-000000a0 eb d2 b6 85 29 1f 59 79 ba 86 53 5c 68 b4 c7 e3 |....).Yy..S\h...|
-000000b0 8a 6c 5c 18 04 4d e4 76 19 30 ba 92 b4 79 8c 64 |.l\..M.v.0...y.d|
-000000c0 00 a0 2e 13 96 45 9f e7 a9 e4 23 9e 9f 89 23 26 |.....E....#...#&|
-000000d0 36 20 82 fc 75 fe |6 ..u.|
+00000000 16 03 03 00 86 10 00 00 82 00 80 6b 03 31 ca a0 |...........k.1..|
+00000010 62 a2 53 11 ce 13 d9 f6 e7 d4 ec 2e c3 0a 38 56 |b.S...........8V|
+00000020 23 22 67 23 c8 8d 16 b4 3c 0b 26 9f 1c 2d 65 13 |#"g#....<.&..-e.|
+00000030 c3 cb 65 69 b0 47 ff 87 e8 02 56 c4 77 8a 40 29 |..ei.G....V.w.@)|
+00000040 82 62 8b 06 61 0a 1c b3 c7 29 b6 aa c9 96 37 18 |.b..a....)....7.|
+00000050 d0 60 66 63 9b 62 4b 30 cc 03 9c 37 05 c6 32 98 |.`fc.bK0...7..2.|
+00000060 cb a0 e2 e4 38 60 d4 93 99 9a fc 03 66 fb b6 ef |....8`......f...|
+00000070 8a 1e bb ca 13 c5 d9 7a 7c 3b 50 dc d0 ad 00 b5 |.......z|;P.....|
+00000080 2c dc 1a ef c4 5c af d3 4e cd e6 14 03 03 00 01 |,....\..N.......|
+00000090 01 16 03 03 00 40 42 31 83 8a 2c 86 22 c5 df e5 |.....@B1..,."...|
+000000a0 f2 0b f8 0c 2f 1e 82 f4 69 fe 1d bd 4c db f1 80 |..../...i...L...|
+000000b0 68 30 b7 e3 60 76 b3 f1 52 ae d6 e7 b3 cb 4a e0 |h0..`v..R.....J.|
+000000c0 27 0a c1 1a 72 ed 71 ab 0a fc 10 d9 5e 4d fd 10 |'...r.q.....^M..|
+000000d0 04 92 39 78 be 23 |..9x.#|
>>> 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 87 61 10 03 |.............a..|
-00000020 b8 a4 42 d4 8b 49 bc 40 80 70 92 c8 25 b0 c6 7f |..B..I.@.p..%...|
-00000030 b3 87 76 50 5a 59 b3 3c d8 3e 23 24 aa 1a f3 36 |..vPZY.<.>#$...6|
-00000040 c9 2c 87 c1 22 d2 94 f8 2c fd ef 17 03 03 00 40 |.,.."...,......@|
-00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-00000060 e5 7f bd 3e ff 9f d4 1b 91 02 f8 69 6f 70 9d 51 |...>.......iop.Q|
-00000070 a5 ec ef 5b 10 3f 4e 3f 44 e5 9a 39 68 7c 3a b9 |...[.?N?D..9h|:.|
-00000080 69 38 31 ec 9c 45 bf 19 d1 5c 5e 2e 06 00 ca 19 |i81..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 63 5e 79 2c f2 05 dc 2b d7 5b ac |.....c^y,...+.[.|
-000000b0 9d fc 75 94 03 16 ca 1f b2 75 58 2d f1 2f f1 1e |..u......uX-./..|
-000000c0 d2 f6 84 8f 2e |.....|
+00000000 15 03 03 00 02 02 14 |.......|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate b/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate
new file mode 100644
index 00000000000..40d3714a86d
--- /dev/null
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate
@@ -0,0 +1,64 @@
+>>> Flow 1 (client to server)
+00000000 16 03 01 00 6e 01 00 00 6a 03 03 23 de 75 da 8e |....n...j..#.u..|
+00000010 0a 4b 7b e4 cb 34 14 83 be d1 6a 95 25 86 f8 91 |.K{..4....j.%...|
+00000020 d8 bb ac 82 9e 19 d6 9f 52 26 f6 00 00 04 00 2f |........R&...../|
+00000030 00 ff 01 00 00 3d 00 00 00 10 00 0e 00 00 0b 73 |.....=.........s|
+00000040 6e 69 74 65 73 74 2e 63 6f 6d 00 0d 00 20 00 1e |nitest.com... ..|
+00000050 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................|
+00000060 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................|
+00000070 00 01 01 |...|
+>>> Flow 2 (server to client)
+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 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
+00000030 05 ff 01 00 01 00 16 03 03 02 00 0b 00 01 fc 00 |................|
+00000040 01 f9 00 01 f6 30 82 01 f2 30 82 01 5d a0 03 02 |.....0...0..]...|
+00000050 01 02 02 01 00 30 0b 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....|
+00000060 01 05 30 28 31 10 30 0e 06 03 55 04 0a 13 07 41 |..0(1.0...U....A|
+00000070 63 6d 65 20 43 6f 31 14 30 12 06 03 55 04 03 13 |cme Co1.0...U...|
+00000080 0b 73 6e 69 74 65 73 74 2e 63 6f 6d 30 1e 17 0d |.snitest.com0...|
+00000090 31 32 30 34 31 31 31 37 34 30 33 35 5a 17 0d 31 |120411174035Z..1|
+000000a0 33 30 34 31 31 31 37 34 35 33 35 5a 30 28 31 10 |30411174535Z0(1.|
+000000b0 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
+000000c0 31 14 30 12 06 03 55 04 03 13 0b 73 6e 69 74 65 |1.0...U....snite|
+000000d0 73 74 2e 63 6f 6d 30 81 9d 30 0b 06 09 2a 86 48 |st.com0..0...*.H|
+000000e0 86 f7 0d 01 01 01 03 81 8d 00 30 81 89 02 81 81 |..........0.....|
+000000f0 00 bb 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 |..y......F...i..|
+00000100 2b 07 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 |+.CZ..-.zC...R..|
+00000110 65 4c 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e |eL,x.#........;~|
+00000120 62 a5 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa |b.,.3...\zV.....|
+00000130 58 7b 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 |X{&?......!.J..T|
+00000140 9f 5a bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d |.Z..Bq......~.}}|
+00000150 f1 04 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 |..9....Q.|..L;2f|
+00000160 01 cf af b1 1d b8 71 9a 1d db db 89 6b ae da 2d |......q.....k..-|
+00000170 79 02 03 01 00 01 a3 32 30 30 30 0e 06 03 55 1d |y......2000...U.|
+00000180 0f 01 01 ff 04 04 03 02 00 a0 30 0d 06 03 55 1d |..........0...U.|
+00000190 0e 04 06 04 04 01 02 03 04 30 0f 06 03 55 1d 23 |.........0...U.#|
+000001a0 04 08 30 06 80 04 01 02 03 04 30 0b 06 09 2a 86 |..0.......0...*.|
+000001b0 48 86 f7 0d 01 01 05 03 81 81 00 89 c6 45 5f 1c |H............E_.|
+000001c0 1f 5e f8 eb 1a b1 74 ee 24 39 05 9f 5c 42 59 bb |.^....t.$9..\BY.|
+000001d0 1a 8d 86 cd b1 d0 56 f5 6a 71 7d a4 0e 95 ab 90 |......V.jq}.....|
+000001e0 f5 9e 8d ea f6 27 c1 57 99 50 94 db 08 02 26 6e |.....'.W.P....&n|
+000001f0 b3 4f c6 84 2d ea 8a 4b 68 d9 c1 38 91 03 ab 84 |.O..-..Kh..8....|
+00000200 fb 9e 1f 85 d9 b5 d2 3f f2 31 2c 86 70 fb b5 40 |.......?.1,.p..@|
+00000210 14 82 45 a4 eb af e2 64 d9 0c 8a 4c f4 f8 5b 0f |..E....d...L..[.|
+00000220 ac 12 ac 2f c4 a3 15 4b ad 52 46 28 68 af 96 c6 |.../...K.RF(h...|
+00000230 2c 65 25 d6 52 b6 e3 18 45 bd cc 16 03 03 00 04 |,e%.R...E.......|
+00000240 0e 00 00 00 |....|
+>>> Flow 3 (client to server)
+00000000 16 03 03 00 86 10 00 00 82 00 80 a2 99 61 c5 90 |.............a..|
+00000010 47 1a e7 47 56 51 59 e4 6e ab 82 01 18 78 ee 95 |G..GVQY.n....x..|
+00000020 b8 e2 c7 c7 f9 64 98 dd 84 8d 96 d9 2d 08 62 1e |.....d......-.b.|
+00000030 4f 29 83 b6 93 68 77 7a 14 1b f0 b3 1a 67 7b 7a |O)...hwz.....g{z|
+00000040 f9 54 f3 7e 6d eb b6 7a c9 37 70 6a 83 68 f2 15 |.T.~m..z.7pj.h..|
+00000050 81 07 30 6e b8 fa 19 0e 46 dc d6 9a 4a 8e 8d f1 |..0n....F...J...|
+00000060 05 78 60 75 d4 00 d9 1e 11 5f 16 f7 bc 9f e8 8a |.x`u....._......|
+00000070 c4 3e bd d9 1a b8 67 50 00 be 5f 43 ee 07 ad be |.>....gP.._C....|
+00000080 f5 85 67 fc 8f c6 87 47 6d 6e b2 14 03 03 00 01 |..g....Gmn......|
+00000090 01 16 03 03 00 40 91 7d 7b 05 99 48 05 70 a9 67 |.....@.}{..H.p.g|
+000000a0 e9 7a 0a c3 6b bf b0 ad 68 65 17 fb 18 bf 8d bd |.z..k...he......|
+000000b0 e1 4b 12 bf ea 82 9d a6 1e 3a c8 77 65 32 bd 5e |.K.......:.we2.^|
+000000c0 c4 46 da e7 e1 ac 09 fe 4a ac bc 57 6a 17 7d dc |.F......J..Wj.}.|
+000000d0 fe 9c d0 d0 6e fc |....n.|
+>>> Flow 4 (server to client)
+00000000 15 03 03 00 02 02 14 |.......|
diff --git a/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound b/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound
new file mode 100644
index 00000000000..904f69ecacb
--- /dev/null
+++ b/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound
@@ -0,0 +1,64 @@
+>>> Flow 1 (client to server)
+00000000 16 03 01 00 6e 01 00 00 6a 03 03 27 db e3 e8 f4 |....n...j..'....|
+00000010 48 1d 45 d5 20 64 97 b2 20 a6 67 94 7a 1e 87 12 |H.E. d.. .g.z...|
+00000020 25 b1 53 94 27 78 ed ae 58 2f 1b 00 00 04 00 2f |%.S.'x..X/...../|
+00000030 00 ff 01 00 00 3d 00 00 00 10 00 0e 00 00 0b 73 |.....=.........s|
+00000040 6e 69 74 65 73 74 2e 63 6f 6d 00 0d 00 20 00 1e |nitest.com... ..|
+00000050 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................|
+00000060 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................|
+00000070 00 01 01 |...|
+>>> Flow 2 (server to client)
+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 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..|
+00000030 05 ff 01 00 01 00 16 03 03 02 00 0b 00 01 fc 00 |................|
+00000040 01 f9 00 01 f6 30 82 01 f2 30 82 01 5d a0 03 02 |.....0...0..]...|
+00000050 01 02 02 01 00 30 0b 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....|
+00000060 01 05 30 28 31 10 30 0e 06 03 55 04 0a 13 07 41 |..0(1.0...U....A|
+00000070 63 6d 65 20 43 6f 31 14 30 12 06 03 55 04 03 13 |cme Co1.0...U...|
+00000080 0b 73 6e 69 74 65 73 74 2e 63 6f 6d 30 1e 17 0d |.snitest.com0...|
+00000090 31 32 30 34 31 31 31 37 34 30 33 35 5a 17 0d 31 |120411174035Z..1|
+000000a0 33 30 34 31 31 31 37 34 35 33 35 5a 30 28 31 10 |30411174535Z0(1.|
+000000b0 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co|
+000000c0 31 14 30 12 06 03 55 04 03 13 0b 73 6e 69 74 65 |1.0...U....snite|
+000000d0 73 74 2e 63 6f 6d 30 81 9d 30 0b 06 09 2a 86 48 |st.com0..0...*.H|
+000000e0 86 f7 0d 01 01 01 03 81 8d 00 30 81 89 02 81 81 |..........0.....|
+000000f0 00 bb 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 |..y......F...i..|
+00000100 2b 07 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 |+.CZ..-.zC...R..|
+00000110 65 4c 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e |eL,x.#........;~|
+00000120 62 a5 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa |b.,.3...\zV.....|
+00000130 58 7b 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 |X{&?......!.J..T|
+00000140 9f 5a bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d |.Z..Bq......~.}}|
+00000150 f1 04 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 |..9....Q.|..L;2f|
+00000160 01 cf af b1 1d b8 71 9a 1d db db 89 6b ae da 2d |......q.....k..-|
+00000170 79 02 03 01 00 01 a3 32 30 30 30 0e 06 03 55 1d |y......2000...U.|
+00000180 0f 01 01 ff 04 04 03 02 00 a0 30 0d 06 03 55 1d |..........0...U.|
+00000190 0e 04 06 04 04 01 02 03 04 30 0f 06 03 55 1d 23 |.........0...U.#|
+000001a0 04 08 30 06 80 04 01 02 03 04 30 0b 06 09 2a 86 |..0.......0...*.|
+000001b0 48 86 f7 0d 01 01 05 03 81 81 00 89 c6 45 5f 1c |H............E_.|
+000001c0 1f 5e f8 eb 1a b1 74 ee 24 39 05 9f 5c 42 59 bb |.^....t.$9..\BY.|
+000001d0 1a 8d 86 cd b1 d0 56 f5 6a 71 7d a4 0e 95 ab 90 |......V.jq}.....|
+000001e0 f5 9e 8d ea f6 27 c1 57 99 50 94 db 08 02 26 6e |.....'.W.P....&n|
+000001f0 b3 4f c6 84 2d ea 8a 4b 68 d9 c1 38 91 03 ab 84 |.O..-..Kh..8....|
+00000200 fb 9e 1f 85 d9 b5 d2 3f f2 31 2c 86 70 fb b5 40 |.......?.1,.p..@|
+00000210 14 82 45 a4 eb af e2 64 d9 0c 8a 4c f4 f8 5b 0f |..E....d...L..[.|
+00000220 ac 12 ac 2f c4 a3 15 4b ad 52 46 28 68 af 96 c6 |.../...K.RF(h...|
+00000230 2c 65 25 d6 52 b6 e3 18 45 bd cc 16 03 03 00 04 |,e%.R...E.......|
+00000240 0e 00 00 00 |....|
+>>> Flow 3 (client to server)
+00000000 16 03 03 00 86 10 00 00 82 00 80 72 23 e9 89 70 |...........r#..p|
+00000010 97 02 08 58 0d 28 96 5b 19 73 dd 4f 6e 4c 11 dd |...X.(.[.s.OnL..|
+00000020 cb 56 14 f4 8f c8 e5 84 03 f5 7e f0 a4 08 44 8c |.V........~...D.|
+00000030 22 74 01 5c e4 9d e0 38 53 90 66 e3 df bb 09 a8 |"t.\...8S.f.....|
+00000040 11 97 0a 44 01 d2 70 85 14 a1 9a 2f 02 34 40 6d |...D..p..../.4@m|
+00000050 66 80 72 9a 97 98 5c 91 0e dc 42 ac c2 90 2f 30 |f.r...\...B.../0|
+00000060 ca 39 25 94 da 6e b6 5f 94 a9 94 66 7f 32 6a bb |.9%..n._...f.2j.|
+00000070 5d 43 20 c3 74 f7 52 29 1f d5 62 6b a4 a1 8c 25 |]C .t.R)..bk...%|
+00000080 46 69 22 a5 68 54 f4 68 30 e2 52 14 03 03 00 01 |Fi".hT.h0.R.....|
+00000090 01 16 03 03 00 40 51 d2 78 64 e3 59 ee b7 5f 95 |.....@Q.xd.Y.._.|
+000000a0 4c 49 7f 0d 49 3f 55 71 8c 3b 24 e3 81 22 4a d1 |LI..I?Uq.;$.."J.|
+000000b0 ab 84 4e df 02 9d 56 ea 2a 14 71 e1 dc 1d 5c 1d |..N...V.*.q...\.|
+000000c0 54 ce cb 58 f6 4d e7 73 44 0d 99 95 a5 2d 7c 2f |T..X.M.sD....-|/|
+000000d0 15 f5 8f fd 97 40 |.....@|
+>>> Flow 4 (server to client)
+00000000 15 03 03 00 02 02 14 |.......|
diff --git a/libgo/go/crypto/tls/ticket.go b/libgo/go/crypto/tls/ticket.go
index 0923027c701..7be50ce68c9 100644
--- a/libgo/go/crypto/tls/ticket.go
+++ b/libgo/go/crypto/tls/ticket.go
@@ -22,6 +22,9 @@ type sessionState struct {
cipherSuite uint16
masterSecret []byte
certificates [][]byte
+ // usedOldKey is true if the ticket from which this session came from
+ // was encrypted with an older key and thus should be refreshed.
+ usedOldKey bool
}
func (s *sessionState) equal(i interface{}) bool {
@@ -132,20 +135,23 @@ func (s *sessionState) unmarshal(data []byte) bool {
func (c *Conn) encryptTicket(state *sessionState) ([]byte, error) {
serialized := state.marshal()
- encrypted := make([]byte, aes.BlockSize+len(serialized)+sha256.Size)
- iv := encrypted[:aes.BlockSize]
+ encrypted := make([]byte, ticketKeyNameLen+aes.BlockSize+len(serialized)+sha256.Size)
+ keyName := encrypted[:ticketKeyNameLen]
+ iv := encrypted[ticketKeyNameLen : ticketKeyNameLen+aes.BlockSize]
macBytes := encrypted[len(encrypted)-sha256.Size:]
if _, err := io.ReadFull(c.config.rand(), iv); err != nil {
return nil, err
}
- block, err := aes.NewCipher(c.config.SessionTicketKey[:16])
+ key := c.config.ticketKeys()[0]
+ copy(keyName, key.keyName[:])
+ block, err := aes.NewCipher(key.aesKey[:])
if err != nil {
return nil, errors.New("tls: failed to create cipher while encrypting ticket: " + err.Error())
}
- cipher.NewCTR(block, iv).XORKeyStream(encrypted[aes.BlockSize:], serialized)
+ cipher.NewCTR(block, iv).XORKeyStream(encrypted[ticketKeyNameLen+aes.BlockSize:], serialized)
- mac := hmac.New(sha256.New, c.config.SessionTicketKey[16:32])
+ mac := hmac.New(sha256.New, key.hmacKey[:])
mac.Write(encrypted[:len(encrypted)-sha256.Size])
mac.Sum(macBytes[:0])
@@ -154,14 +160,29 @@ func (c *Conn) encryptTicket(state *sessionState) ([]byte, error) {
func (c *Conn) decryptTicket(encrypted []byte) (*sessionState, bool) {
if c.config.SessionTicketsDisabled ||
- len(encrypted) < aes.BlockSize+sha256.Size {
+ len(encrypted) < ticketKeyNameLen+aes.BlockSize+sha256.Size {
return nil, false
}
- iv := encrypted[:aes.BlockSize]
+ keyName := encrypted[:ticketKeyNameLen]
+ iv := encrypted[ticketKeyNameLen : ticketKeyNameLen+aes.BlockSize]
macBytes := encrypted[len(encrypted)-sha256.Size:]
- mac := hmac.New(sha256.New, c.config.SessionTicketKey[16:32])
+ keys := c.config.ticketKeys()
+ keyIndex := -1
+ for i, candidateKey := range keys {
+ if bytes.Equal(keyName, candidateKey.keyName[:]) {
+ keyIndex = i
+ break
+ }
+ }
+
+ if keyIndex == -1 {
+ return nil, false
+ }
+ key := &keys[keyIndex]
+
+ mac := hmac.New(sha256.New, key.hmacKey[:])
mac.Write(encrypted[:len(encrypted)-sha256.Size])
expected := mac.Sum(nil)
@@ -169,15 +190,15 @@ func (c *Conn) decryptTicket(encrypted []byte) (*sessionState, bool) {
return nil, false
}
- block, err := aes.NewCipher(c.config.SessionTicketKey[:16])
+ block, err := aes.NewCipher(key.aesKey[:])
if err != nil {
return nil, false
}
- ciphertext := encrypted[aes.BlockSize : len(encrypted)-sha256.Size]
+ ciphertext := encrypted[ticketKeyNameLen+aes.BlockSize : len(encrypted)-sha256.Size]
plaintext := ciphertext
cipher.NewCTR(block, iv).XORKeyStream(plaintext, ciphertext)
- state := new(sessionState)
+ state := &sessionState{usedOldKey: keyIndex > 0}
ok := state.unmarshal(plaintext)
return state, ok
}
diff --git a/libgo/go/crypto/tls/tls.go b/libgo/go/crypto/tls/tls.go
index d50e1202924..0b1c3778ad4 100644
--- a/libgo/go/crypto/tls/tls.go
+++ b/libgo/go/crypto/tls/tls.go
@@ -167,22 +167,24 @@ func Dial(network, addr string, config *Config) (*Conn, error) {
// LoadX509KeyPair reads and parses a public/private key pair from a pair of
// files. The files must contain PEM encoded data.
-func LoadX509KeyPair(certFile, keyFile string) (cert Certificate, err error) {
+func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) {
certPEMBlock, err := ioutil.ReadFile(certFile)
if err != nil {
- return
+ return Certificate{}, err
}
keyPEMBlock, err := ioutil.ReadFile(keyFile)
if err != nil {
- return
+ return Certificate{}, err
}
return X509KeyPair(certPEMBlock, keyPEMBlock)
}
// X509KeyPair parses a public/private key pair from a pair of
// PEM encoded data.
-func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (cert Certificate, err error) {
+func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) {
+ var cert Certificate
var certDERBlock *pem.Block
+ fail := func(err error) (Certificate, error) { return Certificate{}, err }
for {
certDERBlock, certPEMBlock = pem.Decode(certPEMBlock)
if certDERBlock == nil {
@@ -194,62 +196,56 @@ func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (cert Certificate, err error)
}
if len(cert.Certificate) == 0 {
- err = errors.New("crypto/tls: failed to parse certificate PEM data")
- return
+ return fail(errors.New("crypto/tls: failed to parse certificate PEM data"))
}
var keyDERBlock *pem.Block
for {
keyDERBlock, keyPEMBlock = pem.Decode(keyPEMBlock)
if keyDERBlock == nil {
- err = errors.New("crypto/tls: failed to parse key PEM data")
- return
+ return fail(errors.New("crypto/tls: failed to parse key PEM data"))
}
if keyDERBlock.Type == "PRIVATE KEY" || strings.HasSuffix(keyDERBlock.Type, " PRIVATE KEY") {
break
}
}
+ var err error
cert.PrivateKey, err = parsePrivateKey(keyDERBlock.Bytes)
if err != nil {
- return
+ return fail(err)
}
// We don't need to parse the public key for TLS, but we so do anyway
// to check that it looks sane and matches the private key.
x509Cert, err := x509.ParseCertificate(cert.Certificate[0])
if err != nil {
- return
+ return fail(err)
}
switch pub := x509Cert.PublicKey.(type) {
case *rsa.PublicKey:
priv, ok := cert.PrivateKey.(*rsa.PrivateKey)
if !ok {
- err = errors.New("crypto/tls: private key type does not match public key type")
- return
+ return fail(errors.New("crypto/tls: private key type does not match public key type"))
}
if pub.N.Cmp(priv.N) != 0 {
- err = errors.New("crypto/tls: private key does not match public key")
- return
+ return fail(errors.New("crypto/tls: private key does not match public key"))
}
case *ecdsa.PublicKey:
priv, ok := cert.PrivateKey.(*ecdsa.PrivateKey)
if !ok {
- err = errors.New("crypto/tls: private key type does not match public key type")
- return
+ return fail(errors.New("crypto/tls: private key type does not match public key type"))
}
if pub.X.Cmp(priv.X) != 0 || pub.Y.Cmp(priv.Y) != 0 {
- err = errors.New("crypto/tls: private key does not match public key")
- return
+ return fail(errors.New("crypto/tls: private key does not match public key"))
}
default:
- err = errors.New("crypto/tls: unknown public key algorithm")
- return
+ return fail(errors.New("crypto/tls: unknown public key algorithm"))
}
- return
+ return cert, nil
}
// Attempt to parse the given private key DER block. OpenSSL 0.9.8 generates
diff --git a/libgo/go/crypto/tls/tls_test.go b/libgo/go/crypto/tls/tls_test.go
index e82579eee9f..c45c10378d7 100644
--- a/libgo/go/crypto/tls/tls_test.go
+++ b/libgo/go/crypto/tls/tls_test.go
@@ -7,6 +7,7 @@ package tls
import (
"bytes"
"fmt"
+ "internal/testenv"
"io"
"net"
"strings"
@@ -40,7 +41,7 @@ D2lWusoe2/nEqfDVVWGWlyJ7yOmqaVm/iNUN9B2N2g==
`
// keyPEM is the same as rsaKeyPEM, but declares itself as just
-// "PRIVATE KEY", not "RSA PRIVATE KEY". http://golang.org/issue/4477
+// "PRIVATE KEY", not "RSA PRIVATE KEY". https://golang.org/issue/4477
var keyPEM = `-----BEGIN PRIVATE KEY-----
MIIBOwIBAAJBANLJhPHhITqQbPklG3ibCVxwGMRfp/v4XqhfdQHdcVfHap6NQ5Wo
k/4xIA+ui35/MmNartNuC+BdZ1tMuVCPFZcCAwEAAQJAEJ2N+zsR0Xn8/Q6twa4G
@@ -280,3 +281,54 @@ func TestTLSUniqueMatches(t *testing.T) {
t.Error("client and server channel bindings differ when session resumption is used")
}
}
+
+func TestVerifyHostname(t *testing.T) {
+ testenv.MustHaveExternalNetwork(t)
+
+ c, err := Dial("tcp", "www.google.com:https", nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := c.VerifyHostname("www.google.com"); err != nil {
+ t.Fatalf("verify www.google.com: %v", err)
+ }
+ if err := c.VerifyHostname("www.yahoo.com"); err == nil {
+ t.Fatalf("verify www.yahoo.com succeeded")
+ }
+
+ c, err = Dial("tcp", "www.google.com:https", &Config{InsecureSkipVerify: true})
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := c.VerifyHostname("www.google.com"); err == nil {
+ t.Fatalf("verify www.google.com succeeded with InsecureSkipVerify=true")
+ }
+ if err := c.VerifyHostname("www.yahoo.com"); err == nil {
+ t.Fatalf("verify www.google.com succeeded with InsecureSkipVerify=true")
+ }
+}
+
+func TestVerifyHostnameResumed(t *testing.T) {
+ testenv.MustHaveExternalNetwork(t)
+
+ config := &Config{
+ ClientSessionCache: NewLRUClientSessionCache(32),
+ }
+ for i := 0; i < 2; i++ {
+ c, err := Dial("tcp", "www.google.com:https", config)
+ if err != nil {
+ t.Fatalf("Dial #%d: %v", i, err)
+ }
+ cs := c.ConnectionState()
+ if i > 0 && !cs.DidResume {
+ t.Fatalf("Subsequent connection unexpectedly didn't resume")
+ }
+ if cs.VerifiedChains == nil {
+ t.Fatalf("Dial #%d: cs.VerifiedChains == nil", i)
+ }
+ if err := c.VerifyHostname("www.google.com"); err != nil {
+ t.Fatalf("verify www.google.com #%d: %v", i, err)
+ }
+ c.Close()
+ }
+}