@@ -22,6 +22,7 @@ import (
22
22
"testing"
23
23
"time"
24
24
25
+ "github.com/pion/dtls/v3"
25
26
"github.com/pion/ice/v4"
26
27
"github.com/pion/rtp"
27
28
"github.com/pion/transport/v3/test"
@@ -1638,3 +1639,27 @@ func TestPeerConnectionDeadlock(t *testing.T) {
1638
1639
1639
1640
closePairNow (t , pcOffer , pcAnswer )
1640
1641
}
1642
+
1643
+ // Assert that by default NULL Ciphers aren't enabled. Even if
1644
+ // the remote Peer Requests a NULL Cipher we should fail
1645
+ func TestPeerConnectionNoNULLCipherDefault (t * testing.T ) {
1646
+ settingEngine := SettingEngine {}
1647
+ settingEngine .SetSRTPProtectionProfiles (dtls .SRTP_NULL_HMAC_SHA1_80 , dtls .SRTP_NULL_HMAC_SHA1_32 )
1648
+ offerPC , err := NewAPI (WithSettingEngine (settingEngine )).NewPeerConnection (Configuration {})
1649
+ assert .NoError (t , err )
1650
+
1651
+ answerPC , err := NewPeerConnection (Configuration {})
1652
+ assert .NoError (t , err )
1653
+
1654
+ assert .NoError (t , signalPair (offerPC , answerPC ))
1655
+
1656
+ peerConnectionClosed := make (chan struct {})
1657
+ answerPC .OnConnectionStateChange (func (s PeerConnectionState ) {
1658
+ if s == PeerConnectionStateClosed {
1659
+ close (peerConnectionClosed )
1660
+ }
1661
+ })
1662
+
1663
+ <- peerConnectionClosed
1664
+ closePairNow (t , offerPC , answerPC )
1665
+ }
0 commit comments