forked from wolfSSL/wolfssl
in the event of a OCSP_WANT_READ, set the ssl->error
so that the re-run of DoHandShakeMsgType knows not to hash the certificate twice and won't send an alert to the server as it was when OCSP_WANT_READ instead of setting ret to 0
This commit is contained in:
@@ -16332,6 +16332,11 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
|
#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 async, offset index so this msg will be processed again */
|
||||||
if ((ret == WC_PENDING_E || ret == OCSP_WANT_READ) && *inOutIdx > 0) {
|
if ((ret == WC_PENDING_E || ret == OCSP_WANT_READ) && *inOutIdx > 0) {
|
||||||
*inOutIdx -= HANDSHAKE_HEADER_SZ;
|
*inOutIdx -= HANDSHAKE_HEADER_SZ;
|
||||||
@@ -16340,11 +16345,10 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
*inOutIdx -= DTLS_HANDSHAKE_EXTRA;
|
*inOutIdx -= DTLS_HANDSHAKE_EXTRA;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
/* make sure async error is cleared */
|
/* set the async error so the re-run will work and won't send alert */
|
||||||
if (ret == 0 && (ssl->error == WC_PENDING_E || ssl->error == OCSP_WANT_READ)) {
|
ssl->error = ret;
|
||||||
ssl->error = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
#endif /* WOLFSSL_ASYNC_CRYPT || WOLFSSL_NONBLOCK_OCSP */
|
#endif /* WOLFSSL_ASYNC_CRYPT || WOLFSSL_NONBLOCK_OCSP */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user