Add raw DTLS fingerprints

This commit is contained in:
theodorsm 2024-12-19 00:33:48 +01:00
parent fd9f08d986
commit 0976198523
6 changed files with 60 additions and 17 deletions

View file

@ -287,7 +287,17 @@ func (c *WebRTCPeer) preparePeerConnection(
s.SetNet(vnet)
if covertDTLSConfig.Mimic {
if covertDTLSConfig.Fingerprint != "" {
mimic := &mimicry.MimickedClientHello{}
err = mimic.LoadFingerprint(covertDTLSConfig.Fingerprint)
if err != nil {
log.Printf("NewPeerConnection ERROR: %s", err)
return err
}
profiles := utils.DefaultSRTPProtectionProfiles()
s.SetSRTPProtectionProfiles(profiles...)
s.SetDTLSClientHelloMessageHook(mimic.Hook)
} else if covertDTLSConfig.Mimic {
mimic := &mimicry.MimickedClientHello{}
if covertDTLSConfig.Randomize {
err = mimic.LoadRandomFingerprint()