summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-19 15:44:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-19 15:44:40 +0000
commita37f75ae6d967f2193ee1796d75b61eb63946093 (patch)
treeedbf2c9540468d3035e403750a0f883d55084175 /src/modules/m_spanningtree.cpp
parentadc3349b11cb396b1c957245f8e5a89396959144 (diff)
Added extra key length checks, documented encryption in example conf
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2576 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 10da3222c..6e2760e62 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -612,8 +612,15 @@ class TreeSocket : public InspSocket
{
if (x->EncryptionKey != "")
{
- this->WriteLine("AES "+Srv->GetServerName());
- this->InitAES(x->EncryptionKey,x->Name);
+ if (!(x->EncryptionKey.length() == 16 || x->EncryptionKey.length() == 24 || x->EncryptionKey.length() == 32))
+ {
+ WriteOpers("\2WARNING\2: Your encryption key is NOT 16, 24 or 32 characters in length, encryption will \2NOT\2 be enabled.");
+ }
+ else
+ {
+ this->WriteLine("AES "+Srv->GetServerName());
+ this->InitAES(x->EncryptionKey,x->Name);
+ }
}
/* found who we're supposed to be connecting to, send the neccessary gubbins. */
this->WriteLine("SERVER "+Srv->GetServerName()+" "+x->SendPass+" 0 :"+Srv->GetServerDescription());
@@ -1719,7 +1726,11 @@ class TreeSocket : public InspSocket
}
return true;
}
-
+ else if ((this->ctx) && (command == "AES"))
+ {
+ WriteOpers("\2AES\2: Encryption already enabled on this connection yet %s is trying to enable it twice!",params[0].c_str());
+ }
+
switch (this->LinkState)
{
TreeServer* Node;