s2n-tls
s2n-tls copied to clipboard
Capture OpenSSL error codes
OpenSSL has an error reporting mechanism https://www.openssl.org/docs/man1.0.2/crypto/err.html When we see an error calling an openSSL function, we should really take advantage of this error message.
Probably the best way to do this is with a GUARD_OSSL(fun, S2N_ERROR_CODE) macro
Openssl maintains an error queue per thread. An application using s2n may also want to use libcrypto directly for other reasons. It is best if s2n leaves the Openssl error queue in a sane state. When we hit a libcrypto error s2n I think it makes sense to immediately consume the error from the queue and save it in our own thread-local state.
https://www.openssl.org/docs/man1.0.2/man3/ERR_get_error_line_data.html
We are cleaning up stale feature requests. Please reopen this issue if you believe it should be reprioritized.