diff --git a/api/crypto/crypto_options.h b/api/crypto/crypto_options.h index 83189aa317..a937490787 100644 --- a/api/crypto/crypto_options.h +++ b/api/crypto/crypto_options.h @@ -53,9 +53,10 @@ struct RTC_EXPORT CryptoOptions { // purposes. bool enable_aes128_sha1_80_crypto_cipher = true; - // If set to true, encrypted RTP header extensions as defined in RFC 6904 - // will be negotiated. They will only be used if both peers support them. - bool enable_encrypted_rtp_header_extensions = false; + // This feature enables encrypting RTP header extensions using RFC 6904, if + // requested. For this to work the Chromium field trial + // `kWebRtcEncryptedRtpHeaderExtensions` must be enabled. + bool enable_encrypted_rtp_header_extensions = true; } srtp; // Options to be used when the FrameEncryptor / FrameDecryptor APIs are used. diff --git a/pc/media_session.h b/pc/media_session.h index 5e7306a976..83f35f88ae 100644 --- a/pc/media_session.h +++ b/pc/media_session.h @@ -318,7 +318,7 @@ class MediaSessionDescriptionFactory { // This object may or may not be owned by this class. webrtc::AlwaysValidPointer const ssrc_generator_; - bool enable_encrypted_rtp_header_extensions_ = false; + bool enable_encrypted_rtp_header_extensions_ = true; const TransportDescriptionFactory* transport_desc_factory_; // Payoad type tracker interface. Must live longer than this object. webrtc::PayloadTypeSuggester* pt_suggester_; diff --git a/pc/media_session_unittest.cc b/pc/media_session_unittest.cc index 3a157520a3..e28aa86288 100644 --- a/pc/media_session_unittest.cc +++ b/pc/media_session_unittest.cc @@ -2197,11 +2197,11 @@ TEST_F(MediaSessionDescriptionFactoryTest, } TEST_F(MediaSessionDescriptionFactoryTest, - TestOfferAnswerWithEncryptedRtpExtensionHeadersEnabledInOffer) { + NegotiationWithEncryptedRtpExtensionHeadersDisabledInReceiver) { MediaSessionOptions opts; AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts); - f1_.set_enable_encrypted_rtp_header_extensions(true); + f2_.set_enable_encrypted_rtp_header_extensions(false); SetAudioVideoRtpHeaderExtensions(MAKE_VECTOR(kAudioRtpExtensionEncrypted1), MAKE_VECTOR(kVideoRtpExtensionEncrypted1), @@ -2230,11 +2230,11 @@ TEST_F(MediaSessionDescriptionFactoryTest, } TEST_F(MediaSessionDescriptionFactoryTest, - TestOfferAnswerWithEncryptedRtpExtensionHeadersEnabledInReceiver) { + NegotiationWithEncryptedRtpExtensionHeadersDisabledInSender) { MediaSessionOptions opts; AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts); - f2_.set_enable_encrypted_rtp_header_extensions(true); + f1_.set_enable_encrypted_rtp_header_extensions(false); SetAudioVideoRtpHeaderExtensions(MAKE_VECTOR(kAudioRtpExtensionEncrypted1), MAKE_VECTOR(kVideoRtpExtensionEncrypted1), @@ -2263,13 +2263,10 @@ TEST_F(MediaSessionDescriptionFactoryTest, } TEST_F(MediaSessionDescriptionFactoryTest, - TestOfferAnswerPreferEncryptedRtpHeaderExtensionsWhenEncryptionEnabled) { + PreferEncryptedRtpHeaderExtensionsWhenEncryptionEnabled) { MediaSessionOptions opts; AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts); - f1_.set_enable_encrypted_rtp_header_extensions(true); - f2_.set_enable_encrypted_rtp_header_extensions(true); - SetAudioVideoRtpHeaderExtensions( MAKE_VECTOR(kAudioRtpExtensionMixedEncryption1), MAKE_VECTOR(kVideoRtpExtensionMixedEncryption), &opts); @@ -2300,10 +2297,13 @@ TEST_F(MediaSessionDescriptionFactoryTest, } TEST_F(MediaSessionDescriptionFactoryTest, - TestOfferAnswerUseUnencryptedRtpHeaderExtensionsWhenEncryptionDisabled) { + UseUnencryptedRtpHeaderExtensionsWhenEncryptionDisabled) { MediaSessionOptions opts; AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts); + f1_.set_enable_encrypted_rtp_header_extensions(false); + f2_.set_enable_encrypted_rtp_header_extensions(false); + SetAudioVideoRtpHeaderExtensions( MAKE_VECTOR(kAudioRtpExtensionMixedEncryption1), MAKE_VECTOR(kVideoRtpExtensionMixedEncryption), &opts);