Skip to content

Commit

Permalink
Merge pull request #7880 from ColtonWilley/tls13_send_cert_use_signed…
Browse files Browse the repository at this point in the history
…_len

Use signed variable for length calculation in SendTls13Certificate
  • Loading branch information
douzzer committed Aug 29, 2024
2 parents ef4ea53 + a57d234 commit fab5c9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tls13.c
Original file line number Diff line number Diff line change
Expand Up @@ -8462,12 +8462,13 @@ static int SendTls13Certificate(WOLFSSL* ssl)
int ret = 0;
word32 certSz, certChainSz, headerSz, listSz, payloadSz;
word16 extSz = 0;
word32 length, maxFragment;
word32 maxFragment;
word32 len = 0;
word32 idx = 0;
word32 offset = OPAQUE16_LEN;
byte* p = NULL;
byte certReqCtxLen = 0;
sword32 length;
#ifdef WOLFSSL_POST_HANDSHAKE_AUTH
byte* certReqCtx = NULL;
#endif
Expand Down Expand Up @@ -8513,7 +8514,7 @@ static int SendTls13Certificate(WOLFSSL* ssl)
listSz = 0;
}
else {
if (!ssl->buffers.certificate) {
if (!ssl->buffers.certificate || !ssl->buffers.certificate->buffer) {
WOLFSSL_MSG("Send Cert missing certificate buffer");
return NO_CERT_ERROR;
}
Expand Down Expand Up @@ -8604,7 +8605,7 @@ static int SendTls13Certificate(WOLFSSL* ssl)
#endif /* WOLFSSL_DTLS13 */
}
else {
fragSz = min(length, maxFragment);
fragSz = min((word32)length, maxFragment);
sendSz += fragSz;
}

Expand Down

0 comments on commit fab5c9f

Please sign in to comment.