Skip to content

Commit c0b4cde

Browse files
authored
Merge pull request #6632 from jpbland1/ocsp-want-read-error
OCSP_WANT_READ mishandled re-run
2 parents 1285ae7 + 2e4b651 commit c0b4cde

4 files changed

Lines changed: 12 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/internal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16501,6 +16501,9 @@ int SendFatalAlertOnly(WOLFSSL *ssl, int error)
1650116501
case WANT_WRITE:
1650216502
case WANT_READ:
1650316503
case ZERO_RETURN:
16504+
#ifdef WOLFSSL_NONBLOCK_OCSP
16505+
case OCSP_WANT_READ:
16506+
#endif
1650416507
#ifdef WOLFSSL_ASYNC_CRYPT
1650516508
case WC_PENDING_E:
1650616509
#endif

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)