From ea1859541c29bc3cafcde5ad9be131c942522c5f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 15 Apr 2015 18:32:25 -0700 Subject: More cleanup, and fix for the extremely unlikely case of identity collision. --- node/IncomingPacket.cpp | 2 +- node/Network.cpp | 2 +- node/NetworkController.hpp | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'node') diff --git a/node/IncomingPacket.cpp b/node/IncomingPacket.cpp index 967f50f2..efb506fe 100644 --- a/node/IncomingPacket.cpp +++ b/node/IncomingPacket.cpp @@ -674,7 +674,7 @@ bool IncomingPacket::_doNETWORK_CONFIG_REQUEST(const RuntimeEnvironment *RR,cons if (RR->localNetworkController) { Dictionary netconf; - switch(RR->localNetworkController->doNetworkConfigRequest((h > 0) ? InetAddress() : _remoteAddress,peer->identity(),nwid,metaData,haveRevision,netconf)) { + switch(RR->localNetworkController->doNetworkConfigRequest((h > 0) ? InetAddress() : _remoteAddress,RR->identity,peer->identity(),nwid,metaData,haveRevision,netconf)) { case NetworkController::NETCONF_QUERY_OK: { const std::string netconfStr(netconf.toString()); if (netconfStr.length() > 0xffff) { // sanity check since field ix 16-bit diff --git a/node/Network.cpp b/node/Network.cpp index 1c786d24..08856f02 100644 --- a/node/Network.cpp +++ b/node/Network.cpp @@ -250,7 +250,7 @@ void Network::requestConfiguration() if (RR->localNetworkController) { SharedPtr nconf(config2()); Dictionary newconf; - switch(RR->localNetworkController->doNetworkConfigRequest(InetAddress(),RR->identity,_id,Dictionary(),(nconf) ? nconf->revision() : (uint64_t)0,newconf)) { + switch(RR->localNetworkController->doNetworkConfigRequest(InetAddress(),RR->identity,RR->identity,_id,Dictionary(),(nconf) ? nconf->revision() : (uint64_t)0,newconf)) { case NetworkController::NETCONF_QUERY_OK: this->setConfiguration(newconf,true); return; diff --git a/node/NetworkController.hpp b/node/NetworkController.hpp index 353c091a..265ee3d4 100644 --- a/node/NetworkController.hpp +++ b/node/NetworkController.hpp @@ -71,6 +71,7 @@ public: * to indicate the error. * * @param fromAddr Originating wire address or null address if packet is not direct (or from self) + * @param signingId Identity that should be used to sign results -- must include private key * @param identity Originating peer ZeroTier identity * @param nwid 64-bit network ID * @param metaData Meta-data bundled with request (empty if none) @@ -80,6 +81,7 @@ public: */ virtual NetworkController::ResultCode doNetworkConfigRequest( const InetAddress &fromAddr, + const Identity &signingId, const Identity &identity, uint64_t nwid, const Dictionary &metaData, -- cgit v1.2.3