]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC Front-End I/O API: Fix WANT_READ signalling for SSL_read
authorHugo Landau <hlandau@openssl.org>
Tue, 22 Nov 2022 13:29:45 +0000 (13:29 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 19 Jan 2023 13:17:39 +0000 (13:17 +0000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19734)

ssl/quic/quic_impl.c

index c5490cd07581f4cb910ce6593479571f051b855c..d6c91164978cfa13e9a74262eb032856b1e416ed 100644 (file)
@@ -1131,9 +1131,12 @@ static int quic_read(SSL *s, void *buf, size_t len, size_t *bytes_read, int peek
             else
                 return QUIC_RAISE_NON_NORMAL_ERROR(qc, ERR_R_INTERNAL_ERROR, NULL);
         }
-    }
 
-    return 1;
+        return 1;
+    } else {
+        /* We did not get any bytes and are not in blocking mode. */
+        return QUIC_RAISE_NORMAL_ERROR(qc, SSL_ERROR_WANT_READ);
+    }
 }
 
 int ossl_quic_read(SSL *s, void *buf, size_t len, size_t *bytes_read)