Enable negotiation of encrypted headers by default.

The negotiation of encrypted header extensions has already been enabled in Chromium, https://chromium-review.googlesource.com/c/chromium/src/+/5933829. Hence, it make sense to enable the encryption of header extensions by default also in webRTC environment so that all the tests run by taking this into considiration when new changes are made.

Bug: webrtc:358039777
Change-Id: I141fac01b0eb0f2ce5a0a365736f0dcf9f21ddcd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366420
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43573}
This commit is contained in:
Emil Vardar 2024-11-28 09:24:13 +00:00 committed by WebRTC LUCI CQ
parent 5a4b06f6e8
commit 78ab1cf39c
3 changed files with 14 additions and 13 deletions

View File

@ -53,9 +53,10 @@ struct RTC_EXPORT CryptoOptions {
// purposes. // purposes.
bool enable_aes128_sha1_80_crypto_cipher = true; bool enable_aes128_sha1_80_crypto_cipher = true;
// If set to true, encrypted RTP header extensions as defined in RFC 6904 // This feature enables encrypting RTP header extensions using RFC 6904, if
// will be negotiated. They will only be used if both peers support them. // requested. For this to work the Chromium field trial
bool enable_encrypted_rtp_header_extensions = false; // `kWebRtcEncryptedRtpHeaderExtensions` must be enabled.
bool enable_encrypted_rtp_header_extensions = true;
} srtp; } srtp;
// Options to be used when the FrameEncryptor / FrameDecryptor APIs are used. // Options to be used when the FrameEncryptor / FrameDecryptor APIs are used.

View File

@ -318,7 +318,7 @@ class MediaSessionDescriptionFactory {
// This object may or may not be owned by this class. // This object may or may not be owned by this class.
webrtc::AlwaysValidPointer<rtc::UniqueRandomIdGenerator> const webrtc::AlwaysValidPointer<rtc::UniqueRandomIdGenerator> const
ssrc_generator_; ssrc_generator_;
bool enable_encrypted_rtp_header_extensions_ = false; bool enable_encrypted_rtp_header_extensions_ = true;
const TransportDescriptionFactory* transport_desc_factory_; const TransportDescriptionFactory* transport_desc_factory_;
// Payoad type tracker interface. Must live longer than this object. // Payoad type tracker interface. Must live longer than this object.
webrtc::PayloadTypeSuggester* pt_suggester_; webrtc::PayloadTypeSuggester* pt_suggester_;

View File

@ -2197,11 +2197,11 @@ TEST_F(MediaSessionDescriptionFactoryTest,
} }
TEST_F(MediaSessionDescriptionFactoryTest, TEST_F(MediaSessionDescriptionFactoryTest,
TestOfferAnswerWithEncryptedRtpExtensionHeadersEnabledInOffer) { NegotiationWithEncryptedRtpExtensionHeadersDisabledInReceiver) {
MediaSessionOptions opts; MediaSessionOptions opts;
AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &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), SetAudioVideoRtpHeaderExtensions(MAKE_VECTOR(kAudioRtpExtensionEncrypted1),
MAKE_VECTOR(kVideoRtpExtensionEncrypted1), MAKE_VECTOR(kVideoRtpExtensionEncrypted1),
@ -2230,11 +2230,11 @@ TEST_F(MediaSessionDescriptionFactoryTest,
} }
TEST_F(MediaSessionDescriptionFactoryTest, TEST_F(MediaSessionDescriptionFactoryTest,
TestOfferAnswerWithEncryptedRtpExtensionHeadersEnabledInReceiver) { NegotiationWithEncryptedRtpExtensionHeadersDisabledInSender) {
MediaSessionOptions opts; MediaSessionOptions opts;
AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &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), SetAudioVideoRtpHeaderExtensions(MAKE_VECTOR(kAudioRtpExtensionEncrypted1),
MAKE_VECTOR(kVideoRtpExtensionEncrypted1), MAKE_VECTOR(kVideoRtpExtensionEncrypted1),
@ -2263,13 +2263,10 @@ TEST_F(MediaSessionDescriptionFactoryTest,
} }
TEST_F(MediaSessionDescriptionFactoryTest, TEST_F(MediaSessionDescriptionFactoryTest,
TestOfferAnswerPreferEncryptedRtpHeaderExtensionsWhenEncryptionEnabled) { PreferEncryptedRtpHeaderExtensionsWhenEncryptionEnabled) {
MediaSessionOptions opts; MediaSessionOptions opts;
AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts); AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
f1_.set_enable_encrypted_rtp_header_extensions(true);
f2_.set_enable_encrypted_rtp_header_extensions(true);
SetAudioVideoRtpHeaderExtensions( SetAudioVideoRtpHeaderExtensions(
MAKE_VECTOR(kAudioRtpExtensionMixedEncryption1), MAKE_VECTOR(kAudioRtpExtensionMixedEncryption1),
MAKE_VECTOR(kVideoRtpExtensionMixedEncryption), &opts); MAKE_VECTOR(kVideoRtpExtensionMixedEncryption), &opts);
@ -2300,10 +2297,13 @@ TEST_F(MediaSessionDescriptionFactoryTest,
} }
TEST_F(MediaSessionDescriptionFactoryTest, TEST_F(MediaSessionDescriptionFactoryTest,
TestOfferAnswerUseUnencryptedRtpHeaderExtensionsWhenEncryptionDisabled) { UseUnencryptedRtpHeaderExtensionsWhenEncryptionDisabled) {
MediaSessionOptions opts; MediaSessionOptions opts;
AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts); AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
f1_.set_enable_encrypted_rtp_header_extensions(false);
f2_.set_enable_encrypted_rtp_header_extensions(false);
SetAudioVideoRtpHeaderExtensions( SetAudioVideoRtpHeaderExtensions(
MAKE_VECTOR(kAudioRtpExtensionMixedEncryption1), MAKE_VECTOR(kAudioRtpExtensionMixedEncryption1),
MAKE_VECTOR(kVideoRtpExtensionMixedEncryption), &opts); MAKE_VECTOR(kVideoRtpExtensionMixedEncryption), &opts);