From a37f75ae6d967f2193ee1796d75b61eb63946093 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 19 Dec 2005 15:44:40 +0000 Subject: 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 --- src/modules/m_spanningtree.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/modules') 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; -- cgit v1.2.3