From a9969bfb4b343e7d4b1f8d3f3c7c20cf25006360 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 5 Mar 2019 11:34:55 -0800 Subject: [PATCH] ircd::net: Show current cipher in handshake debug log msgs. --- ircd/net.cc | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/ircd/net.cc b/ircd/net.cc index 25a45a75c..e0abf00c9 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -1399,13 +1399,24 @@ noexcept try --handshaking; assert(bool(sock)); + + #ifdef RB_DEBUG + const auto ¤t_cipher + { + openssl::current_cipher(*sock) + }; + log::debug { - log, "%s handshook(%zu) %s", + log, "%s handshook(%zu) cipher:%s %s", loghead(*sock), handshaking, + current_cipher? + openssl::name(*current_cipher): + ""_sv, string(ec) }; + #endif check_handshake_error(ec, *sock); sock->cancel_timeout(); @@ -2581,12 +2592,22 @@ noexcept try if(timedout && ec == errc::operation_canceled) ec = make_error_code(errc::timed_out); + #ifdef RB_DEBUG + const auto ¤t_cipher + { + openssl::current_cipher(*this) + }; + log::debug { - log, "%s handshake %s", + log, "%s handshake cipher:%s %s", loghead(*this), + current_cipher? + openssl::name(*current_cipher): + ""_sv, string(ec) }; + #endif // This is the end of the asynchronous call chain; the user is called // back with or without error here.