Skip to content

Commit 2e4b651

Browse files
committed
update tls13 to handle an OCSP_WANT_READ, update
async client test to retry connect on OCSP_WANT_READ instead of timing out
1 parent 9ea6810 commit 2e4b651

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/async.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010
config: [
1111
# Add new configs here
1212
'--enable-asynccrypt --enable-all --enable-dtls13',
13-
'--enable-asynccrypt-sw',
13+
'--enable-asynccrypt-sw --enable-ocspstapling --enable-ocspstapling2',
14+
'--enable-ocsp CFLAGS="-DTEST_NONBLOCK_CERTS"',
1415
]
1516
name: make check
1617
runs-on: ubuntu-latest

examples/client/client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ static int NonBlockingSSL_Connect(WOLFSSL* ssl)
223223
#ifdef WOLFSSL_ASYNC_CRYPT
224224
|| error == WC_PENDING_E
225225
#endif
226+
#ifdef WOLFSSL_NONBLOCK_OCSP
227+
|| error == OCSP_WANT_READ
228+
#endif
226229
) {
227230
#ifndef WOLFSSL_CALLBACKS
228231
ret = wolfSSL_connect(ssl);

src/tls13.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11479,12 +11479,12 @@ int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1147911479
* == 0) */
1148011480
*inOutIdx -= HANDSHAKE_HEADER_SZ;
1148111481
}
11482-
#endif
1148311482

11484-
/* reset error */
11485-
if (ret == 0 && ssl->error == WC_PENDING_E)
11483+
/* make sure async error is cleared */
11484+
if (ret == 0 && (ssl->error == WC_PENDING_E || ssl->error == OCSP_WANT_READ)) {
1148611485
ssl->error = 0;
11487-
11486+
}
11487+
#endif
1148811488
if (ret == 0 && type != client_hello && type != session_ticket &&
1148911489
type != key_update) {
1149011490
ret = HashInput(ssl, input + inIdx, size);

0 commit comments

Comments
 (0)