]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add methods needed for storing challenge string
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 9 Apr 2007 13:51:33 +0000 (13:51 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 9 Apr 2007 13:51:33 +0000 (13:51 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6766 e03df62e-2008-0410-955e-edbf42e46eb7

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

index 4c8f1495709aca8fc064f262dd1f90b090499dc5..58f2b4bf1a2a2808a1369b017765e88d999bb521 100644 (file)
@@ -92,6 +92,8 @@ class TreeSocket : public InspSocket
        std::string ModuleList;                 /* Module list of other server from CAPAB */
        std::map<std::string,std::string> CapKeys;      /* CAPAB keys from other server */
        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 */
 
  public:
 
@@ -119,6 +121,22 @@ class TreeSocket : public InspSocket
         */
        ServerState GetLinkState();
 
+       /** Get challenge set in our CAPAB for challenge/response
+        */
+       const std::string& GetOurChallenge();
+
+       /** Get challenge set in our CAPAB for challenge/response
+        */
+       void SetOurChallenge(const std::string &c);
+
+       /** Get challenge set in their CAPAB for challenge/response
+        */
+       const std::string& GetTheirChallenge();
+
+       /** Get challenge set in their CAPAB for challenge/response
+        */
+       void SetTheirChallenge(const std::string &c);
+
        /** Return the module which we are hooking to for I/O encapsulation
         */
        Module* GetHook();
index 1f6d28d949745ba7feb21424d307f9d96c6b0dc2..3dbe2938714b33f4bbd0befe0966c012ad00f9df 100644 (file)
@@ -44,6 +44,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string ho
 {
        myhost = host;
        this->LinkState = LISTENER;
+       theirchallenge = ourchallenge = "";
        if (listening && Hook)
                InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send();
 }
@@ -52,6 +53,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string ho
        : InspSocket(SI, host, port, listening, maxtime, bindto), Utils(Util), Hook(HookMod)
 {
        myhost = ServerName;
+       theirchallenge = ourchallenge = "";
        this->LinkState = CONNECTING;
        if (Hook)
                InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send();
@@ -65,6 +67,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, cha
        : InspSocket(SI, newfd, ip), Utils(Util), Hook(HookMod)
 {
        this->LinkState = WAIT_AUTH_1;
+       theirchallenge = ourchallenge = "";
        /* If we have a transport module hooked to the parent, hook the same module to this
         * socket, and set a timer waiting for handshake before we send CAPAB etc.
         */
@@ -98,6 +101,26 @@ TreeSocket::~TreeSocket()
                InspSocketUnhookRequest(this, (Module*)Utils->Creator, Hook).Send();
 }
 
+const std::string& TreeSocket::GetOurChallenge()
+{
+       return this->ourchallenge;
+}
+
+void TreeSocket::SetOurChallenge(const std::string &c)
+{
+       this->ourchallenge = c;
+}
+
+const std::string& TreeSocket::GetTheirChallenge()
+{
+       return this->theirchallenge;
+}
+
+void TreeSocket::SetTheirChallenge(const std::string &c)
+{
+       this->theirchallenge = c;
+}
+
 /** When an outbound connection finishes connecting, we receive
  * this event, and must send our SERVER string to the other
  * side. If the other side is happy, as outlined in the server