summaryrefslogtreecommitdiff
path: root/controller/EmbeddedNetworkController.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-09-07 12:12:52 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-09-07 12:12:52 -0700
commitc9ee8612e496d833b287f00c548f76ee5879bfef (patch)
tree323faeedbb829c3972961d3ac32c95d17c131213 /controller/EmbeddedNetworkController.cpp
parenta7d988745bcca4a0f9c838ec493e658b098d241d (diff)
downloadinfinitytier-c9ee8612e496d833b287f00c548f76ee5879bfef.tar.gz
infinitytier-c9ee8612e496d833b287f00c548f76ee5879bfef.zip
Credential TTL (tags/capabilities) should be credential time max delta, since we could get pushed one that is newer.
Diffstat (limited to 'controller/EmbeddedNetworkController.cpp')
-rw-r--r--controller/EmbeddedNetworkController.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp
index ff2f34ec..cf6bd7c9 100644
--- a/controller/EmbeddedNetworkController.cpp
+++ b/controller/EmbeddedNetworkController.cpp
@@ -654,16 +654,16 @@ NetworkController::ResultCode EmbeddedNetworkController::doNetworkConfigRequest(
// for both.) This is computed by reference to the last time we deauthorized
// a member, since within the time period since this event any temporal
// differences are not particularly relevant.
- uint64_t credentialTtl = ZT_NETWORKCONFIG_DEFAULT_MIN_CREDENTIAL_TTL;
+ uint64_t credentialtmd = ZT_NETWORKCONFIG_DEFAULT_CREDENTIAL_TIME_MIN_MAX_DELTA;
if (now > nmi.mostRecentDeauthTime)
- credentialTtl += (now - nmi.mostRecentDeauthTime);
- if (credentialTtl > ZT_NETWORKCONFIG_DEFAULT_MAX_CREDENTIAL_TTL)
- credentialTtl = ZT_NETWORKCONFIG_DEFAULT_MAX_CREDENTIAL_TTL;
+ credentialtmd += (now - nmi.mostRecentDeauthTime);
+ if (credentialtmd > ZT_NETWORKCONFIG_DEFAULT_CREDENTIAL_TIME_MAX_MAX_DELTA)
+ credentialtmd = ZT_NETWORKCONFIG_DEFAULT_CREDENTIAL_TIME_MAX_MAX_DELTA;
nc.networkId = nwid;
nc.type = _jB(network["private"],true) ? ZT_NETWORK_TYPE_PRIVATE : ZT_NETWORK_TYPE_PUBLIC;
nc.timestamp = now;
- nc.credentialTimeToLive = credentialTtl;
+ nc.credentialTimeMaxDelta = credentialtmd;
nc.revision = _jI(network["revision"],0ULL);
nc.issuedTo = identity.address();
if (_jB(network["enableBroadcast"],true)) nc.flags |= ZT_NETWORKCONFIG_FLAG_ENABLE_BROADCAST;
@@ -925,7 +925,7 @@ NetworkController::ResultCode EmbeddedNetworkController::doNetworkConfigRequest(
}
if (_jB(network["private"],true)) {
- CertificateOfMembership com(now,credentialTtl,nwid,identity.address());
+ CertificateOfMembership com(now,credentialtmd,nwid,identity.address());
if (com.sign(signingId)) {
nc.com = com;
} else {