Skip to content
Snippets Groups Projects
Commit 3f93ddf7 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

peer connection: pass ioContext, logger

Change-Id: Ifb0a3a3a408d8ec7bd001c960315cf2e6d6ad0df
parent 8b831a80
Branches
No related tags found
Loading
......@@ -545,6 +545,7 @@ ConnectionManager::Impl::connectDeviceOnNegoDone(
config_->logger->debug("Start TLS session - Initied by connectDevice(). Launched by channel: {} - device: {} - vid: {}", name, deviceId, vid);
info->tls_ = std::make_unique<TlsSocketEndpoint>(std::move(endpoint),
certStore(),
config_->ioContext,
identity(),
dhParams(),
*cert);
......@@ -1052,6 +1053,7 @@ ConnectionManager::Impl::onRequestOnNegoDone(const PeerConnectionRequest& req)
info->tls_ = std::make_unique<TlsSocketEndpoint>(
std::move(endpoint),
certStore(),
config_->ioContext,
identity(),
dhParams(),
[ph, w = weak()](const dht::crypto::Certificate& cert) {
......
......@@ -162,6 +162,7 @@ public:
Impl(std::unique_ptr<IceSocketEndpoint>&& ep,
tls::CertificateStore& certStore,
const std::shared_ptr<asio::io_context>& ioContext,
const dht::crypto::Certificate& peer_cert,
const Identity& local_identity,
const std::shared_future<tls::DhParams>& dh_params)
......@@ -188,12 +189,15 @@ public:
/*.certStore = */ certStore,
/*.timeout = */ TLS_TIMEOUT,
/*.cert_check = */ nullptr,
/*.io_context = */ ioContext,
/* .logger = */ ep->underlyingICE()->logger()
};
tls = std::make_unique<tls::TlsSession>(std::move(ep), tls_param, tls_cbs);
}
Impl(std::unique_ptr<IceSocketEndpoint>&& ep,
tls::CertificateStore& certStore,
std::shared_ptr<asio::io_context> ioContext,
std::function<bool(const dht::crypto::Certificate&)>&& cert_check,
const Identity& local_identity,
const std::shared_future<tls::DhParams>& dh_params)
......@@ -221,6 +225,8 @@ public:
/*.certStore = */ certStore,
/*.timeout = */ std::chrono::duration_cast<decltype(tls::TlsParams::timeout)>(TLS_TIMEOUT),
/*.cert_check = */ nullptr,
/*.io_context = */ ioContext,
/* .logger = */ ep->underlyingICE()->logger()
};
tls = std::make_unique<tls::TlsSession>(std::move(ep), tls_param, tls_cbs);
}
......@@ -312,20 +318,22 @@ TlsSocketEndpoint::Impl::onTlsCertificatesUpdate([[maybe_unused]] const gnutls_d
TlsSocketEndpoint::TlsSocketEndpoint(std::unique_ptr<IceSocketEndpoint>&& tr,
tls::CertificateStore& certStore,
const std::shared_ptr<asio::io_context>& ioContext,
const Identity& local_identity,
const std::shared_future<tls::DhParams>& dh_params,
const dht::crypto::Certificate& peer_cert)
: pimpl_ {std::make_unique<Impl>(std::move(tr), certStore, peer_cert, local_identity, dh_params)}
: pimpl_ {std::make_unique<Impl>(std::move(tr), certStore, ioContext, peer_cert, local_identity, dh_params)}
{}
TlsSocketEndpoint::TlsSocketEndpoint(
std::unique_ptr<IceSocketEndpoint>&& tr,
tls::CertificateStore& certStore,
const std::shared_ptr<asio::io_context>& ioContext,
const Identity& local_identity,
const std::shared_future<tls::DhParams>& dh_params,
std::function<bool(const dht::crypto::Certificate&)>&& cert_check)
: pimpl_ {
std::make_unique<Impl>(std::move(tr), certStore, std::move(cert_check), local_identity, dh_params)}
std::make_unique<Impl>(std::move(tr), certStore, ioContext, std::move(cert_check), local_identity, dh_params)}
{}
TlsSocketEndpoint::~TlsSocketEndpoint() {}
......
......@@ -94,11 +94,13 @@ public:
TlsSocketEndpoint(std::unique_ptr<IceSocketEndpoint>&& tr,
tls::CertificateStore& certStore,
const std::shared_ptr<asio::io_context>& ioContext,
const Identity& local_identity,
const std::shared_future<tls::DhParams>& dh_params,
const dht::crypto::Certificate& peer_cert);
TlsSocketEndpoint(std::unique_ptr<IceSocketEndpoint>&& tr,
tls::CertificateStore& certStore,
const std::shared_ptr<asio::io_context>& ioContext,
const Identity& local_identity,
const std::shared_future<tls::DhParams>& dh_params,
std::function<bool(const dht::crypto::Certificate&)>&& cert_check);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment