From f91da925b585414ab8e768aa331f37ca2d348e2e Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 28 Apr 2016 17:06:16 +0200 Subject: Export the GetCiphersuite() method from the SSL modules --- src/modules/extra/m_ssl_gnutls.cpp | 4 +++- src/modules/extra/m_ssl_openssl.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 6a653dded..69aedf03d 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -1164,8 +1164,10 @@ info_done_dealloc: } } - void GetCiphersuite(std::string& out) const + void GetCiphersuite(std::string& out) const CXX11_OVERRIDE { + if (!IsHandshakeDone()) + return; out.append(UnknownIfNULL(gnutls_protocol_get_name(gnutls_protocol_get_version(sess)))).push_back('-'); out.append(UnknownIfNULL(gnutls_kx_get_name(gnutls_kx_get(sess)))).push_back('-'); out.append(UnknownIfNULL(gnutls_cipher_get_name(gnutls_cipher_get(sess)))).push_back('-'); diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index c9ae14e11..ed66291f4 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -735,8 +735,10 @@ class OpenSSLIOHook : public SSLIOHook } } - void GetCiphersuite(std::string& out) const + void GetCiphersuite(std::string& out) const CXX11_OVERRIDE { + if (!IsHandshakeDone()) + return; out.append(SSL_get_version(sess)).push_back('-'); out.append(SSL_get_cipher(sess)); } -- cgit v1.2.3