Commit graph

52 commits

Author SHA1 Message Date
Tommi
018feb90c2 Fix OpenSSLStreamAdapter tests when openssl is boringssl
This is a follow-up to:
https://webrtc-review.googlesource.com/c/src/+/318640

The problem was that the scoped field trials in the tests only
applied to the construction of the streams, not the handshake.

Note, although the changes are in OpenSSLStreamAdapter, this CL
actually fixes the SSLStreamAdapterTestDTLSExtensionPermutation tests
in rtc_base/ssl_stream_adapter_unittest.cc.

Bug: webrtc:15467
Change-Id: I25cdd758aab1bc67fd7a6a61c956c6d52f82e3d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344762
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41976}
2024-03-29 21:54:54 +00:00
Philipp Hancke
e75cd0c704 Remove DTLS 1.0 legacy code
which has been enabled by default since M84. This was still available
under an enterprise policy which is gone since M121:
  https://chromiumdash.appspot.com/commit/39d28bb7657b482f1fdcab81ca88371d8914809b

BUG=webrtc:10261,chromium:1132854

Change-Id: Icd534342b60799b7862bc3e7edda6825de7ae976
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317360
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41145}
2023-11-13 16:51:55 +00:00
Philipp Hancke
36e4dd2f42 Add histogram for DTLS peer signature algorithm
in order to estimate the impact of deprecating SHA1. Chromium UMA CL:
  https://chromium-review.googlesource.com/c/chromium/src/+/4894345

BUG=webrtc:15517

Change-Id: I5216ba2a8cbba2f276af20d31aa5e111e7c3a141
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321620
Reviewed-by: David Benjamin <davidben@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40882}
2023-10-06 12:25:37 +00:00
Philipp Hancke
ebe207f71c Add field trial for enabling SSL client hello extension permutation
using WebRTC-PermuteTlsClientHello as a field trial.

This has been launched in Chromium already:
  https://groups.google.com/a/chromium.org/g/blink-dev/c/bYZK81WxYBo/m/lKLrZ_P2BwAJ

WebRTC-specific I2S:
  https://groups.google.com/a/chromium.org/g/blink-dev/c/1CIKec0W1fg

Chromestatus entry:
  https://chromestatus.com/feature/5191245718880256

BUG=webrtc:15467

Change-Id: I18f4065661bbe2db03e1823d7bfba4c9b60046aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318640
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40831}
2023-09-28 13:34:38 +00:00
Tommi
48df56e9ac Remove SignalSSLHandshakeError signal from SSLStreamAdapter.
Also removing has_slots depdency from OpenSSLStreamAdapter and moving
it to the  OpenSSLStreamAdapter subclass where it's still needed.

Bug: webrtc:11943
Change-Id: Ibcae5ea1efff146d78b32bb0eca63d7f44ed08c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318885
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40702}
2023-09-05 12:27:23 +00:00
Tommi
59574ca6d3 Add absl::AnyInvocable to SSLStreamAdapter::Create
Remove internal use of SignalSSLHandshakeError and prepare removal of
sigslot dependency from SSLStreamAdapter.

Bug: webrtc:11943
Change-Id: I9768e2e31529945620bdd8d0d285042bb2388b7b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318881
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40695}
2023-09-05 08:50:11 +00:00
Per K
d1771e925d Enable SSL logging per default
Done in order to simplify connection debuging.

Example log:

openssl_adapter.cc:829): connect_loop TLS client read_server_hello
(openssl_adapter.cc:829): connect_loop TLS client read_server_certificate
(openssl_adapter.cc:829): connect_loop TLS client read_certificate_status
(openssl_adapter.cc:829): connect_loop TLS client verify_server_certificate
(openssl_stream_adapter.cc:1128): Accepted peer certificate.
(openssl_adapter.cc:829): connect_loop TLS client read_server_key_exchange
(openssl_adapter.cc:829): connect_loop TLS client read_certificate_request
(openssl_adapter.cc:829): connect_loop TLS client read_server_hello_done
(openssl_adapter.cc:829): connect_loop TLS client send_client_certificate
(openssl_adapter.cc:829): connect_loop TLS client send_client_key_exchange
(openssl_adapter.cc:829): connect_loop TLS client send_client_certificate_verify
(openssl_adapter.cc:829): connect_loop TLS client send_client_finished
(openssl_adapter.cc:829): connect_loop TLS client finish_flight
(openssl_adapter.cc:829): connect_loop TLS client read_session_ticket
(openssl_adapter.cc:829): connect_exit TLS client read_session_ticket
(openssl_adapter.cc:829): accept_loop TLS server verify_client_certificate
(openssl_stream_adapter.cc:1128): Accepted peer certificate.
(openssl_adapter.cc:829): accept_loop TLS server read_client_key_exchange
(peer_connection.cc:1952): Changing IceConnectionState 0 => 1
(openssl_adapter.cc:829): accept_loop TLS server read_client_certificate_verify
(peer_connection.cc:1971): Changing standardized IceConnectionState 0 => 1
(peer_connection.cc:1971): Changing standardized IceConnectionState 0 => 1
(peer_connection.cc:1971): Changing standardized IceConnectionState 1 => 2
(peer_connection.cc:1971): Changing standardized IceConnectionState 1 => 2
(openssl_adapter.cc:829): accept_loop TLS server read_change_cipher_spec
(openssl_adapter.cc:829): accept_loop TLS server process_change_cipher_spec
(openssl_adapter.cc:829): accept_loop TLS server read_next_proto
(openssl_adapter.cc:829): accept_loop TLS server read_channel_id
(openssl_adapter.cc:829): accept_loop TLS server read_client_finished
(openssl_adapter.cc:829): accept_loop TLS server send_server_finished
(openssl_adapter.cc:829): accept_loop TLS server finish_server_handshake
(openssl_adapter.cc:829): accept_loop TLS server done
(openssl_adapter.cc:829): handshake_done TLS server done
(openssl_adapter.cc:829): accept_exit TLS server done
(dtls_transport.cc:688): DtlsTransport[0|1|__]: DTLS handshake complete.

Bug: b/275671043
Change-Id: Ib8d394aa74c5665c489b485bb44152aff67d3b7c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302300
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39955}
2023-04-26 13:01:13 +00:00
Harald Alvestrand
cf7077693c Remove deprecated rtc::StreamInterface functions
This cleans up the last vestiges of the old interface for rtc::StreamInterface
and will cause builds to refer to the old functions to fail.

Bug: webrtc:14632
Change-Id: I569b16677754d7f9e08449e273672a59a86e6498
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283844
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38784}
2022-12-01 08:21:17 +00:00
Mirko Bonadei
99543ae75f Revert "Remove backwards compatibility functions in openssl"
This reverts commit 4db5b979b7.

Reason for revert: Breaks downstream project

Original change's description:
> Remove backwards compatibility functions in openssl
>
> After changing base functions to a CHECK instead of an =0, these
> are no longer needed.
>
> Bug: webrtc:14632
> Change-Id: If3f1a62905cf433486f4974b2153c9210d1e045b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283542
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38643}

Bug: webrtc:14632
Change-Id: I4c0ec753285fab882f60b059b3d34f772bf5f7e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283721
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38649}
2022-11-16 14:24:11 +00:00
Harald Alvestrand
4db5b979b7 Remove backwards compatibility functions in openssl
After changing base functions to a CHECK instead of an =0, these
are no longer needed.

Bug: webrtc:14632
Change-Id: If3f1a62905cf433486f4974b2153c9210d1e045b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283542
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38643}
2022-11-16 10:09:33 +00:00
Harald Alvestrand
11840ce684 Deprecate void* forms of StreamInterface::Read and ::Write
Updates the code to use the new interfaces

Bug: webrtc:14632
Change-Id: I33b2a25b5968de0251e3cbc84076afc013ecef6e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282680
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38601}
2022-11-10 12:40:20 +00:00
Joachim Reiersen
e457e43836 Fix bug where RTCTransportStats.dtlsCipher was missing when using OpenSSL
A bug in the id being searched for inside OpenSSLStreamAdapter::SslCipherSuiteToName prevented the lookup from ever succeeding.

This resulted in this stat being unavailable when calling PeerConnection::GetStats(). To fix the problem, look for (0x03000000L | cipher_suite) which matches what the BoringSSL codepath is doing.

Bug: webrtc:14596
Change-Id: Ic36d77dbc4c2378fbde1e2f21a9f5bd735b36741
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280100
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38460}
2022-10-24 20:51:33 +00:00
Danil Chapovalov
5286dcfab6 Migrate rtc_base and rtc_tools to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245
Change-Id: I71abe3db7a23ad33bd175297e23fa8e927fa9628
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268768
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37553}
2022-07-19 10:57:42 +00:00
Philipp Hancke
117e692a7d tls: add logging of expected/received hashes on failures
BUG=None

Change-Id: I8e9a4e69c520e1ee1edeb7f45f039f2cda400a50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265869
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37268}
2022-06-19 22:33:10 +00:00
Artem Titov
c374d11fac Move to_queued_task.h and pending_task_safety_flag.h into public API
Bug: b/235812579
Change-Id: I9fa3dc4a65044df8b44fff4e9bfeac7233fa381c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37248}
2022-06-17 09:20:39 +00:00
Philipp Hancke
9c83d9d99e DTLS: fail the connection if DTLSv1_handle_timeout returns an error
which signals a permanent connection failure to the application

BUG=webrtc:13999

Change-Id: I7ba25db4aa9035583558a613db97561c48796c76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260100
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#36700}
2022-04-29 05:44:42 +00:00
Ali Tofigh
2ab914c6ab Adopt absl::string_view in rtc_base/ (straightforward cases)
Bug: webrtc:13579
Change-Id: I240db6285abb22652242bc0b2ebe9844ec4a45f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258723
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36561}
2022-04-17 12:11:56 +00:00
Ali Tofigh
7fa9057a05 Adopt absl::string_view in function parameters under rtc_base/
This is part of a large-scale effort to increase adoption of
absl::string_view across the WebRTC code base.

This CL converts the majority of "const std::string&"s in function
parameters under rtc_base/ to absl::string_view.

Bug: webrtc:13579
Change-Id: I2b1e3776aa42326aa405f76bb324a2d233b21dca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254081
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org>
Reviewed-by: Anders Lilienthal <andersc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36239}
2022-03-17 15:39:26 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
David Benjamin
7a46cc5f3d Remove 3DES from WebRTC
I meant to do this with the Chromium change but forgot. UMA registers
zero uses of 3DES, so this should be safe. (Not too surprising, since
3DES had already been obsolete for just under a decade by the time
WebRTC existed.)

Bug: chromium:1203442
Change-Id: I5bddd2bd3f24beb486c8246fa5dab5836883b8c1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229120
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: David Benjamin <davidben@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34806}
2021-08-19 15:08:40 +00:00
Artem Titov
96e3b991da Use backticks not vertical bars to denote variables in comments for /rtc_base
Bug: webrtc:12338
Change-Id: I72fcb505a92f03b2ace7160ee33d555a977eddfd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226955
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34587}
2021-07-28 13:51:47 +00:00
Mirko Bonadei
7750d802a5 Rename rtc_base/ssl_stream_adapter.h constants.
Uppercase constants are more likely to conflict with macros (for
example rtc::SRTP_AES128_CM_SHA1_80 and OpenSSL SRTP_AES128_CM_SHA1_80).

This CL renames some constants and follows the C++ style guide.

Bug: webrtc:12997
Change-Id: I2398232568b352f88afed571a9b698040bb81c30
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226564
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34553}
2021-07-26 16:33:54 +00:00
Jonas Oreland
808f49428f LOG DTLS (failed) handshake retransmission
Add logging of DTLS handshake retransmission,
either when it happens or when it fails.

Note that is only for the handshake messages,
which are retransmitted with exponential back off.

This patch aim to help rare DTLS hanging problems.

BUG=None

Change-Id: Iae808190711dd80dd8a43ff22757dd69919d63ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222647
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34304}
2021-06-16 13:13:52 +00:00
Niels Möller
0131a4dcf3 Delete StreamAdapterInterface
Shortens the inheritance chain between StreamInterface and
OpenSSLStreamAdapter.

Bug: webrtc:6424
Change-Id: I4306e27b583eb75c1a49efde3c27e1d81c117ac8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213181
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33755}
2021-04-16 08:47:17 +00:00
Taylor Brandstetter
165c618bb9 Reland: Use CRYPTO_BUFFER APIs instead of X509 when building with BoringSSL.
Using CRYPTO_BUFFERs instead of legacy X509 objects offers memory and
security gains, and will provide binary size improvements as well once
the default list of built-in certificates can be removed; the code
dealing with them still depends on the X509 API.

Implemented by splitting openssl_identity and openssl_certificate
into BoringSSL and vanilla OpenSSL implementations.

No-Try: True
Bug: webrtc:11410
Change-Id: I86ddb361b94ad85b15ebb8743490de83632ca53f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196941
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32818}
2020-12-11 09:58:40 +00:00
Sam Zackrisson
7e6290d1d2 Revert "Use CRYPTO_BUFFER APIs instead of X509 when building with BoringSSL."
This reverts commit 72f638a9a2.

Reason for revert: downstream build failures

Original change's description:
> Use CRYPTO_BUFFER APIs instead of X509 when building with BoringSSL.
>
> Using CRYPTO_BUFFERs instead of legacy X509 objects offers memory and
> security gains, and will provide binary size improvements as well once
> the default list of built-in certificates can be removed; the code
> dealing with them still depends on the X509 API.
>
> Implemented by splitting openssl_identity and openssl_certificate
> into BoringSSL and vanilla OpenSSL implementations.
>
> Bug: webrtc:11410
> Change-Id: Idc043462faac5e4ab1b75bedab2057197f80aba6
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174120
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: David Benjamin <davidben@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Taylor <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32811}

TBR=deadbeef@webrtc.org,mbonadei@webrtc.org,davidben@webrtc.org,hta@webrtc.org

Change-Id: Ib5e55cb5798a2f3d25a4460f5311d2e650d3fa82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11410
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196742
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32812}
2020-12-10 07:55:40 +00:00
Taylor Brandstetter
72f638a9a2 Use CRYPTO_BUFFER APIs instead of X509 when building with BoringSSL.
Using CRYPTO_BUFFERs instead of legacy X509 objects offers memory and
security gains, and will provide binary size improvements as well once
the default list of built-in certificates can be removed; the code
dealing with them still depends on the X509 API.

Implemented by splitting openssl_identity and openssl_certificate
into BoringSSL and vanilla OpenSSL implementations.

Bug: webrtc:11410
Change-Id: Idc043462faac5e4ab1b75bedab2057197f80aba6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174120
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: David Benjamin <davidben@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32811}
2020-12-10 02:19:47 +00:00
Guido Urdaneta
ae2e8647aa Remove support for legacy TLS protocols by default
Now this requires explicitly passing the
WebRTC-LegacyTlsProtocols/Enabled/ field trial flag or an override.

Bug: webrtc:10261
Change-Id: Ib880bcc50cec0a21dcaa4784c228cacb020e5568
NOKEYCHECK: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190282
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32488}
2020-10-26 10:45:06 +00:00
Guido Urdaneta
ff7913204c Revert "Reland "Replace sigslot usages with robocaller library.""
This reverts commit c5f7108758.

Reason for revert: Causes Chromium WPT Tests to fail, preventing rolls.

Sample failed run:
https://ci.chromium.org/p/chromium/builders/try/linux-rel/511995?

Sample logs:

STDERR: # Fatal error in: ../../third_party/webrtc/pc/peer_connection.cc, line 575
STDERR: # last system error: 0
STDERR: # Check failed: (signaling_thread())->IsCurrent()
STDERR: # Received signal 6
STDERR: #0 0x7f81d39e3de9 base::debug::CollectStackTrace()
STDERR: #1 0x7f81d38f9ca3 base::debug::StackTrace::StackTrace()
STDERR: #2 0x7f81d39e393b base::debug::(anonymous namespace)::StackDumpSignalHandler()
STDERR: #3 0x7f81c9054140 (/lib/x86_64-linux-gnu/libpthread-2.31.so+0x1413f)
STDERR: #4 0x7f81c8d72db1 gsignal
STDERR: #5 0x7f81c8d5c537 abort
STDERR: #6 0x7f81c7344032 rtc::webrtc_checks_impl::FatalLog()
STDERR: #7 0x7f81c722e5c0 webrtc::webrtc_function_impl::CallHelpers<>::CallInlineStorage<>()
STDERR: #8 0x7f81c7348d99 webrtc::robo_caller_impl::RoboCallerReceivers::Foreach()
STDERR: #9 0x7f81c72d6e8e webrtc::webrtc_function_impl::CallHelpers<>::CallInlineStorage<>()
STDERR: #10 0x7f81c7348d99 webrtc::robo_caller_impl::RoboCallerReceivers::Foreach()
STDERR: #11 0x7f81c71c6df3 webrtc::webrtc_function_impl::CallHelpers<>::CallInlineStorage<>()
STDERR: #12 0x7f81c7348d99 webrtc::robo_caller_impl::RoboCallerReceivers::Foreach()
STDERR: #13 0x7f81c73135bc rtc::OpenSSLStreamAdapter::ContinueSSL()
STDERR: #14 0x7f81c7312fd4 rtc::OpenSSLStreamAdapter::OnEvent()
STDERR: #15 0x7f81c71c30d9 cricket::StreamInterfaceChannel::OnPacketReceived()
STDERR: #16 0x7f81c71c640a cricket::DtlsTransport::OnReadPacket()
STDERR: #17 0x7f81c71cad61 cricket::P2PTransportChannel::OnReadPacket()
STDERR: #18 0x7f81c71bc90f cricket::Connection::OnReadPacket()
STDERR: #19 0x7f81c71e6255 cricket::UDPPort::HandleIncomingPacket()
STDERR: #20 0x7f81cd1f1bff blink::(anonymous namespace)::IpcPacketSocket::OnDataReceived()
STDERR: #21 0x7f81cd1f645d blink::P2PSocketClientImpl::DataReceived()
STDERR: #22 0x7f81cd50a16b network::mojom::blink::P2PSocketClientStubDispatch::Accept()
STDERR: #23 0x7f81d2b4f642 mojo::InterfaceEndpointClient::HandleValidatedMessage()
STDERR: #24 0x7f81d2b5304b mojo::MessageDispatcher::Accept()
STDERR: #25 0x7f81d2b50bb1 mojo::InterfaceEndpointClient::HandleIncomingMessage()
STDERR: #26 0x7f81d2b58a3a mojo::internal::MultiplexRouter::ProcessIncomingMessage()
STDERR: #27 0x7f81d2b57f7f mojo::internal::MultiplexRouter::Accept()
STDERR: #28 0x7f81d2b5304b mojo::MessageDispatcher::Accept()
STDERR: #29 0x7f81d2b48851 mojo::Connector::DispatchMessage()
STDERR: #30 0x7f81d2b492e7 mojo::Connector::ReadAllAvailableMessages()
STDERR: #31 0x7f81d2b490a3 mojo::Connector::OnHandleReadyInternal()
STDERR: #32 0x7f81d2b498f0 mojo::SimpleWatcher::DiscardReadyState()
STDERR: #33 0x7f81d2d0e67a mojo::SimpleWatcher::OnHandleReady()
STDERR: #34 0x7f81d2d0eb2b base::internal::Invoker<>::RunOnce()
STDERR: #35 0x7f81d397f85b base::TaskAnnotator::RunTask()
STDERR: #36 0x7f81d399a04c base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
STDERR: #37 0x7f81d3999c78 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
STDERR: #38 0x7f81d391fe64 base::MessagePumpDefault::Run()
STDERR: #39 0x7f81d399a8dc base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
STDERR: #40 0x7f81d395ae55 base::RunLoop::Run()
STDERR: #41 0x7f81d39c87f2 base::Thread::Run()




Original change's description:
> Reland "Replace sigslot usages with robocaller library."
>
> This is a reland of 40261c3663
>
> Note: Instead of changing the type of JsepTransportController->SignalSSLHandshakeError
> added a new member with a different name and used it in webrtc code.
> After this change do two more follow up CLs to completely remove the old code
> from google3.
>
> Original change's description:
> > Replace sigslot usages with robocaller library.
> >
> > - Replace all the top level signals from jsep_transport_controller.
> > - There are still sigslot usages in this file so keep the inheritance
> >   and that is the reason for not having a binary size gain in this CL.
> >
> > Bug: webrtc:11943
> > Change-Id: I249d3b9710783aef70ba273e082ceeafe3056898
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185540
> > Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32321}
>
> Bug: webrtc:11943
> Change-Id: Ia07394ee395f94836f6b576c3a97d119a7678e1a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186946
> Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32359}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,glahiru@webrtc.org

Change-Id: I6bce1775d10758ac4a9d05b855f473dd70bd9815
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11943
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187487
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32372}
2020-10-09 18:07:56 +00:00
Lahiru Ginnaliya Gamathige
c5f7108758 Reland "Replace sigslot usages with robocaller library."
This is a reland of 40261c3663

Note: Instead of changing the type of JsepTransportController->SignalSSLHandshakeError
added a new member with a different name and used it in webrtc code.
After this change do two more follow up CLs to completely remove the old code
from google3.

Original change's description:
> Replace sigslot usages with robocaller library.
>
> - Replace all the top level signals from jsep_transport_controller.
> - There are still sigslot usages in this file so keep the inheritance
>   and that is the reason for not having a binary size gain in this CL.
>
> Bug: webrtc:11943
> Change-Id: I249d3b9710783aef70ba273e082ceeafe3056898
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185540
> Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32321}

Bug: webrtc:11943
Change-Id: Ia07394ee395f94836f6b576c3a97d119a7678e1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186946
Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32359}
2020-10-09 03:06:34 +00:00
Sam Zackrisson
b298f743b8 Revert "Replace sigslot usages with robocaller library."
This reverts commit 40261c3663.

Reason for revert: Breaks downstream project

Original change's description:
> Replace sigslot usages with robocaller library.
>
> - Replace all the top level signals from jsep_transport_controller.
> - There are still sigslot usages in this file so keep the inheritance
>   and that is the reason for not having a binary size gain in this CL.
>
> Bug: webrtc:11943
> Change-Id: I249d3b9710783aef70ba273e082ceeafe3056898
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185540
> Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32321}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org,glahiru@webrtc.org

Change-Id: Icf438f87c3d95940d858db3cc5848b23abb82fc4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11943
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186844
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32324}
2020-10-06 11:40:43 +00:00
Lahiru Ginnaliya Gamathige
40261c3663 Replace sigslot usages with robocaller library.
- Replace all the top level signals from jsep_transport_controller.
- There are still sigslot usages in this file so keep the inheritance
  and that is the reason for not having a binary size gain in this CL.

Bug: webrtc:11943
Change-Id: I249d3b9710783aef70ba273e082ceeafe3056898
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185540
Commit-Queue: Lahiru Ginnaliya Gamathige <glahiru@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32321}
2020-10-05 22:38:57 +00:00
Tommi
04482985b2 Revert "[Sheriff] Revert "Remove MessageHandler[AutoCleanup] dependency from StreamInterface.""
This reverts commit af05c833da.

Reason for revert: The failure in remoting_unittests has been addressed.

Original change's description:
> [Sheriff] Revert "Remove MessageHandler[AutoCleanup] dependency from StreamInterface."
>
> This reverts commit eb79dd9ffd.
>
> Reason for revert: breaks WebRTC roll into Chrome:
> https://crrev.com/c/2445696
>
> Sample failure:
> https://ci.chromium.org/p/chromium/builders/try/linux-rel/506049
> [ RUN      ] PseudoTcpAdapterTest.DeleteOnConnected
>
> Original change's description:
> > Remove MessageHandler[AutoCleanup] dependency from StreamInterface.
> >
> > This includes relying on related types such as MessageData and
> > PostEvent functionality inside the StreamInterface itself.
> >
> > This affects mostly tests but OpenSSLStreamAdapter
> > requires special attention.
> >
> > Bug: webrtc:11988
> > Change-Id: Ib5c895f1bdf77bb49e3162bd49718f8a98812d91
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185505
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32290}
>
> TBR=kwiberg@webrtc.org,tommi@webrtc.org
>
> Change-Id: I23d7a311a73c739eba872a21e6123235465c28cc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:11988
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186564
> Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
> Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32299}

TBR=kwiberg@webrtc.org,tommi@webrtc.org,marinaciocea@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11988
Change-Id: Iff07e0943fc5dded9eeed5c2626798691594300d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186700
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32314}
2020-10-05 13:46:03 +00:00
Marina Ciocea
af05c833da [Sheriff] Revert "Remove MessageHandler[AutoCleanup] dependency from StreamInterface."
This reverts commit eb79dd9ffd.

Reason for revert: breaks WebRTC roll into Chrome:
https://crrev.com/c/2445696

Sample failure:
https://ci.chromium.org/p/chromium/builders/try/linux-rel/506049
[ RUN      ] PseudoTcpAdapterTest.DeleteOnConnected

Original change's description:
> Remove MessageHandler[AutoCleanup] dependency from StreamInterface.
>
> This includes relying on related types such as MessageData and
> PostEvent functionality inside the StreamInterface itself.
>
> This affects mostly tests but OpenSSLStreamAdapter
> requires special attention.
>
> Bug: webrtc:11988
> Change-Id: Ib5c895f1bdf77bb49e3162bd49718f8a98812d91
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185505
> Commit-Queue: Tommi <tommi@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32290}

TBR=kwiberg@webrtc.org,tommi@webrtc.org

Change-Id: I23d7a311a73c739eba872a21e6123235465c28cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11988
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186564
Commit-Queue: Marina Ciocea <marinaciocea@webrtc.org>
Reviewed-by: Marina Ciocea <marinaciocea@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32299}
2020-10-02 20:40:50 +00:00
Tomas Gunnarsson
d48ff45707 Convert LS_VERBOSE and LS_INFO logs in OpenSSLStreamAdapter to DLOG
Bug: none
Change-Id: I008b76557cc928f9ceeea76927f7de4e4c6f9473
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186580
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32297}
2020-10-02 19:46:33 +00:00
Tomas Gunnarsson
eb79dd9ffd Remove MessageHandler[AutoCleanup] dependency from StreamInterface.
This includes relying on related types such as MessageData and
PostEvent functionality inside the StreamInterface itself.

This affects mostly tests but OpenSSLStreamAdapter
requires special attention.

Bug: webrtc:11988
Change-Id: Ib5c895f1bdf77bb49e3162bd49718f8a98812d91
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185505
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32290}
2020-10-02 11:58:13 +00:00
Guido Urdaneta
14bba6e1c3 Add API to allow legacy TLS protocols.
Bug: webrtc:10261
Change-Id: I87aeb36b8c8a08b5406516bf15bf22261e4916ed
NOKEYCHECK: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185052
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32213}
2020-09-28 14:30:01 +00:00
Philipp Hancke
491fa44ed9 openssl_stream_adapter: improve ssl handshake error logging
BUG=webrtc:11817

Change-Id: Ia8a04779c028bd8071012211e4ac1cb1c424e759
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180621
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#31861}
2020-08-05 21:17:26 +00:00
Mirko Bonadei
6f402f991e Remove unnecessary breaks after return.
Patch author: thakis@chromium.org.

TBR=kwiberg@webrtc.org

No-Try: True
Bug: chromium:1066980
Change-Id: Ifcc7e831337bb2a9bf06b0af0bbd9d1c586db78a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172627
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30968}
2020-04-01 22:20:37 +00:00
Harald Alvestrand
8515d5a4ab Refactor ssl_stream_adapter API to show object ownership
Backwards compatible overloads are provided.

Bug: none
Change-Id: I065ad6b269fe074745f9debf68862ff70fd09628
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170637
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30851}
2020-03-21 18:53:46 +00:00
Harald Alvestrand
137991396d Make a switch to disable DTLS 1.0, TLS 1.0 and TLS 1.1 downgrade in WebRTC.
This reverts commit af1f8655b2

Landing the change with default set to
"enabled" (DTLS 1.0 will continue to work by default),
so that flipping the default can be a separate CL.

Original change's description:
> Revert "Disable DTLS 1.0, TLS 1.0 and TLS 1.1 downgrade in WebRTC."
>
> This reverts commit 7276b974b7.
>
> Reason for revert: Changing to a later Chrome release.
>
> Original change's description:
> > Disable DTLS 1.0, TLS 1.0 and TLS 1.1 downgrade in WebRTC.
> >
> > This change disables DTLS 1.0, TLS 1.0 and TLS 1.1 in WebRTC by default. This
> > is part of a larger effort at Google to remove old TLS protocols:
> > https://security.googleblog.com/2018/10/modernizing-transport-security.html
> >
> > For the M74 timeline I have added a disabled by default field trial
> > WebRTC-LegacyTlsProtocols which can be enabled to support these cipher suites
> > as consumers move away from these legacy cipher protocols but it will be off
> > in Chrome.
> >
> > This is compliant with the webrtc-security-arch specification which states:
> >
> >    All Implementations MUST implement DTLS 1.2 with the
> >    TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 cipher suite and the P-256
> >    curve [FIPS186].  Earlier drafts of this specification required DTLS
> >    1.0 with the cipher suite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, and
> >    at the time of this writing some implementations do not support DTLS
> >    1.2; endpoints which support only DTLS 1.2 might encounter
> >    interoperability issues.  The DTLS-SRTP protection profile
> >    SRTP_AES128_CM_HMAC_SHA1_80 MUST be supported for SRTP.
> >    Implementations MUST favor cipher suites which support (Perfect
> >    Forward Secrecy) PFS over non-PFS cipher suites and SHOULD favor AEAD
> >    over non-AEAD cipher suites.
> >
> > Bug: webrtc:10261
> > Change-Id: I847c567592911cc437f095376ad67585b4355fc0
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125141
> > Commit-Queue: Benjamin Wright <benwright@webrtc.org>
> > Reviewed-by: David Benjamin <davidben@webrtc.org>
> > Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#27006}
>
> TBR=steveanton@webrtc.org,davidben@webrtc.org,qingsi@webrtc.org,benwright@webrtc.org
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: webrtc:10261
> Change-Id: I34727e65c069e1fb2ad71838828ad0a22b5fe811
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130367
> Commit-Queue: Benjamin Wright <benwright@webrtc.org>
> Reviewed-by: Benjamin Wright <benwright@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27403}

Bug: webrtc:10261
Change-Id: I28c6819d37665976e396df280b4abf48fb91d533
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169851
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30733}
2020-03-09 19:23:44 +00:00
Harald Alvestrand
5cb7807a36 Implement crypto stats on DTLS transport
Bug: chromium:1018077
Change-Id: I585d4064f39e5f9d268b408ebf6ae13a056c778a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158403
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29628}
2019-10-28 11:30:23 +00:00
Mirko Bonadei
317a1f09ed Use std::make_unique instead of absl::make_unique.
WebRTC is now using C++14 so there is no need to use the Abseil version
of std::make_unique.

This CL has been created with the following steps:

git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt
git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt
git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt

diff --new-line-format="" --unchanged-line-format="" \
  /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \
  uniq > /tmp/only_make_unique.txt
diff --new-line-format="" --unchanged-line-format="" \
  /tmp/only_make_unique.txt /tmp/memory.txt | \
  xargs grep -l "absl/memory" > /tmp/add-memory.txt

git grep -l "\babsl::make_unique\b" | \
  xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g"

git checkout PRESUBMIT.py abseil-in-webrtc.md

cat /tmp/add-memory.txt | \
  xargs sed -i \
  's/#include "absl\/memory\/memory.h"/#include <memory>/g'
git cl format
# Manual fix order of the new inserted #include <memory>

cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \
  xargs sed -i '/#include "absl\/memory\/memory.h"/d'

git ls-files | grep BUILD.gn | \
  xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d'

python tools_webrtc/gn_check_autofix.py \
  -m tryserver.webrtc -b linux_rel

# Repead the gn_check_autofix step for other platforms

git ls-files | grep BUILD.gn | \
  xargs sed -i 's/absl\/memory:memory/absl\/memory/g'
git cl format

Bug: webrtc:10945
Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 15:47:29 +00:00
Joachim Reiersen
637bed5f8d Add missing BoringSSL ifdef to OpenSSLStreamAdapter
Compiling without BoringSSL fails since g_use_time_callback_for_testing
is defined inside a OPENSSL_IS_BORINGSSL block.

Bug: webrtc:10160
Change-Id: I25c27fa8ed128a50aa855db2012026c97954b91b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134226
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27779}
2019-04-25 21:12:57 +00:00
Benjamin Wright
af1f8655b2 Revert "Disable DTLS 1.0, TLS 1.0 and TLS 1.1 downgrade in WebRTC."
This reverts commit 7276b974b7.

Reason for revert: Changing to a later Chrome release.

Original change's description:
> Disable DTLS 1.0, TLS 1.0 and TLS 1.1 downgrade in WebRTC.
>
> This change disables DTLS 1.0, TLS 1.0 and TLS 1.1 in WebRTC by default. This
> is part of a larger effort at Google to remove old TLS protocols:
> https://security.googleblog.com/2018/10/modernizing-transport-security.html
>
> For the M74 timeline I have added a disabled by default field trial
> WebRTC-LegacyTlsProtocols which can be enabled to support these cipher suites
> as consumers move away from these legacy cipher protocols but it will be off
> in Chrome.
>
> This is compliant with the webrtc-security-arch specification which states:
>
>    All Implementations MUST implement DTLS 1.2 with the
>    TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 cipher suite and the P-256
>    curve [FIPS186].  Earlier drafts of this specification required DTLS
>    1.0 with the cipher suite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, and
>    at the time of this writing some implementations do not support DTLS
>    1.2; endpoints which support only DTLS 1.2 might encounter
>    interoperability issues.  The DTLS-SRTP protection profile
>    SRTP_AES128_CM_HMAC_SHA1_80 MUST be supported for SRTP.
>    Implementations MUST favor cipher suites which support (Perfect
>    Forward Secrecy) PFS over non-PFS cipher suites and SHOULD favor AEAD
>    over non-AEAD cipher suites.
>
> Bug: webrtc:10261
> Change-Id: I847c567592911cc437f095376ad67585b4355fc0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125141
> Commit-Queue: Benjamin Wright <benwright@webrtc.org>
> Reviewed-by: David Benjamin <davidben@webrtc.org>
> Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#27006}

TBR=steveanton@webrtc.org,davidben@webrtc.org,qingsi@webrtc.org,benwright@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:10261
Change-Id: I34727e65c069e1fb2ad71838828ad0a22b5fe811
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130367
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27403}
2019-04-01 19:11:07 +00:00
Benjamin Wright
7276b974b7 Disable DTLS 1.0, TLS 1.0 and TLS 1.1 downgrade in WebRTC.
This change disables DTLS 1.0, TLS 1.0 and TLS 1.1 in WebRTC by default. This
is part of a larger effort at Google to remove old TLS protocols:
https://security.googleblog.com/2018/10/modernizing-transport-security.html

For the M74 timeline I have added a disabled by default field trial
WebRTC-LegacyTlsProtocols which can be enabled to support these cipher suites
as consumers move away from these legacy cipher protocols but it will be off
in Chrome.

This is compliant with the webrtc-security-arch specification which states:

   All Implementations MUST implement DTLS 1.2 with the
   TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 cipher suite and the P-256
   curve [FIPS186].  Earlier drafts of this specification required DTLS
   1.0 with the cipher suite TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, and
   at the time of this writing some implementations do not support DTLS
   1.2; endpoints which support only DTLS 1.2 might encounter
   interoperability issues.  The DTLS-SRTP protection profile
   SRTP_AES128_CM_HMAC_SHA1_80 MUST be supported for SRTP.
   Implementations MUST favor cipher suites which support (Perfect
   Forward Secrecy) PFS over non-PFS cipher suites and SHOULD favor AEAD
   over non-AEAD cipher suites.

Bug: webrtc:10261
Change-Id: I847c567592911cc437f095376ad67585b4355fc0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/125141
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: David Benjamin <davidben@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27006}
2019-03-06 20:44:41 +00:00
Benjamin Wright
8e98c60f84 Cleanup for openssl_stream_adapter.cc.
This is a partial cleanup there is more work to do here. Essentially I am just
moving things from static to anonymous namespaces and reordering things to
make more sense. I have removed some old microsoft compiler warning
supressions which I believe are not required anymore.

After this BIO should be refactored to use proper style.

Bug: webrtc:9860
Change-Id: I8419be002d8f412dd89f37f3b865794792ccf559
Reviewed-on: https://webrtc-review.googlesource.com/c/120863
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26912}
2019-03-01 02:25:13 +00:00
Benjamin Wright
f54e30b596 Add const to variables in openssl_stream_adapter.cc that can use it.
This change simply adds const to all the variables that can use it. It seemed
like a good idea to enforce const correctness where possible in the TLS stack.

Bug: webrtc:9860
Change-Id: Iabfe1e26647b0c21e2f209e0e0f96d0ec7465e7a
Reviewed-on: https://webrtc-review.googlesource.com/c/124623
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26865}
2019-02-27 02:44:09 +00:00
Sergey Sablin
3c119fb793 Handle HKDF key derivation when building with OpenSSL.
Change-Id: I3fd503109190d6a94e15576312c9cb79906a7f61
Bug: webrtc:10160
Reviewed-on: https://webrtc-review.googlesource.com/c/122622
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26669}
2019-02-13 17:44:02 +00:00
David Benjamin
170a4b383f Trim unnecessary OpenSSL/BoringSSL ifdefs.
Now that WebRTC requires OpenSSL 1.1.0 as minimum, some bits can be
removed. The simpler versioning API is shared between BoringSSL and
OpenSSL 1.1.0, and there are some remnants of the threading callbacks
that can be removed.

Bug: none
Change-Id: I2078ca9c444b1f1efa9e4b235eb4e6037865d8fb
Reviewed-on: https://webrtc-review.googlesource.com/c/120261
Commit-Queue: David Benjamin <davidben@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26475}
2019-01-30 17:09:49 +00:00