tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit b6661b911035f287e0874997150c02a02912b933
parent 85808e7dd9cd1f31898d2aaf2f354c014f93b048
Author: Dan Baker <dbaker@mozilla.com>
Date:   Thu, 23 Oct 2025 16:29:03 -0600

Bug 1995393 - Vendor libwebrtc from c6c628c298

We already cherry-picked this when we vendored 847fe79059.

Upstream commit: https://webrtc.googlesource.com/src/+/c6c628c29842e3b2d01d2920159bafed9edc3fe5
    sdp munging: do not misdetect rtp attributes on datachannel

    rtcp-mux and rtcp-rsize are unconditionally set for datachannel
    but since they are not serialized in the SDP they are not parsed.
    This leads the munging detector to misclassify this.

    a unit test is added as a separate CL for easier backmerging.

    Bug: webrtc:414284082
    Change-Id: I4ebb2ad5062ea42fc47a314ed929de42f91bbea7
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404740
    Commit-Queue: Philipp Hancke <phancke@meta.com>
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45357}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Dthird_party/libwebrtc/moz-patch-stack/c6c628c298.no-op-cherry-pick-msg | 1-
Mthird_party/libwebrtc/moz-patch-stack/p0001.patch | 135++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
Dthird_party/libwebrtc/moz-patch-stack/p0002.patch | 109-------------------------------------------------------------------------------
4 files changed, 102 insertions(+), 147 deletions(-)

diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T22:26:24.753434+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T22:28:52.169115+00:00. # base of lastest vendoring -030e116097 +c6c628c298 diff --git a/third_party/libwebrtc/moz-patch-stack/c6c628c298.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/c6c628c298.no-op-cherry-pick-msg @@ -1 +0,0 @@ -We already cherry-picked this when we vendored 847fe79059. diff --git a/third_party/libwebrtc/moz-patch-stack/p0001.patch b/third_party/libwebrtc/moz-patch-stack/p0001.patch @@ -1,44 +1,109 @@ -From: Philipp Hancke <phancke@meta.com> -Date: Sat, 16 Aug 2025 12:15:50 -0700 -Subject: (cherry-pick-branch-heads/7339) [M140] sdp munging: do not misdetect - rtp attributes on datachannel +From: Jonas Oreland <jonaso@webrtc.org> +Date: Tue, 26 Aug 2025 15:57:29 +0200 +Subject: (cherry-pick-branch-heads/7339) [M140] DTLS1.3: Fix missing + retransmission due to failure to set timer. -rtcp-mux and rtcp-rsize are unconditionally set for datachannel -but since they are not serialized in the SDP they are not parsed. -This leads the munging detector to misclassify this. +DTLS 1.3 considers itself connected earlier than DTLS 1.2 did - when +second flight reaches the client. This CL fixes a bug that when +client is connected (state_ != SSL_CONNECTING), it would not +continue retransmitting. Continuous retransmission is needed +when the third flight is lost multiple times. Or really anytime that DTLS request it :) -a unit test is added as a separate CL for easier backmerging. +This fixes the TODO in dtls_ice_integrationtest.cc in which dtls1.3 +spuriously failed with certain (packet loss intensive) configurations. -(cherry picked from commit 602b06b1125ea4d107fbfbda7d314b4157c4c74b) +CREDITS: sergeysu@ that found and fixed the problem! -Bug: webrtc:414284082,chromium:40567530 -Fixed: chromium:439807581 -Change-Id: I4ebb2ad5062ea42fc47a314ed929de42f91bbea7 -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404740 -Commit-Queue: Philipp Hancke <phancke@meta.com> +(cherry picked from commit 4221e1bc2fc360448c1663f0bbae058ff9f65a48) + +No-Try: true +Bug: chromium:441245658, chromium:441486101 +Change-Id: I3302f6f384d7e4cda090184094a6fadaf7e4f129 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/406320 +Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> -Cr-Original-Commit-Position: refs/heads/main@{#45357} -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/405281 -Cr-Commit-Position: refs/branch-heads/7339@{#1} +Commit-Queue: Jonas Oreland <jonaso@webrtc.org> +Cr-Original-Commit-Position: refs/heads/main@{#45439} +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407780 +Commit-Queue: Guido Urdaneta <guidou@webrtc.org> +Cr-Commit-Position: refs/branch-heads/7339@{#2} Cr-Branched-From: 9bd64751d9b3b35a820cb72c9029993e218146a1-refs/heads/main@{#45270} --- - pc/sdp_munging_detector.cc | 6 ++++++ - 1 file changed, 6 insertions(+) + p2p/dtls/dtls_ice_integrationtest.cc | 6 +----- + rtc_base/openssl_stream_adapter.cc | 15 ++++++++++++--- + rtc_base/openssl_stream_adapter.h | 2 ++ + 3 files changed, 15 insertions(+), 8 deletions(-) -diff --git a/pc/sdp_munging_detector.cc b/pc/sdp_munging_detector.cc -index 04f0d53fd0..88f38da30d 100644 ---- a/pc/sdp_munging_detector.cc -+++ b/pc/sdp_munging_detector.cc -@@ -427,6 +427,12 @@ SdpMungingType DetermineSdpMungingType( +diff --git a/p2p/dtls/dtls_ice_integrationtest.cc b/p2p/dtls/dtls_ice_integrationtest.cc +index 339238d664..1610f0002a 100644 +--- a/p2p/dtls/dtls_ice_integrationtest.cc ++++ b/p2p/dtls/dtls_ice_integrationtest.cc +@@ -127,11 +127,7 @@ class DtlsIceIntegrationTest : public ::testing::TestWithParam<std::tuple< + + BuiltInNetworkBehaviorConfig networkBehavior; + networkBehavior.link_capacity = DataRate::KilobitsPerSec(220); +- // TODO (webrtc:383141571) : Investigate why this testcase fails for +- // DTLS 1.3 delay if networkBehavior.queue_delay_ms = 100ms. +- // - unless both peers support dtls in stun, in which case it passes. +- // - note: only for dtls1.3, it works for dtls1.2! +- networkBehavior.queue_delay_ms = 50; ++ networkBehavior.queue_delay_ms = 100; + networkBehavior.queue_length_packets = 30; + networkBehavior.loss_percent = 50; + +diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc +index 50be6b5c26..8c952cd3a2 100644 +--- a/rtc_base/openssl_stream_adapter.cc ++++ b/rtc_base/openssl_stream_adapter.cc +@@ -852,10 +852,15 @@ void OpenSSLStreamAdapter::SetTimeout(int delay_ms) { + // We check the timer even after SSL_CONNECTED, + // but ContinueSSL() is only needed when SSL_CONNECTING + if (state_ == SSL_CONNECTING) { ++ // Note: timeout is set inside ContinueSSL() + ContinueSSL(); ++ } else if (state_ == SSL_CONNECTED) { ++ MaybeSetTimeout(); ++ } else { ++ RTC_DCHECK_NOTREACHED() << "state_: " << state_; + } + } else { +- RTC_DCHECK_NOTREACHED(); ++ RTC_DCHECK_NOTREACHED() << "flag->alive() == false"; + } + // This callback will never run again (stopped above). + return TimeDelta::PlusInfinity(); +@@ -970,6 +975,12 @@ int OpenSSLStreamAdapter::ContinueSSL() { + } + } + ++ MaybeSetTimeout(); ++ ++ return 0; ++} ++ ++void OpenSSLStreamAdapter::MaybeSetTimeout() { + if (ssl_ != nullptr) { + struct timeval timeout; + if (DTLSv1_get_timeout(ssl_, &timeout)) { +@@ -977,8 +988,6 @@ int OpenSSLStreamAdapter::ContinueSSL() { + SetTimeout(delay); } - // Validate video and audio contents. - MediaType media_type = last_created_media_description->type(); -+ bool is_rtp = -+ media_type == MediaType::AUDIO || media_type == MediaType::VIDEO; -+ if (!is_rtp) { -+ // The checks that follow only apply for RTP-based contents. -+ continue; -+ } - if (media_type == MediaType::VIDEO) { - type = DetermineVideoSdpMungingType(last_created_media_description, - media_description_to_set); + } +- +- return 0; + } + + void OpenSSLStreamAdapter::Error(absl::string_view context, +diff --git a/rtc_base/openssl_stream_adapter.h b/rtc_base/openssl_stream_adapter.h +index 856d37c156..c10e93e3d4 100644 +--- a/rtc_base/openssl_stream_adapter.h ++++ b/rtc_base/openssl_stream_adapter.h +@@ -210,6 +210,8 @@ class OpenSSLStreamAdapter final : public SSLStreamAdapter { + !peer_certificate_digest_value_.empty(); + } + ++ void MaybeSetTimeout(); ++ + const std::unique_ptr<StreamInterface> stream_; + absl::AnyInvocable<void(SSLHandshakeError)> handshake_error_; + diff --git a/third_party/libwebrtc/moz-patch-stack/p0002.patch b/third_party/libwebrtc/moz-patch-stack/p0002.patch @@ -1,109 +0,0 @@ -From: Jonas Oreland <jonaso@webrtc.org> -Date: Tue, 26 Aug 2025 15:57:29 +0200 -Subject: (cherry-pick-branch-heads/7339) [M140] DTLS1.3: Fix missing - retransmission due to failure to set timer. - -DTLS 1.3 considers itself connected earlier than DTLS 1.2 did - when -second flight reaches the client. This CL fixes a bug that when -client is connected (state_ != SSL_CONNECTING), it would not -continue retransmitting. Continuous retransmission is needed -when the third flight is lost multiple times. Or really anytime that DTLS request it :) - -This fixes the TODO in dtls_ice_integrationtest.cc in which dtls1.3 -spuriously failed with certain (packet loss intensive) configurations. - -CREDITS: sergeysu@ that found and fixed the problem! - -(cherry picked from commit 4221e1bc2fc360448c1663f0bbae058ff9f65a48) - -No-Try: true -Bug: chromium:441245658, chromium:441486101 -Change-Id: I3302f6f384d7e4cda090184094a6fadaf7e4f129 -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/406320 -Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> -Reviewed-by: Harald Alvestrand <hta@webrtc.org> -Commit-Queue: Jonas Oreland <jonaso@webrtc.org> -Cr-Original-Commit-Position: refs/heads/main@{#45439} -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407780 -Commit-Queue: Guido Urdaneta <guidou@webrtc.org> -Cr-Commit-Position: refs/branch-heads/7339@{#2} -Cr-Branched-From: 9bd64751d9b3b35a820cb72c9029993e218146a1-refs/heads/main@{#45270} ---- - p2p/dtls/dtls_ice_integrationtest.cc | 6 +----- - rtc_base/openssl_stream_adapter.cc | 15 ++++++++++++--- - rtc_base/openssl_stream_adapter.h | 2 ++ - 3 files changed, 15 insertions(+), 8 deletions(-) - -diff --git a/p2p/dtls/dtls_ice_integrationtest.cc b/p2p/dtls/dtls_ice_integrationtest.cc -index 339238d664..1610f0002a 100644 ---- a/p2p/dtls/dtls_ice_integrationtest.cc -+++ b/p2p/dtls/dtls_ice_integrationtest.cc -@@ -127,11 +127,7 @@ class DtlsIceIntegrationTest : public ::testing::TestWithParam<std::tuple< - - BuiltInNetworkBehaviorConfig networkBehavior; - networkBehavior.link_capacity = DataRate::KilobitsPerSec(220); -- // TODO (webrtc:383141571) : Investigate why this testcase fails for -- // DTLS 1.3 delay if networkBehavior.queue_delay_ms = 100ms. -- // - unless both peers support dtls in stun, in which case it passes. -- // - note: only for dtls1.3, it works for dtls1.2! -- networkBehavior.queue_delay_ms = 50; -+ networkBehavior.queue_delay_ms = 100; - networkBehavior.queue_length_packets = 30; - networkBehavior.loss_percent = 50; - -diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc -index 50be6b5c26..8c952cd3a2 100644 ---- a/rtc_base/openssl_stream_adapter.cc -+++ b/rtc_base/openssl_stream_adapter.cc -@@ -852,10 +852,15 @@ void OpenSSLStreamAdapter::SetTimeout(int delay_ms) { - // We check the timer even after SSL_CONNECTED, - // but ContinueSSL() is only needed when SSL_CONNECTING - if (state_ == SSL_CONNECTING) { -+ // Note: timeout is set inside ContinueSSL() - ContinueSSL(); -+ } else if (state_ == SSL_CONNECTED) { -+ MaybeSetTimeout(); -+ } else { -+ RTC_DCHECK_NOTREACHED() << "state_: " << state_; - } - } else { -- RTC_DCHECK_NOTREACHED(); -+ RTC_DCHECK_NOTREACHED() << "flag->alive() == false"; - } - // This callback will never run again (stopped above). - return TimeDelta::PlusInfinity(); -@@ -970,6 +975,12 @@ int OpenSSLStreamAdapter::ContinueSSL() { - } - } - -+ MaybeSetTimeout(); -+ -+ return 0; -+} -+ -+void OpenSSLStreamAdapter::MaybeSetTimeout() { - if (ssl_ != nullptr) { - struct timeval timeout; - if (DTLSv1_get_timeout(ssl_, &timeout)) { -@@ -977,8 +988,6 @@ int OpenSSLStreamAdapter::ContinueSSL() { - SetTimeout(delay); - } - } -- -- return 0; - } - - void OpenSSLStreamAdapter::Error(absl::string_view context, -diff --git a/rtc_base/openssl_stream_adapter.h b/rtc_base/openssl_stream_adapter.h -index 856d37c156..c10e93e3d4 100644 ---- a/rtc_base/openssl_stream_adapter.h -+++ b/rtc_base/openssl_stream_adapter.h -@@ -210,6 +210,8 @@ class OpenSSLStreamAdapter final : public SSLStreamAdapter { - !peer_certificate_digest_value_.empty(); - } - -+ void MaybeSetTimeout(); -+ - const std::unique_ptr<StreamInterface> stream_; - absl::AnyInvocable<void(SSLHandshakeError)> handshake_error_; -