From b19634d7e4f95317924242135ae5019a8e0cabe1 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 28 Aug 2019 14:21:02 -0700 Subject: [PATCH] . --- node/Packet.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node/Packet.hpp b/node/Packet.hpp index b5877496b..4ed7b8634 100644 --- a/node/Packet.hpp +++ b/node/Packet.hpp @@ -986,7 +986,7 @@ public: ZT_ALWAYS_INLINE Packet() : Buffer(ZT_PROTO_MIN_PACKET_LENGTH) { - Utils::getSecureRandom(field(ZT_PACKET_IDX_IV,8),8); + setAt(ZT_PACKET_IDX_IV,Utils::random()); (*this)[ZT_PACKET_IDX_FLAGS] = 0; // zero flags, cipher ID, and hops } @@ -1002,7 +1002,7 @@ public: ZT_ALWAYS_INLINE Packet(const Packet &prototype,const Address &dest) : Buffer(prototype) { - Utils::getSecureRandom(field(ZT_PACKET_IDX_IV,8),8); + setAt(ZT_PACKET_IDX_IV,Utils::random()); setDestination(dest); } @@ -1016,7 +1016,7 @@ public: ZT_ALWAYS_INLINE Packet(const Address &dest,const Address &source,const Verb v) : Buffer(ZT_PROTO_MIN_PACKET_LENGTH) { - Utils::getSecureRandom(field(ZT_PACKET_IDX_IV,8),8); + setAt(ZT_PACKET_IDX_IV,Utils::random()); setDestination(dest); setSource(source); (*this)[ZT_PACKET_IDX_FLAGS] = 0; // zero flags and hops @@ -1033,7 +1033,7 @@ public: ZT_ALWAYS_INLINE void reset(const Address &dest,const Address &source,const Verb v) { setSize(ZT_PROTO_MIN_PACKET_LENGTH); - Utils::getSecureRandom(field(ZT_PACKET_IDX_IV,8),8); + setAt(ZT_PACKET_IDX_IV,Utils::random()); setDestination(dest); setSource(source); (*this)[ZT_PACKET_IDX_FLAGS] = 0; // zero flags, cipher ID, and hops @@ -1047,7 +1047,7 @@ public: * technically different but otherwise identical copies of the same * packet. */ - ZT_ALWAYS_INLINE void newInitializationVector() { Utils::getSecureRandom(field(ZT_PACKET_IDX_IV,8),8); } + ZT_ALWAYS_INLINE void newInitializationVector() { setAt(ZT_PACKET_IDX_IV,Utils::random()); } /** * Set this packet's destination