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
This commit is contained in:
John Bland 2023-07-18 14:05:16 -04:00
parent 80bc547853
commit 7ee38350c0

View File

@ -16332,11 +16332,6 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
}
#if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
/* make sure async error is cleared */
if (ret == 0 && (ssl->error == WC_PENDING_E || ssl->error == OCSP_WANT_READ)) {
ssl->error = 0;
}
/* if async, offset index so this msg will be processed again */
if ((ret == WC_PENDING_E || ret == OCSP_WANT_READ) && *inOutIdx > 0) {
*inOutIdx -= HANDSHAKE_HEADER_SZ;
@ -16345,10 +16340,11 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
*inOutIdx -= DTLS_HANDSHAKE_EXTRA;
}
#endif
}
/* set the async error so the re-run will work and won't send alert */
ssl->error = ret;
ret = 0;
/* make sure async error is cleared */
if (ret == 0 && (ssl->error == WC_PENDING_E || ssl->error == OCSP_WANT_READ)) {
ssl->error = 0;
}
#endif /* WOLFSSL_ASYNC_CRYPT || WOLFSSL_NONBLOCK_OCSP */
@ -16505,6 +16501,7 @@ int SendFatalAlertOnly(WOLFSSL *ssl, int error)
case WANT_WRITE:
case WANT_READ:
case ZERO_RETURN:
case OCSP_WANT_READ:
#ifdef WOLFSSL_ASYNC_CRYPT
case WC_PENDING_E:
#endif