From 085f55195a4f7d383ccb3094f1dd5b8c290174e4 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 6 Aug 2020 17:06:16 -0700 Subject: [PATCH] Fix for handling OCSP response in non-blocking mode. --- src/ocsp.c | 1 + src/wolfio.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/ocsp.c b/src/ocsp.c index b5a27197e..d4002c357 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -453,6 +453,7 @@ int CheckOcspRequest(WOLFSSL_OCSP* ocsp, OcspRequest* ocspRequest, } else { /* cert doesn't have extAuthInfo, assuming CERT_GOOD */ + WOLFSSL_MSG("Cert has no OCSP URL, assuming CERT_GOOD"); return 0; } diff --git a/src/wolfio.c b/src/wolfio.c index 95bb6171f..da5cfda12 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -1078,6 +1078,13 @@ int wolfIO_HttpProcessResponse(int sfd, const char** appStrList, start[len] = 0; } else { + #ifdef WOLFSSL_NONBLOCK_OCSP + result = wolfSSL_LastError(); + if (result == SOCKET_EWOULDBLOCK) { + return OCSP_WANT_READ; + } + #endif + WOLFSSL_MSG("wolfIO_HttpProcessResponse recv http from peer failed"); return -1; }