Skip to content

Commit 7ee3835

Browse files
committed
undo supressing the OCSP_WANT_READ error, instead
add it to the list of non-fatal errors so that a socket close alert wont be sent out but the caller still won't block and will instead get OCSP_WANT_READ as an error back from wolfSSL_connect
1 parent 80bc547 commit 7ee3835

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/internal.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16332,11 +16332,6 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1633216332
}
1633316333

1633416334
#if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
16335-
/* make sure async error is cleared */
16336-
if (ret == 0 && (ssl->error == WC_PENDING_E || ssl->error == OCSP_WANT_READ)) {
16337-
ssl->error = 0;
16338-
}
16339-
1634016335
/* if async, offset index so this msg will be processed again */
1634116336
if ((ret == WC_PENDING_E || ret == OCSP_WANT_READ) && *inOutIdx > 0) {
1634216337
*inOutIdx -= HANDSHAKE_HEADER_SZ;
@@ -16345,10 +16340,11 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1634516340
*inOutIdx -= DTLS_HANDSHAKE_EXTRA;
1634616341
}
1634716342
#endif
16343+
}
1634816344

16349-
/* set the async error so the re-run will work and won't send alert */
16350-
ssl->error = ret;
16351-
ret = 0;
16345+
/* make sure async error is cleared */
16346+
if (ret == 0 && (ssl->error == WC_PENDING_E || ssl->error == OCSP_WANT_READ)) {
16347+
ssl->error = 0;
1635216348
}
1635316349
#endif /* WOLFSSL_ASYNC_CRYPT || WOLFSSL_NONBLOCK_OCSP */
1635416350

@@ -16505,6 +16501,7 @@ int SendFatalAlertOnly(WOLFSSL *ssl, int error)
1650516501
case WANT_WRITE:
1650616502
case WANT_READ:
1650716503
case ZERO_RETURN:
16504+
case OCSP_WANT_READ:
1650816505
#ifdef WOLFSSL_ASYNC_CRYPT
1650916506
case WC_PENDING_E:
1651016507
#endif

0 commit comments

Comments
 (0)