This reverts commit c5f71087589b18bb4df1b78f2c452c4083edf2d9. 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 40261c3663fe316cfe40262c59cee993165ccf63 > > 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}
130 lines
4.4 KiB
C++
130 lines
4.4 KiB
C++
/*
|
|
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef P2P_BASE_DTLS_TRANSPORT_INTERNAL_H_
|
|
#define P2P_BASE_DTLS_TRANSPORT_INTERNAL_H_
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "api/crypto/crypto_options.h"
|
|
#include "api/dtls_transport_interface.h"
|
|
#include "api/scoped_refptr.h"
|
|
#include "p2p/base/ice_transport_internal.h"
|
|
#include "p2p/base/packet_transport_internal.h"
|
|
#include "rtc_base/constructor_magic.h"
|
|
#include "rtc_base/ssl_certificate.h"
|
|
#include "rtc_base/ssl_fingerprint.h"
|
|
#include "rtc_base/ssl_stream_adapter.h"
|
|
#include "rtc_base/third_party/sigslot/sigslot.h"
|
|
|
|
namespace cricket {
|
|
|
|
enum DtlsTransportState {
|
|
// Haven't started negotiating.
|
|
DTLS_TRANSPORT_NEW = 0,
|
|
// Have started negotiating.
|
|
DTLS_TRANSPORT_CONNECTING,
|
|
// Negotiated, and has a secure connection.
|
|
DTLS_TRANSPORT_CONNECTED,
|
|
// Transport is closed.
|
|
DTLS_TRANSPORT_CLOSED,
|
|
// Failed due to some error in the handshake process.
|
|
DTLS_TRANSPORT_FAILED,
|
|
};
|
|
|
|
webrtc::DtlsTransportState ConvertDtlsTransportState(
|
|
cricket::DtlsTransportState cricket_state);
|
|
|
|
enum PacketFlags {
|
|
PF_NORMAL = 0x00, // A normal packet.
|
|
PF_SRTP_BYPASS = 0x01, // An encrypted SRTP packet; bypass any additional
|
|
// crypto provided by the transport (e.g. DTLS)
|
|
};
|
|
|
|
// DtlsTransportInternal is an internal interface that does DTLS, also
|
|
// negotiating SRTP crypto suites so that it may be used for DTLS-SRTP.
|
|
//
|
|
// Once the public interface is supported,
|
|
// (https://www.w3.org/TR/webrtc/#rtcdtlstransport-interface)
|
|
// the DtlsTransportInterface will be split from this class.
|
|
class DtlsTransportInternal : public rtc::PacketTransportInternal {
|
|
public:
|
|
~DtlsTransportInternal() override;
|
|
|
|
virtual const webrtc::CryptoOptions& crypto_options() const = 0;
|
|
|
|
virtual DtlsTransportState dtls_state() const = 0;
|
|
|
|
virtual int component() const = 0;
|
|
|
|
virtual bool IsDtlsActive() const = 0;
|
|
|
|
virtual bool GetDtlsRole(rtc::SSLRole* role) const = 0;
|
|
|
|
virtual bool SetDtlsRole(rtc::SSLRole role) = 0;
|
|
|
|
// Finds out which TLS/DTLS version is running.
|
|
virtual bool GetSslVersionBytes(int* version) const = 0;
|
|
// Finds out which DTLS-SRTP cipher was negotiated.
|
|
// TODO(zhihuang): Remove this once all dependencies implement this.
|
|
virtual bool GetSrtpCryptoSuite(int* cipher) = 0;
|
|
|
|
// Finds out which DTLS cipher was negotiated.
|
|
// TODO(zhihuang): Remove this once all dependencies implement this.
|
|
virtual bool GetSslCipherSuite(int* cipher) = 0;
|
|
|
|
// Gets the local RTCCertificate used for DTLS.
|
|
virtual rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate()
|
|
const = 0;
|
|
|
|
virtual bool SetLocalCertificate(
|
|
const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) = 0;
|
|
|
|
// Gets a copy of the remote side's SSL certificate chain.
|
|
virtual std::unique_ptr<rtc::SSLCertChain> GetRemoteSSLCertChain() const = 0;
|
|
|
|
// Allows key material to be extracted for external encryption.
|
|
virtual bool ExportKeyingMaterial(const std::string& label,
|
|
const uint8_t* context,
|
|
size_t context_len,
|
|
bool use_context,
|
|
uint8_t* result,
|
|
size_t result_len) = 0;
|
|
|
|
// Set DTLS remote fingerprint. Must be after local identity set.
|
|
virtual bool SetRemoteFingerprint(const std::string& digest_alg,
|
|
const uint8_t* digest,
|
|
size_t digest_len) = 0;
|
|
|
|
virtual bool SetSslMaxProtocolVersion(rtc::SSLProtocolVersion version) = 0;
|
|
|
|
// Expose the underneath IceTransport.
|
|
virtual IceTransportInternal* ice_transport() = 0;
|
|
|
|
sigslot::signal2<DtlsTransportInternal*, DtlsTransportState> SignalDtlsState;
|
|
|
|
// Emitted whenever the Dtls handshake failed on some transport channel.
|
|
sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError;
|
|
|
|
protected:
|
|
DtlsTransportInternal();
|
|
|
|
private:
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportInternal);
|
|
};
|
|
|
|
} // namespace cricket
|
|
|
|
#endif // P2P_BASE_DTLS_TRANSPORT_INTERNAL_H_
|