diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-10 17:54:14 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-10 17:54:14 -0800 |
commit | 47166c9614687f4b67d501328663639766dd56f3 (patch) | |
tree | e82f69cae0a70995da2bf554c1a117d4db43cadc /node | |
parent | ecacdf27a9ad2c15d300a8d61fd0c560030e81dd (diff) | |
download | infinitytier-47166c9614687f4b67d501328663639766dd56f3.tar.gz infinitytier-47166c9614687f4b67d501328663639766dd56f3.zip |
Sigh. Another thinko.
Diffstat (limited to 'node')
-rw-r--r-- | node/Packet.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/node/Packet.cpp b/node/Packet.cpp index fa1b9cf4..c825ea9b 100644 --- a/node/Packet.cpp +++ b/node/Packet.cpp @@ -2025,13 +2025,12 @@ bool Packet::dearmor(const void *key) void Packet::cryptField(const void *key,unsigned int start,unsigned int len) { - const uint8_t *const data = reinterpret_cast<const uint8_t *>(unsafeData()); + uint8_t *const data = reinterpret_cast<uint8_t *>(unsafeData()); uint8_t iv[8]; for(int i=0;i<8;++i) iv[i] = data[i]; iv[7] &= 0xf8; // mask off least significant 3 bits of packet ID / IV since this is unset when this function gets called - Salsa20 s20(key,256,data); - unsigned char *const ptr = field(start,len); - s20.crypt12(ptr,ptr,len); + Salsa20 s20(key,256,iv); + s20.crypt12(data + start,data + start,len); } bool Packet::compress() |