summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/Capability.hpp6
-rw-r--r--node/CertificateOfOwnership.hpp6
-rw-r--r--node/Membership.cpp6
-rw-r--r--node/Membership.hpp6
-rw-r--r--node/NetworkConfig.hpp4
-rw-r--r--node/Tag.hpp6
6 files changed, 17 insertions, 17 deletions
diff --git a/node/Capability.hpp b/node/Capability.hpp
index d64625e6..c0336243 100644
--- a/node/Capability.hpp
+++ b/node/Capability.hpp
@@ -85,7 +85,7 @@ public:
* @param rules Network flow rules for this capability
* @param ruleCount Number of flow rules
*/
- Capability(uint32_t id,uint64_t nwid,uint64_t ts,unsigned int mccl,const ZT_VirtualNetworkRule *rules,unsigned int ruleCount)
+ Capability(uint32_t id,uint64_t nwid,int64_t ts,unsigned int mccl,const ZT_VirtualNetworkRule *rules,unsigned int ruleCount)
{
memset(this,0,sizeof(Capability));
_nwid = nwid;
@@ -120,7 +120,7 @@ public:
/**
* @return Timestamp
*/
- inline uint64_t timestamp() const { return _ts; }
+ inline int64_t timestamp() const { return _ts; }
/**
* @return Last 'to' address in chain of custody
@@ -460,7 +460,7 @@ public:
private:
uint64_t _nwid;
- uint64_t _ts;
+ int64_t _ts;
uint32_t _id;
unsigned int _maxCustodyChainLength;
diff --git a/node/CertificateOfOwnership.hpp b/node/CertificateOfOwnership.hpp
index 775324e6..431bcc03 100644
--- a/node/CertificateOfOwnership.hpp
+++ b/node/CertificateOfOwnership.hpp
@@ -72,7 +72,7 @@ public:
memset(this,0,sizeof(CertificateOfOwnership));
}
- CertificateOfOwnership(const uint64_t nwid,const uint64_t ts,const Address &issuedTo,const uint32_t id) :
+ CertificateOfOwnership(const uint64_t nwid,const int64_t ts,const Address &issuedTo,const uint32_t id) :
_networkId(nwid),
_ts(ts),
_flags(0),
@@ -85,7 +85,7 @@ public:
}
inline uint64_t networkId() const { return _networkId; }
- inline uint64_t timestamp() const { return _ts; }
+ inline int64_t timestamp() const { return _ts; }
inline uint32_t id() const { return _id; }
inline unsigned int thingCount() const { return (unsigned int)_thingCount; }
@@ -231,7 +231,7 @@ private:
bool _owns(const Thing &t,const void *v,unsigned int l) const;
uint64_t _networkId;
- uint64_t _ts;
+ int64_t _ts;
uint64_t _flags;
uint32_t _id;
uint16_t _thingCount;
diff --git a/node/Membership.cpp b/node/Membership.cpp
index 740f4e68..de5fb99d 100644
--- a/node/Membership.cpp
+++ b/node/Membership.cpp
@@ -155,7 +155,7 @@ Membership::AddCredentialResult Membership::addCredential(const RuntimeEnvironme
// Template out addCredential() for many cred types to avoid copypasta
template<typename C>
-static Membership::AddCredentialResult _addCredImpl(Hashtable<uint32_t,C> &remoteCreds,const Hashtable<uint64_t,uint64_t> &revocations,const RuntimeEnvironment *RR,void *tPtr,const NetworkConfig &nconf,const C &cred)
+static Membership::AddCredentialResult _addCredImpl(Hashtable<uint32_t,C> &remoteCreds,const Hashtable<uint64_t,int64_t> &revocations,const RuntimeEnvironment *RR,void *tPtr,const NetworkConfig &nconf,const C &cred)
{
C *rc = remoteCreds.get(cred.id());
if (rc) {
@@ -167,7 +167,7 @@ static Membership::AddCredentialResult _addCredImpl(Hashtable<uint32_t,C> &remot
return Membership::ADD_ACCEPTED_REDUNDANT;
}
- const uint64_t *const rt = revocations.get(Membership::credentialKey(C::credentialType(),cred.id()));
+ const int64_t *const rt = revocations.get(Membership::credentialKey(C::credentialType(),cred.id()));
if ((rt)&&(*rt >= cred.timestamp())) {
RR->t->credentialRejected(tPtr,cred,"revoked");
return Membership::ADD_REJECTED;
@@ -193,7 +193,7 @@ Membership::AddCredentialResult Membership::addCredential(const RuntimeEnvironme
Membership::AddCredentialResult Membership::addCredential(const RuntimeEnvironment *RR,void *tPtr,const NetworkConfig &nconf,const Revocation &rev)
{
- uint64_t *rt;
+ int64_t *rt;
switch(rev.verify(RR,tPtr)) {
default:
RR->t->credentialRejected(tPtr,rev,"invalid");
diff --git a/node/Membership.hpp b/node/Membership.hpp
index 5612858a..95ec2180 100644
--- a/node/Membership.hpp
+++ b/node/Membership.hpp
@@ -202,9 +202,9 @@ private:
template<typename C>
inline bool _isCredentialTimestampValid(const NetworkConfig &nconf,const C &remoteCredential) const
{
- const uint64_t ts = remoteCredential.timestamp();
+ const int64_t ts = remoteCredential.timestamp();
if (((ts >= nconf.timestamp) ? (ts - nconf.timestamp) : (nconf.timestamp - ts)) <= nconf.credentialTimeMaxDelta) {
- const uint64_t *threshold = _revocations.get(credentialKey(C::credentialType(),remoteCredential.id()));
+ const int64_t *threshold = _revocations.get(credentialKey(C::credentialType(),remoteCredential.id()));
return ((!threshold)||(ts > *threshold));
}
return false;
@@ -235,7 +235,7 @@ private:
CertificateOfMembership _com;
// Revocations by credentialKey()
- Hashtable< uint64_t,uint64_t > _revocations;
+ Hashtable< uint64_t,int64_t > _revocations;
// Remote credentials that we have received from this member (and that are valid)
Hashtable< uint32_t,Tag > _remoteTags;
diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp
index 3fd5ddac..1bd3b9aa 100644
--- a/node/NetworkConfig.hpp
+++ b/node/NetworkConfig.hpp
@@ -418,12 +418,12 @@ public:
/**
* Controller-side time of config generation/issue
*/
- uint64_t timestamp;
+ int64_t timestamp;
/**
* Max difference between timestamp and tag/capability timestamp
*/
- uint64_t credentialTimeMaxDelta;
+ int64_t credentialTimeMaxDelta;
/**
* Controller-side revision counter for this configuration
diff --git a/node/Tag.hpp b/node/Tag.hpp
index 5fbfb278..fc1377de 100644
--- a/node/Tag.hpp
+++ b/node/Tag.hpp
@@ -77,7 +77,7 @@ public:
* @param id Tag ID
* @param value Tag value
*/
- Tag(const uint64_t nwid,const uint64_t ts,const Address &issuedTo,const uint32_t id,const uint32_t value) :
+ Tag(const uint64_t nwid,const int64_t ts,const Address &issuedTo,const uint32_t id,const uint32_t value) :
_id(id),
_value(value),
_networkId(nwid),
@@ -90,7 +90,7 @@ public:
inline uint32_t id() const { return _id; }
inline const uint32_t &value() const { return _value; }
inline uint64_t networkId() const { return _networkId; }
- inline uint64_t timestamp() const { return _ts; }
+ inline int64_t timestamp() const { return _ts; }
inline const Address &issuedTo() const { return _issuedTo; }
inline const Address &signedBy() const { return _signedBy; }
@@ -199,7 +199,7 @@ private:
uint32_t _id;
uint32_t _value;
uint64_t _networkId;
- uint64_t _ts;
+ int64_t _ts;
Address _issuedTo;
Address _signedBy;
C25519::Signature _signature;