wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.36k stars 834 forks source link

Fix missing error codes when NO_SOCK and USER_IO are in use #8157

Closed redbaron closed 4 days ago

redbaron commented 2 weeks ago

Description

Functions in wolfio.c unconditionally reference SOCKET_* error codes, even if errno.h is conditionally included in wolfio.h.

When compiled with at least WOLFSSL_NO_SOCK + WOLFSSO_USERIO wolfio.h decides not to include errno.h and therefore SOCKET* symbols are missing.

Instead of changing "decision tree" in wolfio.h and risking breaking it on platforms I couldn't test, use "last resort" include of 'errno.h' in the wolfio.c if configure process detected its presence.

Testing

Built with WOLFSSL_USER_IO and WOLFSSL_NO_SOCK

Checklist

wolfSSL-Bot commented 2 weeks ago

Can one of the admins verify this patch?

dgarske commented 2 weeks ago

Hi @redbaron,

Thank you for this PR. I do not see you are an approved contributor. For such a small change we will likely treat as a bug report, attempt to reproduce and fix ourselves. Can you tell us more about your project?

Thanks, David Garske, wolfSSL

embhorn commented 1 week ago

@redbaron is approved as a wolfSSL contributor

douzzer commented 4 days ago

fixed by #8195 -- thank you @redbaron for getting the ball rolling on this!