From 63dfde87c46f8ad037ad5b5e635e609f4909578e Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 1 May 2023 15:40:28 +0100 Subject: Add initial QUIC support for the msg_callback At this stage we just support msg_callback on receipt of a datagram. Reviewed-by: Tomas Mraz Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/20914) --- include/internal/quic_channel.h | 5 +++++ include/internal/quic_record_rx.h | 8 ++++++++ include/openssl/ssl3.h | 3 +++ 3 files changed, 16 insertions(+) (limited to 'include') diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h index 6dbf08665d..ac73097985 100644 --- a/include/internal/quic_channel.h +++ b/include/internal/quic_channel.h @@ -130,6 +130,11 @@ typedef struct quic_channel_args_st { */ OSSL_TIME (*now_cb)(void *arg); void *now_cb_arg; + + /* Message callback related arguments */ + ossl_msg_cb msg_callback; + void *msg_callback_arg; + SSL *msg_callback_s; } QUIC_CHANNEL_ARGS; typedef struct quic_channel_st QUIC_CHANNEL; diff --git a/include/internal/quic_record_rx.h b/include/internal/quic_record_rx.h index 95c0fa5635..4817347993 100644 --- a/include/internal/quic_record_rx.h +++ b/include/internal/quic_record_rx.h @@ -18,6 +18,9 @@ # ifndef OPENSSL_NO_QUIC +typedef void (*ossl_msg_cb)(int write_p, int version, int content_type, + const void *buf, size_t len, SSL *ssl, void *arg); + /* * QUIC Record Layer - RX * ====================== @@ -45,6 +48,11 @@ typedef struct ossl_qrx_args_st { /* Initial key phase. For debugging use only; always 0 in real use. */ unsigned char init_key_phase_bit; + + /* Message callback related arguments */ + ossl_msg_cb msg_callback; + void *msg_callback_arg; + SSL *msg_callback_s; } OSSL_QRX_ARGS; /* Instantiates a new QRX. */ diff --git a/include/openssl/ssl3.h b/include/openssl/ssl3.h index 6c172f45f9..f993d0baa0 100644 --- a/include/openssl/ssl3.h +++ b/include/openssl/ssl3.h @@ -239,6 +239,9 @@ extern "C" { # define SSL3_RT_HEADER 0x100 # define SSL3_RT_INNER_CONTENT_TYPE 0x101 +/* Pseudo content types for QUIC */ +# define SSL3_RT_QUIC_DATAGRAM 0x200 + # define SSL3_AL_WARNING 1 # define SSL3_AL_FATAL 2 -- cgit v1.2.3