Commit 1e46767
committed
Address review: make the 0-RTT fresh start check clock-safe
TimeNowInMilliseconds() reports failure as 0. InitSSL_Ctx stored that as a
real timestamp, which under WOLFSSL_32BIT_MILLI_TIME made every ticket look
like it predated the ctx. Treat a 0 return as "no clock" and skip the check.
The WOLFSSL_32BIT_MILLI_TIME comparison keyed its wrap window to the ctx
uptime rather than the ticket age, so once the ctx had been alive longer
than 2^31 ms (~24.9 days) it flagged its own fresh tickets and rejected all
0-RTT from then on. Bound both the ctx age and the ticket delta by the max
ticket age instead: past that age DoClientTicketCheck has already rejected
anything that could predate the ctx.
Document that the check needs a restart-comparable clock. Ports whose
millisecond clock counts from boot restart it near zero, so the check does
not fire for tickets minted before a reboot.1 parent 88d4bdf commit 1e46767
2 files changed
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2662 | 2662 | | |
2663 | 2663 | | |
2664 | 2664 | | |
2665 | | - | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
2666 | 2673 | | |
2667 | 2674 | | |
2668 | 2675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6641 | 6641 | | |
6642 | 6642 | | |
6643 | 6643 | | |
6644 | | - | |
6645 | | - | |
| 6644 | + | |
| 6645 | + | |
| 6646 | + | |
| 6647 | + | |
| 6648 | + | |
| 6649 | + | |
| 6650 | + | |
| 6651 | + | |
| 6652 | + | |
6646 | 6653 | | |
6647 | 6654 | | |
6648 | 6655 | | |
6649 | | - | |
| 6656 | + | |
| 6657 | + | |
| 6658 | + | |
| 6659 | + | |
6650 | 6660 | | |
6651 | 6661 | | |
6652 | 6662 | | |
| |||
17147 | 17157 | | |
17148 | 17158 | | |
17149 | 17159 | | |
| 17160 | + | |
| 17161 | + | |
| 17162 | + | |
| 17163 | + | |
17150 | 17164 | | |
17151 | 17165 | | |
17152 | 17166 | | |
| |||
0 commit comments