Commit a1c8790
committed
wolfssl: preserve early-data handling across WANT_WRITE retries
The early-data logic setups "early" exits in Accept/Connect state machine so
that the data exchanged during the handshake can be delivered to the
caller.
After the caller process the data, it usually calls Accept/Connect again
to cotinue the handshake.
Under non-blocking I/O there is the chance that these early exits are
skipped, this commit fixes that.
Server-side accept (TLS 1.3/DTLS 1.3) could skip the early-data shortcut
whenever sending the Finished flight first hit WANT_WRITE: when Accept
is called again and the data is eventually flushed into the I/O layer
the accept state is advanced past TLS13_ACCEPT_FINISHED_SENT, so the
next wolfSSL_accept() call skipped the block that marks
SERVER_FINISHED_COMPLETE and lets the application drain 0-RTT data. By
keeping the FALL_THROUGH into TLS13_ACCEPT_FINISHED_SENT and only
returning early while that handshake flag is still unset, we revisit the
shortcut immediately after the buffered flight is delivered, preserving
the intentional behaviour even under non-blocking I/O.
On the client, the same pattern showed up after SendTls13ClientHello()
buffered due to WANT_WRITE: after flushing, the connect state is already
CLIENT_HELLO_SENT so the early-data exit is no longer executed. We now
fall through into the CLIENT_HELLO_SENT case and only short-circuit once
per handshake, ensuring the reply-processing loop still executes on the
retry.1 parent 0a0c430 commit a1c8790
1 file changed
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13396 | 13396 | | |
13397 | 13397 | | |
13398 | 13398 | | |
| 13399 | + | |
| 13400 | + | |
| 13401 | + | |
13399 | 13402 | | |
13400 | | - | |
| 13403 | + | |
| 13404 | + | |
13401 | 13405 | | |
13402 | 13406 | | |
13403 | 13407 | | |
| |||
13411 | 13415 | | |
13412 | 13416 | | |
13413 | 13417 | | |
13414 | | - | |
13415 | | - | |
13416 | | - | |
13417 | 13418 | | |
13418 | 13419 | | |
13419 | 13420 | | |
| |||
14736 | 14737 | | |
14737 | 14738 | | |
14738 | 14739 | | |
| 14740 | + | |
| 14741 | + | |
| 14742 | + | |
14739 | 14743 | | |
14740 | | - | |
| 14744 | + | |
| 14745 | + | |
14741 | 14746 | | |
14742 | 14747 | | |
14743 | 14748 | | |
14744 | 14749 | | |
14745 | | - | |
14746 | | - | |
14747 | | - | |
14748 | 14750 | | |
14749 | 14751 | | |
14750 | 14752 | | |
| |||
0 commit comments