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

Unified Diff: webrtc/pc/srtpfilter.cc

Issue 2958123002: Support getting external HMAC auth context with libsrtp 2.1.0. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/srtpfilter.cc
diff --git a/webrtc/pc/srtpfilter.cc b/webrtc/pc/srtpfilter.cc
index 549410510311650f302facf75876e67c21988bd3..fa310afdf6a1c0cca24aa42e804389fcaf0736f3 100644
--- a/webrtc/pc/srtpfilter.cc
+++ b/webrtc/pc/srtpfilter.cc
@@ -565,10 +565,21 @@ bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {
// stream_template will be the reference context for other streams.
// Let's use it for getting the keys.
srtp_stream_ctx_t* srtp_context = session_->stream_template;
+#if defined(SRTP_MAX_MKI_LEN)
joachim 2017/06/27 21:15:16 The #define has been introduced in libsrtp 2.1.0
+ // libsrtp 2.1.0
+ if (srtp_context && srtp_context->session_keys &&
+ srtp_context->session_keys->rtp_auth) {
+ external_hmac = reinterpret_cast<ExternalHmacContext*>(
+ srtp_context->session_keys->rtp_auth->state);
+ }
+#else
+ // libsrtp 2.0.0
+ // TODO(jbauch): Remove after switching to libsrtp 2.1.0
if (srtp_context && srtp_context->rtp_auth) {
external_hmac = reinterpret_cast<ExternalHmacContext*>(
srtp_context->rtp_auth->state);
}
+#endif
if (!external_hmac) {
LOG(LS_ERROR) << "Failed to get auth keys from libsrtp!.";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698