From 7257188b7054cf8acfc4837e38486459e0930718 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 23 Feb 2023 16:31:49 +0000 Subject: Add support for rstream get/release record in the QUIC TLS layer The QUIC TLS layer was taking an internal copy of rstream data while reading. The QUIC rstream code has recently been extended to enable a get/release model which avoids the need for this internal copy, so we use that instead. Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/20404) --- include/internal/quic_tls.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'include/internal/quic_tls.h') diff --git a/include/internal/quic_tls.h b/include/internal/quic_tls.h index 2d6007e79f..133e247c26 100644 --- a/include/internal/quic_tls.h +++ b/include/internal/quic_tls.h @@ -32,9 +32,18 @@ typedef struct quic_tls_args_st { int (*crypto_send_cb)(const unsigned char *buf, size_t buf_len, size_t *consumed, void *arg); void *crypto_send_cb_arg; - int (*crypto_recv_cb)(unsigned char *buf, size_t buf_len, - size_t *bytes_read, void *arg); - void *crypto_recv_cb_arg; + + /* + * Call to receive crypto stream data. A pointer to the underlying buffer + * is provided, and subsequently released to avoid unnecessary copying of + * data. + */ + int (*crypto_recv_rcd_cb)(const unsigned char **buf, size_t *bytes_read, + void *arg); + void *crypto_recv_rcd_cb_arg; + int (*crypto_release_rcd_cb)(size_t bytes_read, void *arg); + void *crypto_release_rcd_cb_arg; + /* Called when a traffic secret is available for a given encryption level. */ int (*yield_secret_cb)(uint32_t enc_level, int direction /* 0=RX, 1=TX */, -- cgit v1.2.3