diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-13 16:31:16 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-13 16:31:16 -0700 |
commit | c692f2e740a3d3f1165cbd8ba16b65ed9b923056 (patch) | |
tree | c63b6ea038744d6bd0f4032e736ea13efa09f34a | |
parent | ba6fd168235fac1c2ec029a49616510da56efe0f (diff) | |
download | infinitytier-c692f2e740a3d3f1165cbd8ba16b65ed9b923056.tar.gz infinitytier-c692f2e740a3d3f1165cbd8ba16b65ed9b923056.zip |
Fix for new identity generation bug.
-rw-r--r-- | node/C25519.cpp | 18 | ||||
-rw-r--r-- | node/Node.cpp | 1 | ||||
-rw-r--r-- | node/Utils.hpp | 2 |
3 files changed, 4 insertions, 17 deletions
diff --git a/node/C25519.cpp b/node/C25519.cpp index f35a88c2..4158f1ba 100644 --- a/node/C25519.cpp +++ b/node/C25519.cpp @@ -286,24 +286,10 @@ static inline int crypto_scalarmult(unsigned char *q,const unsigned char *n,cons return 0; } -//static const unsigned char base[32] = {9}; +static const unsigned char base[32] = {9}; static inline int crypto_scalarmult_base(unsigned char *q,const unsigned char *n) { - //return crypto_scalarmult(q,n,base); - unsigned int work[96]; - unsigned char e[32]; - unsigned int i; - for (i = 0;i < 32;++i) e[i] = n[i]; - e[0] &= 248; - e[31] &= 127; - e[31] |= 64; - for (i = 0;i < 32;++i) work[i] = 9; - mainloop(work,e); - recip(work + 32,work + 32); - mult(work + 64,work,work + 32); - freeze(work + 64); - for (i = 0;i < 32;++i) q[i] = work[64 + i]; - return 0; + return crypto_scalarmult(q,n,base); } ////////////////////////////////////////////////////////////////////////////// diff --git a/node/Node.cpp b/node/Node.cpp index ff3acfc2..dea0f5ca 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -117,6 +117,7 @@ Node::Node(void *uptr,void *tptr,const struct ZT_Node_Callbacks *callbacks,uint6 delete RR->topology; delete RR->mc; delete RR->sw; + delete RR->t; throw; } diff --git a/node/Utils.hpp b/node/Utils.hpp index 8f61d396..87584fcf 100644 --- a/node/Utils.hpp +++ b/node/Utils.hpp @@ -148,7 +148,7 @@ public: static inline char *hex(const void *d,unsigned int l,char *s) { - char *save = s; + char *const save = s; for(unsigned int i=0;i<l;++i) { const unsigned int b = reinterpret_cast<const uint8_t *>(d)[i]; *(s++) = HEXCHARS[b >> 4]; |