diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-10-21 10:29:44 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-10-21 10:29:44 -0400 |
| commit | 6e217dfcb01c923e54dd172d0dfca68ab8566bdd (patch) | |
| tree | 703d1248b5ba010ed4669c2b9cf5a889419b0057 /node/Identity.hpp | |
| parent | bbfd43e03601add10aa04f8f2770285cb801d905 (diff) | |
| download | infinitytier-6e217dfcb01c923e54dd172d0dfca68ab8566bdd.tar.gz infinitytier-6e217dfcb01c923e54dd172d0dfca68ab8566bdd.zip | |
Get rid of DBM, which technically is a case of YAGNI. Supernodes will need a way to save identities, but that can be a different feature. Regular clients do not really need a permanent cache (yet). When/if we do need one we can do it then. Until then it only caused problems.
Diffstat (limited to 'node/Identity.hpp')
| -rw-r--r-- | node/Identity.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/node/Identity.hpp b/node/Identity.hpp index dfa1c7a9..cb911b92 100644 --- a/node/Identity.hpp +++ b/node/Identity.hpp @@ -256,13 +256,15 @@ public: p += ZT_ADDRESS_LENGTH; if (b[p++] != IDENTITY_TYPE_C25519) - throw std::invalid_argument("Identity: deserialize(): unsupported identity type"); + throw std::invalid_argument("unsupported identity type"); memcpy(_publicKey.data,b.field(p,_publicKey.size()),_publicKey.size()); p += _publicKey.size(); - unsigned int privateKeyLength = b[p++]; - if ((privateKeyLength)&&(privateKeyLength == ZT_C25519_PRIVATE_KEY_LEN)) { + unsigned int privateKeyLength = (unsigned int)b[p++]; + if (privateKeyLength) { + if (privateKeyLength != ZT_C25519_PRIVATE_KEY_LEN) + throw std::invalid_argument("invalid private key"); _privateKey = new C25519::Private(); memcpy(_privateKey->data,b.field(p,ZT_C25519_PRIVATE_KEY_LEN),ZT_C25519_PRIVATE_KEY_LEN); p += ZT_C25519_PRIVATE_KEY_LEN; |
