]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
I think we're almost there now
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 9 Apr 2007 16:15:13 +0000 (16:15 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 9 Apr 2007 16:15:13 +0000 (16:15 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6774 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/treesocket.h
src/modules/m_spanningtree/treesocket1.cpp
src/modules/m_spanningtree/treesocket2.cpp

index 5af0b0eb9f6cc825740f9964b235529977ca5e07..db19f76ac76306b377cc0bd5bd00ec0d9f28b8f3 100644 (file)
@@ -94,6 +94,7 @@ class TreeSocket : public InspSocket
        Module* Hook;                           /* I/O hooking module that we're attached to for this socket */
        std::string ourchallenge;               /* Challenge sent for challenge/response */
        std::string theirchallenge;             /* Challenge recv for challenge/response */
+       std::string OutboundPass;               /* Outbound password */
 
  public:
 
index 2ce296001a502efe649d435710a6ae25a522af47..54aa27982cd417d290bc6dc5448938dc84f78cd0 100644 (file)
@@ -173,6 +173,7 @@ bool TreeSocket::OnConnected()
                                        InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send();
                                        this->Instance->SNO->WriteToSnoMask('l',"Connection to \2"+myhost+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] using transport \2"+x->Hook+"\2");
                                }
+                               this->OutboundPass = x->SendPass;
                                /* found who we're supposed to be connecting to, send the neccessary gubbins. */
                                Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(*x), this->Utils));
                                return true;
@@ -414,9 +415,7 @@ bool TreeSocket::Capab(const std::deque<std::string> &params)
                        this->SetTheirChallenge(n->second);
                        if (!this->GetOurChallenge().empty() && (this->LinkState == CONNECTING))
                        {
-                               Link* lnk = Utils->FindLink(this->myhost.c_str());
-                               if (lnk)
-                                       this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(lnk->SendPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
+                               this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(OutboundPass, this->GetTheirChallenge())+" 0 :"+this->Instance->Config->ServerDesc);
                        }
                }
 
index 1aa4fc8c71d252968b258f44578ef2047f7f4fe2..5f8cafb533a728b5fd49ecffcc1df1aba31f2151 100644 (file)
@@ -833,7 +833,7 @@ bool TreeSocket::Outbound_Reply_Server(std::deque<std::string> &params)
        std::string description = params[3];
        for (std::vector<Link>::iterator x = Utils->LinkBlocks.begin(); x < Utils->LinkBlocks.end(); x++)
        {
-               if ((x->Name == servername) && (this->MakePass(x->RecvPass,this->GetOurChallenge()) == this->MakePass(password,this->GetOurChallenge())))
+               if ((x->Name == servername) && (this->MakePass(x->RecvPass,this->GetOurChallenge()) == password))
                {
                        TreeServer* CheckDupe = Utils->FindServer(sname);
                        if (CheckDupe)
@@ -882,7 +882,7 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> &params)
        std::string description = params[3];
        for (std::vector<Link>::iterator x = Utils->LinkBlocks.begin(); x < Utils->LinkBlocks.end(); x++)
        {
-               if ((x->Name == servername) && (this->MakePass(x->RecvPass,this->GetOurChallenge()) == this->MakePass(password,this->GetOurChallenge())))
+               if ((x->Name == servername) && (this->MakePass(x->RecvPass,this->GetOurChallenge()) == password))
                {
                        TreeServer* CheckDupe = Utils->FindServer(sname);
                        if (CheckDupe)
@@ -1069,6 +1069,10 @@ bool TreeSocket::ProcessLine(std::string &line)
                        {
                                return this->Error(params);
                        }
+                       else if (command == "CAPAB")
+                       {
+                               return this->Capab(params);
+                       }
                break;
                case CONNECTED:
                        // This is the 'authenticated' state, when all passwords