From 49494a3cc362499d95cde3519867bf8a37aeb63f Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Mon, 27 May 2019 18:12:26 +0200 Subject: [PATCH] Better randomization from NTP code. --- ntp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ntp.h b/ntp.h index e43ca8c..8072c14 100644 --- a/ntp.h +++ b/ntp.h @@ -186,7 +186,8 @@ bool NTPClient::forceUpdate() { // this is NTP time (seconds since Jan 1 1900): unsigned long secsSince1900 = highWord << 16 | lowWord; - random16_set_seed(secsSince1900 & 0xFFFF); + random16_add_entropy(this->_packetBuffer[44]<<8 | this->_packetBuffer[45]); + random16_add_entropy(this->_packetBuffer[46]<<8 | this->_packetBuffer[47]); this->_currentEpoc = secsSince1900 - SEVENZYYEARS;