From: Neil Horman Date: Wed, 13 Mar 2024 15:22:15 +0000 (-0400) Subject: Raise an error on syscall failure in tls_retry_write_records X-Git-Tag: openssl-3.4.0-alpha1~625 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=933f57dfe21657f7aba8f13e0cdb3b02dd64fcc3;p=thirdparty%2Fopenssl.git Raise an error on syscall failure in tls_retry_write_records Record the errno when we get a syscall failure in tls_retry_write_records Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/23723) --- diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c index b7481c071f7..d9e017d254a 100644 --- a/ssl/record/methods/tls_common.c +++ b/ssl/record/methods/tls_common.c @@ -1914,10 +1914,13 @@ int tls_retry_write_records(OSSL_RECORD_LAYER *rl) else ret = OSSL_RECORD_RETURN_SUCCESS; } else { - if (BIO_should_retry(rl->bio)) + if (BIO_should_retry(rl->bio)) { ret = OSSL_RECORD_RETURN_RETRY; - else + } else { + ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(), + "tls_retry_write_records failure"); ret = OSSL_RECORD_RETURN_FATAL; + } } } else { RLAYERfatal(rl, SSL_AD_INTERNAL_ERROR, SSL_R_BIO_NOT_SET);