remove nested check for ssl->options.dtls

move cidSz declaration
This commit is contained in:
Ruby Martin
2025-08-07 12:23:57 -06:00
parent e631f2e56e
commit 6070ca8499

View File

@@ -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
}