@@ -110,6 +110,17 @@ typedef struct {
110110 uint64_t bitfield ;
111111} seqnum_t ;
112112
113+ /* Maximum CID length. */
114+ #ifndef DTLS_MAX_CID_LENGTH
115+ #define DTLS_MAX_CID_LENGTH 16
116+ #endif
117+
118+ #if (DTLS_MAX_CID_LENGTH > 0 )
119+ #ifndef DTLS_USE_CID_DEFAULT
120+ #define DTLS_USE_CID_DEFAULT 1
121+ #endif /* DTLS_USE_CID_DEFAULT */
122+ #endif /* DTLS_MAX_CID_LENGTH > 0 */
123+
113124typedef struct {
114125 dtls_compression_t compression ; /**< compression method */
115126
@@ -124,7 +135,12 @@ typedef struct {
124135 * access the components of the key block.
125136 */
126137 uint8 key_block [MAX_KEYBLOCK_LENGTH ];
127-
138+
139+ #if (DTLS_MAX_CID_LENGTH > 0 )
140+ uint8_t write_cid [DTLS_MAX_CID_LENGTH ];
141+ uint8_t write_cid_length ;
142+ #endif /* DTLS_MAX_CID_LENGTH > 0 */
143+
128144 seqnum_t cseq ; /**<sequence number of last record received*/
129145} dtls_security_parameters_t ;
130146
@@ -141,6 +157,9 @@ typedef struct dtls_user_parameters_t {
141157 dtls_cipher_t cipher_suites [DTLS_MAX_CIPHER_SUITES + 1 ];
142158 unsigned int force_extended_master_secret :1 ; /** force extended master secret extension (RFC7627) */
143159 unsigned int force_renegotiation_info :1 ; /** force renegotiation info extension (RFC5746) */
160+ #if (DTLS_MAX_CID_LENGTH > 0 )
161+ unsigned int support_cid :1 ; /** indicate CID support (RFC9146) */
162+ #endif
144163} dtls_user_parameters_t ;
145164
146165typedef struct {
@@ -158,6 +177,12 @@ typedef struct {
158177 dtls_compression_t compression ; /**< compression method */
159178 dtls_user_parameters_t user_parameters ; /**< user parameters */
160179 dtls_cipher_index_t cipher_index ; /**< internal index for cipher_suite_params, DTLS_CIPHER_INDEX_NULL for TLS_NULL_WITH_NULL_NULL */
180+
181+ #if (DTLS_MAX_CID_LENGTH > 0 )
182+ uint8_t write_cid [DTLS_MAX_CID_LENGTH ];
183+ uint8_t write_cid_length ;
184+ #endif /* DTLS_MAX_CID_LENGTH > 0 */
185+
161186 unsigned int do_client_auth :1 ;
162187 unsigned int extended_master_secret :1 ;
163188 unsigned int renegotiation_info :1 ;
0 commit comments