Skip to content

Commit

Permalink
Merge pull request #29 from tgragnato/hotfix/dtls_embedding
Browse files Browse the repository at this point in the history
* Remove 'Generate Authors' workflow

pion/.goassets#185

* Remove 'AUTHORS.txt' from README.md

Relates to pion/.goassets#185

* Update CI configs to v0.11.0

Update lint scripts and CI configs.

* Update CI configs to v0.11.3

Update lint scripts and CI configs.

* Fix flight1parse processing exception

* Format code

* If not found in the cache return nil

* chore(deps): bump golang.org/x/crypto from 0.17.0 to 0.18.0 in /dtls

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.17.0 to 0.18.0.
- [Commits](golang/crypto@v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(deps): bump golang.org/x/net from 0.19.0 to 0.20.0 in /dtls (#24)

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.19.0 to 0.20.0.
- [Commits](golang/net@v0.19.0...v0.20.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tommaso Gragnato <91843630+tgragnato@users.noreply.github.com>

* fix(dtls): remove `rsa` from e2e tests

* fix(dtls): adapt some tests

* chore(dtls): move f1h test in `dtls`

* chore(dtls): bump the dtls version in snowflake

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sean DuBois <sean@siobud.com>
Co-authored-by: Pion <59523206+pionbot@users.noreply.github.com>
Co-authored-by: minlpli <minlpli@tencent.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Jan 10, 2024
2 parents e1ea6bb + 49996f5 commit ba62139
Show file tree
Hide file tree
Showing 9 changed files with 303 additions and 75 deletions.
4 changes: 2 additions & 2 deletions dtls/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type ClientHelloInfo struct {
// client is using SNI (see RFC 4366, Section 3.1).
ServerName string

// CipherSuites lists the CipherSuites supported by the client (e.g.
// TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256).
// CipherSuites lists the CipherSuites supported by the client
// (e.g. TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384).
CipherSuites []CipherSuiteID
}

Expand Down
8 changes: 4 additions & 4 deletions dtls/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,13 @@ func TestHandshakeWithInvalidRecord(t *testing.T) {
}
go func() {
client, err := testClient(ctx, dtlsnet.PacketConnFromConn(caWithInvalidRecord), caWithInvalidRecord.RemoteAddr(), &Config{
CipherSuites: []CipherSuiteID{TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256},
CipherSuites: []CipherSuiteID{TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384},
}, true)
clientErr <- result{client, err}
}()

server, errServer := testServer(ctx, dtlsnet.PacketConnFromConn(cb), cb.RemoteAddr(), &Config{
CipherSuites: []CipherSuiteID{TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256},
CipherSuites: []CipherSuiteID{TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384},
}, true)

errClient := <-clientErr
Expand Down Expand Up @@ -471,8 +471,8 @@ func TestExportKeyingMaterial(t *testing.T) {
var rand [28]byte
exportLabel := "EXTRACTOR-dtls_srtp"

expectedServerKey := []byte{0x61, 0x09, 0x9d, 0x7d, 0xcb, 0x08, 0x52, 0x2c, 0xe7, 0x7b}
expectedClientKey := []byte{0x87, 0xf0, 0x40, 0x02, 0xf6, 0x1c, 0xf1, 0xfe, 0x8c, 0x77}
expectedServerKey := []byte{0x30, 0xef, 0x2b, 0x2d, 0x4f, 0x72, 0xe2, 0x3d, 0x2a, 0x13}
expectedClientKey := []byte{0xc7, 0xf9, 0x75, 0x03, 0x6b, 0x44, 0x10, 0x42, 0x34, 0xcf}

c := &Conn{
state: State{
Expand Down
57 changes: 0 additions & 57 deletions dtls/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"context"
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"errors"
Expand Down Expand Up @@ -512,54 +511,6 @@ func testPionE2ESimpleECDSAClientCert(t *testing.T, server, client func(*comm),
comm.assert(t)
}

func testPionE2ESimpleRSAClientCert(t *testing.T, server, client func(*comm), opts ...dtlsConfOpts) {
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)
if err != nil {
t.Fatal(err)
}
scert, err := selfsign.SelfSign(spriv)
if err != nil {
t.Fatal(err)
}

cpriv, err := rsa.GenerateKey(rand.Reader, 2048)
if err != nil {
t.Fatal(err)
}
ccert, err := selfsign.SelfSign(cpriv)
if err != nil {
t.Fatal(err)
}

scfg := &dtls.Config{
Certificates: []tls.Certificate{scert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384},
ClientAuth: dtls.RequireAnyClientCert,
}
ccfg := &dtls.Config{
Certificates: []tls.Certificate{ccert},
CipherSuites: []dtls.CipherSuiteID{dtls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384},
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 TestPionE2ESimple(t *testing.T) {
testPionE2ESimple(t, serverPion, clientPion)
}
Expand All @@ -584,10 +535,6 @@ 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)))
}
Expand All @@ -611,7 +558,3 @@ func TestPionE2ESimpleED25519ClientCertCID(t *testing.T) {
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)))
}
Loading

0 comments on commit ba62139

Please # to comment.