goto err;
if (!ossl_quic_wire_encode_transport_param_cid(&wpkt, QUIC_TPARAM_INITIAL_SCID,
- &ch->cur_local_dcid))
+ &ch->cur_local_cid))
goto err;
} else {
/* Client always uses an empty SCID. */
/* Generate a SCID we will use for the connection. */
if (!gen_rand_conn_id(ch->libctx, INIT_DCID_LEN,
- &ch->cur_local_dcid))
+ &ch->cur_local_cid))
return 0;
/* Note our newly learnt peer address and CIDs. */
if (!ossl_quic_tx_packetiser_set_cur_dcid(ch->txp, &ch->cur_remote_dcid))
return 0;
- if (!ossl_quic_tx_packetiser_set_cur_scid(ch->txp, &ch->cur_local_dcid))
+ if (!ossl_quic_tx_packetiser_set_cur_scid(ch->txp, &ch->cur_local_cid))
return 0;
/* Plug in secrets for the Initial EL. */
ch->qrx, ch->qtx))
return 0;
- /* Register our local DCID in the DEMUX. */
- if (!ossl_qrx_add_dst_conn_id(ch->qrx, &ch->cur_local_dcid))
+ /* Register our local CID in the DEMUX. */
+ if (!ossl_qrx_add_dst_conn_id(ch->qrx, &ch->cur_local_cid))
return 0;
/* Change state. */
ossl_quic_stream_map_update_state(&ch->qsm, qs);
}
+
+/* Replace local connection ID in TXP and DEMUX for testing purposes. */
+int ossl_quic_channel_replace_local_cid(QUIC_CHANNEL *ch,
+ const QUIC_CONN_ID *conn_id)
+{
+ /* Remove the current local CID from the DEMUX. */
+ if (!ossl_qrx_remove_dst_conn_id(ch->qrx, &ch->cur_local_cid))
+ return 0;
+ ch->cur_local_cid = *conn_id;
+ /* Set in the TXP, used only for long header packets. */
+ if (!ossl_quic_tx_packetiser_set_cur_scid(ch->txp, &ch->cur_local_cid))
+ return 0;
+ /* Register our new local CID in the DEMUX. */
+ if (!ossl_qrx_add_dst_conn_id(ch->qrx, &ch->cur_local_cid))
+ return 0;
+ return 1;
+}
uint64_t cur_remote_seq_num;
uint64_t cur_retire_prior_to;
/* Server only: The DCID we currently expect the peer to use to talk to us. */
- QUIC_CONN_ID cur_local_dcid;
+ QUIC_CONN_ID cur_local_cid;
/* Transport parameter values we send to our peer. */
uint64_t tx_init_max_stream_data_bidi_local;