Merge pull request #11379 from Frauschi/0rtt-fresh-start-clock-skew

TLS 1.3: compare the 0-RTT fresh start reference against a whole second
pull/8069/merge
Sean Parkinson 2026-09-08 09:07:32 +10:00 committed by GitHub
commit 19b6eecb87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 6 deletions

View File

@ -2670,15 +2670,13 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap)
}
else {
ctx->ticketStartTime -= ctx->ticketStartTime % 1000;
#ifdef WOLFSSL_32BIT_MILLI_TIME
/* A 32 bit ms clock is truncated mod 2^32, which is not a multiple
* of 1000, so the modulo above does not remove the true sub-second
* part. Drop a whole further second so a ticket minted in the same
* second as this ctx is never flagged as predating it. */
/* Drop a further second so a ticket minted in the same second as the
* ctx is never flagged as predating it: ticketSeen is read from
* LowResTimer() rather than this clock, and a wrapped 32 bit ms clock
* keeps its true sub-second part through the modulo above. */
if (ctx->ticketStartTime > 1000) {
ctx->ticketStartTime -= 1000;
}
#endif
}
#endif