diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/tls/tls_callbacks.h | 33 | ||||
-rw-r--r-- | src/lib/tls/tls_channel.cpp | 4 | ||||
-rw-r--r-- | src/lib/tls/tls_client.cpp | 16 | ||||
-rw-r--r-- | src/lib/tls/tls_client.h | 13 | ||||
-rw-r--r-- | src/lib/tls/tls_server.cpp | 16 | ||||
-rw-r--r-- | src/lib/tls/tls_server.h | 10 |
6 files changed, 49 insertions, 43 deletions
diff --git a/src/lib/tls/tls_callbacks.h b/src/lib/tls/tls_callbacks.h index 88e502e89..1e0aca9a9 100644 --- a/src/lib/tls/tls_callbacks.h +++ b/src/lib/tls/tls_callbacks.h @@ -353,40 +353,43 @@ class BOTAN_PUBLIC_API(2,0) Compat_Callbacks final : public Callbacks * @param next_proto is called with ALPN protocol data sent by the client */ BOTAN_DEPRECATED("Use TLS::Callbacks (virtual interface).") - Compat_Callbacks(output_fn output_fn, data_cb app_data_cb, alert_cb alert_cb, + Compat_Callbacks(output_fn data_output_fn, data_cb app_data_cb, alert_cb recv_alert_cb, handshake_cb hs_cb, handshake_msg_cb hs_msg_cb = nullptr, next_protocol_fn next_proto = nullptr) - : m_output_function(output_fn), m_app_data_cb(app_data_cb), - m_alert_cb(std::bind(alert_cb, std::placeholders::_1, nullptr, 0)), + : m_output_function(data_output_fn), m_app_data_cb(app_data_cb), + m_alert_cb(std::bind(recv_alert_cb, std::placeholders::_1, nullptr, 0)), m_hs_cb(hs_cb), m_hs_msg_cb(hs_msg_cb), m_next_proto(next_proto) {} BOTAN_DEPRECATED("Use TLS::Callbacks (virtual interface).") - Compat_Callbacks(output_fn output_fn, data_cb app_data_cb, - std::function<void (Alert)> alert_cb, + Compat_Callbacks(output_fn data_output_fn, data_cb app_data_cb, + std::function<void (Alert)> recv_alert_cb, handshake_cb hs_cb, handshake_msg_cb hs_msg_cb = nullptr, next_protocol_fn next_proto = nullptr) - : m_output_function(output_fn), m_app_data_cb(app_data_cb), - m_alert_cb(alert_cb), + : m_output_function(data_output_fn), m_app_data_cb(app_data_cb), + m_alert_cb(recv_alert_cb), m_hs_cb(hs_cb), m_hs_msg_cb(hs_msg_cb), m_next_proto(next_proto) {} enum class SILENCE_DEPRECATION_WARNING { PLEASE = 0 }; Compat_Callbacks(SILENCE_DEPRECATION_WARNING, - output_fn output_fn, data_cb app_data_cb, - std::function<void (Alert)> alert_cb, + output_fn data_output_fn, data_cb app_data_cb, + std::function<void (Alert)> recv_alert_cb, handshake_cb hs_cb, handshake_msg_cb hs_msg_cb = nullptr, next_protocol_fn next_proto = nullptr) - : m_output_function(output_fn), m_app_data_cb(app_data_cb), - m_alert_cb(alert_cb), - m_hs_cb(hs_cb), m_hs_msg_cb(hs_msg_cb), m_next_proto(next_proto) {} + : m_output_function(data_output_fn), + m_app_data_cb(app_data_cb), + m_alert_cb(recv_alert_cb), + m_hs_cb(hs_cb), + m_hs_msg_cb(hs_msg_cb), + m_next_proto(next_proto) {} Compat_Callbacks(SILENCE_DEPRECATION_WARNING, - output_fn output_fn, data_cb app_data_cb, alert_cb alert_cb, + output_fn data_output_fn, data_cb app_data_cb, alert_cb recv_alert_cb, handshake_cb hs_cb, handshake_msg_cb hs_msg_cb = nullptr, next_protocol_fn next_proto = nullptr) - : m_output_function(output_fn), m_app_data_cb(app_data_cb), - m_alert_cb(std::bind(alert_cb, std::placeholders::_1, nullptr, 0)), + : m_output_function(data_output_fn), m_app_data_cb(app_data_cb), + m_alert_cb(std::bind(recv_alert_cb, std::placeholders::_1, nullptr, 0)), m_hs_cb(hs_cb), m_hs_msg_cb(hs_msg_cb), m_next_proto(next_proto) {} diff --git a/src/lib/tls/tls_channel.cpp b/src/lib/tls/tls_channel.cpp index 6e3e5987b..37f3ec415 100644 --- a/src/lib/tls/tls_channel.cpp +++ b/src/lib/tls/tls_channel.cpp @@ -40,7 +40,7 @@ Channel::Channel(Callbacks& callbacks, Channel::Channel(output_fn out, data_cb app_data_cb, - alert_cb alert_cb, + alert_cb recv_alert_cb, handshake_cb hs_cb, handshake_msg_cb hs_msg_cb, Session_Manager& session_manager, @@ -55,7 +55,7 @@ Channel::Channel(output_fn out, relies on a deprecated API */ Compat_Callbacks::SILENCE_DEPRECATION_WARNING::PLEASE, - out, app_data_cb, alert_cb, hs_cb, hs_msg_cb)), + out, app_data_cb, recv_alert_cb, hs_cb, hs_msg_cb)), m_callbacks(*m_compat_callbacks.get()), m_session_manager(session_manager), m_policy(policy), diff --git a/src/lib/tls/tls_client.cpp b/src/lib/tls/tls_client.cpp index 39e69d8ea..94616c60b 100644 --- a/src/lib/tls/tls_client.cpp +++ b/src/lib/tls/tls_client.cpp @@ -64,10 +64,10 @@ Client::Client(Callbacks& callbacks, init(offer_version, next_protos); } -Client::Client(output_fn output_fn, +Client::Client(output_fn data_output_fn, data_cb proc_cb, - alert_cb alert_cb, - handshake_cb handshake_cb, + alert_cb recv_alert_cb, + handshake_cb hs_cb, Session_Manager& session_manager, Credentials_Manager& creds, const Policy& policy, @@ -76,7 +76,7 @@ Client::Client(output_fn output_fn, const Protocol_Version& offer_version, const std::vector<std::string>& next_protos, size_t io_buf_sz) : - Channel(output_fn, proc_cb, alert_cb, handshake_cb, Channel::handshake_msg_cb(), + Channel(data_output_fn, proc_cb, recv_alert_cb, hs_cb, Channel::handshake_msg_cb(), session_manager, rng, policy, offer_version.is_datagram_protocol(), io_buf_sz), m_creds(creds), m_info(info) @@ -84,10 +84,10 @@ Client::Client(output_fn output_fn, init(offer_version, next_protos); } -Client::Client(output_fn output_fn, +Client::Client(output_fn data_output_fn, data_cb proc_cb, - alert_cb alert_cb, - handshake_cb handshake_cb, + alert_cb recv_alert_cb, + handshake_cb hs_cb, handshake_msg_cb hs_msg_cb, Session_Manager& session_manager, Credentials_Manager& creds, @@ -96,7 +96,7 @@ Client::Client(output_fn output_fn, const Server_Information& info, const Protocol_Version& offer_version, const std::vector<std::string>& next_protos) : - Channel(output_fn, proc_cb, alert_cb, handshake_cb, hs_msg_cb, + Channel(data_output_fn, proc_cb, recv_alert_cb, hs_cb, hs_msg_cb, session_manager, rng, policy, offer_version.is_datagram_protocol()), m_creds(creds), m_info(info) diff --git a/src/lib/tls/tls_client.h b/src/lib/tls/tls_client.h index 67a086e15..63c26b9cd 100644 --- a/src/lib/tls/tls_client.h +++ b/src/lib/tls/tls_client.h @@ -63,15 +63,16 @@ class BOTAN_PUBLIC_API(2,0) Client final : public Channel /** * DEPRECATED. This constructor is only provided for backward - * compatibility and should not be used in new code. - * + * compatibility and should not be used in new code. It will be + * removed in a future release. + * * Set up a new TLS client session * - * @param output_fn is called with data for the outbound socket + * @param data_output_fn is called with data for the outbound socket * * @param app_data_cb is called when new application data is received * - * @param alert_cb is called when a TLS alert is received + * @param recv_alert_cb is called when a TLS alert is received * * @param hs_cb is called when a handshake is completed * @@ -95,9 +96,9 @@ class BOTAN_PUBLIC_API(2,0) Client final : public Channel * values just mean reallocations and copies are more likely. */ BOTAN_DEPRECATED("Use TLS::Client(TLS::Callbacks ...)") - Client(output_fn output_fn, + Client(output_fn data_output_fn, data_cb app_data_cb, - alert_cb alert_cb, + alert_cb recv_alert_cb, handshake_cb hs_cb, Session_Manager& session_manager, Credentials_Manager& creds, diff --git a/src/lib/tls/tls_server.cpp b/src/lib/tls/tls_server.cpp index 786932a1d..2b1885e45 100644 --- a/src/lib/tls/tls_server.cpp +++ b/src/lib/tls/tls_server.cpp @@ -303,9 +303,9 @@ Server::Server(Callbacks& callbacks, } Server::Server(output_fn output, - data_cb data_cb, - alert_cb alert_cb, - handshake_cb handshake_cb, + data_cb got_data_cb, + alert_cb recv_alert_cb, + handshake_cb hs_cb, Session_Manager& session_manager, Credentials_Manager& creds, const Policy& policy, @@ -313,7 +313,7 @@ Server::Server(output_fn output, next_protocol_fn next_proto, bool is_datagram, size_t io_buf_sz) : - Channel(output, data_cb, alert_cb, handshake_cb, + Channel(output, got_data_cb, recv_alert_cb, hs_cb, Channel::handshake_msg_cb(), session_manager, rng, policy, is_datagram, io_buf_sz), m_creds(creds), @@ -323,9 +323,9 @@ Server::Server(output_fn output, Server::Server(output_fn output, - data_cb data_cb, - alert_cb alert_cb, - handshake_cb handshake_cb, + data_cb got_data_cb, + alert_cb recv_alert_cb, + handshake_cb hs_cb, handshake_msg_cb hs_msg_cb, Session_Manager& session_manager, Credentials_Manager& creds, @@ -333,7 +333,7 @@ Server::Server(output_fn output, RandomNumberGenerator& rng, next_protocol_fn next_proto, bool is_datagram) : - Channel(output, data_cb, alert_cb, handshake_cb, hs_msg_cb, + Channel(output, got_data_cb, recv_alert_cb, hs_cb, hs_msg_cb, session_manager, rng, policy, is_datagram), m_creds(creds), m_choose_next_protocol(next_proto) diff --git a/src/lib/tls/tls_server.h b/src/lib/tls/tls_server.h index 7c5d9668f..c55c3f93d 100644 --- a/src/lib/tls/tls_server.h +++ b/src/lib/tls/tls_server.h @@ -61,12 +61,13 @@ class BOTAN_PUBLIC_API(2,0) Server final : public Channel /** * DEPRECATED. This constructor is only provided for backward * compatibility and should not be used in new implementations. + * It will be removed in a future release. */ BOTAN_DEPRECATED("Use TLS::Server(TLS::Callbacks ...)") Server(output_fn output, data_cb data_cb, - alert_cb alert_cb, - handshake_cb handshake_cb, + alert_cb recv_alert_cb, + handshake_cb hs_cb, Session_Manager& session_manager, Credentials_Manager& creds, const Policy& policy, @@ -79,12 +80,13 @@ class BOTAN_PUBLIC_API(2,0) Server final : public Channel /** * DEPRECATED. This constructor is only provided for backward * compatibility and should not be used in new implementations. + * It will be removed in a future release. */ BOTAN_DEPRECATED("Use TLS::Server(TLS::Callbacks ...)") Server(output_fn output, data_cb data_cb, - alert_cb alert_cb, - handshake_cb handshake_cb, + alert_cb recv_alert_cb, + handshake_cb hs_cb, handshake_msg_cb hs_msg_cb, Session_Manager& session_manager, Credentials_Manager& creds, |