From 6e217dfcb01c923e54dd172d0dfca68ab8566bdd Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 21 Oct 2013 10:29:44 -0400 Subject: 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. --- node/Identity.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'node/Identity.hpp') 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; -- cgit v1.2.3