1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754
|
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT
//go:build !js
// +build !js
package e2e
import (
"context"
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"io"
"net"
"sync"
"sync/atomic"
"testing"
"time"
"github.com/pion/dtls/v3"
"github.com/pion/dtls/v3/pkg/crypto/selfsign"
"github.com/pion/dtls/v3/pkg/protocol/extension"
"github.com/pion/dtls/v3/pkg/protocol/handshake"
"github.com/pion/transport/v3/test"
"github.com/stretchr/testify/assert"
)
const (
testMessage = "Hello World"
testTimeLimit = 5 * time.Second
messageRetry = 200 * time.Millisecond
)
var (
errServerTimeout = errors.New("waiting on serverReady err: timeout")
errHookCiphersFailed = errors.New("hook failed to modify cipherlist")
errHookAPLNFailed = errors.New("hook failed to modify APLN extension")
)
func randomPort(tb testing.TB) int {
tb.Helper()
conn, err := net.ListenPacket("udp4", "127.0.0.1:0")
assert.NoError(tb, err, "failed to pick port")
defer func() {
_ = conn.Close()
}()
switch addr := conn.LocalAddr().(type) {
case *net.UDPAddr:
return addr.Port
default:
assert.Fail(tb, "failed to acquire port", "unknown addr type %T", addr)
return 0
}
}
func simpleReadWrite(errChan chan error, outChan chan string, conn io.ReadWriter, messageRecvCount *uint64) {
go func() {
buffer := make([]byte, 8192)
n, err := conn.Read(buffer)
if err != nil {
errChan <- err
return
}
outChan <- string(buffer[:n])
atomic.AddUint64(messageRecvCount, 1)
}()
for {
if atomic.LoadUint64(messageRecvCount) == 2 {
break
} else if _, err := conn.Write([]byte(testMessage)); err != nil {
errChan <- err
break
}
time.Sleep(messageRetry)
}
}
type comm struct {
ctx context.Context //nolint:containedctx
clientConfig, serverConfig *dtls.Config
serverPort int
messageRecvCount *uint64 // Counter to make sure both sides got a message
clientMutex *sync.Mutex
clientConn net.Conn
clientDone chan error
serverMutex *sync.Mutex
serverConn net.Conn
serverListener net.Listener
serverReady chan struct{}
serverDone chan error
errChan chan error
clientChan chan string
serverChan chan string
client func(*comm)
server func(*comm)
}
func newComm(
ctx context.Context,
clientConfig, serverConfig *dtls.Config,
serverPort int,
server, client func(*comm),
) *comm {
messageRecvCount := uint64(0)
com := &comm{
ctx: ctx,
clientConfig: clientConfig,
serverConfig: serverConfig,
serverPort: serverPort,
messageRecvCount: &messageRecvCount,
clientMutex: &sync.Mutex{},
serverMutex: &sync.Mutex{},
serverReady: make(chan struct{}),
serverDone: make(chan error),
clientDone: make(chan error),
errChan: make(chan error),
clientChan: make(chan string),
serverChan: make(chan string),
server: server,
client: client,
}
return com
}
func (c *comm) assert(t *testing.T) { //nolint:cyclop
t.Helper()
// DTLS Client
go c.client(c)
// DTLS Server
go c.server(c)
defer func() {
if c.clientConn != nil {
assert.NoError(t, c.clientConn.Close())
}
if c.serverConn != nil {
assert.NoError(t, c.serverConn.Close())
}
if c.serverListener != nil {
assert.NoError(t, c.serverListener.Close())
}
}()
func() {
seenClient, seenServer := false, false
for {
select {
case err := <-c.errChan:
assert.NoError(t, err)
case <-time.After(testTimeLimit):
assert.Failf(t, "Test timeout", "seenClient %t seenServer %t", seenClient, seenServer)
case clientMsg := <-c.clientChan:
assert.Equal(t, testMessage, clientMsg)
seenClient = true
if seenClient && seenServer {
return
}
case serverMsg := <-c.serverChan:
assert.Equal(t, testMessage, serverMsg)
seenServer = true
if seenClient && seenServer {
return
}
}
}
}()
}
func (c *comm) cleanup(t *testing.T) {
t.Helper()
clientDone, serverDone := false, false
for {
select {
case err := <-c.clientDone:
assert.NoError(t, err)
clientDone = true
if clientDone && serverDone {
return
}
case err := <-c.serverDone:
assert.NoError(t, err)
serverDone = true
if clientDone && serverDone {
return
}
case <-time.After(testTimeLimit):
assert.Fail(t, "Test timeout waiting for server shutdown")
}
}
}
func clientPion(c *comm) { //nolint:varnamelen
select {
case <-c.serverReady:
// OK
case <-time.After(time.Second):
c.errChan <- errServerTimeout
}
c.clientMutex.Lock()
defer c.clientMutex.Unlock()
conn, err := dtls.Dial("udp",
&net.UDPAddr{IP: net.ParseIP("127.0.0.1"), Port: c.serverPort},
c.clientConfig,
)
if err != nil {
c.errChan <- err
return
}
if err := conn.HandshakeContext(c.ctx); err != nil {
c.errChan <- err
return
}
c.clientConn = conn
simpleReadWrite(c.errChan, c.clientChan, c.clientConn, c.messageRecvCount)
c.clientDone <- nil
close(c.clientDone)
}
func serverPion(c *comm) { //nolint:varnamelen
c.serverMutex.Lock()
defer c.serverMutex.Unlock()
var err error
c.serverListener, err = dtls.Listen("udp",
&net.UDPAddr{IP: net.ParseIP("127.0.0.1"), Port: c.serverPort},
c.serverConfig,
)
if err != nil {
c.errChan <- err
return
}
c.serverReady <- struct{}{}
c.serverConn, err = c.serverListener.Accept()
if err != nil {
c.errChan <- err
return
}
dtlsConn, ok := c.serverConn.(*dtls.Conn)
if ok {
if err := dtlsConn.HandshakeContext(c.ctx); err != nil {
c.errChan <- err
return
}
}
simpleReadWrite(c.errChan, c.serverChan, c.serverConn, c.messageRecvCount)
c.serverDone <- nil
close(c.serverDone)
}
type dtlsConfOpts func(*dtls.Config)
func withConnectionIDGenerator(g func() []byte) dtlsConfOpts {
return func(c *dtls.Config) {
c.ConnectionIDGenerator = g
}
}
// Simple DTLS Client/Server can communicate
// - Assert that you can send messages both ways
// - Assert that Close() on both ends work
// - Assert that no Goroutines are leaked
func testPionE2ESimple(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
for _, cipherSuite := range []dtls.CipherSuiteID{
dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
dtls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
dtls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
} {
cipherSuite := cipherSuite
t.Run(cipherSuite.String(), func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
cert, err := selfsign.GenerateSelfSignedWithDNS("localhost")
assert.NoError(t, err)
cfg := &dtls.Config{
Certificates: []tls.Certificate{cert},
CipherSuites: []dtls.CipherSuiteID{cipherSuite},
InsecureSkipVerify: true,
}
for _, o := range opts {
o(cfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, cfg, cfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
})
}
}
func testPionE2ESimplePSK(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
for _, cipherSuite := range []dtls.CipherSuiteID{
dtls.TLS_PSK_WITH_AES_128_CCM,
dtls.TLS_PSK_WITH_AES_128_CCM_8,
dtls.TLS_PSK_WITH_AES_256_CCM_8,
dtls.TLS_PSK_WITH_AES_128_GCM_SHA256,
dtls.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256,
} {
cipherSuite := cipherSuite
t.Run(cipherSuite.String(), func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
cfg := &dtls.Config{
PSK: func([]byte) ([]byte, error) {
return []byte{0xAB, 0xC1, 0x23}, nil
},
PSKIdentityHint: []byte{0x01, 0x02, 0x03, 0x04, 0x05},
CipherSuites: []dtls.CipherSuiteID{cipherSuite},
}
for _, o := range opts {
o(cfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, cfg, cfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
})
}
}
func testPionE2EMTUs(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
for _, mtu := range []int{
10000,
1000,
100,
} {
mtu := mtu
t.Run(fmt.Sprintf("MTU%d", mtu), func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
cert, err := selfsign.GenerateSelfSignedWithDNS("localhost")
assert.NoError(t, err)
cfg := &dtls.Config{
Certificates: []tls.Certificate{cert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256},
InsecureSkipVerify: true,
MTU: mtu,
}
for _, o := range opts {
o(cfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, cfg, cfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
})
}
}
func testPionE2ESimpleED25519(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
for _, cipherSuite := range []dtls.CipherSuiteID{
dtls.TLS_ECDHE_ECDSA_WITH_AES_128_CCM,
dtls.TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8,
dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
dtls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
dtls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
} {
cipherSuite := cipherSuite
t.Run(cipherSuite.String(), func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_, key, err := ed25519.GenerateKey(rand.Reader)
assert.NoError(t, err)
cert, err := selfsign.SelfSign(key)
assert.NoError(t, err)
cfg := &dtls.Config{
Certificates: []tls.Certificate{cert},
CipherSuites: []dtls.CipherSuiteID{cipherSuite},
InsecureSkipVerify: true,
}
for _, o := range opts {
o(cfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, cfg, cfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
})
}
}
func testPionE2ESimpleED25519ClientCert(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
_, skey, err := ed25519.GenerateKey(rand.Reader)
assert.NoError(t, err)
scert, err := selfsign.SelfSign(skey)
assert.NoError(t, err)
_, ckey, err := ed25519.GenerateKey(rand.Reader)
assert.NoError(t, err)
ccert, err := selfsign.SelfSign(ckey)
assert.NoError(t, err)
scfg := &dtls.Config{
Certificates: []tls.Certificate{scert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256},
ClientAuth: dtls.RequireAnyClientCert,
}
ccfg := &dtls.Config{
Certificates: []tls.Certificate{ccert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256},
InsecureSkipVerify: true,
}
for _, o := range opts {
o(scfg)
o(ccfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, ccfg, scfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
}
func testPionE2ESimpleECDSAClientCert(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
scert, err := selfsign.GenerateSelfSigned()
assert.NoError(t, err)
ccert, err := selfsign.GenerateSelfSigned()
assert.NoError(t, err)
clientCAs := x509.NewCertPool()
caCert, err := x509.ParseCertificate(ccert.Certificate[0])
assert.NoError(t, err)
clientCAs.AddCert(caCert)
scfg := &dtls.Config{
ClientCAs: clientCAs,
Certificates: []tls.Certificate{scert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256},
ClientAuth: dtls.RequireAnyClientCert,
}
ccfg := &dtls.Config{
Certificates: []tls.Certificate{ccert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256},
InsecureSkipVerify: true,
}
for _, o := range opts {
o(scfg)
o(ccfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, ccfg, scfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
}
func testPionE2ESimpleRSAClientCert(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
spriv, err := rsa.GenerateKey(rand.Reader, 2048)
assert.NoError(t, err)
scert, err := selfsign.SelfSign(spriv)
assert.NoError(t, err)
cpriv, err := rsa.GenerateKey(rand.Reader, 2048)
assert.NoError(t, err)
ccert, err := selfsign.SelfSign(cpriv)
assert.NoError(t, err)
scfg := &dtls.Config{
Certificates: []tls.Certificate{scert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256},
ClientAuth: dtls.RequireAnyClientCert,
}
ccfg := &dtls.Config{
Certificates: []tls.Certificate{ccert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256},
InsecureSkipVerify: true,
}
for _, o := range opts {
o(scfg)
o(ccfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, ccfg, scfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
}
func testPionE2ESimpleClientHelloHook(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
t.Run("ClientHello hook", func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
cert, err := selfsign.GenerateSelfSignedWithDNS("localhost")
assert.NoError(t, err)
modifiedCipher := dtls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
supportedList := []dtls.CipherSuiteID{
dtls.TLS_ECDHE_ECDSA_WITH_AES_128_CCM,
modifiedCipher,
}
ccfg := &dtls.Config{
Certificates: []tls.Certificate{cert},
VerifyConnection: func(s *dtls.State) error {
if s.CipherSuiteID != modifiedCipher {
return errHookCiphersFailed
}
return nil
},
CipherSuites: supportedList,
ClientHelloMessageHook: func(ch handshake.MessageClientHello) handshake.Message {
ch.CipherSuiteIDs = []uint16{uint16(modifiedCipher)}
return &ch
},
InsecureSkipVerify: true,
}
scfg := &dtls.Config{
Certificates: []tls.Certificate{cert},
CipherSuites: supportedList,
InsecureSkipVerify: true,
}
for _, o := range opts {
o(ccfg)
o(scfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, ccfg, scfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
})
}
func testPionE2ESimpleServerHelloHook(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
t.Helper()
lim := test.TimeOut(time.Second * 30)
defer lim.Stop()
report := test.CheckRoutines(t)
defer report()
t.Run("ServerHello hook", func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
cert, err := selfsign.GenerateSelfSignedWithDNS("localhost")
assert.NoError(t, err)
supportedList := []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_128_CCM}
apln := "APLN"
ccfg := &dtls.Config{
Certificates: []tls.Certificate{cert},
VerifyConnection: func(s *dtls.State) error {
if s.NegotiatedProtocol != apln {
return errHookAPLNFailed
}
return nil
},
CipherSuites: supportedList,
InsecureSkipVerify: true,
}
scfg := &dtls.Config{
Certificates: []tls.Certificate{cert},
CipherSuites: supportedList,
ServerHelloMessageHook: func(sh handshake.MessageServerHello) handshake.Message {
sh.Extensions = append(sh.Extensions, &extension.ALPN{
ProtocolNameList: []string{apln},
})
return &sh
},
InsecureSkipVerify: true,
}
for _, o := range opts {
o(ccfg)
o(scfg)
}
serverPort := randomPort(t)
comm := newComm(ctx, ccfg, scfg, serverPort, server, client)
defer comm.cleanup(t)
comm.assert(t)
})
}
func TestPionE2ESimple(t *testing.T) {
testPionE2ESimple(t, serverPion, clientPion)
}
func TestPionE2ESimplePSK(t *testing.T) {
testPionE2ESimplePSK(t, serverPion, clientPion)
}
func TestPionE2EMTUs(t *testing.T) {
testPionE2EMTUs(t, serverPion, clientPion)
}
func TestPionE2ESimpleED25519(t *testing.T) {
testPionE2ESimpleED25519(t, serverPion, clientPion)
}
func TestPionE2ESimpleED25519ClientCert(t *testing.T) {
testPionE2ESimpleED25519ClientCert(t, serverPion, clientPion)
}
func TestPionE2ESimpleECDSAClientCert(t *testing.T) {
testPionE2ESimpleECDSAClientCert(t, serverPion, clientPion)
}
func TestPionE2ESimpleRSAClientCert(t *testing.T) {
testPionE2ESimpleRSAClientCert(t, serverPion, clientPion)
}
func TestPionE2ESimpleCID(t *testing.T) {
testPionE2ESimple(t, serverPion, clientPion, withConnectionIDGenerator(dtls.RandomCIDGenerator(8)))
}
func TestPionE2ESimplePSKCID(t *testing.T) {
testPionE2ESimplePSK(t, serverPion, clientPion, withConnectionIDGenerator(dtls.RandomCIDGenerator(8)))
}
func TestPionE2EMTUsCID(t *testing.T) {
testPionE2EMTUs(t, serverPion, clientPion, withConnectionIDGenerator(dtls.RandomCIDGenerator(8)))
}
func TestPionE2ESimpleED25519CID(t *testing.T) {
testPionE2ESimpleED25519(t, serverPion, clientPion, withConnectionIDGenerator(dtls.RandomCIDGenerator(8)))
}
func TestPionE2ESimpleED25519ClientCertCID(t *testing.T) {
testPionE2ESimpleED25519ClientCert(t, serverPion, clientPion, withConnectionIDGenerator(dtls.RandomCIDGenerator(8)))
}
func TestPionE2ESimpleECDSAClientCertCID(t *testing.T) {
testPionE2ESimpleECDSAClientCert(t, serverPion, clientPion, withConnectionIDGenerator(dtls.RandomCIDGenerator(8)))
}
func TestPionE2ESimpleRSAClientCertCID(t *testing.T) {
testPionE2ESimpleRSAClientCert(t, serverPion, clientPion, withConnectionIDGenerator(dtls.RandomCIDGenerator(8)))
}
func TestPionE2ESimpleClientHelloHook(t *testing.T) {
testPionE2ESimpleClientHelloHook(t, serverPion, clientPion)
}
func TestPionE2ESimpleServerHelloHook(t *testing.T) {
testPionE2ESimpleServerHelloHook(t, serverPion, clientPion)
}
|