Index: webrtc/pc/srtpfilter.h |
diff --git a/webrtc/pc/srtpfilter.h b/webrtc/pc/srtpfilter.h |
index 06edddf80d97a4e6d1a8274c4710cb94c11fc4a6..a4605ed9eac0118f263f5cea1511598a67590fb3 100644 |
--- a/webrtc/pc/srtpfilter.h |
+++ b/webrtc/pc/srtpfilter.h |
@@ -108,6 +108,15 @@ class SrtpFilter { |
bool UnprotectRtp(void* data, int in_len, int* out_len); |
bool UnprotectRtcp(void* data, int in_len, int* out_len); |
+ // A SRTP filter supports external creation of the auth tag if a non-GCM |
+ // cipher is used. This method is only valid after the RTP params have |
+ // been set. |
+ bool AllowExternalAuth(); |
+ |
+ // Force-disable support for external auth tag creation. This is required |
+ // for some tests. |
+ void DisableAllowExternalAuthForTests(bool disable_allow_external_auth); |
+ |
// Returns rtp auth params from srtp context. |
bool GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len); |
@@ -164,6 +173,7 @@ class SrtpFilter { |
}; |
State state_; |
int signal_silent_time_in_ms_; |
+ bool force_disable_allow_external_auth_ = false; |
std::vector<CryptoParams> offer_params_; |
std::unique_ptr<SrtpSession> send_session_; |
std::unique_ptr<SrtpSession> recv_session_; |
@@ -201,6 +211,10 @@ class SrtpSession { |
bool UnprotectRtp(void* data, int in_len, int* out_len); |
bool UnprotectRtcp(void* data, int in_len, int* out_len); |
+ bool AllowExternalAuth(); |
+ |
+ void DisableAllowExternalAuthForTests(bool disable_allow_external_auth); |
+ |
// Helper method to get authentication params. |
bool GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len); |
@@ -225,13 +239,15 @@ class SrtpSession { |
static void HandleEventThunk(srtp_event_data_t* ev); |
rtc::ThreadChecker thread_checker_; |
- srtp_ctx_t_* session_; |
- int rtp_auth_tag_len_; |
- int rtcp_auth_tag_len_; |
+ srtp_ctx_t_* session_ = nullptr; |
+ int rtp_auth_tag_len_ = 0; |
+ int rtcp_auth_tag_len_ = 0; |
std::unique_ptr<SrtpStat> srtp_stat_; |
static bool inited_; |
static rtc::GlobalLockPod lock_; |
- int last_send_seq_num_; |
+ int last_send_seq_num_ = -1; |
+ bool allow_external_auth_ = false; |
+ bool force_disable_allow_external_auth_ = false; |
RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession); |
}; |