summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-08-03 11:56:12 +0100
committerMatt Caswell <matt@openssl.org>2023-08-08 14:33:42 +0100
commit7a2bb2101be4f4dfd9f437ebe1d7fd5dbc14b894 (patch)
tree408accb61c481fc060859267a7d1da3d80c9f3f2 /ssl/ssl_lib.c
parent828c9c6690dc2791cee7873cf6793db187b558bb (diff)
QUIC TLS: Rethink error handling
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21547)
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r--ssl/ssl_lib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index aefdba2ae5..93c0b00bb5 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -4560,6 +4560,11 @@ int SSL_set_ssl_method(SSL *s, const SSL_METHOD *meth)
int SSL_get_error(const SSL *s, int i)
{
+ return ossl_ssl_get_error(s, i, /*check_err=*/1);
+}
+
+int ossl_ssl_get_error(const SSL *s, int i, int check_err)
+{
int reason;
unsigned long l;
BIO *bio;
@@ -4583,7 +4588,7 @@ int SSL_get_error(const SSL *s, int i)
* Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc,
* where we do encode the error
*/
- if ((l = ERR_peek_error()) != 0) {
+ if (check_err && (l = ERR_peek_error()) != 0) {
if (ERR_GET_LIB(l) == ERR_LIB_SYS)
return SSL_ERROR_SYSCALL;
else