Better randomization from NTP code.

This commit is contained in:
Fabian Schlenz 2019-05-27 18:12:26 +02:00
parent ad0ac8fb21
commit 49494a3cc3
1 changed files with 2 additions and 1 deletions

3
ntp.h
View File

@ -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;