summaryrefslogtreecommitdiff
path: root/node/Revocation.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/Revocation.hpp')
-rw-r--r--node/Revocation.hpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/node/Revocation.hpp b/node/Revocation.hpp
index e5e013bd..eaf01915 100644
--- a/node/Revocation.hpp
+++ b/node/Revocation.hpp
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
+ * Copyright (C) 2011-2018 ZeroTier, Inc. https://www.zerotier.com/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,6 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * You can be released from the requirements of the license by purchasing
+ * a commercial license. Buying such a license is mandatory as soon as you
+ * develop commercial closed-source software that incorporates or links
+ * directly against ZeroTier software without disclosing the source code
+ * of your own application.
*/
#ifndef ZT_REVOCATION_HPP
@@ -77,7 +85,7 @@ public:
inline uint32_t id() const { return _id; }
inline uint32_t credentialId() const { return _credentialId; }
inline uint64_t networkId() const { return _networkId; }
- inline uint64_t threshold() const { return _threshold; }
+ inline int64_t threshold() const { return _threshold; }
inline const Address &target() const { return _target; }
inline const Address &signer() const { return _signedBy; }
inline Credential::Type type() const { return _type; }
@@ -158,16 +166,16 @@ public:
if (b[p++] == 1) {
if (b.template at<uint16_t>(p) == ZT_C25519_SIGNATURE_LEN) {
p += 2;
- memcpy(_signature.data,b.field(p,ZT_C25519_SIGNATURE_LEN),ZT_C25519_SIGNATURE_LEN);
+ ZT_FAST_MEMCPY(_signature.data,b.field(p,ZT_C25519_SIGNATURE_LEN),ZT_C25519_SIGNATURE_LEN);
p += ZT_C25519_SIGNATURE_LEN;
- } else throw std::runtime_error("invalid signature");
+ } else throw ZT_EXCEPTION_INVALID_SERIALIZED_DATA_INVALID_CRYPTOGRAPHIC_TOKEN;
} else {
p += 2 + b.template at<uint16_t>(p);
}
p += 2 + b.template at<uint16_t>(p);
if (p > b.size())
- throw std::runtime_error("extended field overflow");
+ throw ZT_EXCEPTION_INVALID_SERIALIZED_DATA_OVERFLOW;
return (p - startAt);
}
@@ -176,7 +184,7 @@ private:
uint32_t _id;
uint32_t _credentialId;
uint64_t _networkId;
- uint64_t _threshold;
+ int64_t _threshold;
uint64_t _flags;
Address _target;
Address _signedBy;