Fix off by 1 in rollover calculation.

This commit is contained in:
David Garske 2021-05-06 14:46:35 -07:00
parent f8ecd4b441
commit 6c131e3e8b
2 changed files with 2 additions and 2 deletions

View File

@ -10375,7 +10375,7 @@ int TLSX_PopulateExtensions(WOLFSSL* ssl, byte isServer)
return ret;
now = TimeNowInMilliseconds();
if (now < sess->ticketSeen)
milli = (0xFFFFFFFFU - sess->ticketSeen) + now;
milli = (0xFFFFFFFFU - sess->ticketSeen) + 1 + now;
else
milli = now - sess->ticketSeen;
milli += sess->ticketAdd;

View File

@ -3548,7 +3548,7 @@ static int DoPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
if (now == (word32)GETTIME_ERROR)
return now;
if (now < ssl->session.ticketSeen)
diff = (0xFFFFFFFFU - ssl->session.ticketSeen) + now;
diff = (0xFFFFFFFFU - ssl->session.ticketSeen) + 1 + now;
else
diff = now - ssl->session.ticketSeen;
diff -= current->ticketAge - ssl->session.ticketAdd;