Commit
dd07c9fc1f37bed8d1f67ffe7b203f61e7914edf broke the reception of datagram
SPTPS packets, by undoing the conversion of the sequence number to host byte
order before comparison. This caused error messages like "Packet is
16777215
seqs in the future, dropped (1)".
memcpy(buffer, &netlen, 2);
memcpy(buffer + 2, data, len);
memcpy(buffer, &netlen, 2);
memcpy(buffer + 2, data, len);
- memcpy(&seqno, buffer + 2, 4);
-
if(!digest_verify(&s->indigest, buffer, len - 14, buffer + len - 14))
return error(s, EIO, "Invalid HMAC");
if(!digest_verify(&s->indigest, buffer, len - 14, buffer + len - 14))
return error(s, EIO, "Invalid HMAC");
s->received++;
// Decrypt.
s->received++;
// Decrypt.
+ memcpy(&seqno, buffer + 2, 4);
cipher_set_counter(&s->incipher, &seqno, sizeof seqno);
if(!cipher_counter_xor(&s->incipher, buffer + 6, len - 4, buffer + 6))
return false;
cipher_set_counter(&s->incipher, &seqno, sizeof seqno);
if(!cipher_counter_xor(&s->incipher, buffer + 6, len - 4, buffer + 6))
return false;