Add missing BIO_should_read and BIO_should_write functions #5410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently, BIO_should_retry exists as a component of the OpenSSL compatibility layer. However, there is no way to check the should_read/should_write flag of a BIO object - the BIO_should_read and BIO_should_write functions from OpenSSL are not implemented.
I've implemented the two missing functions as
wolfSSL_BIO_should_read
andwolfSSL_BIO_should_write
by letting wolfSSL check the flags of the BIO, then created the compatibility definitions forBIO_should_read
andBIO_should_write
in the OpenSSL compatibility header.Testing
I've created two unit tests,
test_wolfSSL_BIO_should_read
andtest_wolfSSL_BIO_should_write
. They each test the respective function before creating the connection and when a read or write is expected to happen.I've ran the unit_test program after creating these unit tests, and all unit tests completed successfully.
Checklist