From 6070ca8499afa4d5043bcd123b600b910a3cf760 Mon Sep 17 00:00:00 2001 From: Ruby Martin Date: Thu, 7 Aug 2025 12:23:57 -0600 Subject: [PATCH] remove nested check for ssl->options.dtls move cidSz declaration --- src/internal.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 }