diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-02 13:36:17 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-02 13:36:17 -0700 |
| commit | ecc1324bb0b2435d958947148984a2bd1f630ed7 (patch) | |
| tree | 405459f1dfba3cd2c349aa4eb63f558e8b4d3cea /node/Identity.hpp | |
| parent | d3b0081447940ee3cad4f39bc6e022bd7434402b (diff) | |
| download | infinitytier-ecc1324bb0b2435d958947148984a2bd1f630ed7.tar.gz infinitytier-ecc1324bb0b2435d958947148984a2bd1f630ed7.zip | |
Rules engine work: capability based security model with tags and capabilities, and some cleanup across other places.
Diffstat (limited to 'node/Identity.hpp')
| -rw-r--r-- | node/Identity.hpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/node/Identity.hpp b/node/Identity.hpp index e19c4980..4aa93b87 100644 --- a/node/Identity.hpp +++ b/node/Identity.hpp @@ -46,14 +46,6 @@ namespace ZeroTier { class Identity { public: - /** - * Identity types - */ - enum Type - { - IDENTITY_TYPE_C25519 = 0 - }; - Identity() : _privateKey((C25519::Private *)0) { @@ -206,11 +198,6 @@ public: } /** - * @return Identity type - */ - inline Type type() const throw() { return IDENTITY_TYPE_C25519; } - - /** * @return This identity's address */ inline const Address &address() const throw() { return _address; } @@ -226,7 +213,7 @@ public: inline void serialize(Buffer<C> &b,bool includePrivate = false) const { _address.appendTo(b); - b.append((unsigned char)IDENTITY_TYPE_C25519); + b.append((uint8_t)0); // C25519/Ed25519 identity type b.append(_publicKey.data,(unsigned int)_publicKey.size()); if ((_privateKey)&&(includePrivate)) { b.append((unsigned char)_privateKey->size()); @@ -257,7 +244,7 @@ public: _address.setTo(b.field(p,ZT_ADDRESS_LENGTH),ZT_ADDRESS_LENGTH); p += ZT_ADDRESS_LENGTH; - if (b[p++] != IDENTITY_TYPE_C25519) + if (b[p++] != 0) throw std::invalid_argument("unsupported identity type"); memcpy(_publicKey.data,b.field(p,(unsigned int)_publicKey.size()),(unsigned int)_publicKey.size()); |
