mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 07:06:51 +08:00
Add replay protection setting to SettingEngine
Set windows size of each protocol by: - SetDTLSReplayProtectionWindow - SetSRTPReplayProtectionWindow - SetSRTCPReplayProtectionWindow
This commit is contained in:

committed by
Sean DuBois

parent
58338965b2
commit
438ac1eb2f
@@ -43,6 +43,11 @@ type SettingEngine struct {
|
||||
UsernameFragment string
|
||||
Password string
|
||||
}
|
||||
replayProtection struct {
|
||||
DTLS *uint
|
||||
SRTP *uint
|
||||
SRTCP *uint
|
||||
}
|
||||
answeringDTLSRole DTLSRole
|
||||
disableCertificateFingerprintVerification bool
|
||||
vnet *vnet.Net
|
||||
@@ -205,3 +210,18 @@ func (e *SettingEngine) SetICECredentials(usernameFragment, password string) {
|
||||
func (e *SettingEngine) DisableCertificateFingerprintVerification(isDisabled bool) {
|
||||
e.disableCertificateFingerprintVerification = isDisabled
|
||||
}
|
||||
|
||||
// SetDTLSReplayProtectionWindow sets a replay attack protection window size of DTLS connection.
|
||||
func (e *SettingEngine) SetDTLSReplayProtectionWindow(n uint) {
|
||||
e.replayProtection.DTLS = &n
|
||||
}
|
||||
|
||||
// SetSRTPReplayProtectionWindow sets a replay attack protection window size of SRTP session.
|
||||
func (e *SettingEngine) SetSRTPReplayProtectionWindow(n uint) {
|
||||
e.replayProtection.SRTP = &n
|
||||
}
|
||||
|
||||
// SetSRTCPReplayProtectionWindow sets a replay attack protection window size of SRTCP session.
|
||||
func (e *SettingEngine) SetSRTCPReplayProtectionWindow(n uint) {
|
||||
e.replayProtection.SRTCP = &n
|
||||
}
|
||||
|
Reference in New Issue
Block a user