]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Stop the quicserver if the handshake or receiving the request fails
authorMatt Caswell <matt@openssl.org>
Mon, 30 Oct 2023 16:30:35 +0000 (16:30 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 1 Nov 2023 11:11:45 +0000 (12:11 +0100)
Previously we entered an infinite loop if these things failed.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22557)

util/quicserver.c

index fd9f9399bd6e2219d03694863061b9f79953e1e7..b80a5ce21a9386c31a7c46676439df67a7a4212e 100644 (file)
@@ -231,6 +231,11 @@ int main(int argc, char *argv[])
     while(!ossl_quic_tserver_is_handshake_confirmed(qtserv)) {
         wait_for_activity(qtserv);
         ossl_quic_tserver_tick(qtserv);
+        if (ossl_quic_tserver_is_terminated(qtserv)) {
+            BIO_printf(bio_err, "Failed waiting for handshake completion\n");
+            ret = EXIT_FAILURE;
+            goto end;
+        }
     }
 
     for (;; respnum++) {
@@ -257,6 +262,11 @@ int main(int argc, char *argv[])
                 wait_for_activity(qtserv);
 
             ossl_quic_tserver_tick(qtserv);
+            if (ossl_quic_tserver_is_terminated(qtserv)) {
+                BIO_printf(bio_err, "Failed reading request\n");
+                ret = EXIT_FAILURE;
+                goto end;
+            }
 
             if (ossl_quic_tserver_read(qtserv, streamid, reqbuf + reqbytes,
                                     sizeof(reqbuf) - reqbytes,