Use SRTP profiles exported from covert-dtls

This commit is contained in:
theodorsm 2024-12-15 22:15:05 +01:00
parent e5d13b9b95
commit 8caebb484d
4 changed files with 9 additions and 20 deletions

View file

@ -18,6 +18,7 @@ import (
"github.com/pion/webrtc/v4"
"github.com/theodorsm/covert-dtls/pkg/mimicry"
"github.com/theodorsm/covert-dtls/pkg/randomize"
"github.com/theodorsm/covert-dtls/pkg/utils"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/event"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/proxy"
@ -256,14 +257,7 @@ func (c *WebRTCPeer) preparePeerConnection(
s.SetDTLSClientHelloMessageHook(rand.Hook)
} else if dtlsMimic {
mimic := &mimicry.MimickedClientHello{}
profiles := []dtls.SRTPProtectionProfile{
dtls.SRTP_AES128_CM_HMAC_SHA1_80,
dtls.SRTP_AES128_CM_HMAC_SHA1_32,
dtls.SRTP_AEAD_AES_128_GCM,
dtls.SRTP_AEAD_AES_256_GCM,
dtls.SRTP_AES256_CM_SHA1_32,
dtls.SRTP_AES256_CM_SHA1_80,
}
profiles := utils.DefaultSRTPProtectionProfiles()
s.SetSRTPProtectionProfiles(profiles...)
s.SetDTLSClientHelloMessageHook(mimic.Hook)
}