Merge pull request #4919 from julek-wolfssl/ZD13737

Reported in ZD13737
This commit is contained in:
David Garske 2022-03-03 08:22:11 -08:00 committed by GitHub
commit 3a5f78b55a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2204,11 +2204,22 @@ int wolfSSL_BIO_flush(WOLFSSL_BIO* bio)
int wolfSSL_BIO_eof(WOLFSSL_BIO* b)
{
int ret = 0;
WOLFSSL_ENTER("BIO_eof");
if ((b != NULL) && (b->eof))
return 1;
return 0;
if (b == NULL)
return 1; /* Undefined in OpenSSL. Let's signal we're done. */
switch (b->type) {
case WOLFSSL_BIO_SSL:
ret = b->eof;
break;
default:
ret = wolfSSL_BIO_get_len(b) != 0;
break;
}
return ret;
}
long wolfSSL_BIO_do_handshake(WOLFSSL_BIO *b)