Close another potential anti-recursion loophole.

This commit is contained in:
Adam Ierymenko 2016-01-06 15:35:27 -08:00
parent 47ce52228b
commit a56fbc1929
3 changed files with 3 additions and 0 deletions

View File

@ -250,6 +250,7 @@ bool IncomingPacket::_doHELLO(const RuntimeEnvironment *RR,SharedPtr<Peer> &peer
outp.append((uint64_t)pid); outp.append((uint64_t)pid);
outp.append((unsigned char)Packet::ERROR_IDENTITY_COLLISION); outp.append((unsigned char)Packet::ERROR_IDENTITY_COLLISION);
outp.armor(key,true); outp.armor(key,true);
RR->antiRec->logOutgoingZT(outp.data(),outp.size());
RR->node->putPacket(_localAddress,_remoteAddress,outp.data(),outp.size()); RR->node->putPacket(_localAddress,_remoteAddress,outp.data(),outp.size());
} else { } else {
TRACE("rejected HELLO from %s(%s): packet failed authentication",id.address().toString().c_str(),_remoteAddress.toString().c_str()); TRACE("rejected HELLO from %s(%s): packet failed authentication",id.address().toString().c_str(),_remoteAddress.toString().c_str());

View File

@ -199,6 +199,7 @@ void Peer::received(
// 1.1.1 and newer nodes support ECHO, which is smaller -- but 1.1.0 has a bug so use HELLO there too // 1.1.1 and newer nodes support ECHO, which is smaller -- but 1.1.0 has a bug so use HELLO there too
Packet outp(_id.address(),RR->identity.address(),Packet::VERB_ECHO); Packet outp(_id.address(),RR->identity.address(),Packet::VERB_ECHO);
outp.armor(_key,true); outp.armor(_key,true);
RR->antiRec->logOutgoingZT(outp.data(),outp.size());
RR->node->putPacket(localAddr,remoteAddr,outp.data(),outp.size()); RR->node->putPacket(localAddr,remoteAddr,outp.data(),outp.size());
} else { } else {
sendHELLO(localAddr,remoteAddr,now); sendHELLO(localAddr,remoteAddr,now);

View File

@ -97,6 +97,7 @@ void Switch::onRemotePacket(const InetAddress &localAddr,const InetAddress &from
_lastBeaconResponse = now; _lastBeaconResponse = now;
Packet outp(peer->address(),RR->identity.address(),Packet::VERB_NOP); Packet outp(peer->address(),RR->identity.address(),Packet::VERB_NOP);
outp.armor(peer->key(),true); outp.armor(peer->key(),true);
RR->antiRec->logOutgoingZT(outp.data(),outp.size());
RR->node->putPacket(localAddr,fromAddr,outp.data(),outp.size()); RR->node->putPacket(localAddr,fromAddr,outp.data(),outp.size());
} }
} }