From 68b4ca9b3181e69108bb4120c1c4230e3d09293b Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 23 Aug 2016 11:52:10 -0700 Subject: [PATCH] Cleanup. --- node/Network.cpp | 4 ++-- node/NetworkConfig.cpp | 12 +----------- node/NetworkConfig.hpp | 3 +-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/node/Network.cpp b/node/Network.cpp index 2a33321c7..d8e3b07a1 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -416,7 +416,7 @@ Network::Network(const RuntimeEnvironment *renv,uint64_t nwid,void *uptr) : std::string conf(RR->node->dataStoreGet(confn)); if (conf.length()) { dconf->load(conf.c_str()); - if (nconf->fromDictionary(Identity(),*dconf)) { + if (nconf->fromDictionary(*dconf)) { this->setConfiguration(*nconf,false); _lastConfigUpdate = 0; // we still want to re-request a new config from the network gotConf = true; @@ -672,7 +672,7 @@ void Network::handleInboundConfigChunk(const uint64_t inRePacketId,const void *d try { Identity controllerId(RR->topology->getIdentity(this->controller())); if (controllerId) { - if (nc->fromDictionary(controllerId,*dict)) { + if (nc->fromDictionary(*dict)) { this->setConfiguration(*nc,true); } else { TRACE("error parsing new config with length %u: deserialization of NetworkConfig failed (certificate error?)",(unsigned int)newConfig.length()); diff --git a/node/NetworkConfig.cpp b/node/NetworkConfig.cpp index 14ebb2090..0c9c05caa 100644 --- a/node/NetworkConfig.cpp +++ b/node/NetworkConfig.cpp @@ -179,18 +179,8 @@ bool NetworkConfig::toDictionary(Dictionary &d,b return true; } -bool NetworkConfig::fromDictionary(const Identity &controllerId,Dictionary &d) +bool NetworkConfig::fromDictionary(const Dictionary &d) { - if ((d.contains(ZT_NETWORKCONFIG_DICT_KEY_SIGNATURE))&&(controllerId)) { - // FIXME: right now signature are optional since network configs are only - // accepted directly from the controller and the protocol already guarantees - // the sender. In the future these might be made non-optional once old - // controllers that do not sign are gone and if we ever support peer caching - // of network configs. - if (!d.unwrapAndVerify(ZT_NETWORKCONFIG_DICT_KEY_SIGNATURE,controllerId.publicKey())) - return false; - } - Buffer *tmp = new Buffer(); try { diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp index 9b12aa0ef..a853d0207 100644 --- a/node/NetworkConfig.hpp +++ b/node/NetworkConfig.hpp @@ -206,11 +206,10 @@ public: /** * Read this network config from a dictionary * - * @param controllerId Controller identity for verification of any signature or NULL identity to skip * @param d Dictionary (non-const since it might be modified during parse, should not be used after call) * @return True if dictionary was valid and network config successfully initialized */ - bool fromDictionary(const Identity &controllerId,Dictionary &d); + bool fromDictionary(const Dictionary &d); /** * @return True if passive bridging is allowed (experimental)