diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-10-16 21:15:31 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-10-16 21:15:31 +0200 |
commit | 3e20f7bd2959fb1f267ba03b0387443b1c30cba1 (patch) | |
tree | 619ce4daa95286133165d8209be4702f6a8b339d /src/modules/extra | |
parent | e04ece9061f3b454876a09da9cac018d6aabef9a (diff) |
Add interface to SSL modules that allows other modules to obtain the raw SSL session of a socket
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 6 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 4135194c5..cdfe00b9c 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -615,6 +615,12 @@ class ModuleSSLGnuTLS : public Module req.cert = session->cert; } + else if (!strcmp("GET_RAW_SSL_SESSION", request.id)) + { + SSLRawSessionRequest& req = static_cast<SSLRawSessionRequest&>(request); + if ((req.fd >= 0) && (req.fd < ServerInstance->SE->GetMaxFds())) + req.data = reinterpret_cast<void*>(sessions[req.fd].sess); + } } void InitSession(StreamSocket* user, bool me_server) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 27cd3a2ae..9ca92fe52 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -392,6 +392,12 @@ class ModuleSSLOpenSSL : public Module req.cert = session->cert; } + else if (!strcmp("GET_RAW_SSL_SESSION", request.id)) + { + SSLRawSessionRequest& req = static_cast<SSLRawSessionRequest&>(request); + if ((req.fd >= 0) && (req.fd < ServerInstance->SE->GetMaxFds())) + req.data = reinterpret_cast<void*>(sessions[req.fd].sess); + } } void OnStreamSocketAccept(StreamSocket* user, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server) |