Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: webrtc/pc/srtpfilter.h

Issue 2722423003: Improve testing of SRTP external auth code paths. (Closed)
Patch Set: Changes based on feedback from Taylor. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/pc/externalhmac.cc ('k') | webrtc/pc/srtpfilter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/srtpfilter.h
diff --git a/webrtc/pc/srtpfilter.h b/webrtc/pc/srtpfilter.h
index 46b9dea19f38400abdb38f56cabc2eeece1197fb..3df787646c740eb819f93986e697de0daabf1237 100644
--- a/webrtc/pc/srtpfilter.h
+++ b/webrtc/pc/srtpfilter.h
@@ -114,12 +114,18 @@ class SrtpFilter {
// Returns srtp overhead for rtp packets.
bool GetSrtpOverhead(int* srtp_overhead) const;
-#if defined(ENABLE_EXTERNAL_AUTH)
+ // If external auth is enabled, SRTP will write a dummy auth tag that then
+ // later must get replaced before the packet is sent out. Only supported for
+ // non-GCM cipher suites and can be checked through "IsExternalAuthActive"
+ // if it is actually used. This method is only valid before the RTP params
+ // have been set.
+ void EnableExternalAuth();
+ bool IsExternalAuthEnabled() const;
+
// 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 IsExternalAuthActive() const;
-#endif
// Update the silent threshold (in ms) for signaling errors.
void set_signal_silent_time(int signal_silent_time_in_ms);
@@ -169,8 +175,9 @@ class SrtpFilter {
// ST_INIT.
ST_RECEIVEDPRANSWER
};
- State state_;
- int signal_silent_time_in_ms_;
+ State state_ = ST_INIT;
+ int signal_silent_time_in_ms_ = 0;
+ bool external_auth_enabled_ = false;
std::vector<CryptoParams> offer_params_;
std::unique_ptr<SrtpSession> send_session_;
std::unique_ptr<SrtpSession> recv_session_;
@@ -213,12 +220,18 @@ class SrtpSession {
int GetSrtpOverhead() const;
-#if defined(ENABLE_EXTERNAL_AUTH)
+ // If external auth is enabled, SRTP will write a dummy auth tag that then
+ // later must get replaced before the packet is sent out. Only supported for
+ // non-GCM cipher suites and can be checked through "IsExternalAuthActive"
+ // if it is actually used. This method is only valid before the RTP params
+ // have been set.
+ void EnableExternalAuth();
+ bool IsExternalAuthEnabled() const;
+
// A SRTP session 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 IsExternalAuthActive() const;
-#endif
// Update the silent threshold (in ms) for signaling errors.
void set_signal_silent_time(int signal_silent_time_in_ms);
@@ -246,9 +259,8 @@ class SrtpSession {
static bool inited_;
static rtc::GlobalLockPod lock_;
int last_send_seq_num_ = -1;
-#if defined(ENABLE_EXTERNAL_AUTH)
bool external_auth_active_ = false;
-#endif
+ bool external_auth_enabled_ = false;
RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession);
};
« no previous file with comments | « webrtc/pc/externalhmac.cc ('k') | webrtc/pc/srtpfilter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698