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; BuildMsgArgs lcl_args;
#endif #endif
#ifdef WOLFSSL_DTLS_CID
byte cidSz = 0;
#endif
WOLFSSL_ENTER("BuildMessage"); WOLFSSL_ENTER("BuildMessage");
if (ssl == NULL) { if (ssl == NULL) {
@@ -23730,14 +23734,11 @@ int BuildMessage(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
args->idx += DTLS_RECORD_EXTRA; args->idx += DTLS_RECORD_EXTRA;
args->headerSz += DTLS_RECORD_EXTRA; args->headerSz += DTLS_RECORD_EXTRA;
#ifdef WOLFSSL_DTLS_CID #ifdef WOLFSSL_DTLS_CID
if (ssl->options.dtls) { if ((cidSz = DtlsGetCidTxSize(ssl)) > 0) {
byte cidSz = 0; args->sz += cidSz;
if ((cidSz = DtlsGetCidTxSize(ssl)) > 0) { args->idx += cidSz;
args->sz += cidSz; args->headerSz += cidSz;
args->idx += cidSz; args->sz++; /* real_type. no padding. */
args->headerSz += cidSz;
args->sz++; /* real_type. no padding. */
}
} }
#endif #endif
} }