keylength = key.length();
if (!(keylength == 16 || keylength == 24 || keylength == 32))
{
- WriteOpers("\2ERROR\2: Key length for encryptionkey is not 16, 24 or 32 bytes in length!");
+ WriteOpers("*** \2ERROR\2: Key length for encryptionkey is not 16, 24 or 32 bytes in length!");
log(DEBUG,"Key length not 16, 24 or 32 characters!");
}
else
{
- WriteOpers("\2AES\2: Initialized %d bit encryption to server %s",keylength*8,SName.c_str());
+ WriteOpers("*** \2AES\2: Initialized %d bit encryption to server %s",keylength*8,SName.c_str());
ctx->MakeKey(key.c_str(), "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", keylength, keylength);
}
if (CheckDupe)
{
this->WriteLine("ERROR :Server "+servername+" already exists on server "+CheckDupe->GetParent()->GetName()+"!");
+ Srv->SendOpers("*** Server connection from \2"+servername+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
return false;
}
TreeServer* Node = new TreeServer(servername,description,ParentOfThis,NULL);
if (hops)
{
this->WriteLine("ERROR :Server too far away for authentication");
+ Srv->SendOpers("*** Server connection from \2"+servername+"\2 denied, server is too far away for authentication");
return false;
}
std::string description = params[3];
if (CheckDupe)
{
this->WriteLine("ERROR :Server "+servername+" already exists on server "+CheckDupe->GetParent()->GetName()+"!");
+ Srv->SendOpers("*** Server connection from \2"+servername+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
return false;
}
// Begin the sync here. this kickstarts the
}
}
this->WriteLine("ERROR :Invalid credentials");
+ Srv->SendOpers("*** Server connection from \2"+servername+"\2 denied, invalid link credentials");
return false;
}
if (hops)
{
this->WriteLine("ERROR :Server too far away for authentication");
+ Srv->SendOpers("*** Server connection from \2"+servername+"\2 denied, server is too far away for authentication");
return false;
}
std::string description = params[3];
if (CheckDupe)
{
this->WriteLine("ERROR :Server "+servername+" already exists on server "+CheckDupe->GetParent()->GetName()+"!");
+ Srv->SendOpers("*** Server connection from \2"+servername+"\2 denied, already exists on server "+CheckDupe->GetParent()->GetName());
return false;
}
/* If the config says this link is encrypted, but the remote side
if ((x->EncryptionKey != "") && (!this->ctx))
{
this->WriteLine("ERROR :This link requires AES encryption to be enabled. Plaintext connection refused.");
+ Srv->SendOpers("*** Server connection from \2"+servername+"\2 denied, remote server did not enable AES.");
return false;
}
Srv->SendOpers("*** Verified incoming server connection from \002"+servername+"\002["+this->GetIP()+"] ("+description+")");
}
}
this->WriteLine("ERROR :Invalid credentials");
+ Srv->SendOpers("*** Server connection from \2"+servername+"\2 denied, invalid link credentials");
return false;
}
}
else if ((this->ctx) && (command == "AES"))
{
- WriteOpers("\2AES\2: Encryption already enabled on this connection yet %s is trying to enable it twice!",params[0].c_str());
+ WriteOpers("*** \2AES\2: Encryption already enabled on this connection yet %s is trying to enable it twice!",params[0].c_str());
}
switch (this->LinkState)
{
return this->Error(params);
}
+ else if (command == "USER")
+ {
+ this->WriteLine("ERROR :Client connections to this port are prohibited.");
+ return false;
+ }
break;
case WAIT_AUTH_2:
// Waiting for start of other side's netmerge to say they liked our
{
if (route_back_again)
{
- WriteOpers("Protocol violation: Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName().c_str());
+ WriteOpers("*** Protocol violation: Fake direction in command '%s' from connection '%s'",line.c_str(),this->GetName().c_str());
}
else
{
- WriteOpers("Protocol violation: Invalid source '%s' in command '%s' from connection '%s'",direction.c_str(),line.c_str(),this->GetName().c_str());
+ WriteOpers("*** Protocol violation: Invalid source '%s' in command '%s' from connection '%s'",direction.c_str(),line.c_str(),this->GetName().c_str());
}
return true;
{
for (unsigned int i = 0; i < LinkBlocks.size(); i++)
{
- WriteServ(user->fd,"213 %s C *@%s * %s %d 0 M",user->nick,LinkBlocks[i].IPAddr.c_str(),LinkBlocks[i].Name.c_str(),LinkBlocks[i].Port);
+ WriteServ(user->fd,"213 %s C *@%s * %s %d 0 %s",user->nick,LinkBlocks[i].IPAddr.c_str(),LinkBlocks[i].Name.c_str(),LinkBlocks[i].Port,(LinkBlocks[i].EncryptionKey != "" ? "es" : " s"));
WriteServ(user->fd,"244 %s H * * %s",user->nick,LinkBlocks[i].Name.c_str());
}
WriteServ(user->fd,"219 %s %s :End of /STATS report",user->nick,parameters[0]);