git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6768
e03df62e-2008-0410-955e-
edbf42e46eb7
{
sock->SendCapabilities();
if (sock->GetLinkState() == CONNECTING)
{
sock->SendCapabilities();
if (sock->GetLinkState() == CONNECTING)
- sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+lnk->SendPass+" 0 :"+this->Instance->Config->ServerDesc);
+ sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+sock->MakePass(lnk->SendPass)+" 0 :"+this->Instance->Config->ServerDesc);
InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
sock->SendCapabilities();
if (sock->GetLinkState() == CONNECTING)
InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send();
sock->SendCapabilities();
if (sock->GetLinkState() == CONNECTING)
- sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+lnk->SendPass+" 0 :"+this->Instance->Config->ServerDesc);
+ sock->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+sock->MakePass(lnk->SendPass)+" 0 :"+this->Instance->Config->ServerDesc);
*/
std::string RandString(unsigned int length);
*/
std::string RandString(unsigned int length);
+ /** Construct a password, optionally hashed with the other side's
+ * challenge string
+ */
+ std::string MakePass(const std::string &password);
+
/** 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
/** 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
this->theirchallenge = c;
}
this->theirchallenge = c;
}
+std::string TreeSocket::MakePass(const std::string &password)
+{
+ if ((this->GetOurChallenge() != "") && (this->GetTheirChallenge() != ""))
+ {
+ return password + ":" + this->GetTheirChallenge();
+ }
+ return password;
+}
+
/** 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
/** 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
else
this->SendCapabilities();
/* found who we're supposed to be connecting to, send the neccessary gubbins. */
else
this->SendCapabilities();
/* found who we're supposed to be connecting to, send the neccessary gubbins. */
- /*if (Hook)*/
- Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(*x), this->Utils));
- /*else
- this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+x->SendPass+" 0 :"+this->Instance->Config->ServerDesc);*/
+ Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(*x), this->Utils));
this->InboundDescription = description;
// this is good. Send our details: Our server name and description and hopcount of 0,
// along with the sendpass from this block.
this->InboundDescription = description;
// this is good. Send our details: Our server name and description and hopcount of 0,
// along with the sendpass from this block.
- this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+x->SendPass+" 0 :"+this->Instance->Config->ServerDesc);
+ this->WriteLine(std::string("SERVER ")+this->Instance->Config->ServerName+" "+this->MakePass(x->SendPass)+" 0 :"+this->Instance->Config->ServerDesc);
// move to the next state, we are now waiting for THEM.
this->LinkState = WAIT_AUTH_2;
return true;
// move to the next state, we are now waiting for THEM.
this->LinkState = WAIT_AUTH_2;
return true;