Commit graph

877 commits

Author SHA1 Message Date
Oscar Mira
d54fdb5f19
Revert "Remove SOCKS5 support"
This reverts commit b5f2b17fd8.
2025-05-16 19:28:43 +02:00
Oscar Mira
ddb29d3dbf
Revert "Remove unused+unmaintained PROXY_HTTPS code."
This reverts commit 81be7b2394.
2025-05-16 19:27:26 +02:00
Oscar Mira
89b14a2720
Revert "Remove more ProxyInfo references."
This reverts commit db6767dd0c.
2025-05-16 19:26:13 +02:00
Oscar Mira
a2ad0276af
Revert "Remove deprecated ProxyInfo code"
This reverts commit f54e0133d7.
2025-05-16 19:26:11 +02:00
Oscar Mira
06c2c56683
Resolve TURN hostname through proxy 2025-05-16 19:11:05 +02:00
Jim Gustafson
467f69ef4a Resolve use of kDefaultPortAllocatorFlags 2025-03-26 17:11:29 -07:00
Jim Gustafson
05a8ba099d m134 merge fixes 2025-03-26 15:03:13 -07:00
Jim Gustafson
04b41481d4 Merge remote-tracking branch 'upstream/branch-heads/6998' 2025-03-19 19:25:31 -07:00
Jonas Oreland
4b39cb3eb6 Reland "Move piggybacking controller from P2PTC to DTLS transport"
This reverts commit 4de5839c11.

Reason for revert: Bug fixed + DCHECK added

Original change's description:
> Revert "Move piggybacking controller from P2PTC to DTLS transport"
>
> This reverts commit 29e639e0a4.
>
> Reason for revert: found bug accessing variable after it has been moved.
>
> Original change's description:
> > Move piggybacking controller from P2PTC to DTLS transport
> >
> > The DTLS-STUN piggybacking controller is associated with both the DTLS
> > transport and the ICE transport (P2PTransportChannel). It turned out to
> > be more closely associated with the DTLS transport and requires less
> > plumbing when moved there.
> >
> > The config option to enable the feature remains as part of the ICE
> > transport config since the ICE transport does not know its "upstream"
> > DTLS transport and hence can not query the config from it.
> >
> > BUG=webrtc:367395350
> >
> > Change-Id: Iafd5abd8b65855bcf32bf840414d96513d8e6300
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375283
> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> > Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#43823}
>
> Bug: webrtc:367395350
> Change-Id: I2d83de8890b0aa230dd9e21cb5ce2eb03c8d3564
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375861
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43824}

Bug: webrtc:367395350
Change-Id: I4b4acccf15de565736b072ca2de88a1551a6378e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375862
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43825}
2025-01-30 02:51:41 -08:00
Jonas Oreland
4de5839c11 Revert "Move piggybacking controller from P2PTC to DTLS transport"
This reverts commit 29e639e0a4.

Reason for revert: found bug accessing variable after it has been moved.

Original change's description:
> Move piggybacking controller from P2PTC to DTLS transport
>
> The DTLS-STUN piggybacking controller is associated with both the DTLS
> transport and the ICE transport (P2PTransportChannel). It turned out to
> be more closely associated with the DTLS transport and requires less
> plumbing when moved there.
>
> The config option to enable the feature remains as part of the ICE
> transport config since the ICE transport does not know its "upstream"
> DTLS transport and hence can not query the config from it.
>
> BUG=webrtc:367395350
>
> Change-Id: Iafd5abd8b65855bcf32bf840414d96513d8e6300
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375283
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43823}

Bug: webrtc:367395350
Change-Id: I2d83de8890b0aa230dd9e21cb5ce2eb03c8d3564
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375861
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43824}
2025-01-30 00:26:07 -08:00
Philipp Hancke
29e639e0a4 Move piggybacking controller from P2PTC to DTLS transport
The DTLS-STUN piggybacking controller is associated with both the DTLS
transport and the ICE transport (P2PTransportChannel). It turned out to
be more closely associated with the DTLS transport and requires less
plumbing when moved there.

The config option to enable the feature remains as part of the ICE
transport config since the ICE transport does not know its "upstream"
DTLS transport and hence can not query the config from it.

BUG=webrtc:367395350

Change-Id: Iafd5abd8b65855bcf32bf840414d96513d8e6300
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375283
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43823}
2025-01-29 23:27:14 -08:00
Philipp Hancke
589acd56d0 dtls-stun piggybacking: make it compatible with DTLS 1.3
DTLS 1.3 encrypts more parts of the handshake so we move from
deep packet inspection to looking at the state of DTLS to
decide whether to intercept the packet.

BUG=webrtc:367395350

Change-Id: Idb1eda0437f24002f48381af5d6a167a4a153381
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374501
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43794}
2025-01-24 03:11:19 -08:00
Evan Shrubsole
0bebca526a Remove gunit.h EXPECT/ASSERT..WAIT macros
Bug: webrtc:381524905
Change-Id: I01dff16f7ec26fa4075a9ef659dee3f0844db041
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374881
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43785}
2025-01-22 00:33:15 -08:00
Evan Shrubsole
2a858e21f6 Migrate last uses of gunit.h macros
Bug: webrtc:381524905
Change-Id: I9bf00a61dfcc00355e81fea34625119ef3ac61b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43769}
2025-01-20 02:06:48 -08:00
Evan Shrubsole
b0038dd14a Replace gunit.h macros with WaitUntil in P2P
Bug: webrtc:381524905
Change-Id: Ia2614729b17a40cd2f5f226e351b3f82c2038977
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374181
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43758}
2025-01-17 06:53:50 -08:00
Philipp Hancke
bce57cda1e Piggyback DTLS handshake in initial STUN packets
This change puts the DTLS handshake as payload of STUN packets with a custom STUN attribute (registered with the IANA) and starts the DTLS handshake before the ICE transport becomes writable. Effectively, STUN acts as a transport layer for DTLS during the handshake phase.

This will theoretically reduce the call setup time by one RTT for aggressive nomination or two RTTs for regular nomination.

The latest DTLS packet (flight) is cached and sent on every STUN request or response. DTLS packets are extracted from every authenticated STUN request or response and handled to the DTLS layer for processing.
The caching also increases the resilience to packet loss as STUN pacing is more aggressive (every 20ms) than the exponential backoff used by DTLS which should reduce call setup time in lossy networks.

If the other side of the connection does not support this feature the fallback to normal DTLS happens as soon as the ICE transport becomes writable. This also handles edge-cases like fragmentation of the DTLS handshake.

The feature is only supported when ECDSA certificates are used since RSA certificates are too large to transport as STUN attributes. The observed attributes for the server and client flights with the certificates were around 600 to 650 bytes. This may be further reduced by using raw public keys defined in RFC 7250.

This feature is disabled by default and guarded by the field trial
  WebRTC-IceHandshakeDtls
and requires experimentation and standardization before roll-out in the browser.

Parts of this landed in
  https://webrtc-review.googlesource.com/c/src/+/370679

BUG=webrtc:367395350

Change-Id: I4809438b2a267c4690a9b2bd6f1766d2f959500d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362480
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43742}
2025-01-15 07:54:23 -08:00
Boris Tsirkin
c6b7acb9cd Format p2p/base files
I ran the formatter on everything to make find leftovers, and these are
the last files.
git ls-files | grep -E '^.*\.(h|cc|mm|c|m)$' | xargs clang-format -i

No-Iwyu: Includes didn't change and it isn't related to formatting
Bug: webrtc:42225392
Change-Id: I8bbe8bd3c97b76c691e38b8ca290417202a61b6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374161
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43720}
2025-01-13 05:09:52 -08:00
Miriam Zimmerman
8604cca7c6 Merge remote-tracking branch 'upstream/branch-heads/6834' into mutexlox/m132-merge 2025-01-07 12:25:28 -05:00
Jonas Oreland
12574a315f DTLS 1.3 - patch 4
This patchs adds a field trial for enabling DTLS1.3, WebRTC-ForceDtls13
- "Enabled" set max version to DTLS1.3
- "Only" set min & max version to DTLS1.3

Wireup a FieldTrialsView so that this does not
use the global string.

Also convert the WebRTC-DisableTlsSessionTicketKillswitch
from global string to FieldTrialsView.

BUG=webrtc:383141571

Change-Id: Ia775efc1dcbffd01bfddb6030490438cb8de89d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/372261
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43616}
2024-12-19 07:37:19 -08:00
Jonas Oreland
ac40185001 DTLS 1.3 - patch 2
- add DTLS1.3 ciphers (without KeyType)
- remove code in dtls_transport.cc that tries to parse DTLS packet
- cleanup some test
- start on test for packet loss during dtls handshake (more to come!)

After this patch is submitted, it is possible
to set max version = dtls1.3 and it will active
but DON'T do it yet.

BUG=webrtc:383141571

Change-Id: I6f9a120c53415ccee7a560ea83bd0c2636702997
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371300
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43595}
2024-12-18 02:26:22 -08:00
Philipp Hancke
740d726739 Move DTLS related code from p2p/base to p2p/dtls
BUG=webrtc:367395350

Change-Id: I3fd1551f974705ce6b10e2c757f4d406a520a2c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370460
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43528}
2024-12-10 15:55:26 +00:00
Philipp Hancke
cab60a0842 Provide default implementation of IceTransportInternal::config()
to be deleted when downstream consumers are upgraded

BUG=webrtc:367395350

Change-Id: I35f1fefdc6535ad443b86176ea600455c2361834
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370284
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43502}
2024-12-06 02:44:34 +00:00
Philipp Hancke
89b0f2ef71 Introduce p2p DTLS utils
for (partially) parsing DTLS packets and extracting the msg_seqs

BUG=webrtc:367395350

Change-Id: Ieb0fc121c6dc82118ced5939c1a9ebe2d72e3cb3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370181
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43501}
2024-12-05 17:08:59 +00:00
Philipp Hancke
1cf342a321 Add IceConfig getter to IceTransportInternal(Interface)
and misc cleanup

BUG=webrtc:367395350
No-Iwyu: remaining IWYU failure is deep inside gtest which is unrelated to the changes and needs to be investigated separately

Change-Id: I5c2b7a6cc6b15fc5474c55eb98635cb9145b7373
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370180
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43498}
2024-12-05 09:13:32 +00:00
Philipp Hancke
4060745995 spanify SSLStreamAdapter::SetPeerCertificateDigest
BUG=webrtc:357776213

Change-Id: Ie6189ac21b9f76f7ce5ddb3e4208c08793df73ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368220
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43462}
2024-11-27 06:13:28 +00:00
Tommi
924dc088dc Use 16bit unsigned for channel id for TURN
Bug: webrtc:345518625
Change-Id: I0ee879e9a35cd9831e035a661d54201dc6defac9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353901
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43447}
2024-11-24 22:47:10 +00:00
Jim Gustafson
a827dd359d Fix some tests and disable others 2024-11-20 08:34:47 -08:00
Dor Hen
da7b7ca1c1 Comment unused variables in implemented functions 15\n
Bug: webrtc:370878648
Change-Id: I4529c17f54c653864cca27097e44c843210b9c52
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368061
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43429}
2024-11-20 11:50:20 +00:00
Per Kjellander
906deafff4 Add support for sending packets with ECT(1) based on packet options in native WebRTC.
With L4S in WebRTC, only RTP packets are supposed to be send with ECT(1)

Bug: webrtc:42225697
Change-Id: If10bf74a867d3ea04fd1fb931cdc2a6380176270
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367220
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43343}
2024-11-01 07:48:19 +00:00
Philipp Hancke
0e5d73510d DTLS: cleanup extension permutation
which shipped in M129.

BUG=webrtc:42225803

Change-Id: I5021c7878069a1cd0eafd078b73fa57c5b9b2155
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364360
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43313}
2024-10-28 10:04:37 +00:00
Philipp Hancke
ba957e486c Clean up deprecated variant of DTLS-SRTP key exporter
follow-up from
  https://webrtc-review.googlesource.com/c/src/+/364521 (reland as
  https://webrtc-review.googlesource.com/c/src/+/365180)

BUG=webrtc:357776213

Change-Id: I4f59d53407f41d903bca6664d85bd2c72d4ff1eb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365020
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43295}
2024-10-24 07:59:26 +00:00
Jim Gustafson
72d638d9de m130 merge fixes 2024-10-23 20:01:09 -07:00
Tom Sepez
7085a884aa Avoid string duplication when returning StringBuilder strings
The const-ref result of .str() must be copied into the returned
value, whereas the result of .Release() can be moved.

Bug: webrtc:374845009
Change-Id: I3abc98be30ce9947127c7664f5ffa6846b772ea2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366480
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43288}
2024-10-23 07:54:18 +00:00
Dor Hen
6d58a43413 Comment unused variables in implemented functions 3\n
Bug: webrtc:370878648
Change-Id: I40251cc529cc20fbf2b034fa25798965b91dbd88
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364683
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43278}
2024-10-22 11:58:48 +00:00
Philipp Hancke
03b2c9f6fc Let ZeroOnFreeBuffer do the memcpy for DTLS-SRTP key extraction
and use uint8_t instead of unsigned char. Follow-up from
  https://webrtc-review.googlesource.com/c/src/+/365274

BUG=webrtc:357776213

Change-Id: Ibc97e5cc85316ba69b4133b7f3c42e3afbdd7abd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365540
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43263}
2024-10-18 11:18:21 +00:00
Jim Gustafson
9280d4e8f0 Merge remote-tracking branch 'upstream/branch-heads/6723' 2024-10-17 09:03:43 -07:00
Philipp Hancke
6caca655d8 Reland "Spanify SRTP key export"
This is a reland of commit 65ae3245f9
with more backward compat which also fixes the off-by-one issue which caused wrong SRTP keys to be extracted.

Original change's description:
> Spanify SRTP key export
>
> and simplify the interface used as this is only used for exporting
> SRTP keys and passing arcane OpenSSL arguments around does not make
> much sense.
>
> BUG=webrtc:357776213
>
> Change-Id: I9e5a94fe368b77975e48b6dd5ab6a2d2575d6382
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364521
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43198}

Bug: webrtc:357776213
Change-Id: I5d43dc23f90ef630834fb400751979fcc5e18203
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365180
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43225}
2024-10-11 19:39:28 +00:00
Jeremy Leconte
32590ef877 Revert "Spanify SRTP key export"
This reverts commit 65ae3245f9.

Reason for revert: breaks downstream compilation

Original change's description:
> Spanify SRTP key export
>
> and simplify the interface used as this is only used for exporting
> SRTP keys and passing arcane OpenSSL arguments around does not make
> much sense.
>
> BUG=webrtc:357776213
>
> Change-Id: I9e5a94fe368b77975e48b6dd5ab6a2d2575d6382
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364521
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43198}

Bug: webrtc:357776213
Change-Id: I03ffcda3d6821718f355b243ce78a9c54b4036f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365062
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Owners-Override: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43202}
2024-10-09 08:51:23 +00:00
Philipp Hancke
65ae3245f9 Spanify SRTP key export
and simplify the interface used as this is only used for exporting
SRTP keys and passing arcane OpenSSL arguments around does not make
much sense.

BUG=webrtc:357776213

Change-Id: I9e5a94fe368b77975e48b6dd5ab6a2d2575d6382
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364521
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43198}
2024-10-08 19:05:40 +00:00
Philipp Hancke
4f732f4847 Constify transport stats
BUG=None

Change-Id: I441a46dea97d9a9022b96aaadef1d7348c6f90ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364124
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43148}
2024-10-02 14:41:09 +00:00
Harald Alvestrand
d259a754a8 Remove deprecated variant of StreamInterface::WriteAll
This has been deprecated since November 2022.

Bug: None
Change-Id: Ia547489b1f703d0744ab7ffc096eeadbb937974a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364381
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43140}
2024-10-02 11:57:16 +00:00
Philipp Hancke
1831184330 Unify TLS cipher suite name handling
Move it away from the "proprietary" SSL_CIPHER_get_id and looking up the cipher based on that towards SSL_CIPHER_standard_name.

SSL_CIPHER_get_id and the associated GetSslCipherSuite API is kept around for
  WebRTC.PeerConnection.SslCipherSuite.*
UMA metrics and metrics compability (despite not yielding the IANA ids it promises).

BUG=None

Change-Id: Iaa357e3e31dc90abea688cf6ca10c0b40582ef38
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363202
Reviewed-by: David Benjamin <davidben@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43097}
2024-09-27 21:45:18 +00:00
Richard Russo
bc875d82f3
Allow connection to a TCP+TLS server candidate 2024-09-11 11:18:48 -07:00
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Adel Lahlou
2888424bfd Merge remote-tracking branch 'upstream/branch-heads/6613' into 6613-testing 2024-08-31 02:18:43 -07:00
Per K
b60f0ffbce Dont signal ReadyToSend in RtpTransport::SendPacket
Before this cl, ReadyToSend signaled false if sending a packet failed and transport->GetError() returns ECONN.
ECONN may be reported by the TCP connection (TcpConnection) if the remote closed the connection. TcpConnection will attempt to reconnect and should change the writable state if it fail.
Changing the state in the context of sending packets may cause recursive
calls and seems to cause problems with incorrect states.
It is simpler if RtpTransport::SendPacket ignore these failures and
upper layers treat these lost packets similar to if the packets had been
lost via UDP.
For safety, this change can be reverted by field trial WebRTC-SetReadyToSendFalseIfSendFail/Enabled/.

Bug: webrtc:361124449 b/359989715
Change-Id: I8e7016dfb4301862286215c4512aa8ac03a16685
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360120
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42868}
2024-08-27 14:16:53 +00:00
Per K
6db0db5cfd Ensure TCPPort is notified of sent packets after reconnect
This fix an issue where the socket does not notify the port of sent packets after that the TCPConnection has opened a new socket. TcpConnection will open a new socket if the TCP  connection has been closed.

Bug: webrtc:361124449 b/359989715
Change-Id: Id33c5fc5292ee7d1c2d1cad6c373e2d4355d4fe1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360260
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42865}
2024-08-27 12:29:52 +00:00
Philipp Hancke
b31ade36ff stun/turn: suppress icecandidateerror for incompatible address family
Suppresses the ice candidate error callback when the STUN/TURN server
address family is not compatible with the local candidate address family.

This is similar to not pairing between candidates that have different
incompatible address families as described in
https://datatracker.ietf.org/doc/html/rfc5245#section-5.7.1

The spec actually says to emit the 701 error if *no* host candidate is able to reach the server:
  https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerrorevent-errorcode

Also use the same (spec) error code for STUN and TURN, see
https://github.com/webrtc/samples/issues/1215 (error 600 for TURN)
https://github.com/webrtc/samples/issues/1227 (error 701 with AF mismatch)

Drive-by: misc logging fixes

BUG=webrtc:359404135

Change-Id: I99574b7b2b79986a52ab38a7fa58ea1bebab954c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358961
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42830}
2024-08-22 21:33:45 +00:00
Philipp Hancke
2cfedb277a Remove vestiges of GTURN
and update some usage to use the "correct" stun attribute names

BUG=webrtc:42229250

Change-Id: If0c34d1d9b399766d7073661ea2a5515100256a5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359440
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42810}
2024-08-19 16:05:37 +00:00
Sun Shin
303113a620 Enable rtc::Socket::OPT_RECV_ECN socket option
Enable rtc::Socket::OPT_RECV_ECN socket option by field trial
WebRTC-RFC8888CongestionControlFeedback.

Bug: webrtc:15368
Change-Id: I9befbbb59745c0fc9528bf948ad2cfc90efe226b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357920
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42726}
2024-08-06 01:10:42 +00:00