diff --git a/src/internal.c b/src/internal.c index 154d2fdbe..becfeb72b 100644 --- a/src/internal.c +++ b/src/internal.c @@ -23598,6 +23598,10 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input, BuildMsgArgs lcl_args; #endif +#ifdef WOLFSSL_DTLS_CID + byte cidSz = 0; +#endif + WOLFSSL_ENTER("BuildMessage"); if (ssl == NULL) { @@ -23730,14 +23734,11 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input, args->idx += DTLS_RECORD_EXTRA; args->headerSz += DTLS_RECORD_EXTRA; #ifdef WOLFSSL_DTLS_CID - if (ssl->options.dtls) { - byte cidSz = 0; - if ((cidSz = DtlsGetCidTxSize(ssl)) > 0) { - args->sz += cidSz; - args->idx += cidSz; - args->headerSz += cidSz; - args->sz++; /* real_type. no padding. */ - } + if ((cidSz = DtlsGetCidTxSize(ssl)) > 0) { + args->sz += cidSz; + args->idx += cidSz; + args->headerSz += cidSz; + args->sz++; /* real_type. no padding. */ } #endif }