(1) distribute default root-topology in new dictionary format, (2) bump peer serialization version to force obsolescence of old supernodes, (3) stop outputting a log message every time we poll for software updates

This commit is contained in:
Adam Ierymenko 2014-08-14 19:52:22 -04:00
parent 56296f96db
commit c2187c8759
10 changed files with 109 additions and 63 deletions

View file

@ -27,6 +27,8 @@
#include <algorithm>
#include "Constants.hpp"
#include "Defaults.hpp"
#include "Topology.hpp"
#include "NodeConfig.hpp"
#include "CMWC4096.hpp"
@ -239,6 +241,24 @@ void Topology::clean()
}
}
bool Topology::authenticateRootTopology(const Dictionary &rt)
{
try {
std::string signer(rt.signingIdentity());
if (!signer.length())
return false;
Identity signerId(signer);
std::map< Address,Identity >::const_iterator authority(ZT_DEFAULTS.rootTopologyAuthorities.find(signerId.address()));
if (authority == ZT_DEFAULTS.rootTopologyAuthorities.end())
return false;
if (signerId != authority->second)
return false;
return rt.verify(authority->second);
} catch ( ... ) {
return false;
}
}
void Topology::_dumpPeers()
{
Buffer<ZT_PEER_WRITE_BUF_SIZE> buf;