Add replay protection setting to SettingEngine

Set windows size of each protocol by:
- SetDTLSReplayProtectionWindow
- SetSRTPReplayProtectionWindow
- SetSRTCPReplayProtectionWindow
This commit is contained in:
Atsushi Watanabe
2020-03-29 19:20:17 +09:00
committed by Sean DuBois
parent 58338965b2
commit 438ac1eb2f
3 changed files with 63 additions and 0 deletions

View File

@@ -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
}