diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-08-14 19:52:22 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-08-14 19:52:22 -0400 |
| commit | c2187c87599c60b9c47dd9d01244ce1ffd105fea (patch) | |
| tree | 061667e920472a08f073ab2beb89456c05851cc5 /node/Topology.cpp | |
| parent | 56296f96db2ebecc69214de6ef0ca47d7aa77c6e (diff) | |
| download | infinitytier-c2187c87599c60b9c47dd9d01244ce1ffd105fea.tar.gz infinitytier-c2187c87599c60b9c47dd9d01244ce1ffd105fea.zip | |
(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
Diffstat (limited to 'node/Topology.cpp')
| -rw-r--r-- | node/Topology.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/node/Topology.cpp b/node/Topology.cpp index 4fae1372..6fcb17af 100644 --- a/node/Topology.cpp +++ b/node/Topology.cpp @@ -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; |
