diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/treesocket.h | 18 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 23 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 4c8f14957..58f2b4bf1 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -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(); diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 1f6d28d94..3dbe29387 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -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 |