]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/utils.cpp
Improve SSL fingerprint on link message
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / utils.cpp
index da3417de9735d60a8c5a85d047e507a20b8c1869..ab057570a3a2f32655d3a25fd60882e556d0c48b 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -371,8 +371,8 @@ void SpanningTreeUtilities::ReadConfiguration()
                L->AllowMask = tag->getString("allowmask");
                L->IPAddr = tag->getString("ipaddr");
                L->Port = tag->getInt("port");
-               L->SendPass = tag->getString("sendpass");
-               L->RecvPass = tag->getString("recvpass");
+               L->SendPass = tag->getString("sendpass", tag->getString("password"));
+               L->RecvPass = tag->getString("recvpass", tag->getString("password"));
                L->Fingerprint = tag->getString("fingerprint");
                L->HiddenFromStats = tag->getBool("statshidden");
                L->Timeout = tag->getInt("timeout");
@@ -386,6 +386,15 @@ void SpanningTreeUtilities::ReadConfiguration()
                if (L->Name.length() > 64)
                        throw CoreException("The link name '"+assign(L->Name)+"' is longer than 64 characters!");
 
+               if (L->Fingerprint.find(':') != std::string::npos)
+               {
+                       std::string tmp = L->Fingerprint;
+                       L->Fingerprint.clear();
+                       for(unsigned int j=0; j < tmp.length(); j++)
+                               if (tmp[j] != ':')
+                                       L->Fingerprint.push_back(tmp[j]);
+               }
+
                if ((!L->IPAddr.empty()) && (!L->RecvPass.empty()) && (!L->SendPass.empty()) && (!L->Name.empty()) && (L->Port))
                {
                        ValidIPs.push_back(L->IPAddr);