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

Unified Diff: webrtc/pc/srtpfilter.h

Issue 2761143002: Support encrypted RTP extensions (RFC 6904) (Closed)
Patch Set: Updated comment. Created 3 years, 8 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
Index: webrtc/pc/srtpfilter.h
diff --git a/webrtc/pc/srtpfilter.h b/webrtc/pc/srtpfilter.h
index 3df787646c740eb819f93986e697de0daabf1237..db02fffe6f08d8e0cf9cae6e8bba2566586c7fc5 100644
--- a/webrtc/pc/srtpfilter.h
+++ b/webrtc/pc/srtpfilter.h
@@ -78,6 +78,10 @@ class SrtpFilter {
bool SetAnswer(const std::vector<CryptoParams>& answer_params,
ContentSource source);
+ // Set the header extension ids that should be encrypted for the given source.
+ void SetEncryptedHeaderExtensionIds(ContentSource source,
+ const std::vector<int>& extension_ids);
+
// Just set up both sets of keys directly.
// Used with DTLS-SRTP.
bool SetRtpParams(int send_cs,
@@ -86,6 +90,12 @@ class SrtpFilter {
int recv_cs,
const uint8_t* recv_key,
int recv_key_len);
+ bool UpdateRtpParams(int send_cs,
+ const uint8_t* send_key,
+ int send_key_len,
+ int recv_cs,
+ const uint8_t* recv_key,
+ int recv_key_len);
bool SetRtcpParams(int send_cs,
const uint8_t* send_key,
int send_key_len,
@@ -185,6 +195,8 @@ class SrtpFilter {
std::unique_ptr<SrtpSession> recv_rtcp_session_;
CryptoParams applied_send_params_;
CryptoParams applied_recv_params_;
+ std::vector<int> send_encrypted_header_extension_ids_;
+ std::vector<int> recv_encrypted_header_extension_ids_;
};
// Class that wraps a libSRTP session.
@@ -196,9 +208,15 @@ class SrtpSession {
// Configures the session for sending data using the specified
// cipher-suite and key. Receiving must be done by a separate session.
bool SetSend(int cs, const uint8_t* key, size_t len);
+ bool UpdateSend(int cs, const uint8_t* key, size_t len);
+
// Configures the session for receiving data using the specified
// cipher-suite and key. Sending must be done by a separate session.
bool SetRecv(int cs, const uint8_t* key, size_t len);
+ bool UpdateRecv(int cs, const uint8_t* key, size_t len);
+
+ void SetEncryptedHeaderExtensionIds(
+ const std::vector<int>& encrypted_header_extension_ids);
// Encrypts/signs an individual RTP/RTCP packet, in-place.
// If an HMAC is used, this will increase the packet size.
@@ -243,7 +261,11 @@ class SrtpSession {
SignalSrtpError;
private:
+ bool DoSetKey(int type, int cs, const uint8_t* key, size_t len);
bool SetKey(int type, int cs, const uint8_t* key, size_t len);
+ bool UpdateKey(int type, int cs, const uint8_t* key, size_t len);
+ bool SetEncryptedHeaderExtensionIds(int type,
+ const std::vector<int>& encrypted_header_extension_ids);
// Returns send stream current packet index from srtp db.
bool GetSendStreamPacketIndex(void* data, int in_len, int64_t* index);
@@ -261,6 +283,7 @@ class SrtpSession {
int last_send_seq_num_ = -1;
bool external_auth_active_ = false;
bool external_auth_enabled_ = false;
+ std::vector<int> encrypted_header_extension_ids_;
RTC_DISALLOW_COPY_AND_ASSIGN(SrtpSession);
};

Powered by Google App Engine
This is Rietveld 408576698