summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-18 19:17:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-18 19:17:40 +0000
commitf08dda3cad24f68719e9c58d28b9381aad7f8689 (patch)
tree79db3c5e96501f395491e4ce8003f018d6cfbd61 /src/modules/extra
parent97c0bb9edc4cb7597017fe60c78c81375baa80be (diff)
Add ISUPPORT SSL token requested by tabris.
Syntax: SSL=<ip/host>:<port>[;<ip/host>:<port> ...] Note that the insp implementation due to API limitations (ick, we have some) will print '*' in the host/ip section, meaning 'bound to all', a client should just connect-back to the ip it connected to initially, on the new port to make use of this. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7386 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp10
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp13
2 files changed, 21 insertions, 2 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 8c08fb80b..a6fd64fa7 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -80,6 +80,7 @@ class ModuleSSLGnuTLS : public Module
std::string certfile;
std::string cafile;
std::string crlfile;
+ std::string sslports;
int dh_bits;
int clientactive;
@@ -124,6 +125,7 @@ class ModuleSSLGnuTLS : public Module
listenports.clear();
clientactive = 0;
+ sslports.clear();
for(int i = 0; i < Conf->Enumerate("bind"); i++)
{
@@ -147,6 +149,7 @@ class ModuleSSLGnuTLS : public Module
if (ServerInstance->Config->ports[i]->GetPort() == portno)
ServerInstance->Config->ports[i]->SetDescription("ssl");
ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno);
+ sslports.append("*:").append(ConvToStr(portno)).append(";");
}
else
{
@@ -281,10 +284,15 @@ class ModuleSSLGnuTLS : public Module
void Implements(char* List)
{
- List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = 1;
+ List[I_On005Numeric] = List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = 1;
List[I_OnRequest] = List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnUnloadModule] = List[I_OnRehash] = List[I_OnWhois] = List[I_OnPostConnect] = 1;
}
+ virtual void On005Numeric(std::string &output)
+ {
+ output.append(" SSL=" + sslports);
+ }
+
virtual char* OnRequest(Request* request)
{
ISHRequest* ISR = (ISHRequest*)request;
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 943d88843..1d323e3b8 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -122,6 +122,7 @@ class ModuleSSLOpenSSL : public Module
std::string cafile;
// std::string crlfile;
std::string dhfile;
+ std::string sslports;
int clientactive;
@@ -168,6 +169,7 @@ class ModuleSSLOpenSSL : public Module
listenports.clear();
clientactive = 0;
+ sslports.clear();
for (int i = 0; i < Conf->Enumerate("bind"); i++)
{
@@ -191,6 +193,7 @@ class ModuleSSLOpenSSL : public Module
if (ServerInstance->Config->ports[i]->GetPort() == portno)
ServerInstance->Config->ports[i]->SetDescription("ssl");
ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno);
+ sslports.append("*:").append(ConvToStr(portno)).append(";");
}
else
{
@@ -205,6 +208,9 @@ class ModuleSSLOpenSSL : public Module
}
}
+ if (!sslports.empty())
+ sslports.erase(sslports.end() - 1);
+
std::string confdir(ServerInstance->ConfigFileName);
// +1 so we the path ends with a /
confdir = confdir.substr(0, confdir.find_last_of('/') + 1);
@@ -285,6 +291,11 @@ class ModuleSSLOpenSSL : public Module
DELETE(Conf);
}
+ virtual void On005Numeric(std::string &output)
+ {
+ output.append(" SSL=" + sslports);
+ }
+
virtual ~ModuleSSLOpenSSL()
{
SSL_CTX_free(ctx);
@@ -334,7 +345,7 @@ class ModuleSSLOpenSSL : public Module
void Implements(char* List)
{
- List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = 1;
+ List[I_OnRawSocketConnect] = List[I_OnRawSocketAccept] = List[I_OnRawSocketClose] = List[I_OnRawSocketRead] = List[I_OnRawSocketWrite] = List[I_OnCleanup] = List[I_On005Numeric] = 1;
List[I_OnRequest] = List[I_OnSyncUserMetaData] = List[I_OnDecodeMetaData] = List[I_OnUnloadModule] = List[I_OnRehash] = List[I_OnWhois] = List[I_OnPostConnect] = 1;
}