Raise an error on syscall failure in tls_retry_write_records master
authorNeil Horman <nhorman@openssl.org>
Wed, 13 Mar 2024 15:22:15 +0000 (11:22 -0400)
committerTomas Mraz <tomas@openssl.org>
Fri, 26 Apr 2024 15:10:38 +0000 (17:10 +0200)
Record the errno when we get a syscall failure in
tls_retry_write_records

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23723)

ssl/record/methods/tls_common.c

index b7481c071f74616d16123192e08f41070a0c8f3f..d9e017d254afdf7d86a3a1dd52987e03f03a36dd 100644 (file)
@@ -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);