wolfssl icon indicating copy to clipboard operation
wolfssl copied to clipboard

Add BIO_sock_should_retry and BIO_sock_non_fatal_error to OpenSSL compatibility layer

Open darktohka opened this issue 3 years ago • 5 comments

Description

BIO_sock_should_retry and BIO_sock_non_fatal_error are not currently implemented inside the OpenSSL compatibility layer.

BIO_sock_should_retry is used to check whether the last socket operation has resulted in a fatal error or not, and if a retry (as such) is advised or not.

To make it possible to implement BIO_sock_should_retry without code reuse, I've taken the liberty of making wolfSSL_LastError a public function, available in the wolfio.h header. Thanks to this change, examples/server/server.c no longer needs its own definition of wolfSSL_LastError either.

Testing

I've created a new test case, based on the BIO_should_retry test case. It completes successfully. The application I'm porting to WolfSSL also works fine with the change.

Checklist

  • [X] added tests
  • [ ] updated/added doxygen
  • [ ] updated appropriate READMEs
  • [ ] Updated manual and documentation

darktohka avatar Jul 28 '22 17:07 darktohka

Can one of the wolfSSL admins verify this patch?

wolfSSL-Bot avatar Jul 28 '22 17:07 wolfSSL-Bot

OK to test

dgarske avatar Jul 28 '22 17:07 dgarske

Approved as contributor.

embhorn avatar Aug 01 '22 13:08 embhorn

@darktohka ./configure --enable-all && make check is failing the scripts/unit.test.

dgarske avatar Aug 03 '22 14:08 dgarske

Can one of the admins verify this patch?

wolfSSL-Bot avatar Feb 09 '23 20:02 wolfSSL-Bot