OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [crypto/] [tls/] [handshake_server_test.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2009 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package tls
6
 
7
import (
8
        "bytes"
9
        "crypto/rsa"
10
        "crypto/x509"
11
        "encoding/hex"
12
        "encoding/pem"
13
        "flag"
14
        "io"
15
        "log"
16
        "math/big"
17
        "net"
18
        "strconv"
19
        "strings"
20
        "testing"
21
        "time"
22
)
23
 
24
type zeroSource struct{}
25
 
26
func (zeroSource) Read(b []byte) (n int, err error) {
27
        for i := range b {
28
                b[i] = 0
29
        }
30
 
31
        return len(b), nil
32
}
33
 
34
var testConfig *Config
35
 
36
func init() {
37
        testConfig = new(Config)
38
        testConfig.Time = func() time.Time { return time.Unix(0, 0) }
39
        testConfig.Rand = zeroSource{}
40
        testConfig.Certificates = make([]Certificate, 1)
41
        testConfig.Certificates[0].Certificate = [][]byte{testCertificate}
42
        testConfig.Certificates[0].PrivateKey = testPrivateKey
43
        testConfig.CipherSuites = []uint16{TLS_RSA_WITH_RC4_128_SHA}
44
        testConfig.InsecureSkipVerify = true
45
}
46
 
47
func testClientHelloFailure(t *testing.T, m handshakeMessage, expected error) {
48
        // Create in-memory network connection,
49
        // send message to server.  Should return
50
        // expected error.
51
        c, s := net.Pipe()
52
        go func() {
53
                cli := Client(c, testConfig)
54
                if ch, ok := m.(*clientHelloMsg); ok {
55
                        cli.vers = ch.vers
56
                }
57
                cli.writeRecord(recordTypeHandshake, m.marshal())
58
                c.Close()
59
        }()
60
        err := Server(s, testConfig).Handshake()
61
        s.Close()
62
        if e, ok := err.(*net.OpError); !ok || e.Err != expected {
63
                t.Errorf("Got error: %s; expected: %s", err, expected)
64
        }
65
}
66
 
67
func TestSimpleError(t *testing.T) {
68
        testClientHelloFailure(t, &serverHelloDoneMsg{}, alertUnexpectedMessage)
69
}
70
 
71
var badProtocolVersions = []uint16{0x0000, 0x0005, 0x0100, 0x0105, 0x0200, 0x0205}
72
 
73
func TestRejectBadProtocolVersion(t *testing.T) {
74
        for _, v := range badProtocolVersions {
75
                testClientHelloFailure(t, &clientHelloMsg{vers: v}, alertProtocolVersion)
76
        }
77
}
78
 
79
func TestNoSuiteOverlap(t *testing.T) {
80
        clientHello := &clientHelloMsg{nil, 0x0301, nil, nil, []uint16{0xff00}, []uint8{0}, false, "", false, nil, nil}
81
        testClientHelloFailure(t, clientHello, alertHandshakeFailure)
82
 
83
}
84
 
85
func TestNoCompressionOverlap(t *testing.T) {
86
        clientHello := &clientHelloMsg{nil, 0x0301, nil, nil, []uint16{TLS_RSA_WITH_RC4_128_SHA}, []uint8{0xff}, false, "", false, nil, nil}
87
        testClientHelloFailure(t, clientHello, alertHandshakeFailure)
88
}
89
 
90
func TestAlertForwarding(t *testing.T) {
91
        c, s := net.Pipe()
92
        go func() {
93
                Client(c, testConfig).sendAlert(alertUnknownCA)
94
                c.Close()
95
        }()
96
 
97
        err := Server(s, testConfig).Handshake()
98
        s.Close()
99
        if e, ok := err.(*net.OpError); !ok || e.Err != error(alertUnknownCA) {
100
                t.Errorf("Got error: %s; expected: %s", err, alertUnknownCA)
101
        }
102
}
103
 
104
func TestClose(t *testing.T) {
105
        c, s := net.Pipe()
106
        go c.Close()
107
 
108
        err := Server(s, testConfig).Handshake()
109
        s.Close()
110
        if err != io.EOF {
111
                t.Errorf("Got error: %s; expected: %s", err, io.EOF)
112
        }
113
}
114
 
115
func testServerScript(t *testing.T, name string, serverScript [][]byte, config *Config, peers []*x509.Certificate) {
116
        c, s := net.Pipe()
117
        srv := Server(s, config)
118
        pchan := make(chan []*x509.Certificate, 1)
119
        go func() {
120
                srv.Write([]byte("hello, world\n"))
121
                srv.Close()
122
                s.Close()
123
                st := srv.ConnectionState()
124
                pchan <- st.PeerCertificates
125
        }()
126
 
127
        for i, b := range serverScript {
128
                if i%2 == 0 {
129
                        c.Write(b)
130
                        continue
131
                }
132
                bb := make([]byte, len(b))
133
                n, err := io.ReadFull(c, bb)
134
                if err != nil {
135
                        t.Fatalf("%s #%d: %s\nRead %d, wanted %d, got %x, wanted %x\n", name, i, err, n, len(bb), bb[:n], b)
136
                }
137
                if !bytes.Equal(b, bb) {
138
                        t.Fatalf("%s #%d: mismatch on read: got:%x want:%x", name, i, bb, b)
139
                }
140
        }
141
        c.Close()
142
 
143
        if peers != nil {
144
                gotpeers := <-pchan
145
                if len(peers) == len(gotpeers) {
146
                        for i, _ := range peers {
147
                                if !peers[i].Equal(gotpeers[i]) {
148
                                        t.Fatalf("%s: mismatch on peer cert %d", name, i)
149
                                }
150
                        }
151
                } else {
152
                        t.Fatalf("%s: mismatch on peer list length: %d (wanted) != %d (got)", name, len(peers), len(gotpeers))
153
                }
154
        }
155
}
156
 
157
func TestHandshakeServerRC4(t *testing.T) {
158
        testServerScript(t, "RC4", rc4ServerScript, testConfig, nil)
159
}
160
 
161
func TestHandshakeServer3DES(t *testing.T) {
162
        des3Config := new(Config)
163
        *des3Config = *testConfig
164
        des3Config.CipherSuites = []uint16{TLS_RSA_WITH_3DES_EDE_CBC_SHA}
165
        testServerScript(t, "3DES", des3ServerScript, des3Config, nil)
166
}
167
 
168
func TestHandshakeServerAES(t *testing.T) {
169
        aesConfig := new(Config)
170
        *aesConfig = *testConfig
171
        aesConfig.CipherSuites = []uint16{TLS_RSA_WITH_AES_128_CBC_SHA}
172
        testServerScript(t, "AES", aesServerScript, aesConfig, nil)
173
}
174
 
175
func TestHandshakeServerSSLv3(t *testing.T) {
176
        testServerScript(t, "SSLv3", sslv3ServerScript, testConfig, nil)
177
}
178
 
179
type clientauthTest struct {
180
        name       string
181
        clientauth ClientAuthType
182
        peers      []*x509.Certificate
183
        script     [][]byte
184
}
185
 
186
func TestClientAuth(t *testing.T) {
187
        for _, cat := range clientauthTests {
188
                t.Log("running", cat.name)
189
                cfg := new(Config)
190
                *cfg = *testConfig
191
                cfg.ClientAuth = cat.clientauth
192
                testServerScript(t, cat.name, cat.script, cfg, cat.peers)
193
        }
194
}
195
 
196
var serve = flag.Bool("serve", false, "run a TLS server on :10443")
197
var testCipherSuites = flag.String("ciphersuites",
198
        "0x"+strconv.FormatInt(int64(TLS_RSA_WITH_RC4_128_SHA), 16),
199
        "cipher suites to accept in serving mode")
200
var testClientAuth = flag.Int("clientauth", 0, "value for tls.Config.ClientAuth")
201
 
202
func TestRunServer(t *testing.T) {
203
        if !*serve {
204
                return
205
        }
206
 
207
        suites := strings.Split(*testCipherSuites, ",")
208
        testConfig.CipherSuites = make([]uint16, len(suites))
209
        for i := range suites {
210
                suite, err := strconv.ParseUint(suites[i], 0, 64)
211
                if err != nil {
212
                        panic(err)
213
                }
214
                testConfig.CipherSuites[i] = uint16(suite)
215
        }
216
 
217
        testConfig.ClientAuth = ClientAuthType(*testClientAuth)
218
 
219
        l, err := Listen("tcp", ":10443", testConfig)
220
        if err != nil {
221
                t.Fatal(err)
222
        }
223
 
224
        for {
225
                c, err := l.Accept()
226
                if err != nil {
227
                        log.Printf("error from TLS handshake: %s", err)
228
                        break
229
                }
230
 
231
                _, err = c.Write([]byte("hello, world\n"))
232
                if err != nil {
233
                        log.Printf("error from TLS: %s", err)
234
                        continue
235
                }
236
 
237
                st := c.(*Conn).ConnectionState()
238
                if len(st.PeerCertificates) > 0 {
239
                        log.Print("Handling request from client ", st.PeerCertificates[0].Subject.CommonName)
240
                } else {
241
                        log.Print("Handling request from anon client")
242
                }
243
 
244
                c.Close()
245
        }
246
}
247
 
248
func bigFromString(s string) *big.Int {
249
        ret := new(big.Int)
250
        ret.SetString(s, 10)
251
        return ret
252
}
253
 
254
func fromHex(s string) []byte {
255
        b, _ := hex.DecodeString(s)
256
        return b
257
}
258
 
259
var testCertificate = fromHex("308202b030820219a00302010202090085b0bba48a7fb8ca300d06092a864886f70d01010505003045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c7464301e170d3130303432343039303933385a170d3131303432343039303933385a3045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746430819f300d06092a864886f70d010101050003818d0030818902818100bb79d6f517b5e5bf4610d0dc69bee62b07435ad0032d8a7a4385b71452e7a5654c2c78b8238cb5b482e5de1f953b7e62a52ca533d6fe125c7a56fcf506bffa587b263fb5cd04d3d0c921964ac7f4549f5abfef427100fe1899077f7e887d7df10439c4a22edb51c97ce3c04c3b326601cfafb11db8719a1ddbdb896baeda2d790203010001a381a73081a4301d0603551d0e04160414b1ade2855acfcb28db69ce2369ded3268e18883930750603551d23046e306c8014b1ade2855acfcb28db69ce2369ded3268e188839a149a4473045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746482090085b0bba48a7fb8ca300c0603551d13040530030101ff300d06092a864886f70d010105050003818100086c4524c76bb159ab0c52ccf2b014d7879d7a6475b55a9566e4c52b8eae12661feb4f38b36e60d392fdf74108b52513b1187a24fb301dbaed98b917ece7d73159db95d31d78ea50565cd5825a2d5a5f33c4b6d8c97590968c0f5298b5cd981f89205ff2a01ca31b9694dda9fd57e970e8266d71999b266e3850296c90a7bdd9")
260
 
261
var testPrivateKey = &rsa.PrivateKey{
262
        PublicKey: rsa.PublicKey{
263
                N: bigFromString("131650079503776001033793877885499001334664249354723305978524647182322416328664556247316495448366990052837680518067798333412266673813370895702118944398081598789828837447552603077848001020611640547221687072142537202428102790818451901395596882588063427854225330436740647715202971973145151161964464812406232198521"),
264
                E: 65537,
265
        },
266
        D: bigFromString("29354450337804273969007277378287027274721892607543397931919078829901848876371746653677097639302788129485893852488285045793268732234230875671682624082413996177431586734171663258657462237320300610850244186316880055243099640544518318093544057213190320837094958164973959123058337475052510833916491060913053867729"),
267
        Primes: []*big.Int{
268
                bigFromString("11969277782311800166562047708379380720136961987713178380670422671426759650127150688426177829077494755200794297055316163155755835813760102405344560929062149"),
269
                bigFromString("10998999429884441391899182616418192492905073053684657075974935218461686523870125521822756579792315215543092255516093840728890783887287417039645833477273829"),
270
        },
271
}
272
 
273
func loadPEMCert(in string) *x509.Certificate {
274
        block, _ := pem.Decode([]byte(in))
275
        if block.Type == "CERTIFICATE" && len(block.Headers) == 0 {
276
                cert, err := x509.ParseCertificate(block.Bytes)
277
                if err == nil {
278
                        return cert
279
                }
280
                panic("error parsing cert")
281
        }
282
        panic("error parsing PEM")
283
}
284
 
285
// Script of interaction with gnutls implementation.
286
// The values for this test are obtained by building and running in server mode:
287
//   % gotest -test.run "TestRunServer" -serve
288
// and then:
289
//   % gnutls-cli --insecure --debug 100 -p 10443 localhost > /tmp/log 2>&1
290
//   % python parse-gnutls-cli-debug-log.py < /tmp/log
291
var rc4ServerScript = [][]byte{
292
        {
293
                0x16, 0x03, 0x02, 0x00, 0x7a, 0x01, 0x00, 0x00,
294
                0x76, 0x03, 0x02, 0x4e, 0xdd, 0xe6, 0xa5, 0xf7,
295
                0x00, 0x36, 0xf7, 0x83, 0xec, 0x93, 0x7c, 0xd2,
296
                0x4d, 0xe7, 0x7b, 0xf5, 0x4c, 0xf7, 0xe3, 0x86,
297
                0xe8, 0xec, 0x3b, 0xbd, 0x2c, 0x9a, 0x3f, 0x57,
298
                0xf0, 0xa4, 0xd4, 0x00, 0x00, 0x34, 0x00, 0x33,
299
                0x00, 0x45, 0x00, 0x39, 0x00, 0x88, 0x00, 0x16,
300
                0x00, 0x32, 0x00, 0x44, 0x00, 0x38, 0x00, 0x87,
301
                0x00, 0x13, 0x00, 0x66, 0x00, 0x90, 0x00, 0x91,
302
                0x00, 0x8f, 0x00, 0x8e, 0x00, 0x2f, 0x00, 0x41,
303
                0x00, 0x35, 0x00, 0x84, 0x00, 0x0a, 0x00, 0x05,
304
                0x00, 0x04, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8b,
305
                0x00, 0x8a, 0x01, 0x00, 0x00, 0x19, 0x00, 0x09,
306
                0x00, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
307
                0x0e, 0x00, 0x0c, 0x00, 0x00, 0x09, 0x6c, 0x6f,
308
                0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74,
309
        },
310
 
311
        {
312
                0x16, 0x03, 0x01, 0x00, 0x2a, 0x02, 0x00, 0x00,
313
                0x26, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
314
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
315
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
316
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
317
                0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x16,
318
                0x03, 0x01, 0x02, 0xbe, 0x0b, 0x00, 0x02, 0xba,
319
                0x00, 0x02, 0xb7, 0x00, 0x02, 0xb4, 0x30, 0x82,
320
                0x02, 0xb0, 0x30, 0x82, 0x02, 0x19, 0xa0, 0x03,
321
                0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x85, 0xb0,
322
                0xbb, 0xa4, 0x8a, 0x7f, 0xb8, 0xca, 0x30, 0x0d,
323
                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
324
                0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x45, 0x31,
325
                0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
326
                0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11,
327
                0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53,
328
                0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
329
                0x65, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55,
330
                0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65,
331
                0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
332
                0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79,
333
                0x20, 0x4c, 0x74, 0x64, 0x30, 0x1e, 0x17, 0x0d,
334
                0x31, 0x30, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39,
335
                0x30, 0x39, 0x33, 0x38, 0x5a, 0x17, 0x0d, 0x31,
336
                0x31, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39, 0x30,
337
                0x39, 0x33, 0x38, 0x5a, 0x30, 0x45, 0x31, 0x0b,
338
                0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
339
                0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06,
340
                0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f,
341
                0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
342
                0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04,
343
                0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72,
344
                0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
345
                0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20,
346
                0x4c, 0x74, 0x64, 0x30, 0x81, 0x9f, 0x30, 0x0d,
347
                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
348
                0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d,
349
                0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00,
350
                0xbb, 0x79, 0xd6, 0xf5, 0x17, 0xb5, 0xe5, 0xbf,
351
                0x46, 0x10, 0xd0, 0xdc, 0x69, 0xbe, 0xe6, 0x2b,
352
                0x07, 0x43, 0x5a, 0xd0, 0x03, 0x2d, 0x8a, 0x7a,
353
                0x43, 0x85, 0xb7, 0x14, 0x52, 0xe7, 0xa5, 0x65,
354
                0x4c, 0x2c, 0x78, 0xb8, 0x23, 0x8c, 0xb5, 0xb4,
355
                0x82, 0xe5, 0xde, 0x1f, 0x95, 0x3b, 0x7e, 0x62,
356
                0xa5, 0x2c, 0xa5, 0x33, 0xd6, 0xfe, 0x12, 0x5c,
357
                0x7a, 0x56, 0xfc, 0xf5, 0x06, 0xbf, 0xfa, 0x58,
358
                0x7b, 0x26, 0x3f, 0xb5, 0xcd, 0x04, 0xd3, 0xd0,
359
                0xc9, 0x21, 0x96, 0x4a, 0xc7, 0xf4, 0x54, 0x9f,
360
                0x5a, 0xbf, 0xef, 0x42, 0x71, 0x00, 0xfe, 0x18,
361
                0x99, 0x07, 0x7f, 0x7e, 0x88, 0x7d, 0x7d, 0xf1,
362
                0x04, 0x39, 0xc4, 0xa2, 0x2e, 0xdb, 0x51, 0xc9,
363
                0x7c, 0xe3, 0xc0, 0x4c, 0x3b, 0x32, 0x66, 0x01,
364
                0xcf, 0xaf, 0xb1, 0x1d, 0xb8, 0x71, 0x9a, 0x1d,
365
                0xdb, 0xdb, 0x89, 0x6b, 0xae, 0xda, 0x2d, 0x79,
366
                0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xa7,
367
                0x30, 0x81, 0xa4, 0x30, 0x1d, 0x06, 0x03, 0x55,
368
                0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb1, 0xad,
369
                0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb, 0x69,
370
                0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e, 0x18,
371
                0x88, 0x39, 0x30, 0x75, 0x06, 0x03, 0x55, 0x1d,
372
                0x23, 0x04, 0x6e, 0x30, 0x6c, 0x80, 0x14, 0xb1,
373
                0xad, 0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb,
374
                0x69, 0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e,
375
                0x18, 0x88, 0x39, 0xa1, 0x49, 0xa4, 0x47, 0x30,
376
                0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
377
                0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13,
378
                0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
379
                0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74,
380
                0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06,
381
                0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e,
382
                0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57,
383
                0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50,
384
                0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x82, 0x09,
385
                0x00, 0x85, 0xb0, 0xbb, 0xa4, 0x8a, 0x7f, 0xb8,
386
                0xca, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13,
387
                0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
388
                0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
389
                0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81,
390
                0x81, 0x00, 0x08, 0x6c, 0x45, 0x24, 0xc7, 0x6b,
391
                0xb1, 0x59, 0xab, 0x0c, 0x52, 0xcc, 0xf2, 0xb0,
392
                0x14, 0xd7, 0x87, 0x9d, 0x7a, 0x64, 0x75, 0xb5,
393
                0x5a, 0x95, 0x66, 0xe4, 0xc5, 0x2b, 0x8e, 0xae,
394
                0x12, 0x66, 0x1f, 0xeb, 0x4f, 0x38, 0xb3, 0x6e,
395
                0x60, 0xd3, 0x92, 0xfd, 0xf7, 0x41, 0x08, 0xb5,
396
                0x25, 0x13, 0xb1, 0x18, 0x7a, 0x24, 0xfb, 0x30,
397
                0x1d, 0xba, 0xed, 0x98, 0xb9, 0x17, 0xec, 0xe7,
398
                0xd7, 0x31, 0x59, 0xdb, 0x95, 0xd3, 0x1d, 0x78,
399
                0xea, 0x50, 0x56, 0x5c, 0xd5, 0x82, 0x5a, 0x2d,
400
                0x5a, 0x5f, 0x33, 0xc4, 0xb6, 0xd8, 0xc9, 0x75,
401
                0x90, 0x96, 0x8c, 0x0f, 0x52, 0x98, 0xb5, 0xcd,
402
                0x98, 0x1f, 0x89, 0x20, 0x5f, 0xf2, 0xa0, 0x1c,
403
                0xa3, 0x1b, 0x96, 0x94, 0xdd, 0xa9, 0xfd, 0x57,
404
                0xe9, 0x70, 0xe8, 0x26, 0x6d, 0x71, 0x99, 0x9b,
405
                0x26, 0x6e, 0x38, 0x50, 0x29, 0x6c, 0x90, 0xa7,
406
                0xbd, 0xd9, 0x16, 0x03, 0x01, 0x00, 0x04, 0x0e,
407
                0x00, 0x00, 0x00,
408
        },
409
 
410
        {
411
                0x16, 0x03, 0x01, 0x00, 0x86, 0x10, 0x00, 0x00,
412
                0x82, 0x00, 0x80, 0x39, 0xe2, 0x0f, 0x49, 0xa0,
413
                0xe6, 0xe4, 0x3b, 0x0c, 0x5f, 0xce, 0x39, 0x97,
414
                0x6c, 0xb6, 0x41, 0xd9, 0xe1, 0x52, 0x8f, 0x43,
415
                0xb3, 0xc6, 0x4f, 0x9a, 0xe2, 0x1e, 0xb9, 0x3b,
416
                0xe3, 0x72, 0x17, 0x68, 0xb2, 0x0d, 0x7b, 0x71,
417
                0x33, 0x96, 0x5c, 0xf9, 0xfe, 0x18, 0x8f, 0x2f,
418
                0x2b, 0x82, 0xec, 0x03, 0xf2, 0x16, 0xa8, 0xf8,
419
                0x39, 0xf9, 0xbb, 0x5a, 0xd3, 0x0c, 0xc1, 0x2a,
420
                0x52, 0xa1, 0x90, 0x20, 0x6b, 0x24, 0xc9, 0x55,
421
                0xee, 0x05, 0xd8, 0xb3, 0x43, 0x58, 0xf6, 0x7f,
422
                0x68, 0x2d, 0xb3, 0xd1, 0x1b, 0x30, 0xaa, 0xdf,
423
                0xfc, 0x85, 0xf1, 0xab, 0x14, 0x51, 0x91, 0x78,
424
                0x29, 0x35, 0x65, 0xe0, 0x9c, 0xf6, 0xb7, 0x35,
425
                0x33, 0xdb, 0x28, 0x93, 0x4d, 0x86, 0xbc, 0xfe,
426
                0xaa, 0xd1, 0xc0, 0x2e, 0x4d, 0xec, 0xa2, 0x98,
427
                0xca, 0x08, 0xb2, 0x91, 0x14, 0xde, 0x97, 0x3a,
428
                0xc4, 0x6b, 0x49, 0x14, 0x03, 0x01, 0x00, 0x01,
429
                0x01, 0x16, 0x03, 0x01, 0x00, 0x24, 0x7a, 0xcb,
430
                0x3b, 0x0e, 0xbb, 0x7a, 0x56, 0x39, 0xaf, 0x83,
431
                0xae, 0xfd, 0x25, 0xfd, 0x64, 0xb4, 0x0c, 0x0c,
432
                0x17, 0x46, 0x54, 0x2c, 0x6a, 0x07, 0x83, 0xc6,
433
                0x46, 0x08, 0x0b, 0xcd, 0x15, 0x53, 0xef, 0x40,
434
                0x4e, 0x56,
435
        },
436
 
437
        {
438
                0x14, 0x03, 0x01, 0x00, 0x01, 0x01, 0x16, 0x03,
439
                0x01, 0x00, 0x24, 0xd3, 0x72, 0xeb, 0x29, 0xb9,
440
                0x15, 0x29, 0xb5, 0xe5, 0xb7, 0xef, 0x5c, 0xb2,
441
                0x9d, 0xf6, 0xc8, 0x47, 0xd6, 0xa0, 0x84, 0xf0,
442
                0x8c, 0xcb, 0xe6, 0xbe, 0xbc, 0xfb, 0x38, 0x90,
443
                0x89, 0x60, 0xa2, 0xe8, 0xaa, 0xb3, 0x12, 0x17,
444
                0x03, 0x01, 0x00, 0x21, 0x67, 0x4a, 0x3d, 0x31,
445
                0x6c, 0x5a, 0x1c, 0xf9, 0x6e, 0xf1, 0xd8, 0x12,
446
                0x0e, 0xb9, 0xfd, 0xfc, 0x66, 0x91, 0xd1, 0x1d,
447
                0x6e, 0xe4, 0x55, 0xdd, 0x11, 0xb9, 0xb8, 0xa2,
448
                0x65, 0xa1, 0x95, 0x64, 0x1c, 0x15, 0x03, 0x01,
449
                0x00, 0x16, 0x9b, 0xa0, 0x24, 0xe3, 0xcb, 0xae,
450
                0xad, 0x51, 0xb3, 0x63, 0x59, 0x78, 0x49, 0x24,
451
                0x06, 0x6e, 0xee, 0x7a, 0xd7, 0x74, 0x53, 0x04,
452
        },
453
}
454
 
455
var des3ServerScript = [][]byte{
456
        {
457
                0x16, 0x03, 0x02, 0x00, 0x7a, 0x01, 0x00, 0x00,
458
                0x76, 0x03, 0x02, 0x4e, 0x84, 0xf4, 0x3c, 0xe4,
459
                0xb8, 0xc7, 0xa0, 0x30, 0x55, 0x2a, 0xbc, 0xb7,
460
                0x04, 0x6b, 0x6f, 0x87, 0x93, 0x96, 0xbd, 0x1a,
461
                0x7a, 0x1e, 0xce, 0xd2, 0x0d, 0xf3, 0x01, 0x03,
462
                0xbe, 0x7b, 0x17, 0x00, 0x00, 0x34, 0x00, 0x33,
463
                0x00, 0x45, 0x00, 0x39, 0x00, 0x88, 0x00, 0x16,
464
                0x00, 0x32, 0x00, 0x44, 0x00, 0x38, 0x00, 0x87,
465
                0x00, 0x13, 0x00, 0x66, 0x00, 0x90, 0x00, 0x91,
466
                0x00, 0x8f, 0x00, 0x8e, 0x00, 0x2f, 0x00, 0x41,
467
                0x00, 0x35, 0x00, 0x84, 0x00, 0x0a, 0x00, 0x05,
468
                0x00, 0x04, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8b,
469
                0x00, 0x8a, 0x01, 0x00, 0x00, 0x19, 0x00, 0x09,
470
                0x00, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
471
                0x0e, 0x00, 0x0c, 0x00, 0x00, 0x09, 0x6c, 0x6f,
472
                0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74,
473
        },
474
 
475
        {
476
                0x16, 0x03, 0x01, 0x00, 0x2a, 0x02, 0x00, 0x00,
477
                0x26, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
478
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
479
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
480
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
481
                0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x16,
482
                0x03, 0x01, 0x02, 0xbe, 0x0b, 0x00, 0x02, 0xba,
483
                0x00, 0x02, 0xb7, 0x00, 0x02, 0xb4, 0x30, 0x82,
484
                0x02, 0xb0, 0x30, 0x82, 0x02, 0x19, 0xa0, 0x03,
485
                0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x85, 0xb0,
486
                0xbb, 0xa4, 0x8a, 0x7f, 0xb8, 0xca, 0x30, 0x0d,
487
                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
488
                0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x45, 0x31,
489
                0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
490
                0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11,
491
                0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53,
492
                0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
493
                0x65, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55,
494
                0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65,
495
                0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
496
                0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79,
497
                0x20, 0x4c, 0x74, 0x64, 0x30, 0x1e, 0x17, 0x0d,
498
                0x31, 0x30, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39,
499
                0x30, 0x39, 0x33, 0x38, 0x5a, 0x17, 0x0d, 0x31,
500
                0x31, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39, 0x30,
501
                0x39, 0x33, 0x38, 0x5a, 0x30, 0x45, 0x31, 0x0b,
502
                0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
503
                0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06,
504
                0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f,
505
                0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
506
                0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04,
507
                0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72,
508
                0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
509
                0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20,
510
                0x4c, 0x74, 0x64, 0x30, 0x81, 0x9f, 0x30, 0x0d,
511
                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
512
                0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d,
513
                0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00,
514
                0xbb, 0x79, 0xd6, 0xf5, 0x17, 0xb5, 0xe5, 0xbf,
515
                0x46, 0x10, 0xd0, 0xdc, 0x69, 0xbe, 0xe6, 0x2b,
516
                0x07, 0x43, 0x5a, 0xd0, 0x03, 0x2d, 0x8a, 0x7a,
517
                0x43, 0x85, 0xb7, 0x14, 0x52, 0xe7, 0xa5, 0x65,
518
                0x4c, 0x2c, 0x78, 0xb8, 0x23, 0x8c, 0xb5, 0xb4,
519
                0x82, 0xe5, 0xde, 0x1f, 0x95, 0x3b, 0x7e, 0x62,
520
                0xa5, 0x2c, 0xa5, 0x33, 0xd6, 0xfe, 0x12, 0x5c,
521
                0x7a, 0x56, 0xfc, 0xf5, 0x06, 0xbf, 0xfa, 0x58,
522
                0x7b, 0x26, 0x3f, 0xb5, 0xcd, 0x04, 0xd3, 0xd0,
523
                0xc9, 0x21, 0x96, 0x4a, 0xc7, 0xf4, 0x54, 0x9f,
524
                0x5a, 0xbf, 0xef, 0x42, 0x71, 0x00, 0xfe, 0x18,
525
                0x99, 0x07, 0x7f, 0x7e, 0x88, 0x7d, 0x7d, 0xf1,
526
                0x04, 0x39, 0xc4, 0xa2, 0x2e, 0xdb, 0x51, 0xc9,
527
                0x7c, 0xe3, 0xc0, 0x4c, 0x3b, 0x32, 0x66, 0x01,
528
                0xcf, 0xaf, 0xb1, 0x1d, 0xb8, 0x71, 0x9a, 0x1d,
529
                0xdb, 0xdb, 0x89, 0x6b, 0xae, 0xda, 0x2d, 0x79,
530
                0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xa7,
531
                0x30, 0x81, 0xa4, 0x30, 0x1d, 0x06, 0x03, 0x55,
532
                0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb1, 0xad,
533
                0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb, 0x69,
534
                0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e, 0x18,
535
                0x88, 0x39, 0x30, 0x75, 0x06, 0x03, 0x55, 0x1d,
536
                0x23, 0x04, 0x6e, 0x30, 0x6c, 0x80, 0x14, 0xb1,
537
                0xad, 0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb,
538
                0x69, 0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e,
539
                0x18, 0x88, 0x39, 0xa1, 0x49, 0xa4, 0x47, 0x30,
540
                0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
541
                0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13,
542
                0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
543
                0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74,
544
                0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06,
545
                0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e,
546
                0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57,
547
                0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50,
548
                0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x82, 0x09,
549
                0x00, 0x85, 0xb0, 0xbb, 0xa4, 0x8a, 0x7f, 0xb8,
550
                0xca, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13,
551
                0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
552
                0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
553
                0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81,
554
                0x81, 0x00, 0x08, 0x6c, 0x45, 0x24, 0xc7, 0x6b,
555
                0xb1, 0x59, 0xab, 0x0c, 0x52, 0xcc, 0xf2, 0xb0,
556
                0x14, 0xd7, 0x87, 0x9d, 0x7a, 0x64, 0x75, 0xb5,
557
                0x5a, 0x95, 0x66, 0xe4, 0xc5, 0x2b, 0x8e, 0xae,
558
                0x12, 0x66, 0x1f, 0xeb, 0x4f, 0x38, 0xb3, 0x6e,
559
                0x60, 0xd3, 0x92, 0xfd, 0xf7, 0x41, 0x08, 0xb5,
560
                0x25, 0x13, 0xb1, 0x18, 0x7a, 0x24, 0xfb, 0x30,
561
                0x1d, 0xba, 0xed, 0x98, 0xb9, 0x17, 0xec, 0xe7,
562
                0xd7, 0x31, 0x59, 0xdb, 0x95, 0xd3, 0x1d, 0x78,
563
                0xea, 0x50, 0x56, 0x5c, 0xd5, 0x82, 0x5a, 0x2d,
564
                0x5a, 0x5f, 0x33, 0xc4, 0xb6, 0xd8, 0xc9, 0x75,
565
                0x90, 0x96, 0x8c, 0x0f, 0x52, 0x98, 0xb5, 0xcd,
566
                0x98, 0x1f, 0x89, 0x20, 0x5f, 0xf2, 0xa0, 0x1c,
567
                0xa3, 0x1b, 0x96, 0x94, 0xdd, 0xa9, 0xfd, 0x57,
568
                0xe9, 0x70, 0xe8, 0x26, 0x6d, 0x71, 0x99, 0x9b,
569
                0x26, 0x6e, 0x38, 0x50, 0x29, 0x6c, 0x90, 0xa7,
570
                0xbd, 0xd9, 0x16, 0x03, 0x01, 0x00, 0x04, 0x0e,
571
                0x00, 0x00, 0x00,
572
        },
573
 
574
        {
575
                0x16, 0x03, 0x01, 0x00, 0x86, 0x10, 0x00, 0x00,
576
                0x82, 0x00, 0x80, 0xae, 0xcf, 0x4f, 0x70, 0x0e,
577
                0xe5, 0xe7, 0xba, 0xef, 0x0c, 0x66, 0xe9, 0xae,
578
                0x76, 0xf4, 0xe0, 0xbc, 0x1c, 0x22, 0x5b, 0x72,
579
                0xc9, 0x68, 0x63, 0x44, 0xec, 0x72, 0xc2, 0xca,
580
                0xac, 0xc2, 0xf5, 0x5c, 0x28, 0xa1, 0xaf, 0xd0,
581
                0xc2, 0xf7, 0x79, 0x71, 0x32, 0x73, 0x86, 0xea,
582
                0x39, 0xf6, 0x04, 0x26, 0x19, 0x84, 0x1d, 0x7d,
583
                0xa1, 0x21, 0xa6, 0x88, 0xbf, 0x33, 0x5a, 0x64,
584
                0xb0, 0xc2, 0xcc, 0x19, 0x7a, 0x8b, 0x6e, 0x94,
585
                0x9e, 0x2e, 0x20, 0xbe, 0xdc, 0xe9, 0x8e, 0xae,
586
                0x5c, 0x39, 0xc8, 0xcd, 0x0e, 0x19, 0x9a, 0xa2,
587
                0xfc, 0x3f, 0x61, 0x9a, 0xca, 0x58, 0x69, 0x0d,
588
                0xa8, 0x7b, 0xbe, 0x98, 0x8f, 0xb9, 0x9d, 0x8b,
589
                0x68, 0x65, 0xa9, 0x74, 0xcc, 0x8d, 0x0c, 0xb2,
590
                0xc4, 0x0f, 0xdc, 0x56, 0x3e, 0x44, 0x61, 0x0a,
591
                0x26, 0x93, 0x99, 0xef, 0x67, 0xff, 0x6e, 0x73,
592
                0x01, 0xa1, 0x90, 0x14, 0x03, 0x01, 0x00, 0x01,
593
                0x01, 0x16, 0x03, 0x01, 0x00, 0x60, 0x49, 0x36,
594
                0xc8, 0x38, 0x95, 0xe4, 0x5d, 0x8e, 0x80, 0x10,
595
                0x26, 0x9f, 0x87, 0x7d, 0xcd, 0xb9, 0x32, 0x6c,
596
                0xff, 0xaa, 0xe0, 0x07, 0xec, 0x33, 0xe2, 0x36,
597
                0x9d, 0xd5, 0x83, 0x2c, 0xf0, 0x0a, 0xa0, 0xa8,
598
                0x12, 0x9f, 0xca, 0x72, 0xda, 0x70, 0x7d, 0x76,
599
                0x80, 0x12, 0x88, 0x07, 0xaa, 0x27, 0x62, 0x33,
600
                0xab, 0x55, 0xad, 0x3c, 0x2b, 0x54, 0xc4, 0x1c,
601
                0x91, 0xfd, 0x8f, 0x9c, 0xa7, 0x8b, 0x75, 0x10,
602
                0xa8, 0x6e, 0xfc, 0x30, 0x52, 0x8a, 0x61, 0x02,
603
                0xdb, 0x9c, 0x6f, 0xc8, 0x19, 0x93, 0x5d, 0x41,
604
                0x1d, 0x36, 0x68, 0x0b, 0xec, 0x30, 0xae, 0xfb,
605
                0x90, 0xdb, 0x6d, 0x83, 0xb0, 0xf2,
606
        },
607
 
608
        {
609
                0x14, 0x03, 0x01, 0x00, 0x01, 0x01, 0x16, 0x03,
610
                0x01, 0x00, 0x28, 0x07, 0xf3, 0x33, 0x84, 0xb1,
611
                0x5d, 0x2b, 0x52, 0xa4, 0x63, 0x3c, 0x32, 0xe0,
612
                0x0d, 0x22, 0xf5, 0x23, 0xec, 0xf9, 0xa6, 0xec,
613
                0xc0, 0x12, 0x69, 0x88, 0xf6, 0x7d, 0x37, 0xcd,
614
                0xc2, 0x74, 0x2f, 0xef, 0xf6, 0x49, 0x15, 0xea,
615
                0x88, 0x3f, 0x55, 0x17, 0x03, 0x01, 0x00, 0x28,
616
                0xaf, 0x00, 0x84, 0xff, 0x11, 0x01, 0x6d, 0xba,
617
                0x39, 0x5e, 0x45, 0xe1, 0x52, 0x5e, 0xc1, 0xab,
618
                0xde, 0x5b, 0x16, 0xdd, 0xd6, 0x61, 0x57, 0xb8,
619
                0x66, 0x8b, 0x2d, 0xde, 0x51, 0x41, 0xc5, 0x09,
620
                0xb3, 0x6a, 0x06, 0x43, 0xb4, 0x73, 0x5c, 0xf1,
621
                0x15, 0x03, 0x01, 0x00, 0x18, 0xbd, 0x65, 0xb2,
622
                0xce, 0x77, 0x2e, 0xf9, 0x11, 0xc4, 0x80, 0x43,
623
                0x5a, 0x73, 0x8b, 0x73, 0xdd, 0xf0, 0x54, 0x44,
624
                0x7c, 0x56, 0x19, 0x54, 0xda,
625
        },
626
}
627
 
628
var aesServerScript = [][]byte{
629
        {
630
                0x16, 0x03, 0x02, 0x00, 0x7f, 0x01, 0x00, 0x00,
631
                0x7b, 0x03, 0x02, 0x4d, 0x08, 0x2d, 0x0b, 0xb3,
632
                0x57, 0x85, 0x71, 0x4b, 0xfb, 0x34, 0xab, 0x16,
633
                0xd4, 0x92, 0x50, 0x81, 0x16, 0x95, 0x11, 0x28,
634
                0x1a, 0xcb, 0xff, 0x09, 0x4d, 0x23, 0xa6, 0xfe,
635
                0x2e, 0xbb, 0x78, 0x00, 0x00, 0x34, 0x00, 0x33,
636
                0x00, 0x45, 0x00, 0x39, 0x00, 0x88, 0x00, 0x16,
637
                0x00, 0x32, 0x00, 0x44, 0x00, 0x38, 0x00, 0x87,
638
                0x00, 0x13, 0x00, 0x66, 0x00, 0x90, 0x00, 0x91,
639
                0x00, 0x8f, 0x00, 0x8e, 0x00, 0x2f, 0x00, 0x41,
640
                0x00, 0x35, 0x00, 0x84, 0x00, 0x0a, 0x00, 0x05,
641
                0x00, 0x04, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8b,
642
                0x00, 0x8a, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x09,
643
                0x00, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
644
                0x0e, 0x00, 0x0c, 0x00, 0x00, 0x09, 0x6c, 0x6f,
645
                0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0xff,
646
                0x01, 0x00, 0x01, 0x00,
647
        },
648
 
649
        {
650
                0x16, 0x03, 0x01, 0x00, 0x2a, 0x02, 0x00, 0x00,
651
                0x26, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
652
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
653
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
654
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
655
                0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x16,
656
                0x03, 0x01, 0x02, 0xbe, 0x0b, 0x00, 0x02, 0xba,
657
                0x00, 0x02, 0xb7, 0x00, 0x02, 0xb4, 0x30, 0x82,
658
                0x02, 0xb0, 0x30, 0x82, 0x02, 0x19, 0xa0, 0x03,
659
                0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x85, 0xb0,
660
                0xbb, 0xa4, 0x8a, 0x7f, 0xb8, 0xca, 0x30, 0x0d,
661
                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
662
                0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x45, 0x31,
663
                0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
664
                0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11,
665
                0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53,
666
                0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
667
                0x65, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55,
668
                0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65,
669
                0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
670
                0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79,
671
                0x20, 0x4c, 0x74, 0x64, 0x30, 0x1e, 0x17, 0x0d,
672
                0x31, 0x30, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39,
673
                0x30, 0x39, 0x33, 0x38, 0x5a, 0x17, 0x0d, 0x31,
674
                0x31, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39, 0x30,
675
                0x39, 0x33, 0x38, 0x5a, 0x30, 0x45, 0x31, 0x0b,
676
                0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
677
                0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06,
678
                0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f,
679
                0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
680
                0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04,
681
                0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72,
682
                0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
683
                0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20,
684
                0x4c, 0x74, 0x64, 0x30, 0x81, 0x9f, 0x30, 0x0d,
685
                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
686
                0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d,
687
                0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00,
688
                0xbb, 0x79, 0xd6, 0xf5, 0x17, 0xb5, 0xe5, 0xbf,
689
                0x46, 0x10, 0xd0, 0xdc, 0x69, 0xbe, 0xe6, 0x2b,
690
                0x07, 0x43, 0x5a, 0xd0, 0x03, 0x2d, 0x8a, 0x7a,
691
                0x43, 0x85, 0xb7, 0x14, 0x52, 0xe7, 0xa5, 0x65,
692
                0x4c, 0x2c, 0x78, 0xb8, 0x23, 0x8c, 0xb5, 0xb4,
693
                0x82, 0xe5, 0xde, 0x1f, 0x95, 0x3b, 0x7e, 0x62,
694
                0xa5, 0x2c, 0xa5, 0x33, 0xd6, 0xfe, 0x12, 0x5c,
695
                0x7a, 0x56, 0xfc, 0xf5, 0x06, 0xbf, 0xfa, 0x58,
696
                0x7b, 0x26, 0x3f, 0xb5, 0xcd, 0x04, 0xd3, 0xd0,
697
                0xc9, 0x21, 0x96, 0x4a, 0xc7, 0xf4, 0x54, 0x9f,
698
                0x5a, 0xbf, 0xef, 0x42, 0x71, 0x00, 0xfe, 0x18,
699
                0x99, 0x07, 0x7f, 0x7e, 0x88, 0x7d, 0x7d, 0xf1,
700
                0x04, 0x39, 0xc4, 0xa2, 0x2e, 0xdb, 0x51, 0xc9,
701
                0x7c, 0xe3, 0xc0, 0x4c, 0x3b, 0x32, 0x66, 0x01,
702
                0xcf, 0xaf, 0xb1, 0x1d, 0xb8, 0x71, 0x9a, 0x1d,
703
                0xdb, 0xdb, 0x89, 0x6b, 0xae, 0xda, 0x2d, 0x79,
704
                0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xa7,
705
                0x30, 0x81, 0xa4, 0x30, 0x1d, 0x06, 0x03, 0x55,
706
                0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb1, 0xad,
707
                0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb, 0x69,
708
                0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e, 0x18,
709
                0x88, 0x39, 0x30, 0x75, 0x06, 0x03, 0x55, 0x1d,
710
                0x23, 0x04, 0x6e, 0x30, 0x6c, 0x80, 0x14, 0xb1,
711
                0xad, 0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb,
712
                0x69, 0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e,
713
                0x18, 0x88, 0x39, 0xa1, 0x49, 0xa4, 0x47, 0x30,
714
                0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
715
                0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13,
716
                0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
717
                0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74,
718
                0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06,
719
                0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e,
720
                0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57,
721
                0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50,
722
                0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x82, 0x09,
723
                0x00, 0x85, 0xb0, 0xbb, 0xa4, 0x8a, 0x7f, 0xb8,
724
                0xca, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13,
725
                0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
726
                0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
727
                0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81,
728
                0x81, 0x00, 0x08, 0x6c, 0x45, 0x24, 0xc7, 0x6b,
729
                0xb1, 0x59, 0xab, 0x0c, 0x52, 0xcc, 0xf2, 0xb0,
730
                0x14, 0xd7, 0x87, 0x9d, 0x7a, 0x64, 0x75, 0xb5,
731
                0x5a, 0x95, 0x66, 0xe4, 0xc5, 0x2b, 0x8e, 0xae,
732
                0x12, 0x66, 0x1f, 0xeb, 0x4f, 0x38, 0xb3, 0x6e,
733
                0x60, 0xd3, 0x92, 0xfd, 0xf7, 0x41, 0x08, 0xb5,
734
                0x25, 0x13, 0xb1, 0x18, 0x7a, 0x24, 0xfb, 0x30,
735
                0x1d, 0xba, 0xed, 0x98, 0xb9, 0x17, 0xec, 0xe7,
736
                0xd7, 0x31, 0x59, 0xdb, 0x95, 0xd3, 0x1d, 0x78,
737
                0xea, 0x50, 0x56, 0x5c, 0xd5, 0x82, 0x5a, 0x2d,
738
                0x5a, 0x5f, 0x33, 0xc4, 0xb6, 0xd8, 0xc9, 0x75,
739
                0x90, 0x96, 0x8c, 0x0f, 0x52, 0x98, 0xb5, 0xcd,
740
                0x98, 0x1f, 0x89, 0x20, 0x5f, 0xf2, 0xa0, 0x1c,
741
                0xa3, 0x1b, 0x96, 0x94, 0xdd, 0xa9, 0xfd, 0x57,
742
                0xe9, 0x70, 0xe8, 0x26, 0x6d, 0x71, 0x99, 0x9b,
743
                0x26, 0x6e, 0x38, 0x50, 0x29, 0x6c, 0x90, 0xa7,
744
                0xbd, 0xd9, 0x16, 0x03, 0x01, 0x00, 0x04, 0x0e,
745
                0x00, 0x00, 0x00,
746
        },
747
 
748
        {
749
                0x16, 0x03, 0x01, 0x00, 0x86, 0x10, 0x00, 0x00,
750
                0x82, 0x00, 0x80, 0x71, 0x9c, 0xe7, 0x23, 0xfc,
751
                0xb9, 0x19, 0x29, 0x82, 0xbf, 0xef, 0x08, 0xf7,
752
                0x99, 0x36, 0xc3, 0x4c, 0x6f, 0x05, 0xd2, 0x8b,
753
                0x62, 0x2b, 0x19, 0x9b, 0x7f, 0xc0, 0xcc, 0x48,
754
                0x30, 0x5f, 0xcd, 0xc3, 0x70, 0x55, 0x53, 0x73,
755
                0xfa, 0x79, 0x74, 0xf3, 0xa3, 0x76, 0x9f, 0xa1,
756
                0x7f, 0x98, 0xc2, 0xc0, 0xe3, 0xc5, 0xa0, 0x31,
757
                0x2f, 0xa6, 0xe8, 0x1e, 0x61, 0x46, 0xb3, 0x9b,
758
                0x4b, 0x16, 0xf1, 0x2d, 0xc7, 0x63, 0x7f, 0x79,
759
                0x22, 0x30, 0xd1, 0xf2, 0xfc, 0x77, 0x98, 0x0a,
760
                0x16, 0x11, 0x63, 0x71, 0x7f, 0x70, 0xef, 0x16,
761
                0xbb, 0x39, 0x87, 0x34, 0xac, 0x49, 0xbd, 0x07,
762
                0x67, 0xcb, 0x9c, 0xcc, 0xde, 0xef, 0xb1, 0xe0,
763
                0xdb, 0x01, 0xb5, 0x35, 0xa9, 0xb3, 0x10, 0x0c,
764
                0x4b, 0xee, 0xb3, 0x4e, 0xfd, 0xbe, 0x15, 0x27,
765
                0xf0, 0x46, 0xb2, 0x38, 0xba, 0x5f, 0xcc, 0x89,
766
                0xec, 0x29, 0x82, 0x14, 0x03, 0x01, 0x00, 0x01,
767
                0x01, 0x16, 0x03, 0x01, 0x00, 0x30, 0x3c, 0xfb,
768
                0xa4, 0x12, 0xcb, 0x00, 0xf9, 0x57, 0x7e, 0x9b,
769
                0xc9, 0xdc, 0x0c, 0xba, 0x9a, 0x81, 0x62, 0xfb,
770
                0x26, 0x13, 0x53, 0xfe, 0xaa, 0xcc, 0x82, 0xbb,
771
                0xb6, 0x67, 0x7f, 0x39, 0xbe, 0x4d, 0xbb, 0xc0,
772
                0x6c, 0x24, 0x31, 0x83, 0xa5, 0x50, 0x3a, 0x75,
773
                0x32, 0x64, 0xb5, 0xdb, 0xbe, 0x0a,
774
        },
775
 
776
        {
777
                0x14, 0x03, 0x01, 0x00, 0x01, 0x01, 0x16, 0x03,
778
                0x01, 0x00, 0x30, 0x43, 0x24, 0x42, 0x55, 0x08,
779
                0xe4, 0xc2, 0x15, 0xc9, 0xdb, 0x71, 0x69, 0xee,
780
                0x09, 0xc5, 0x1c, 0xfd, 0x46, 0x10, 0xa0, 0x68,
781
                0x21, 0xf2, 0x48, 0xac, 0x6c, 0xc0, 0x2b, 0x62,
782
                0x07, 0x8f, 0x48, 0x33, 0x0a, 0x6b, 0x62, 0x28,
783
                0x2e, 0x2c, 0xad, 0xcb, 0x34, 0x85, 0xca, 0x2e,
784
                0xcd, 0x84, 0xf0,
785
        },
786
}
787
 
788
var sslv3ServerScript = [][]byte{
789
        {
790
                0x16, 0x03, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00,
791
                0x3d, 0x03, 0x00, 0x4e, 0x70, 0xe2, 0x18, 0x86,
792
                0xd6, 0xc6, 0x6f, 0xf3, 0xc8, 0xf4, 0x02, 0xd6,
793
                0x4d, 0xee, 0x17, 0x32, 0x4b, 0xd2, 0x78, 0xd8,
794
                0xa1, 0x03, 0x5d, 0x68, 0x82, 0x89, 0xbe, 0xfd,
795
                0x12, 0xb9, 0x06, 0x00, 0x00, 0x16, 0x00, 0x33,
796
                0x00, 0x39, 0x00, 0x16, 0x00, 0x32, 0x00, 0x38,
797
                0x00, 0x13, 0x00, 0x2f, 0x00, 0x35, 0x00, 0x0a,
798
                0x00, 0x05, 0x00, 0x04, 0x01, 0x00,
799
        },
800
 
801
        {
802
                0x16, 0x03, 0x00, 0x00, 0x2a, 0x02, 0x00, 0x00,
803
                0x26, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
804
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
805
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
806
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
807
                0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x16,
808
                0x03, 0x00, 0x02, 0xbe, 0x0b, 0x00, 0x02, 0xba,
809
                0x00, 0x02, 0xb7, 0x00, 0x02, 0xb4, 0x30, 0x82,
810
                0x02, 0xb0, 0x30, 0x82, 0x02, 0x19, 0xa0, 0x03,
811
                0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x85, 0xb0,
812
                0xbb, 0xa4, 0x8a, 0x7f, 0xb8, 0xca, 0x30, 0x0d,
813
                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
814
                0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x45, 0x31,
815
                0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
816
                0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11,
817
                0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53,
818
                0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
819
                0x65, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55,
820
                0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65,
821
                0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
822
                0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79,
823
                0x20, 0x4c, 0x74, 0x64, 0x30, 0x1e, 0x17, 0x0d,
824
                0x31, 0x30, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39,
825
                0x30, 0x39, 0x33, 0x38, 0x5a, 0x17, 0x0d, 0x31,
826
                0x31, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39, 0x30,
827
                0x39, 0x33, 0x38, 0x5a, 0x30, 0x45, 0x31, 0x0b,
828
                0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
829
                0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06,
830
                0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f,
831
                0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
832
                0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04,
833
                0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72,
834
                0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
835
                0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20,
836
                0x4c, 0x74, 0x64, 0x30, 0x81, 0x9f, 0x30, 0x0d,
837
                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
838
                0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d,
839
                0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00,
840
                0xbb, 0x79, 0xd6, 0xf5, 0x17, 0xb5, 0xe5, 0xbf,
841
                0x46, 0x10, 0xd0, 0xdc, 0x69, 0xbe, 0xe6, 0x2b,
842
                0x07, 0x43, 0x5a, 0xd0, 0x03, 0x2d, 0x8a, 0x7a,
843
                0x43, 0x85, 0xb7, 0x14, 0x52, 0xe7, 0xa5, 0x65,
844
                0x4c, 0x2c, 0x78, 0xb8, 0x23, 0x8c, 0xb5, 0xb4,
845
                0x82, 0xe5, 0xde, 0x1f, 0x95, 0x3b, 0x7e, 0x62,
846
                0xa5, 0x2c, 0xa5, 0x33, 0xd6, 0xfe, 0x12, 0x5c,
847
                0x7a, 0x56, 0xfc, 0xf5, 0x06, 0xbf, 0xfa, 0x58,
848
                0x7b, 0x26, 0x3f, 0xb5, 0xcd, 0x04, 0xd3, 0xd0,
849
                0xc9, 0x21, 0x96, 0x4a, 0xc7, 0xf4, 0x54, 0x9f,
850
                0x5a, 0xbf, 0xef, 0x42, 0x71, 0x00, 0xfe, 0x18,
851
                0x99, 0x07, 0x7f, 0x7e, 0x88, 0x7d, 0x7d, 0xf1,
852
                0x04, 0x39, 0xc4, 0xa2, 0x2e, 0xdb, 0x51, 0xc9,
853
                0x7c, 0xe3, 0xc0, 0x4c, 0x3b, 0x32, 0x66, 0x01,
854
                0xcf, 0xaf, 0xb1, 0x1d, 0xb8, 0x71, 0x9a, 0x1d,
855
                0xdb, 0xdb, 0x89, 0x6b, 0xae, 0xda, 0x2d, 0x79,
856
                0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xa7,
857
                0x30, 0x81, 0xa4, 0x30, 0x1d, 0x06, 0x03, 0x55,
858
                0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb1, 0xad,
859
                0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb, 0x69,
860
                0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e, 0x18,
861
                0x88, 0x39, 0x30, 0x75, 0x06, 0x03, 0x55, 0x1d,
862
                0x23, 0x04, 0x6e, 0x30, 0x6c, 0x80, 0x14, 0xb1,
863
                0xad, 0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb,
864
                0x69, 0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e,
865
                0x18, 0x88, 0x39, 0xa1, 0x49, 0xa4, 0x47, 0x30,
866
                0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
867
                0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13,
868
                0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
869
                0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74,
870
                0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06,
871
                0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e,
872
                0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57,
873
                0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50,
874
                0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x82, 0x09,
875
                0x00, 0x85, 0xb0, 0xbb, 0xa4, 0x8a, 0x7f, 0xb8,
876
                0xca, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13,
877
                0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
878
                0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
879
                0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81,
880
                0x81, 0x00, 0x08, 0x6c, 0x45, 0x24, 0xc7, 0x6b,
881
                0xb1, 0x59, 0xab, 0x0c, 0x52, 0xcc, 0xf2, 0xb0,
882
                0x14, 0xd7, 0x87, 0x9d, 0x7a, 0x64, 0x75, 0xb5,
883
                0x5a, 0x95, 0x66, 0xe4, 0xc5, 0x2b, 0x8e, 0xae,
884
                0x12, 0x66, 0x1f, 0xeb, 0x4f, 0x38, 0xb3, 0x6e,
885
                0x60, 0xd3, 0x92, 0xfd, 0xf7, 0x41, 0x08, 0xb5,
886
                0x25, 0x13, 0xb1, 0x18, 0x7a, 0x24, 0xfb, 0x30,
887
                0x1d, 0xba, 0xed, 0x98, 0xb9, 0x17, 0xec, 0xe7,
888
                0xd7, 0x31, 0x59, 0xdb, 0x95, 0xd3, 0x1d, 0x78,
889
                0xea, 0x50, 0x56, 0x5c, 0xd5, 0x82, 0x5a, 0x2d,
890
                0x5a, 0x5f, 0x33, 0xc4, 0xb6, 0xd8, 0xc9, 0x75,
891
                0x90, 0x96, 0x8c, 0x0f, 0x52, 0x98, 0xb5, 0xcd,
892
                0x98, 0x1f, 0x89, 0x20, 0x5f, 0xf2, 0xa0, 0x1c,
893
                0xa3, 0x1b, 0x96, 0x94, 0xdd, 0xa9, 0xfd, 0x57,
894
                0xe9, 0x70, 0xe8, 0x26, 0x6d, 0x71, 0x99, 0x9b,
895
                0x26, 0x6e, 0x38, 0x50, 0x29, 0x6c, 0x90, 0xa7,
896
                0xbd, 0xd9, 0x16, 0x03, 0x00, 0x00, 0x04, 0x0e,
897
                0x00, 0x00, 0x00,
898
        },
899
 
900
        {
901
                0x16, 0x03, 0x00, 0x00, 0x84, 0x10, 0x00, 0x00,
902
                0x80, 0x74, 0x0e, 0x3a, 0xcf, 0xba, 0x9f, 0x1a,
903
                0x9b, 0xb2, 0xa4, 0xc7, 0x5d, 0xf3, 0x0c, 0x80,
904
                0x06, 0x80, 0xf3, 0x57, 0xb2, 0xd9, 0x36, 0x24,
905
                0x6a, 0x06, 0x13, 0x40, 0xf9, 0x7c, 0xb9, 0x3e,
906
                0x4b, 0x68, 0x4f, 0x21, 0x90, 0x2d, 0xbd, 0xca,
907
                0xd4, 0x83, 0xf0, 0x7a, 0xeb, 0x7a, 0x74, 0x1b,
908
                0xcd, 0xfe, 0x69, 0xef, 0xc0, 0x86, 0xa0, 0x24,
909
                0x31, 0x65, 0x40, 0xd2, 0xdd, 0x6f, 0xb9, 0xd7,
910
                0x8d, 0xc1, 0x69, 0x60, 0x44, 0x7a, 0x75, 0xfb,
911
                0x42, 0x6a, 0x0f, 0x66, 0x45, 0x10, 0x73, 0xee,
912
                0x87, 0x28, 0x37, 0x83, 0x86, 0xd8, 0x5a, 0xc8,
913
                0x60, 0x87, 0xda, 0x33, 0x87, 0xaf, 0x34, 0x8b,
914
                0xf5, 0x61, 0x63, 0x7a, 0x5c, 0x60, 0x26, 0xb9,
915
                0xdb, 0xa1, 0xb7, 0xe3, 0x60, 0x38, 0x94, 0x5c,
916
                0x83, 0x23, 0xd6, 0x8d, 0xc2, 0x14, 0x4a, 0x0f,
917
                0x0e, 0x4f, 0xf9, 0x4e, 0x7b, 0x15, 0xcd, 0x18,
918
                0x04, 0x14, 0x03, 0x00, 0x00, 0x01, 0x01, 0x16,
919
                0x03, 0x00, 0x00, 0x3c, 0xbd, 0xbc, 0xec, 0xdc,
920
                0x79, 0xb1, 0xae, 0x16, 0xc9, 0x26, 0x9a, 0xc0,
921
                0xc0, 0x2c, 0x33, 0x36, 0x13, 0x91, 0x58, 0x5d,
922
                0x7d, 0xee, 0x4e, 0xd8, 0x7e, 0xac, 0x88, 0x87,
923
                0x0a, 0x75, 0x66, 0xb1, 0x44, 0x79, 0x2f, 0x42,
924
                0xe8, 0x92, 0x74, 0x4c, 0xab, 0x36, 0xc8, 0x17,
925
                0x5f, 0x02, 0x8a, 0x20, 0x53, 0xe9, 0x1d, 0xb4,
926
                0xfe, 0x5c, 0x2b, 0xd9, 0x0a, 0xfb, 0xc6, 0x63,
927
        },
928
 
929
        {
930
                0x14, 0x03, 0x00, 0x00, 0x01, 0x01, 0x16, 0x03,
931
                0x00, 0x00, 0x3c, 0xaa, 0xa1, 0x98, 0xc4, 0x6b,
932
                0x5a, 0x16, 0x3f, 0x5f, 0xa4, 0x96, 0x3e, 0x78,
933
                0xe4, 0x6f, 0x49, 0x05, 0x47, 0xc4, 0x05, 0x60,
934
                0xeb, 0x0b, 0x45, 0xe3, 0xbc, 0x50, 0x11, 0x24,
935
                0x5f, 0x01, 0xd7, 0xb8, 0x8f, 0x60, 0x63, 0x66,
936
                0xbd, 0x3e, 0xd9, 0xa8, 0x80, 0x43, 0x9f, 0x0b,
937
                0x51, 0x61, 0xed, 0x13, 0xc6, 0x21, 0xd0, 0xfe,
938
                0xbc, 0x17, 0x3c, 0x36, 0xb0, 0x82, 0x7f, 0x17,
939
                0x03, 0x00, 0x00, 0x21, 0xee, 0x44, 0xf3, 0xa6,
940
                0x88, 0x9d, 0x78, 0x44, 0xde, 0xdf, 0xeb, 0xc5,
941
                0xad, 0xc4, 0xcc, 0x56, 0x5c, 0x54, 0x96, 0x52,
942
                0x3f, 0xd9, 0x40, 0x6e, 0x79, 0xd8, 0x58, 0x78,
943
                0x4f, 0x5a, 0xe9, 0x06, 0xef, 0x15, 0x03, 0x00,
944
                0x00, 0x16, 0xd3, 0xc2, 0x52, 0x99, 0x2a, 0x84,
945
                0xc4, 0x52, 0x5f, 0x3b, 0x19, 0xe7, 0xfc, 0x65,
946
                0xaf, 0xd3, 0xb7, 0xa3, 0xcc, 0x4a, 0x1d, 0x2e,
947
        },
948
}
949
 
950
var clientauthTests = []clientauthTest{
951
        // Server doesn't asks for cert
952
        // gotest -test.run "TestRunServer" -serve -clientauth 0
953
        // gnutls-cli --insecure --debug 100 -p 10443 localhost 2>&1 |
954
        //   python parse-gnutls-cli-debug-log.py
955
        {"NoClientCert", NoClientCert, nil,
956
                [][]byte{{
957
                        0x16, 0x03, 0x02, 0x00, 0x7a, 0x01, 0x00, 0x00,
958
                        0x76, 0x03, 0x02, 0x4e, 0xe0, 0x92, 0x5d, 0xcd,
959
                        0xfe, 0x0c, 0x69, 0xd4, 0x7d, 0x8e, 0xa6, 0x88,
960
                        0xde, 0x72, 0x04, 0x29, 0x6a, 0x4a, 0x16, 0x23,
961
                        0xd7, 0x8f, 0xbc, 0xfa, 0x80, 0x73, 0x2e, 0x12,
962
                        0xb7, 0x0b, 0x39, 0x00, 0x00, 0x34, 0x00, 0x33,
963
                        0x00, 0x45, 0x00, 0x39, 0x00, 0x88, 0x00, 0x16,
964
                        0x00, 0x32, 0x00, 0x44, 0x00, 0x38, 0x00, 0x87,
965
                        0x00, 0x13, 0x00, 0x66, 0x00, 0x90, 0x00, 0x91,
966
                        0x00, 0x8f, 0x00, 0x8e, 0x00, 0x2f, 0x00, 0x41,
967
                        0x00, 0x35, 0x00, 0x84, 0x00, 0x0a, 0x00, 0x05,
968
                        0x00, 0x04, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8b,
969
                        0x00, 0x8a, 0x01, 0x00, 0x00, 0x19, 0x00, 0x09,
970
                        0x00, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
971
                        0x0e, 0x00, 0x0c, 0x00, 0x00, 0x09, 0x6c, 0x6f,
972
                        0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74,
973
                },
974
 
975
                        {
976
                                0x16, 0x03, 0x01, 0x00, 0x2a, 0x02, 0x00, 0x00,
977
                                0x26, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
978
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
979
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
980
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
981
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x16,
982
                                0x03, 0x01, 0x02, 0xbe, 0x0b, 0x00, 0x02, 0xba,
983
                                0x00, 0x02, 0xb7, 0x00, 0x02, 0xb4, 0x30, 0x82,
984
                                0x02, 0xb0, 0x30, 0x82, 0x02, 0x19, 0xa0, 0x03,
985
                                0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x85, 0xb0,
986
                                0xbb, 0xa4, 0x8a, 0x7f, 0xb8, 0xca, 0x30, 0x0d,
987
                                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
988
                                0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x45, 0x31,
989
                                0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
990
                                0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11,
991
                                0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53,
992
                                0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
993
                                0x65, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55,
994
                                0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65,
995
                                0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
996
                                0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79,
997
                                0x20, 0x4c, 0x74, 0x64, 0x30, 0x1e, 0x17, 0x0d,
998
                                0x31, 0x30, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39,
999
                                0x30, 0x39, 0x33, 0x38, 0x5a, 0x17, 0x0d, 0x31,
1000
                                0x31, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39, 0x30,
1001
                                0x39, 0x33, 0x38, 0x5a, 0x30, 0x45, 0x31, 0x0b,
1002
                                0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
1003
                                0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06,
1004
                                0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f,
1005
                                0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
1006
                                0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04,
1007
                                0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72,
1008
                                0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
1009
                                0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20,
1010
                                0x4c, 0x74, 0x64, 0x30, 0x81, 0x9f, 0x30, 0x0d,
1011
                                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
1012
                                0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d,
1013
                                0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00,
1014
                                0xbb, 0x79, 0xd6, 0xf5, 0x17, 0xb5, 0xe5, 0xbf,
1015
                                0x46, 0x10, 0xd0, 0xdc, 0x69, 0xbe, 0xe6, 0x2b,
1016
                                0x07, 0x43, 0x5a, 0xd0, 0x03, 0x2d, 0x8a, 0x7a,
1017
                                0x43, 0x85, 0xb7, 0x14, 0x52, 0xe7, 0xa5, 0x65,
1018
                                0x4c, 0x2c, 0x78, 0xb8, 0x23, 0x8c, 0xb5, 0xb4,
1019
                                0x82, 0xe5, 0xde, 0x1f, 0x95, 0x3b, 0x7e, 0x62,
1020
                                0xa5, 0x2c, 0xa5, 0x33, 0xd6, 0xfe, 0x12, 0x5c,
1021
                                0x7a, 0x56, 0xfc, 0xf5, 0x06, 0xbf, 0xfa, 0x58,
1022
                                0x7b, 0x26, 0x3f, 0xb5, 0xcd, 0x04, 0xd3, 0xd0,
1023
                                0xc9, 0x21, 0x96, 0x4a, 0xc7, 0xf4, 0x54, 0x9f,
1024
                                0x5a, 0xbf, 0xef, 0x42, 0x71, 0x00, 0xfe, 0x18,
1025
                                0x99, 0x07, 0x7f, 0x7e, 0x88, 0x7d, 0x7d, 0xf1,
1026
                                0x04, 0x39, 0xc4, 0xa2, 0x2e, 0xdb, 0x51, 0xc9,
1027
                                0x7c, 0xe3, 0xc0, 0x4c, 0x3b, 0x32, 0x66, 0x01,
1028
                                0xcf, 0xaf, 0xb1, 0x1d, 0xb8, 0x71, 0x9a, 0x1d,
1029
                                0xdb, 0xdb, 0x89, 0x6b, 0xae, 0xda, 0x2d, 0x79,
1030
                                0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xa7,
1031
                                0x30, 0x81, 0xa4, 0x30, 0x1d, 0x06, 0x03, 0x55,
1032
                                0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb1, 0xad,
1033
                                0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb, 0x69,
1034
                                0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e, 0x18,
1035
                                0x88, 0x39, 0x30, 0x75, 0x06, 0x03, 0x55, 0x1d,
1036
                                0x23, 0x04, 0x6e, 0x30, 0x6c, 0x80, 0x14, 0xb1,
1037
                                0xad, 0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb,
1038
                                0x69, 0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e,
1039
                                0x18, 0x88, 0x39, 0xa1, 0x49, 0xa4, 0x47, 0x30,
1040
                                0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
1041
                                0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13,
1042
                                0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
1043
                                0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74,
1044
                                0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06,
1045
                                0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e,
1046
                                0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57,
1047
                                0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50,
1048
                                0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x82, 0x09,
1049
                                0x00, 0x85, 0xb0, 0xbb, 0xa4, 0x8a, 0x7f, 0xb8,
1050
                                0xca, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13,
1051
                                0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
1052
                                0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
1053
                                0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81,
1054
                                0x81, 0x00, 0x08, 0x6c, 0x45, 0x24, 0xc7, 0x6b,
1055
                                0xb1, 0x59, 0xab, 0x0c, 0x52, 0xcc, 0xf2, 0xb0,
1056
                                0x14, 0xd7, 0x87, 0x9d, 0x7a, 0x64, 0x75, 0xb5,
1057
                                0x5a, 0x95, 0x66, 0xe4, 0xc5, 0x2b, 0x8e, 0xae,
1058
                                0x12, 0x66, 0x1f, 0xeb, 0x4f, 0x38, 0xb3, 0x6e,
1059
                                0x60, 0xd3, 0x92, 0xfd, 0xf7, 0x41, 0x08, 0xb5,
1060
                                0x25, 0x13, 0xb1, 0x18, 0x7a, 0x24, 0xfb, 0x30,
1061
                                0x1d, 0xba, 0xed, 0x98, 0xb9, 0x17, 0xec, 0xe7,
1062
                                0xd7, 0x31, 0x59, 0xdb, 0x95, 0xd3, 0x1d, 0x78,
1063
                                0xea, 0x50, 0x56, 0x5c, 0xd5, 0x82, 0x5a, 0x2d,
1064
                                0x5a, 0x5f, 0x33, 0xc4, 0xb6, 0xd8, 0xc9, 0x75,
1065
                                0x90, 0x96, 0x8c, 0x0f, 0x52, 0x98, 0xb5, 0xcd,
1066
                                0x98, 0x1f, 0x89, 0x20, 0x5f, 0xf2, 0xa0, 0x1c,
1067
                                0xa3, 0x1b, 0x96, 0x94, 0xdd, 0xa9, 0xfd, 0x57,
1068
                                0xe9, 0x70, 0xe8, 0x26, 0x6d, 0x71, 0x99, 0x9b,
1069
                                0x26, 0x6e, 0x38, 0x50, 0x29, 0x6c, 0x90, 0xa7,
1070
                                0xbd, 0xd9, 0x16, 0x03, 0x01, 0x00, 0x04, 0x0e,
1071
                                0x00, 0x00, 0x00,
1072
                        },
1073
 
1074
                        {
1075
                                0x16, 0x03, 0x01, 0x00, 0x86, 0x10, 0x00, 0x00,
1076
                                0x82, 0x00, 0x80, 0x10, 0xe1, 0x00, 0x3d, 0x0a,
1077
                                0x6b, 0x02, 0x7f, 0x97, 0xde, 0xfb, 0x65, 0x46,
1078
                                0x1a, 0x50, 0x4e, 0x34, 0x9a, 0xae, 0x14, 0x7e,
1079
                                0xec, 0xef, 0x85, 0x15, 0x3b, 0x39, 0xc2, 0x45,
1080
                                0x04, 0x40, 0x92, 0x71, 0xd6, 0x7e, 0xf6, 0xfd,
1081
                                0x4d, 0x84, 0xf7, 0xc4, 0x77, 0x99, 0x3d, 0xe2,
1082
                                0xc3, 0x8d, 0xb0, 0x4c, 0x74, 0xc8, 0x51, 0xec,
1083
                                0xb2, 0xe8, 0x6b, 0xa1, 0xd2, 0x4d, 0xd8, 0x61,
1084
                                0x92, 0x7a, 0x24, 0x57, 0x44, 0x4f, 0xa2, 0x1e,
1085
                                0x74, 0x0b, 0x06, 0x4b, 0x80, 0x34, 0x8b, 0xfe,
1086
                                0xc2, 0x0e, 0xc1, 0xcd, 0xab, 0x0c, 0x3f, 0x54,
1087
                                0xe2, 0x44, 0xe9, 0x6c, 0x2b, 0xba, 0x7b, 0x64,
1088
                                0xf1, 0x93, 0x65, 0x75, 0xf2, 0x35, 0xff, 0x27,
1089
                                0x03, 0xd5, 0x64, 0xe6, 0x8e, 0xe7, 0x7b, 0x56,
1090
                                0xb6, 0x61, 0x73, 0xeb, 0xa2, 0xdc, 0xa4, 0x6e,
1091
                                0x52, 0xac, 0xbc, 0xba, 0x11, 0xa3, 0xd2, 0x61,
1092
                                0x4a, 0xe0, 0xbb, 0x14, 0x03, 0x01, 0x00, 0x01,
1093
                                0x01, 0x16, 0x03, 0x01, 0x00, 0x24, 0xd2, 0x5a,
1094
                                0x0c, 0x2a, 0x27, 0x96, 0xba, 0xa9, 0x67, 0xd2,
1095
                                0x51, 0x68, 0x32, 0x68, 0x22, 0x1f, 0xb9, 0x27,
1096
                                0x79, 0x59, 0x28, 0xdf, 0x38, 0x1f, 0x92, 0x21,
1097
                                0x5d, 0x0f, 0xf4, 0xc0, 0xee, 0xb7, 0x10, 0x5a,
1098
                                0xa9, 0x45,
1099
                        },
1100
 
1101
                        {
1102
                                0x14, 0x03, 0x01, 0x00, 0x01, 0x01, 0x16, 0x03,
1103
                                0x01, 0x00, 0x24, 0x13, 0x6f, 0x6c, 0x71, 0x83,
1104
                                0x59, 0xcf, 0x32, 0x72, 0xe9, 0xce, 0xcc, 0x7a,
1105
                                0x6c, 0xf0, 0x72, 0x39, 0x16, 0xae, 0x40, 0x61,
1106
                                0xfa, 0x92, 0x4c, 0xe7, 0xf2, 0x1a, 0xd7, 0x0c,
1107
                                0x84, 0x76, 0x6c, 0xe9, 0x11, 0x43, 0x19, 0x17,
1108
                                0x03, 0x01, 0x00, 0x21, 0xc0, 0xa2, 0x13, 0x28,
1109
                                0x94, 0x8c, 0x5c, 0xd6, 0x79, 0xb9, 0xfe, 0xae,
1110
                                0x45, 0x4b, 0xc0, 0x7c, 0xae, 0x2d, 0xb4, 0x0d,
1111
                                0x31, 0xc4, 0xad, 0x22, 0xd7, 0x1e, 0x99, 0x1c,
1112
                                0x4c, 0x69, 0xab, 0x42, 0x61, 0x15, 0x03, 0x01,
1113
                                0x00, 0x16, 0xe1, 0x0c, 0x67, 0xf3, 0xf4, 0xb9,
1114
                                0x8e, 0x81, 0x8e, 0x01, 0xb8, 0xa0, 0x69, 0x8c,
1115
                                0x03, 0x11, 0x43, 0x3e, 0xee, 0xb7, 0x4d, 0x69,
1116
                        }}},
1117
        // Server asks for cert with empty CA list, client doesn't give it.
1118
        // gotest -test.run "TestRunServer" -serve -clientauth 1
1119
        // gnutls-cli --insecure --debug 100 -p 10443 localhost
1120
        {"RequestClientCert, none given", RequestClientCert, nil,
1121
                [][]byte{{
1122
                        0x16, 0x03, 0x02, 0x00, 0x7a, 0x01, 0x00, 0x00,
1123
                        0x76, 0x03, 0x02, 0x4e, 0xe0, 0x93, 0xe2, 0x47,
1124
                        0x06, 0xa0, 0x61, 0x0c, 0x51, 0xdd, 0xf0, 0xef,
1125
                        0xf4, 0x30, 0x72, 0xe1, 0xa6, 0x50, 0x68, 0x82,
1126
                        0x3c, 0xfb, 0xcb, 0x72, 0x5e, 0x73, 0x9d, 0xda,
1127
                        0x27, 0x35, 0x72, 0x00, 0x00, 0x34, 0x00, 0x33,
1128
                        0x00, 0x45, 0x00, 0x39, 0x00, 0x88, 0x00, 0x16,
1129
                        0x00, 0x32, 0x00, 0x44, 0x00, 0x38, 0x00, 0x87,
1130
                        0x00, 0x13, 0x00, 0x66, 0x00, 0x90, 0x00, 0x91,
1131
                        0x00, 0x8f, 0x00, 0x8e, 0x00, 0x2f, 0x00, 0x41,
1132
                        0x00, 0x35, 0x00, 0x84, 0x00, 0x0a, 0x00, 0x05,
1133
                        0x00, 0x04, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8b,
1134
                        0x00, 0x8a, 0x01, 0x00, 0x00, 0x19, 0x00, 0x09,
1135
                        0x00, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
1136
                        0x0e, 0x00, 0x0c, 0x00, 0x00, 0x09, 0x6c, 0x6f,
1137
                        0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74,
1138
                },
1139
 
1140
                        {
1141
                                0x16, 0x03, 0x01, 0x00, 0x2a, 0x02, 0x00, 0x00,
1142
                                0x26, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1143
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1144
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1145
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1146
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x16,
1147
                                0x03, 0x01, 0x02, 0xbe, 0x0b, 0x00, 0x02, 0xba,
1148
                                0x00, 0x02, 0xb7, 0x00, 0x02, 0xb4, 0x30, 0x82,
1149
                                0x02, 0xb0, 0x30, 0x82, 0x02, 0x19, 0xa0, 0x03,
1150
                                0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x85, 0xb0,
1151
                                0xbb, 0xa4, 0x8a, 0x7f, 0xb8, 0xca, 0x30, 0x0d,
1152
                                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
1153
                                0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x45, 0x31,
1154
                                0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
1155
                                0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11,
1156
                                0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53,
1157
                                0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
1158
                                0x65, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55,
1159
                                0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65,
1160
                                0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
1161
                                0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79,
1162
                                0x20, 0x4c, 0x74, 0x64, 0x30, 0x1e, 0x17, 0x0d,
1163
                                0x31, 0x30, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39,
1164
                                0x30, 0x39, 0x33, 0x38, 0x5a, 0x17, 0x0d, 0x31,
1165
                                0x31, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39, 0x30,
1166
                                0x39, 0x33, 0x38, 0x5a, 0x30, 0x45, 0x31, 0x0b,
1167
                                0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
1168
                                0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06,
1169
                                0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f,
1170
                                0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
1171
                                0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04,
1172
                                0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72,
1173
                                0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
1174
                                0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20,
1175
                                0x4c, 0x74, 0x64, 0x30, 0x81, 0x9f, 0x30, 0x0d,
1176
                                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
1177
                                0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d,
1178
                                0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00,
1179
                                0xbb, 0x79, 0xd6, 0xf5, 0x17, 0xb5, 0xe5, 0xbf,
1180
                                0x46, 0x10, 0xd0, 0xdc, 0x69, 0xbe, 0xe6, 0x2b,
1181
                                0x07, 0x43, 0x5a, 0xd0, 0x03, 0x2d, 0x8a, 0x7a,
1182
                                0x43, 0x85, 0xb7, 0x14, 0x52, 0xe7, 0xa5, 0x65,
1183
                                0x4c, 0x2c, 0x78, 0xb8, 0x23, 0x8c, 0xb5, 0xb4,
1184
                                0x82, 0xe5, 0xde, 0x1f, 0x95, 0x3b, 0x7e, 0x62,
1185
                                0xa5, 0x2c, 0xa5, 0x33, 0xd6, 0xfe, 0x12, 0x5c,
1186
                                0x7a, 0x56, 0xfc, 0xf5, 0x06, 0xbf, 0xfa, 0x58,
1187
                                0x7b, 0x26, 0x3f, 0xb5, 0xcd, 0x04, 0xd3, 0xd0,
1188
                                0xc9, 0x21, 0x96, 0x4a, 0xc7, 0xf4, 0x54, 0x9f,
1189
                                0x5a, 0xbf, 0xef, 0x42, 0x71, 0x00, 0xfe, 0x18,
1190
                                0x99, 0x07, 0x7f, 0x7e, 0x88, 0x7d, 0x7d, 0xf1,
1191
                                0x04, 0x39, 0xc4, 0xa2, 0x2e, 0xdb, 0x51, 0xc9,
1192
                                0x7c, 0xe3, 0xc0, 0x4c, 0x3b, 0x32, 0x66, 0x01,
1193
                                0xcf, 0xaf, 0xb1, 0x1d, 0xb8, 0x71, 0x9a, 0x1d,
1194
                                0xdb, 0xdb, 0x89, 0x6b, 0xae, 0xda, 0x2d, 0x79,
1195
                                0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xa7,
1196
                                0x30, 0x81, 0xa4, 0x30, 0x1d, 0x06, 0x03, 0x55,
1197
                                0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb1, 0xad,
1198
                                0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb, 0x69,
1199
                                0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e, 0x18,
1200
                                0x88, 0x39, 0x30, 0x75, 0x06, 0x03, 0x55, 0x1d,
1201
                                0x23, 0x04, 0x6e, 0x30, 0x6c, 0x80, 0x14, 0xb1,
1202
                                0xad, 0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb,
1203
                                0x69, 0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e,
1204
                                0x18, 0x88, 0x39, 0xa1, 0x49, 0xa4, 0x47, 0x30,
1205
                                0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
1206
                                0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13,
1207
                                0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
1208
                                0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74,
1209
                                0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06,
1210
                                0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e,
1211
                                0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57,
1212
                                0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50,
1213
                                0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x82, 0x09,
1214
                                0x00, 0x85, 0xb0, 0xbb, 0xa4, 0x8a, 0x7f, 0xb8,
1215
                                0xca, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13,
1216
                                0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
1217
                                0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
1218
                                0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81,
1219
                                0x81, 0x00, 0x08, 0x6c, 0x45, 0x24, 0xc7, 0x6b,
1220
                                0xb1, 0x59, 0xab, 0x0c, 0x52, 0xcc, 0xf2, 0xb0,
1221
                                0x14, 0xd7, 0x87, 0x9d, 0x7a, 0x64, 0x75, 0xb5,
1222
                                0x5a, 0x95, 0x66, 0xe4, 0xc5, 0x2b, 0x8e, 0xae,
1223
                                0x12, 0x66, 0x1f, 0xeb, 0x4f, 0x38, 0xb3, 0x6e,
1224
                                0x60, 0xd3, 0x92, 0xfd, 0xf7, 0x41, 0x08, 0xb5,
1225
                                0x25, 0x13, 0xb1, 0x18, 0x7a, 0x24, 0xfb, 0x30,
1226
                                0x1d, 0xba, 0xed, 0x98, 0xb9, 0x17, 0xec, 0xe7,
1227
                                0xd7, 0x31, 0x59, 0xdb, 0x95, 0xd3, 0x1d, 0x78,
1228
                                0xea, 0x50, 0x56, 0x5c, 0xd5, 0x82, 0x5a, 0x2d,
1229
                                0x5a, 0x5f, 0x33, 0xc4, 0xb6, 0xd8, 0xc9, 0x75,
1230
                                0x90, 0x96, 0x8c, 0x0f, 0x52, 0x98, 0xb5, 0xcd,
1231
                                0x98, 0x1f, 0x89, 0x20, 0x5f, 0xf2, 0xa0, 0x1c,
1232
                                0xa3, 0x1b, 0x96, 0x94, 0xdd, 0xa9, 0xfd, 0x57,
1233
                                0xe9, 0x70, 0xe8, 0x26, 0x6d, 0x71, 0x99, 0x9b,
1234
                                0x26, 0x6e, 0x38, 0x50, 0x29, 0x6c, 0x90, 0xa7,
1235
                                0xbd, 0xd9, 0x16, 0x03, 0x01, 0x00, 0x08, 0x0d,
1236
                                0x00, 0x00, 0x04, 0x01, 0x01, 0x00, 0x00, 0x16,
1237
                                0x03, 0x01, 0x00, 0x04, 0x0e, 0x00, 0x00, 0x00,
1238
                        },
1239
 
1240
                        {
1241
                                0x16, 0x03, 0x01, 0x00, 0x07, 0x0b, 0x00, 0x00,
1242
                                0x03, 0x00, 0x00, 0x00, 0x16, 0x03, 0x01, 0x00,
1243
                                0x86, 0x10, 0x00, 0x00, 0x82, 0x00, 0x80, 0x64,
1244
                                0x28, 0xb9, 0x3f, 0x48, 0xaf, 0x06, 0x22, 0x39,
1245
                                0x56, 0xd8, 0x6f, 0x63, 0x5d, 0x03, 0x48, 0x63,
1246
                                0x01, 0x13, 0xa2, 0xd6, 0x76, 0xc0, 0xab, 0xda,
1247
                                0x25, 0x30, 0x75, 0x6c, 0xaa, 0xb4, 0xdc, 0x35,
1248
                                0x72, 0xdc, 0xf2, 0x43, 0xe4, 0x1d, 0x82, 0xfb,
1249
                                0x6c, 0x64, 0xe2, 0xa7, 0x8f, 0x32, 0x67, 0x6b,
1250
                                0xcd, 0xd2, 0xb2, 0x36, 0x94, 0xbc, 0x6f, 0x46,
1251
                                0x79, 0x29, 0x42, 0xe3, 0x1a, 0xbf, 0xfb, 0x41,
1252
                                0xd5, 0xe3, 0xb4, 0x2a, 0xf6, 0x95, 0x6f, 0x0c,
1253
                                0x87, 0xb9, 0x03, 0x18, 0xa1, 0xea, 0x4a, 0xe2,
1254
                                0x2e, 0x0f, 0x50, 0x00, 0xc1, 0xe8, 0x8c, 0xc8,
1255
                                0xa2, 0xf6, 0xa4, 0x05, 0xf4, 0x38, 0x3e, 0xd9,
1256
                                0x6e, 0x63, 0x96, 0x0c, 0x34, 0x73, 0x90, 0x03,
1257
                                0x55, 0xa6, 0x34, 0xb0, 0x5e, 0x8c, 0x48, 0x40,
1258
                                0x25, 0x45, 0x84, 0xa6, 0x21, 0x3f, 0x81, 0x97,
1259
                                0xa7, 0x11, 0x09, 0x14, 0x95, 0xa5, 0xe5, 0x14,
1260
                                0x03, 0x01, 0x00, 0x01, 0x01, 0x16, 0x03, 0x01,
1261
                                0x00, 0x24, 0x16, 0xaa, 0x01, 0x2c, 0xa8, 0xc1,
1262
                                0x28, 0xaf, 0x35, 0xc1, 0xc1, 0xf3, 0x0a, 0x25,
1263
                                0x66, 0x6e, 0x27, 0x11, 0xa3, 0xa4, 0xd9, 0xe9,
1264
                                0xea, 0x15, 0x09, 0x9d, 0x28, 0xe3, 0x5b, 0x2b,
1265
                                0xa6, 0x25, 0xa7, 0x14, 0x24, 0x3a,
1266
                        },
1267
 
1268
                        {
1269
                                0x14, 0x03, 0x01, 0x00, 0x01, 0x01, 0x16, 0x03,
1270
                                0x01, 0x00, 0x24, 0x9a, 0xa8, 0xd6, 0x77, 0x46,
1271
                                0x45, 0x68, 0x9d, 0x5d, 0xa9, 0x68, 0x03, 0xe5,
1272
                                0xaf, 0xe8, 0xc8, 0x21, 0xc5, 0xc6, 0xc1, 0x50,
1273
                                0xe0, 0xd8, 0x52, 0xce, 0xa3, 0x4f, 0x2d, 0xf4,
1274
                                0xe3, 0xa7, 0x7d, 0x35, 0x80, 0x84, 0x12, 0x17,
1275
                                0x03, 0x01, 0x00, 0x21, 0x8a, 0x82, 0x0c, 0x54,
1276
                                0x1b, 0xeb, 0x77, 0x90, 0x2c, 0x3e, 0xbc, 0xf0,
1277
                                0x23, 0xcc, 0xa8, 0x9f, 0x25, 0x08, 0x12, 0xed,
1278
                                0x43, 0xf1, 0xf9, 0x06, 0xad, 0xa9, 0x4b, 0x97,
1279
                                0x82, 0xb7, 0xc4, 0x0b, 0x4c, 0x15, 0x03, 0x01,
1280
                                0x00, 0x16, 0x05, 0x2d, 0x9d, 0x45, 0x03, 0xb7,
1281
                                0xc2, 0xd1, 0xb5, 0x1a, 0x43, 0xcf, 0x1a, 0x37,
1282
                                0xf4, 0x70, 0xcc, 0xb4, 0xed, 0x07, 0x76, 0x3a,
1283
                        }}},
1284
        // Server asks for cert with empty CA list, client gives one
1285
        // gotest -test.run "TestRunServer" -serve -clientauth 1
1286
        // gnutls-cli --insecure --debug 100 -p 10443 localhost
1287
        {"RequestClientCert, client gives it", RequestClientCert,
1288
                []*x509.Certificate{clicert},
1289
                [][]byte{{
1290
                        0x16, 0x03, 0x02, 0x00, 0x7a, 0x01, 0x00, 0x00,
1291
                        0x76, 0x03, 0x02, 0x4e, 0xe7, 0x44, 0xda, 0x58,
1292
                        0x7d, 0x46, 0x4a, 0x48, 0x97, 0x9f, 0xe5, 0x91,
1293
                        0x11, 0x64, 0xa7, 0x1e, 0x4d, 0xb7, 0xfe, 0x9b,
1294
                        0xc6, 0x63, 0xf8, 0xa4, 0xb5, 0x0b, 0x18, 0xb5,
1295
                        0xbd, 0x19, 0xb3, 0x00, 0x00, 0x34, 0x00, 0x33,
1296
                        0x00, 0x45, 0x00, 0x39, 0x00, 0x88, 0x00, 0x16,
1297
                        0x00, 0x32, 0x00, 0x44, 0x00, 0x38, 0x00, 0x87,
1298
                        0x00, 0x13, 0x00, 0x66, 0x00, 0x90, 0x00, 0x91,
1299
                        0x00, 0x8f, 0x00, 0x8e, 0x00, 0x2f, 0x00, 0x41,
1300
                        0x00, 0x35, 0x00, 0x84, 0x00, 0x0a, 0x00, 0x05,
1301
                        0x00, 0x04, 0x00, 0x8c, 0x00, 0x8d, 0x00, 0x8b,
1302
                        0x00, 0x8a, 0x01, 0x00, 0x00, 0x19, 0x00, 0x09,
1303
                        0x00, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
1304
                        0x0e, 0x00, 0x0c, 0x00, 0x00, 0x09, 0x6c, 0x6f,
1305
                        0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74,
1306
                },
1307
 
1308
                        {
1309
                                0x16, 0x03, 0x01, 0x00, 0x2a, 0x02, 0x00, 0x00,
1310
                                0x26, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
1311
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1312
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1313
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1314
                                0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x16,
1315
                                0x03, 0x01, 0x02, 0xbe, 0x0b, 0x00, 0x02, 0xba,
1316
                                0x00, 0x02, 0xb7, 0x00, 0x02, 0xb4, 0x30, 0x82,
1317
                                0x02, 0xb0, 0x30, 0x82, 0x02, 0x19, 0xa0, 0x03,
1318
                                0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0x85, 0xb0,
1319
                                0xbb, 0xa4, 0x8a, 0x7f, 0xb8, 0xca, 0x30, 0x0d,
1320
                                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
1321
                                0x01, 0x01, 0x05, 0x05, 0x00, 0x30, 0x45, 0x31,
1322
                                0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
1323
                                0x13, 0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11,
1324
                                0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53,
1325
                                0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74,
1326
                                0x65, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55,
1327
                                0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65,
1328
                                0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64,
1329
                                0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79,
1330
                                0x20, 0x4c, 0x74, 0x64, 0x30, 0x1e, 0x17, 0x0d,
1331
                                0x31, 0x30, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39,
1332
                                0x30, 0x39, 0x33, 0x38, 0x5a, 0x17, 0x0d, 0x31,
1333
                                0x31, 0x30, 0x34, 0x32, 0x34, 0x30, 0x39, 0x30,
1334
                                0x39, 0x33, 0x38, 0x5a, 0x30, 0x45, 0x31, 0x0b,
1335
                                0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
1336
                                0x02, 0x41, 0x55, 0x31, 0x13, 0x30, 0x11, 0x06,
1337
                                0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f,
1338
                                0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65,
1339
                                0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04,
1340
                                0x0a, 0x13, 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72,
1341
                                0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67,
1342
                                0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20,
1343
                                0x4c, 0x74, 0x64, 0x30, 0x81, 0x9f, 0x30, 0x0d,
1344
                                0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
1345
                                0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8d,
1346
                                0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00,
1347
                                0xbb, 0x79, 0xd6, 0xf5, 0x17, 0xb5, 0xe5, 0xbf,
1348
                                0x46, 0x10, 0xd0, 0xdc, 0x69, 0xbe, 0xe6, 0x2b,
1349
                                0x07, 0x43, 0x5a, 0xd0, 0x03, 0x2d, 0x8a, 0x7a,
1350
                                0x43, 0x85, 0xb7, 0x14, 0x52, 0xe7, 0xa5, 0x65,
1351
                                0x4c, 0x2c, 0x78, 0xb8, 0x23, 0x8c, 0xb5, 0xb4,
1352
                                0x82, 0xe5, 0xde, 0x1f, 0x95, 0x3b, 0x7e, 0x62,
1353
                                0xa5, 0x2c, 0xa5, 0x33, 0xd6, 0xfe, 0x12, 0x5c,
1354
                                0x7a, 0x56, 0xfc, 0xf5, 0x06, 0xbf, 0xfa, 0x58,
1355
                                0x7b, 0x26, 0x3f, 0xb5, 0xcd, 0x04, 0xd3, 0xd0,
1356
                                0xc9, 0x21, 0x96, 0x4a, 0xc7, 0xf4, 0x54, 0x9f,
1357
                                0x5a, 0xbf, 0xef, 0x42, 0x71, 0x00, 0xfe, 0x18,
1358
                                0x99, 0x07, 0x7f, 0x7e, 0x88, 0x7d, 0x7d, 0xf1,
1359
                                0x04, 0x39, 0xc4, 0xa2, 0x2e, 0xdb, 0x51, 0xc9,
1360
                                0x7c, 0xe3, 0xc0, 0x4c, 0x3b, 0x32, 0x66, 0x01,
1361
                                0xcf, 0xaf, 0xb1, 0x1d, 0xb8, 0x71, 0x9a, 0x1d,
1362
                                0xdb, 0xdb, 0x89, 0x6b, 0xae, 0xda, 0x2d, 0x79,
1363
                                0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x81, 0xa7,
1364
                                0x30, 0x81, 0xa4, 0x30, 0x1d, 0x06, 0x03, 0x55,
1365
                                0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xb1, 0xad,
1366
                                0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb, 0x69,
1367
                                0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e, 0x18,
1368
                                0x88, 0x39, 0x30, 0x75, 0x06, 0x03, 0x55, 0x1d,
1369
                                0x23, 0x04, 0x6e, 0x30, 0x6c, 0x80, 0x14, 0xb1,
1370
                                0xad, 0xe2, 0x85, 0x5a, 0xcf, 0xcb, 0x28, 0xdb,
1371
                                0x69, 0xce, 0x23, 0x69, 0xde, 0xd3, 0x26, 0x8e,
1372
                                0x18, 0x88, 0x39, 0xa1, 0x49, 0xa4, 0x47, 0x30,
1373
                                0x45, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
1374
                                0x04, 0x06, 0x13, 0x02, 0x41, 0x55, 0x31, 0x13,
1375
                                0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13,
1376
                                0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74,
1377
                                0x61, 0x74, 0x65, 0x31, 0x21, 0x30, 0x1f, 0x06,
1378
                                0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, 0x49, 0x6e,
1379
                                0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57,
1380
                                0x69, 0x64, 0x67, 0x69, 0x74, 0x73, 0x20, 0x50,
1381
                                0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x82, 0x09,
1382
                                0x00, 0x85, 0xb0, 0xbb, 0xa4, 0x8a, 0x7f, 0xb8,
1383
                                0xca, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13,
1384
                                0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30,
1385
                                0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
1386
                                0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x81,
1387
                                0x81, 0x00, 0x08, 0x6c, 0x45, 0x24, 0xc7, 0x6b,
1388
                                0xb1, 0x59, 0xab, 0x0c, 0x52, 0xcc, 0xf2, 0xb0,
1389
                                0x14, 0xd7, 0x87, 0x9d, 0x7a, 0x64, 0x75, 0xb5,
1390
                                0x5a, 0x95, 0x66, 0xe4, 0xc5, 0x2b, 0x8e, 0xae,
1391
                                0x12, 0x66, 0x1f, 0xeb, 0x4f, 0x38, 0xb3, 0x6e,
1392
                                0x60, 0xd3, 0x92, 0xfd, 0xf7, 0x41, 0x08, 0xb5,
1393
                                0x25, 0x13, 0xb1, 0x18, 0x7a, 0x24, 0xfb, 0x30,
1394
                                0x1d, 0xba, 0xed, 0x98, 0xb9, 0x17, 0xec, 0xe7,
1395
                                0xd7, 0x31, 0x59, 0xdb, 0x95, 0xd3, 0x1d, 0x78,
1396
                                0xea, 0x50, 0x56, 0x5c, 0xd5, 0x82, 0x5a, 0x2d,
1397
                                0x5a, 0x5f, 0x33, 0xc4, 0xb6, 0xd8, 0xc9, 0x75,
1398
                                0x90, 0x96, 0x8c, 0x0f, 0x52, 0x98, 0xb5, 0xcd,
1399
                                0x98, 0x1f, 0x89, 0x20, 0x5f, 0xf2, 0xa0, 0x1c,
1400
                                0xa3, 0x1b, 0x96, 0x94, 0xdd, 0xa9, 0xfd, 0x57,
1401
                                0xe9, 0x70, 0xe8, 0x26, 0x6d, 0x71, 0x99, 0x9b,
1402
                                0x26, 0x6e, 0x38, 0x50, 0x29, 0x6c, 0x90, 0xa7,
1403
                                0xbd, 0xd9, 0x16, 0x03, 0x01, 0x00, 0x08, 0x0d,
1404
                                0x00, 0x00, 0x04, 0x01, 0x01, 0x00, 0x00, 0x16,
1405
                                0x03, 0x01, 0x00, 0x04, 0x0e, 0x00, 0x00, 0x00,
1406
                        },
1407
 
1408
                        {
1409
                                0x16, 0x03, 0x01, 0x01, 0xfb, 0x0b, 0x00, 0x01,
1410
                                0xf7, 0x00, 0x01, 0xf4, 0x00, 0x01, 0xf1, 0x30,
1411
                                0x82, 0x01, 0xed, 0x30, 0x82, 0x01, 0x58, 0xa0,
1412
                                0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x00, 0x30,
1413
                                0x0b, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
1414
                                0x0d, 0x01, 0x01, 0x05, 0x30, 0x26, 0x31, 0x10,
1415
                                0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
1416
                                0x07, 0x41, 0x63, 0x6d, 0x65, 0x20, 0x43, 0x6f,
1417
                                0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04,
1418
                                0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30,
1419
                                0x2e, 0x30, 0x2e, 0x31, 0x30, 0x1e, 0x17, 0x0d,
1420
                                0x31, 0x31, 0x31, 0x32, 0x30, 0x38, 0x30, 0x37,
1421
                                0x35, 0x35, 0x31, 0x32, 0x5a, 0x17, 0x0d, 0x31,
1422
                                0x32, 0x31, 0x32, 0x30, 0x37, 0x30, 0x38, 0x30,
1423
                                0x30, 0x31, 0x32, 0x5a, 0x30, 0x26, 0x31, 0x10,
1424
                                0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
1425
                                0x07, 0x41, 0x63, 0x6d, 0x65, 0x20, 0x43, 0x6f,
1426
                                0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04,
1427
                                0x03, 0x13, 0x09, 0x31, 0x32, 0x37, 0x2e, 0x30,
1428
                                0x2e, 0x30, 0x2e, 0x31, 0x30, 0x81, 0x9c, 0x30,
1429
                                0x0b, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
1430
                                0x0d, 0x01, 0x01, 0x01, 0x03, 0x81, 0x8c, 0x00,
1431
                                0x30, 0x81, 0x88, 0x02, 0x81, 0x80, 0x4e, 0xd0,
1432
                                0x7b, 0x31, 0xe3, 0x82, 0x64, 0xd9, 0x59, 0xc0,
1433
                                0xc2, 0x87, 0xa4, 0x5e, 0x1e, 0x8b, 0x73, 0x33,
1434
                                0xc7, 0x63, 0x53, 0xdf, 0x66, 0x92, 0x06, 0x84,
1435
                                0xf6, 0x64, 0xd5, 0x8f, 0xe4, 0x36, 0xa7, 0x1d,
1436
                                0x2b, 0xe8, 0xb3, 0x20, 0x36, 0x45, 0x23, 0xb5,
1437
                                0xe3, 0x95, 0xae, 0xed, 0xe0, 0xf5, 0x20, 0x9c,
1438
                                0x8d, 0x95, 0xdf, 0x7f, 0x5a, 0x12, 0xef, 0x87,
1439
                                0xe4, 0x5b, 0x68, 0xe4, 0xe9, 0x0e, 0x74, 0xec,
1440
                                0x04, 0x8a, 0x7f, 0xde, 0x93, 0x27, 0xc4, 0x01,
1441
                                0x19, 0x7a, 0xbd, 0xf2, 0xdc, 0x3d, 0x14, 0xab,
1442
                                0xd0, 0x54, 0xca, 0x21, 0x0c, 0xd0, 0x4d, 0x6e,
1443
                                0x87, 0x2e, 0x5c, 0xc5, 0xd2, 0xbb, 0x4d, 0x4b,
1444
                                0x4f, 0xce, 0xb6, 0x2c, 0xf7, 0x7e, 0x88, 0xec,
1445
                                0x7c, 0xd7, 0x02, 0x91, 0x74, 0xa6, 0x1e, 0x0c,
1446
                                0x1a, 0xda, 0xe3, 0x4a, 0x5a, 0x2e, 0xde, 0x13,
1447
                                0x9c, 0x4c, 0x40, 0x88, 0x59, 0x93, 0x02, 0x03,
1448
                                0x01, 0x00, 0x01, 0xa3, 0x32, 0x30, 0x30, 0x30,
1449
                                0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01,
1450
                                0xff, 0x04, 0x04, 0x03, 0x02, 0x00, 0xa0, 0x30,
1451
                                0x0d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x06,
1452
                                0x04, 0x04, 0x01, 0x02, 0x03, 0x04, 0x30, 0x0f,
1453
                                0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x08, 0x30,
1454
                                0x06, 0x80, 0x04, 0x01, 0x02, 0x03, 0x04, 0x30,
1455
                                0x0b, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
1456
                                0x0d, 0x01, 0x01, 0x05, 0x03, 0x81, 0x81, 0x00,
1457
                                0x36, 0x1f, 0xb3, 0x7a, 0x0c, 0x75, 0xc9, 0x6e,
1458
                                0x37, 0x46, 0x61, 0x2b, 0xd5, 0xbd, 0xc0, 0xa7,
1459
                                0x4b, 0xcc, 0x46, 0x9a, 0x81, 0x58, 0x7c, 0x85,
1460
                                0x79, 0x29, 0xc8, 0xc8, 0xc6, 0x67, 0xdd, 0x32,
1461
                                0x56, 0x45, 0x2b, 0x75, 0xb6, 0xe9, 0x24, 0xa9,
1462
                                0x50, 0x9a, 0xbe, 0x1f, 0x5a, 0xfa, 0x1a, 0x15,
1463
                                0xd9, 0xcc, 0x55, 0x95, 0x72, 0x16, 0x83, 0xb9,
1464
                                0xc2, 0xb6, 0x8f, 0xfd, 0x88, 0x8c, 0x38, 0x84,
1465
                                0x1d, 0xab, 0x5d, 0x92, 0x31, 0x13, 0x4f, 0xfd,
1466
                                0x83, 0x3b, 0xc6, 0x9d, 0xf1, 0x11, 0x62, 0xb6,
1467
                                0x8b, 0xec, 0xab, 0x67, 0xbe, 0xc8, 0x64, 0xb0,
1468
                                0x11, 0x50, 0x46, 0x58, 0x17, 0x6b, 0x99, 0x1c,
1469
                                0xd3, 0x1d, 0xfc, 0x06, 0xf1, 0x0e, 0xe5, 0x96,
1470
                                0xa8, 0x0c, 0xf9, 0x78, 0x20, 0xb7, 0x44, 0x18,
1471
                                0x51, 0x8d, 0x10, 0x7e, 0x4f, 0x94, 0x67, 0xdf,
1472
                                0xa3, 0x4e, 0x70, 0x73, 0x8e, 0x90, 0x91, 0x85,
1473
                                0x16, 0x03, 0x01, 0x00, 0x86, 0x10, 0x00, 0x00,
1474
                                0x82, 0x00, 0x80, 0xa7, 0x2f, 0xed, 0xfa, 0xc2,
1475
                                0xbd, 0x46, 0xa1, 0xf2, 0x69, 0xc5, 0x1d, 0xa1,
1476
                                0x34, 0xd6, 0xd0, 0x84, 0xf5, 0x5d, 0x8c, 0x82,
1477
                                0x8d, 0x98, 0x82, 0x9c, 0xd9, 0x07, 0xe0, 0xf7,
1478
                                0x55, 0x49, 0x4d, 0xa1, 0x48, 0x59, 0x02, 0xd3,
1479
                                0x84, 0x37, 0xaf, 0x01, 0xb3, 0x3a, 0xf4, 0xed,
1480
                                0x99, 0xbe, 0x67, 0x36, 0x19, 0x55, 0xf3, 0xf9,
1481
                                0xcb, 0x94, 0xe5, 0x7b, 0x8b, 0x77, 0xf2, 0x5f,
1482
                                0x4c, 0xfe, 0x01, 0x1f, 0x7b, 0xd7, 0x23, 0x49,
1483
                                0x0c, 0xcb, 0x6c, 0xb0, 0xe7, 0x77, 0xd6, 0xcf,
1484
                                0xa8, 0x7d, 0xdb, 0xa7, 0x14, 0xe2, 0xf5, 0xf3,
1485
                                0xff, 0xba, 0x23, 0xd2, 0x9a, 0x36, 0x14, 0x60,
1486
                                0x2a, 0x91, 0x5d, 0x2b, 0x35, 0x3b, 0xb6, 0xdd,
1487
                                0xcb, 0x6b, 0xdc, 0x18, 0xdc, 0x33, 0xb8, 0xb3,
1488
                                0xc7, 0x27, 0x7e, 0xfc, 0xd2, 0xf7, 0x97, 0x90,
1489
                                0x5e, 0x17, 0xac, 0x14, 0x8e, 0x0f, 0xca, 0xb5,
1490
                                0x6f, 0xc9, 0x2d, 0x16, 0x03, 0x01, 0x00, 0x86,
1491
                                0x0f, 0x00, 0x00, 0x82, 0x00, 0x80, 0x44, 0x7f,
1492
                                0xa2, 0x59, 0x60, 0x0b, 0x5a, 0xc4, 0xaf, 0x1e,
1493
                                0x60, 0xa5, 0x24, 0xea, 0xc1, 0xc3, 0x22, 0x21,
1494
                                0x6b, 0x22, 0x8b, 0x2a, 0x11, 0x82, 0x68, 0x7d,
1495
                                0xb9, 0xdd, 0x9c, 0x27, 0x4c, 0xc2, 0xc8, 0xa2,
1496
                                0x8b, 0x6b, 0x77, 0x8d, 0x3a, 0x2b, 0x8d, 0x2f,
1497
                                0x6a, 0x2b, 0x43, 0xd2, 0xd1, 0xc6, 0x41, 0x79,
1498
                                0xa2, 0x4f, 0x2b, 0xc2, 0xf7, 0xb2, 0x10, 0xad,
1499
                                0xa6, 0x01, 0x51, 0x51, 0x25, 0xe7, 0x58, 0x7a,
1500
                                0xcf, 0x3b, 0xc4, 0x29, 0xb5, 0xe5, 0xa7, 0x83,
1501
                                0xe6, 0xcb, 0x1e, 0xf3, 0x02, 0x0f, 0x53, 0x3b,
1502
                                0xb5, 0x39, 0xef, 0x9c, 0x42, 0xe0, 0xa6, 0x9b,
1503
                                0x2b, 0xdd, 0x60, 0xae, 0x0a, 0x73, 0x35, 0xbe,
1504
                                0x26, 0x10, 0x1b, 0xe9, 0xe9, 0x61, 0xab, 0x20,
1505
                                0xa5, 0x48, 0xc6, 0x60, 0xa6, 0x50, 0x3c, 0xfb,
1506
                                0xa7, 0xca, 0xb0, 0x80, 0x95, 0x1e, 0xce, 0xc7,
1507
                                0xbb, 0x68, 0x44, 0xdc, 0x0e, 0x0e, 0x14, 0x03,
1508
                                0x01, 0x00, 0x01, 0x01, 0x16, 0x03, 0x01, 0x00,
1509
                                0x24, 0xb6, 0xcd, 0x0c, 0x78, 0xfd, 0xd6, 0xff,
1510
                                0xbe, 0x97, 0xd5, 0x0a, 0x7d, 0x4f, 0xa1, 0x03,
1511
                                0x78, 0xc8, 0x61, 0x6f, 0xf2, 0x4b, 0xa8, 0x56,
1512
                                0x4f, 0x3c, 0xa2, 0xd9, 0xd0, 0x20, 0x13, 0x1b,
1513
                                0x8b, 0x36, 0xb7, 0x33, 0x9c,
1514
                        },
1515
 
1516
                        {
1517
                                0x14, 0x03, 0x01, 0x00, 0x01, 0x01, 0x16, 0x03,
1518
                                0x01, 0x00, 0x24, 0xa3, 0x43, 0x94, 0xe7, 0xdf,
1519
                                0xb6, 0xc3, 0x03, 0x9f, 0xc1, 0x59, 0x0c, 0xc3,
1520
                                0x13, 0xae, 0xed, 0xcf, 0xff, 0xf1, 0x80, 0xf3,
1521
                                0x13, 0x63, 0x1c, 0xf0, 0xca, 0xad, 0x9e, 0x71,
1522
                                0x46, 0x5f, 0x6b, 0xeb, 0x10, 0x3f, 0xe3, 0x17,
1523
                                0x03, 0x01, 0x00, 0x21, 0xe9, 0x80, 0x95, 0x6e,
1524
                                0x05, 0x55, 0x2f, 0xed, 0x4d, 0xde, 0x17, 0x3a,
1525
                                0x32, 0x9b, 0x2a, 0x74, 0x30, 0x4f, 0xe0, 0x9f,
1526
                                0x4e, 0xd3, 0x06, 0xbd, 0x3a, 0x43, 0x75, 0x8b,
1527
                                0x5b, 0x9a, 0xd8, 0x2e, 0x56, 0x15, 0x03, 0x01,
1528
                                0x00, 0x16, 0x53, 0xf5, 0xff, 0xe0, 0xa1, 0x6c,
1529
                                0x33, 0xf4, 0x4e, 0x89, 0x68, 0xe1, 0xf7, 0x61,
1530
                                0x13, 0xb3, 0x12, 0xa1, 0x8e, 0x5a, 0x7a, 0x02,
1531
                        }}},
1532
}
1533
 
1534
// cert.pem and key.pem were generated with generate_cert.go
1535
// Thus, they have no ExtKeyUsage fields and trigger an error
1536
// when verification is turned on.
1537
 
1538
var clicert = loadPEMCert(`
1539
-----BEGIN CERTIFICATE-----
1540
MIIB7TCCAVigAwIBAgIBADALBgkqhkiG9w0BAQUwJjEQMA4GA1UEChMHQWNtZSBD
1541
bzESMBAGA1UEAxMJMTI3LjAuMC4xMB4XDTExMTIwODA3NTUxMloXDTEyMTIwNzA4
1542
MDAxMlowJjEQMA4GA1UEChMHQWNtZSBDbzESMBAGA1UEAxMJMTI3LjAuMC4xMIGc
1543
MAsGCSqGSIb3DQEBAQOBjAAwgYgCgYBO0Hsx44Jk2VnAwoekXh6LczPHY1PfZpIG
1544
hPZk1Y/kNqcdK+izIDZFI7Xjla7t4PUgnI2V339aEu+H5Fto5OkOdOwEin/ekyfE
1545
ARl6vfLcPRSr0FTKIQzQTW6HLlzF0rtNS0/Otiz3fojsfNcCkXSmHgwa2uNKWi7e
1546
E5xMQIhZkwIDAQABozIwMDAOBgNVHQ8BAf8EBAMCAKAwDQYDVR0OBAYEBAECAwQw
1547
DwYDVR0jBAgwBoAEAQIDBDALBgkqhkiG9w0BAQUDgYEANh+zegx1yW43RmEr1b3A
1548
p0vMRpqBWHyFeSnIyMZn3TJWRSt1tukkqVCavh9a+hoV2cxVlXIWg7nCto/9iIw4
1549
hB2rXZIxE0/9gzvGnfERYraL7KtnvshksBFQRlgXa5kc0x38BvEO5ZaoDPl4ILdE
1550
GFGNEH5PlGffo05wc46QkYU=
1551
-----END CERTIFICATE-----
1552
`)
1553
 
1554
/* corresponding key.pem for cert.pem is:
1555
-----BEGIN RSA PRIVATE KEY-----
1556
MIICXAIBAAKBgE7QezHjgmTZWcDCh6ReHotzM8djU99mkgaE9mTVj+Q2px0r6LMg
1557
NkUjteOVru3g9SCcjZXff1oS74fkW2jk6Q507ASKf96TJ8QBGXq98tw9FKvQVMoh
1558
DNBNbocuXMXSu01LT862LPd+iOx81wKRdKYeDBra40paLt4TnExAiFmTAgMBAAEC
1559
gYBxvXd8yNteFTns8A/2yomEMC4yeosJJSpp1CsN3BJ7g8/qTnrVPxBy+RU+qr63
1560
t2WquaOu/cr5P8iEsa6lk20tf8pjKLNXeX0b1RTzK8rJLbS7nGzP3tvOhL096VtQ
1561
dAo4ROEaro0TzYpHmpciSvxVIeEIAAdFDObDJPKqcJAxyQJBAJizfYgK8Gzx9fsx
1562
hxp+VteCbVPg2euASH5Yv3K5LukRdKoSzHE2grUVQgN/LafC0eZibRanxHegYSr7
1563
7qaswKUCQQCEIWor/X4XTMdVj3Oj+vpiw75y/S9gh682+myZL+d/02IEkwnB098P
1564
RkKVpenBHyrGg0oeN5La7URILWKj7CPXAkBKo6F+d+phNjwIFoN1Xb/RA32w/D1I
1565
saG9sF+UEhRt9AxUfW/U/tIQ9V0ZHHcSg1XaCM5Nvp934brdKdvTOKnJAkBD5h/3
1566
Rybatlvg/fzBEaJFyq09zhngkxlZOUtBVTqzl17RVvY2orgH02U4HbCHy4phxOn7
1567
qTdQRYlHRftgnWK1AkANibn9PRYJ7mJyJ9Dyj2QeNcSkSTzrt0tPvUMf4+meJymN
1568
1Ntu5+S1DLLzfxlaljWG6ylW6DNxujCyuXIV2rvAMAA=
1569
-----END RSA PRIVATE KEY-----
1570
*/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.