Skip to content

Commit 80bc547

Browse files
committed
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
1 parent 37be7a4 commit 80bc547

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/internal.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16332,6 +16332,11 @@ 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+
1633516340
/* if async, offset index so this msg will be processed again */
1633616341
if ((ret == WC_PENDING_E || ret == OCSP_WANT_READ) && *inOutIdx > 0) {
1633716342
*inOutIdx -= HANDSHAKE_HEADER_SZ;
@@ -16340,11 +16345,10 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1634016345
*inOutIdx -= DTLS_HANDSHAKE_EXTRA;
1634116346
}
1634216347
#endif
16343-
}
1634416348

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;
16349+
/* set the async error so the re-run will work and won't send alert */
16350+
ssl->error = ret;
16351+
ret = 0;
1634816352
}
1634916353
#endif /* WOLFSSL_ASYNC_CRYPT || WOLFSSL_NONBLOCK_OCSP */
1635016354

0 commit comments

Comments
 (0)