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:
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;
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);
}
}
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)
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)
{
return this->Error(params);
}
+ else if (command == "CAPAB")
+ {
+ return this->Capab(params);
+ }
break;
case CONNECTED:
// This is the 'authenticated' state, when all passwords