From 8eec77bdde05b5e8503a5c19a7c40c60473e21cf Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 9 Apr 2007 15:34:14 +0000 Subject: Debug, and we seem to be sending capab twice git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6771 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/treesocket1.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index f145783bc..b0a7e3205 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -73,17 +73,9 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, cha * socket, and set a timer waiting for handshake before we send CAPAB etc. */ if (Hook) - { InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); - Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(Utils->LinkBlocks[0]), this->Utils)); - } - else - { - /* Otherwise, theres no lower layer transport in plain TCP/IP, - * so just send the capabilities right now. - */ - this->SendCapabilities(); - } + + Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(Utils->LinkBlocks[0]), this->Utils)); } ServerState TreeSocket::GetLinkState() @@ -109,6 +101,7 @@ const std::string& TreeSocket::GetOurChallenge() void TreeSocket::SetOurChallenge(const std::string &c) { + Instance->Log(DEBUG,"SetOurChallenge: "+c); this->ourchallenge = c; } @@ -119,11 +112,13 @@ const std::string& TreeSocket::GetTheirChallenge() void TreeSocket::SetTheirChallenge(const std::string &c) { + Instance->Log(DEBUG,"SetTheirChallenge: "+c); this->theirchallenge = c; } std::string TreeSocket::MakePass(const std::string &password, const std::string &challenge) { + Instance->Log(DEBUG,"MakePass('"+password+"','"+challenge+"')"); Module* sha256 = Instance->FindModule("m_sha256.so"); if (sha256 && !challenge.empty()) { @@ -136,13 +131,19 @@ std::string TreeSocket::MakePass(const std::string &password, const std::string hmac2 += static_cast(password[n] ^ 0x36); } + Instance->Log(DEBUG,"MakePass hmac1="+hmac1+" hmac="+hmac2); + HashResetRequest(Utils->Creator, sha256).Send(); hmac2 = HashSumRequest(Utils->Creator, sha256, hmac2).Send(); + Instance->Log(DEBUG,"MakePass hmac1="+hmac1+" hmac="+hmac2); + HashResetRequest(Utils->Creator, sha256).Send(); std::string hmac = hmac1 + hmac2 + challenge; hmac = HashSumRequest(Utils->Creator, sha256, hmac).Send(); + Instance->Log(DEBUG,"MakePass hmac="+hmac); + return hmac; } else if (!challenge.empty() && !sha256) -- cgit v1.2.3