dtls13: don't overrun hdr->epoch

This commit is contained in:
Juliusz Sosinowicz
2025-01-30 17:59:48 +01:00
parent 25c8869541
commit 2590aebfd9

View File

@@ -185,7 +185,8 @@ int Dtls13RlAddPlaintextHeader(WOLFSSL* ssl, byte* out,
/* seq[0] combines the epoch and 16 MSB of sequence number. We write on the /* seq[0] combines the epoch and 16 MSB of sequence number. We write on the
epoch field and will overflow to the first two bytes of the sequence epoch field and will overflow to the first two bytes of the sequence
number */ number */
c32toa(seq[0], hdr->epoch); c16toa((word16)(seq[0] >> 16), hdr->epoch);
c16toa((word16)seq[0], hdr->sequenceNumber);
c32toa(seq[1], &hdr->sequenceNumber[2]); c32toa(seq[1], &hdr->sequenceNumber[2]);
c16toa(length, hdr->length); c16toa(length, hdr->length);