diff options
author | Matt Caswell <matt@openssl.org> | 2023-05-18 16:46:58 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2023-05-24 13:18:33 +0200 |
commit | 5cf99b4040eb1ef63b3254090d16299cad690b1e (patch) | |
tree | 84cb0a5a6e10ca358c45d8def9ec79bb8137f24b /include | |
parent | Add a test for the new QUIC tracing capability (diff) | |
download | openssl-5cf99b4040eb1ef63b3254090d16299cad690b1e.tar.xz openssl-5cf99b4040eb1ef63b3254090d16299cad690b1e.zip |
Create setter functions for the msg_callback and msg_callback_arg
We create setter functions for the msg_callback and msg_callback_arg so
that these values can be properly propagated to the QRX/QTX/TXP even
after the channel has been created.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20914)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/quic_channel.h | 12 | ||||
-rw-r--r-- | include/internal/quic_record_rx.h | 11 | ||||
-rw-r--r-- | include/internal/quic_record_tx.h | 10 | ||||
-rw-r--r-- | include/internal/quic_txp.h | 12 |
4 files changed, 25 insertions, 20 deletions
diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h index ac73097985..74ee125f34 100644 --- a/include/internal/quic_channel.h +++ b/include/internal/quic_channel.h @@ -130,11 +130,6 @@ 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; @@ -328,6 +323,13 @@ void ossl_quic_channel_reject_stream(QUIC_CHANNEL *ch, QUIC_STREAM *qs); int ossl_quic_channel_replace_local_cid(QUIC_CHANNEL *ch, const QUIC_CONN_ID *conn_id); +/* Setters for the msg_callback and msg_callback_arg */ +void ossl_quic_channel_set_msg_callback(QUIC_CHANNEL *ch, + ossl_msg_cb msg_callback, + SSL *msg_callback_s); +void ossl_quic_channel_set_msg_callback_arg(QUIC_CHANNEL *ch, + void *msg_callback_arg); + # endif #endif diff --git a/include/internal/quic_record_rx.h b/include/internal/quic_record_rx.h index f372887f1b..b86d9a98b5 100644 --- a/include/internal/quic_record_rx.h +++ b/include/internal/quic_record_rx.h @@ -45,11 +45,6 @@ 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. */ @@ -65,6 +60,12 @@ OSSL_QRX *ossl_qrx_new(const OSSL_QRX_ARGS *args); */ void ossl_qrx_free(OSSL_QRX *qrx); +/* Setters for the msg_callback and msg_callback_arg */ +void ossl_qrx_set_msg_callback(OSSL_QRX *qrx, ossl_msg_cb msg_callback, + SSL *msg_callback_s); +void ossl_qrx_set_msg_callback_arg(OSSL_QRX *qrx, + void *msg_callback_arg); + /* * DCID Management * =============== diff --git a/include/internal/quic_record_tx.h b/include/internal/quic_record_tx.h index 21bfb9d01b..a12c3abe00 100644 --- a/include/internal/quic_record_tx.h +++ b/include/internal/quic_record_tx.h @@ -46,11 +46,6 @@ typedef struct ossl_qtx_args_st { /* Maximum datagram payload length (MDPL) for TX purposes. */ size_t mdpl; - - /* Message callback related arguments */ - ossl_msg_cb msg_callback; - void *msg_callback_arg; - SSL *msg_callback_s; } OSSL_QTX_ARGS; /* Instantiates a new QTX. */ @@ -63,6 +58,11 @@ void ossl_qtx_free(OSSL_QTX *qtx); void ossl_qtx_set_mutator(OSSL_QTX *qtx, ossl_mutate_packet_cb mutatecb, ossl_finish_mutate_cb finishmutatecb, void *mutatearg); +/* Setters for the msg_callback and the msg_callback_arg */ +void ossl_qtx_set_msg_callback(OSSL_QTX *qtx, ossl_msg_cb msg_callback, + SSL *msg_callback_s); +void ossl_qtx_set_msg_callback_arg(OSSL_QTX *qtx, void *msg_callback_arg); + /* * Secret Management * ----------------- diff --git a/include/internal/quic_txp.h b/include/internal/quic_txp.h index 54c25754eb..ad1c06f31e 100644 --- a/include/internal/quic_txp.h +++ b/include/internal/quic_txp.h @@ -49,11 +49,6 @@ typedef struct ossl_quic_tx_packetiser_args_st { OSSL_TIME (*now)(void *arg); /* Callback to get current time. */ void *now_arg; - /* Message callback related arguments */ - ossl_msg_cb msg_callback; - void *msg_callback_arg; - SSL *msg_callback_s; - /* * Injected dependencies - crypto streams. * @@ -172,6 +167,13 @@ void ossl_quic_tx_packetiser_schedule_ack_eliciting(OSSL_QUIC_TX_PACKETISER *txp int ossl_quic_tx_packetiser_schedule_conn_close(OSSL_QUIC_TX_PACKETISER *txp, const OSSL_QUIC_FRAME_CONN_CLOSE *f); +/* Setters for the msg_callback and msg_callback_arg */ +void ossl_quic_tx_packetiser_set_msg_callback(OSSL_QUIC_TX_PACKETISER *txp, + ossl_msg_cb msg_callback, + SSL *msg_callback_s); +void ossl_quic_tx_packetiser_set_msg_callback_arg(OSSL_QUIC_TX_PACKETISER *txp, + void *msg_callback_arg); + # endif #endif |