diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-04-04 08:39:22 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-04-04 08:39:22 -0700 |
| commit | b48a70db2e2639bef81941b17c4f3268c41d2a9f (patch) | |
| tree | c0b58909b46c43d9733cbbd425f2864b86670bcf /node/Tag.hpp | |
| parent | cd050b3423ede9c21e53db3a47cdad7ccf5bcb65 (diff) | |
| parent | eddbc7e757f26e59d6eeab7e31e31eb6c47dcf20 (diff) | |
| download | infinitytier-b48a70db2e2639bef81941b17c4f3268c41d2a9f.tar.gz infinitytier-b48a70db2e2639bef81941b17c4f3268c41d2a9f.zip | |
Merge branch 'dev' of http://10.6.6.2/zerotier/ZeroTierOne into dev
Diffstat (limited to 'node/Tag.hpp')
| -rw-r--r-- | node/Tag.hpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/node/Tag.hpp b/node/Tag.hpp index 38085906..1f7f6835 100644 --- a/node/Tag.hpp +++ b/node/Tag.hpp @@ -25,6 +25,7 @@ #include <string.h> #include "Constants.hpp" +#include "Credential.hpp" #include "C25519.hpp" #include "Address.hpp" #include "Identity.hpp" @@ -51,9 +52,11 @@ class RuntimeEnvironment; * Unlike capabilities tags are signed only by the issuer and are never * transferrable. */ -class Tag +class Tag : public Credential { public: + static inline Credential::Type credentialType() { return Credential::CREDENTIAL_TYPE_TAG; } + Tag() { memset(this,0,sizeof(Tag)); @@ -67,19 +70,19 @@ public: * @param value Tag value */ Tag(const uint64_t nwid,const uint64_t ts,const Address &issuedTo,const uint32_t id,const uint32_t value) : - _networkId(nwid), - _ts(ts), _id(id), _value(value), + _networkId(nwid), + _ts(ts), _issuedTo(issuedTo), _signedBy() { } - inline uint64_t networkId() const { return _networkId; } - inline uint64_t timestamp() const { return _ts; } 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 const Address &issuedTo() const { return _issuedTo; } inline const Address &signedBy() const { return _signedBy; } @@ -115,11 +118,9 @@ public: { if (forSign) b.append((uint64_t)0x7f7f7f7f7f7f7f7fULL); - // These are the same between Tag and Capability b.append(_networkId); b.append(_ts); b.append(_id); - b.append(_value); _issuedTo.appendTo(b); @@ -187,10 +188,10 @@ public: }; private: - uint64_t _networkId; - uint64_t _ts; uint32_t _id; uint32_t _value; + uint64_t _networkId; + uint64_t _ts; Address _issuedTo; Address _signedBy; C25519::Signature _signature; |
