update based on pr comments

This commit is contained in:
John Bland
2023-09-12 19:43:28 -04:00
parent 6e87fc7f90
commit 6c8eaf26f5

View File

@ -14045,10 +14045,8 @@ 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);
@ -14304,10 +14302,8 @@ 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");
@ -14510,7 +14506,6 @@ int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx,
args->dCert, ssl); args->dCert, ssl);
#ifdef WOLFSSL_NONBLOCK_OCSP #ifdef WOLFSSL_NONBLOCK_OCSP
if (ret == OCSP_WANT_READ) { if (ret == OCSP_WANT_READ) {
args->lastErr = ret;
goto exit_ppc; goto exit_ppc;
} }
#endif #endif
@ -15129,12 +15124,7 @@ 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;
} }
@ -15248,9 +15238,9 @@ static int DoCertificate(WOLFSSL* ssl, byte* input, word32* inOutIdx,
#ifdef SESSION_CERTS #ifdef SESSION_CERTS
/* 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 ((ssl->error != OCSP_WANT_READ && ssl->error != WC_PENDING_E)) if (ssl->error != OCSP_WANT_READ && ssl->error != WC_PENDING_E)
#endif #endif
{ {
ssl->session->chain.count = 0; ssl->session->chain.count = 0;