diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-04 11:40:38 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-04 11:40:38 -0700 |
| commit | 98152d974ada42e659e65590dec9a53d0a28ef54 (patch) | |
| tree | 0b548af496bc78c0f106b5592322024c274491a5 /node/Capability.cpp | |
| parent | 56febbf2bac2c51d9478616a1dd28243ef03f406 (diff) | |
| download | infinitytier-98152d974ada42e659e65590dec9a53d0a28ef54.tar.gz infinitytier-98152d974ada42e659e65590dec9a53d0a28ef54.zip | |
More cleanup and removal of DeferredPackets, will do the latter in a more elegant way.
Diffstat (limited to 'node/Capability.cpp')
| -rw-r--r-- | node/Capability.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/node/Capability.cpp b/node/Capability.cpp index ee798a6c..0a736ca8 100644 --- a/node/Capability.cpp +++ b/node/Capability.cpp @@ -28,9 +28,11 @@ namespace ZeroTier { int Capability::verify(const RuntimeEnvironment *RR) const { try { + // There must be at least one entry, and sanity check for bad chain max length if ((_maxCustodyChainLength < 1)||(_maxCustodyChainLength > ZT_MAX_CAPABILITY_CUSTODY_CHAIN_LENGTH)) return -1; + // Validate all entries in chain of custody Buffer<(sizeof(Capability) * 2)> tmp; this->serialize(tmp,true); for(unsigned int c=0;c<_maxCustodyChainLength;++c) { @@ -53,6 +55,8 @@ int Capability::verify(const RuntimeEnvironment *RR) const return 1; } } + + // We reached max custody chain length and everything was valid return 0; } catch ( ... ) {} return -1; |
