Skip to content

Commit 7b9d374

Browse files
committed
tls13: early_data: prevent earlyData reset on re-entry
Avoid resetting ssl->earlyData in wolfSSL_write_early_data when the function is re-entered due to WC_PENDING_E, WANT_WRITE, or WANT_READ.
1 parent 29941d5 commit 7b9d374

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/tls13.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15015,7 +15015,9 @@ int wolfSSL_write_early_data(WOLFSSL* ssl, const void* data, int sz, int* outSz)
1501515015
}
1501615016

1501715017
if (ssl->options.handShakeState == NULL_STATE) {
15018-
if (ssl->error != WC_NO_ERR_TRACE(WC_PENDING_E))
15018+
/* avoid re-setting ssl->earlyData if we re-enter the function because
15019+
* of WC_PENDING_E, WANT_WRITE or WANT_READ */
15020+
if (ssl->error == 0)
1501915021
ssl->earlyData = expecting_early_data;
1502015022
ret = wolfSSL_connect_TLSv13(ssl);
1502115023
if (ret != WOLFSSL_SUCCESS)

0 commit comments

Comments
 (0)