diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-01 10:22:57 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-01 10:22:57 -0800 |
| commit | 2bf9145ae65385bf968542619ffcf204cf6241d8 (patch) | |
| tree | b97d30342ef7c34fe0a1b236635d78ec29ed40d9 /node/Cluster.cpp | |
| parent | 127bcb02ffd09b522678c7e50aae21a1ecd87e4e (diff) | |
| download | infinitytier-2bf9145ae65385bf968542619ffcf204cf6241d8.tar.gz infinitytier-2bf9145ae65385bf968542619ffcf204cf6241d8.zip | |
Outgoing side of packet counter for link quality reporting. Also some cleanup and a cluster mode build fix.
Diffstat (limited to 'node/Cluster.cpp')
| -rw-r--r-- | node/Cluster.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/node/Cluster.cpp b/node/Cluster.cpp index 00122402..52e03ffe 100644 --- a/node/Cluster.cpp +++ b/node/Cluster.cpp @@ -255,7 +255,7 @@ void Cluster::handleIncomingStateMessage(const void *msg,unsigned int len) // One-time-use Poly1305 key from first 32 bytes of Salsa20 keystream (as per DJB/NaCl "standard") char polykey[ZT_POLY1305_KEY_LEN]; memset(polykey,0,sizeof(polykey)); - s20.encrypt12(polykey,polykey,sizeof(polykey)); + s20.crypt12(polykey,polykey,sizeof(polykey)); // Compute 16-byte MAC char mac[ZT_POLY1305_MAC_LEN]; @@ -267,7 +267,7 @@ void Cluster::handleIncomingStateMessage(const void *msg,unsigned int len) // Decrypt! dmsg.setSize(len - 24); - s20.decrypt12(reinterpret_cast<const char *>(msg) + 24,const_cast<void *>(dmsg.data()),dmsg.size()); + s20.crypt12(reinterpret_cast<const char *>(msg) + 24,const_cast<void *>(dmsg.data()),dmsg.size()); } if (dmsg.size() < 4) @@ -954,10 +954,10 @@ void Cluster::_flush(uint16_t memberId) // One-time-use Poly1305 key from first 32 bytes of Salsa20 keystream (as per DJB/NaCl "standard") char polykey[ZT_POLY1305_KEY_LEN]; memset(polykey,0,sizeof(polykey)); - s20.encrypt12(polykey,polykey,sizeof(polykey)); + s20.crypt12(polykey,polykey,sizeof(polykey)); // Encrypt m.q in place - s20.encrypt12(reinterpret_cast<const char *>(m.q.data()) + 24,const_cast<char *>(reinterpret_cast<const char *>(m.q.data())) + 24,m.q.size() - 24); + s20.crypt12(reinterpret_cast<const char *>(m.q.data()) + 24,const_cast<char *>(reinterpret_cast<const char *>(m.q.data())) + 24,m.q.size() - 24); // Add MAC for authentication (encrypt-then-MAC) char mac[ZT_POLY1305_MAC_LEN]; |
