Skip to content

Commit b7beaf2

Browse files
committed
Update module github.com/pion/ice/v3 to v3.0.13
1 parent 6a4a57a commit b7beaf2

File tree

8 files changed

+32
-11
lines changed

8 files changed

+32
-11
lines changed

certificate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"strings"
2121
"time"
2222

23-
"github.com/pion/dtls/v2/pkg/crypto/fingerprint"
23+
"github.com/pion/dtls/v3/pkg/crypto/fingerprint"
2424
"github.com/pion/webrtc/v4/pkg/rtcerr"
2525
)
2626

constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
package webrtc
55

6-
import "github.com/pion/dtls/v2"
6+
import "github.com/pion/dtls/v3"
77

88
const (
99
// Equal to UDP MTU

dtlstransport.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"sync/atomic"
2020
"time"
2121

22-
"github.com/pion/dtls/v2"
23-
"github.com/pion/dtls/v2/pkg/crypto/fingerprint"
22+
"github.com/pion/dtls/v3"
23+
"github.com/pion/dtls/v3/pkg/crypto/fingerprint"
2424
"github.com/pion/interceptor"
2525
"github.com/pion/logging"
2626
"github.com/pion/rtcp"
@@ -346,7 +346,6 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error {
346346
dtlsConfig.FlightInterval = t.api.settingEngine.dtls.retransmissionInterval
347347
dtlsConfig.InsecureSkipVerifyHello = t.api.settingEngine.dtls.insecureSkipHelloVerify
348348
dtlsConfig.EllipticCurves = t.api.settingEngine.dtls.ellipticCurves
349-
dtlsConfig.ConnectContextMaker = t.api.settingEngine.dtls.connectContextMaker
350349
dtlsConfig.ExtendedMasterSecret = t.api.settingEngine.dtls.extendedMasterSecret
351350
dtlsConfig.ClientCAs = t.api.settingEngine.dtls.clientCAs
352351
dtlsConfig.RootCAs = t.api.settingEngine.dtls.rootCAs
@@ -355,9 +354,16 @@ func (t *DTLSTransport) Start(remoteParameters DTLSParameters) error {
355354
// Connect as DTLS Client/Server, function is blocking and we
356355
// must not hold the DTLSTransport lock
357356
if role == DTLSRoleClient {
358-
dtlsConn, err = dtls.Client(dtlsEndpoint, dtlsConfig)
357+
dtlsConn, err = dtls.Client(dtlsEndpoint, dtlsEndpoint.RemoteAddr(), dtlsConfig)
359358
} else {
360-
dtlsConn, err = dtls.Server(dtlsEndpoint, dtlsConfig)
359+
dtlsConn, err = dtls.Server(dtlsEndpoint, dtlsEndpoint.RemoteAddr(), dtlsConfig)
360+
}
361+
362+
if t.api.settingEngine.dtls.connectContextMaker != nil {
363+
handshakeCtx, _ := t.api.settingEngine.dtls.connectContextMaker()
364+
err = dtlsConn.HandshakeContext(handshakeCtx)
365+
} else {
366+
err = dtlsConn.Handshake()
361367
}
362368

363369
// Re-take the lock, nothing beyond here is blocking

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.19
44

55
require (
66
github.com/pion/datachannel v1.5.8
7-
github.com/pion/dtls/v2 v2.2.12
7+
github.com/pion/dtls/v3 v3.0.0
88
github.com/pion/ice/v3 v3.0.13
99
github.com/pion/interceptor v0.1.29
1010
github.com/pion/logging v0.2.2
@@ -26,6 +26,7 @@ require (
2626
github.com/google/uuid v1.6.0 // indirect
2727
github.com/onsi/ginkgo v1.16.5 // indirect
2828
github.com/onsi/gomega v1.17.0 // indirect
29+
github.com/pion/dtls/v2 v2.2.12 // indirect
2930
github.com/pion/mdns/v2 v2.0.7 // indirect
3031
github.com/pion/transport/v2 v2.2.8 // indirect
3132
github.com/pion/turn/v3 v3.0.3 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ github.com/pion/datachannel v1.5.8/go.mod h1:PgmdpoaNBLX9HNzNClmdki4DYW5JtI7Yibu
4040
github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s=
4141
github.com/pion/dtls/v2 v2.2.12 h1:KP7H5/c1EiVAAKUmXyCzPiQe5+bCJrpOeKg/L05dunk=
4242
github.com/pion/dtls/v2 v2.2.12/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE=
43+
github.com/pion/dtls/v3 v3.0.0 h1:m2hzwPkzqoBjVKXm5ymNuX01OAjht82TdFL6LoTzgi4=
44+
github.com/pion/dtls/v3 v3.0.0/go.mod h1:tiX7NaneB0wNoRaUpaMVP7igAlkMCTQkbpiY+OfeIi0=
4345
github.com/pion/ice/v3 v3.0.13 h1:tPi5fh2xbWhS0DBcs7LTEG0SOUTHLVDjTlFwBy3hXfw=
4446
github.com/pion/ice/v3 v3.0.13/go.mod h1:q2M/RnfpgGhC4HcluxPpD1wImaqFqU0Z1PE2eeOPrIs=
4547
github.com/pion/interceptor v0.1.29 h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M=

internal/mux/endpoint.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ func (e *Endpoint) Read(p []byte) (int, error) {
4444
return e.buffer.Read(p)
4545
}
4646

47+
// ReadFrom reads a packet of len(p) bytes from the underlying conn
48+
// that are matched by the associated MuxFunc
49+
func (e *Endpoint) ReadFrom(p []byte) (int, net.Addr, error) {
50+
i, err := e.Read(p)
51+
return i, nil, err
52+
}
53+
4754
// Write writes len(p) bytes to the underlying conn
4855
func (e *Endpoint) Write(p []byte) (int, error) {
4956
n, err := e.mux.nextConn.Write(p)
@@ -56,6 +63,11 @@ func (e *Endpoint) Write(p []byte) (int, error) {
5663
return n, err
5764
}
5865

66+
// WriteTo writes len(p) bytes to the underlying conn
67+
func (e *Endpoint) WriteTo(p []byte, _ net.Addr) (int, error) {
68+
return e.Write(p)
69+
}
70+
5971
// LocalAddr is a stub
6072
func (e *Endpoint) LocalAddr() net.Addr {
6173
return e.mux.nextConn.LocalAddr()

settingengine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"net"
1414
"time"
1515

16-
"github.com/pion/dtls/v2"
17-
dtlsElliptic "github.com/pion/dtls/v2/pkg/crypto/elliptic"
16+
"github.com/pion/dtls/v3"
17+
dtlsElliptic "github.com/pion/dtls/v3/pkg/crypto/elliptic"
1818
"github.com/pion/ice/v3"
1919
"github.com/pion/logging"
2020
"github.com/pion/stun/v2"

settingengine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"testing"
1313
"time"
1414

15-
"github.com/pion/dtls/v2/pkg/crypto/elliptic"
15+
"github.com/pion/dtls/v3/pkg/crypto/elliptic"
1616
"github.com/pion/ice/v3"
1717
"github.com/pion/stun/v2"
1818
"github.com/pion/transport/v3/test"

0 commit comments

Comments
 (0)