mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
fix bad error setting and instances where lastErr
wasn't set as it should have been
This commit is contained in:
@ -14045,8 +14045,10 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
if (ret == WC_PENDING_E)
|
if (ret == WC_PENDING_E) {
|
||||||
|
args->lastErr = ret;
|
||||||
goto exit_ppc;
|
goto exit_ppc;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = ProcessPeerCertCheckKey(ssl, args);
|
ret = ProcessPeerCertCheckKey(ssl, args);
|
||||||
@ -14302,8 +14304,10 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
if (ret == WC_PENDING_E)
|
if (ret == WC_PENDING_E) {
|
||||||
|
args->lastErr = ret;
|
||||||
goto exit_ppc;
|
goto exit_ppc;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
WOLFSSL_MSG("Verified Peer's cert");
|
WOLFSSL_MSG("Verified Peer's cert");
|
||||||
@ -15124,7 +15128,12 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
case TLS_ASYNC_FINALIZE:
|
case TLS_ASYNC_FINALIZE:
|
||||||
{
|
{
|
||||||
/* load last error */
|
/* load last error */
|
||||||
if (args->lastErr != 0 && ret == 0) {
|
if (args->lastErr != 0 && ret == 0
|
||||||
|
#if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
|
||||||
|
&& args->lastErr != WC_PENDING_E &&
|
||||||
|
args->lastErr != OCSP_WANT_READ
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
ret = args->lastErr;
|
ret = args->lastErr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15240,8 +15249,9 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx,
|
|||||||
/* Reset the session cert chain count in case the session resume failed,
|
/* Reset the session cert chain count in case the session resume failed,
|
||||||
do not reset if we are resuming after an async wait */
|
do not reset if we are resuming after an async wait */
|
||||||
#if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
|
#if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
|
||||||
if (((ProcPeerCertArgs*)(ssl->async->args))->lastErr != OCSP_WANT_READ &&
|
if (ssl->async == NULL || ssl->async->args == NULL ||
|
||||||
((ProcPeerCertArgs*)(ssl->async->args))->lastErr != WC_PENDING_E)
|
(((ProcPeerCertArgs*)(ssl->async->args))->lastErr != OCSP_WANT_READ &&
|
||||||
|
((ProcPeerCertArgs*)(ssl->async->args))->lastErr != WC_PENDING_E))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ssl->session->chain.count = 0;
|
ssl->session->chain.count = 0;
|
||||||
|
Reference in New Issue
Block a user