diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-04-05 21:03:35 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-04-05 21:03:35 +0000 |
commit | 1997b706416324bded467d7abf34667dfe4b6ff2 (patch) | |
tree | 758bdb090466f4304dad60ed8f8f4d14246bc147 /src/modules/extra | |
parent | 6ed948b23c91653bb341ad40fffda44f55f25e0f (diff) |
Add feature outlined in bug #192, give a notice showing cipher on connect to users. Its not possible (without something really spammy and ugly) to show it to opers, and its no use showing it to opers
anyway, this would just be a silly vanity feature :p (admins know its working - people are connecting on the ssl port!)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6736 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 7 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 6abc5c1de..def9abdd2 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -657,6 +657,13 @@ class ModuleSSLGnuTLS : public Module DELETE(metadata); VerifyCertificate(&sessions[user->GetFd()],user); + if (sessions[user->GetFd()].sess) + { + std::string cipher = gnutls_kx_get_name(gnutls_kx_get(sessions[user->GetFd()].sess)); + cipher.append("-").append(gnutls_cipher_get_name(gnutls_cipher_get(sessions[user->GetFd()].sess))).append("-"); + cipher.append(gnutls_mac_get_name(gnutls_mac_get(sessions[user->GetFd()].sess))); + user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick, cipher.c_str()); + } } } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index def8a0061..ee672b798 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -107,6 +107,7 @@ class ModuleSSLOpenSSL : public Module SSL_CTX* clictx; char* dummy; + char cipher[MAXBUF]; std::string keyfile; std::string certfile; @@ -746,6 +747,8 @@ class ModuleSSLOpenSSL : public Module DELETE(metadata); VerifyCertificate(&sessions[user->GetFd()], user); + if (sessions[user->GetFd()].sess) + user->WriteServ("NOTICE %s :*** You are connected using SSL cipher \"%s\"", user->nick, SSL_get_cipher(sessions[user->GetFd()].sess)); } } |