Merge pull request #4099 from embhorn/zd12274

Fix nonblocking ret value from crlIOCb
This commit is contained in:
David Garske
2021-06-16 10:05:04 -07:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -354,7 +354,7 @@ int CheckCertCRL(WOLFSSL_CRL* crl, DecodedCert* cert)
ret = crl->crlIOCb(crl, (const char*)cert->extCrlInfo, ret = crl->crlIOCb(crl, (const char*)cert->extCrlInfo,
cert->extCrlInfoSz); cert->extCrlInfoSz);
if (ret == WOLFSSL_CBIO_ERR_WANT_READ) { if (ret == WOLFSSL_CBIO_ERR_WANT_READ) {
ret = WANT_READ; ret = OCSP_WANT_READ;
} }
else if (ret >= 0) { else if (ret >= 0) {
/* try again */ /* try again */
@@ -372,7 +372,7 @@ int CheckCertCRL(WOLFSSL_CRL* crl, DecodedCert* cert)
/* Loading <issuer-hash>.rN form CRL file if find at the folder, */ /* Loading <issuer-hash>.rN form CRL file if find at the folder, */
/* and try again checking Cert in the CRL list. */ /* and try again checking Cert in the CRL list. */
/* When not set the folder or not use hash_dir, do nothing. */ /* When not set the folder or not use hash_dir, do nothing. */
if (foundEntry == 0) { if ((foundEntry == 0) && (ret != OCSP_WANT_READ)) {
if (crl->cm->x509_store_p != NULL) { if (crl->cm->x509_store_p != NULL) {
ret = LoadCertByIssuer(crl->cm->x509_store_p, ret = LoadCertByIssuer(crl->cm->x509_store_p,
(WOLFSSL_X509_NAME*)cert->issuerName, X509_LU_CRL); (WOLFSSL_X509_NAME*)cert->issuerName, X509_LU_CRL);

View File

@@ -8090,9 +8090,9 @@ int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
#endif /* NO_WOLFSSL_SERVER */ #endif /* NO_WOLFSSL_SERVER */
} }
#ifdef WOLFSSL_ASYNC_CRYPT #if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLFSSL_NONBLOCK_OCSP)
/* 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 && *inOutIdx > 0) { if ((ret == WC_PENDING_E || ret == OCSP_WANT_READ) && *inOutIdx > 0) {
*inOutIdx -= HANDSHAKE_HEADER_SZ; *inOutIdx -= HANDSHAKE_HEADER_SZ;
} }
#endif #endif