void *now_arg;
QLOG *(*get_qlog_cb)(void *arg); /* Optional QLOG retrieval func */
void *get_qlog_cb_arg;
+ uint32_t protocol_version; /* The protocol version to try negotiating */
/*
* Injected dependencies - crypto streams.
ossl_quic_initial_token_free_fn *free_cb,
void *free_cb_arg);
+/*
+ * Set the protocol version used when generating packets. Currently should
+ * only ever be set to QUIC_VERSION_1
+ */
+int ossl_quic_tx_packetiser_set_protocol_version(OSSL_QUIC_TX_PACKETISER *txp,
+ uint32_t protocol_version);
+
/* Change the DCID the TXP uses to send outgoing packets. */
int ossl_quic_tx_packetiser_set_cur_dcid(OSSL_QUIC_TX_PACKETISER *txp,
const QUIC_CONN_ID *dcid);
txp_args.now_arg = ch;
txp_args.get_qlog_cb = ch_get_qlog_cb;
txp_args.get_qlog_cb_arg = ch;
+ txp_args.protocol_version = QUIC_VERSION_1;
for (pn_space = QUIC_PN_SPACE_INITIAL; pn_space < QUIC_PN_SPACE_NUM; ++pn_space) {
ch->crypto_send[pn_space] = ossl_quic_sstream_new(INIT_CRYPTO_SEND_BUF_LEN);
|| args->conn_txfc == NULL
|| args->conn_rxfc == NULL
|| args->max_streams_bidi_rxfc == NULL
- || args->max_streams_uni_rxfc == NULL) {
+ || args->max_streams_uni_rxfc == NULL
+ || args->protocol_version == 0) {
ERR_raise(ERR_LIB_SSL, ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
return 1;
}
+int ossl_quic_tx_packetiser_set_protocol_version(OSSL_QUIC_TX_PACKETISER *txp,
+ uint32_t protocol_version)
+{
+ txp->args.protocol_version = protocol_version;
+ return 1;
+}
+
int ossl_quic_tx_packetiser_set_cur_dcid(OSSL_QUIC_TX_PACKETISER *txp,
const QUIC_CONN_ID *dcid)
{
phdr->partial = 0;
phdr->fixed = 1;
phdr->reserved = 0;
- phdr->version = QUIC_VERSION_1;
+ phdr->version = txp->args.protocol_version;
phdr->dst_conn_id = txp->args.cur_dcid;
phdr->src_conn_id = txp->args.cur_scid;
h->args.cc_method = h->cc_method;
h->args.cc_data = h->cc_data;
h->args.now = fake_now;
+ h->args.protocol_version = QUIC_VERSION_1;
if (!TEST_ptr(h->txp = ossl_quic_tx_packetiser_new(&h->args)))
goto err;