Ensure last_write_sequence is saved in DTLS1.2
authorMatt Caswell <matt@openssl.org>
Thu, 5 Feb 2015 13:54:37 +0000 (13:54 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 25 Mar 2015 12:24:10 +0000 (12:24 +0000)
commitd5d0a1cb1347d4a8547e78aec56c50c528186e50
tree2ad858e44c117146d57071ac8745971a0c6eca2e
parentd64070838ebba86f00fb3755df5d3e65106e1628
Ensure last_write_sequence is saved in DTLS1.2

In DTLS, immediately prior to epoch change, the write_sequence is supposed
to be stored in s->d1->last_write_sequence. The write_sequence is then reset
back to 00000000. In the event of retransmits of records from the previous
epoch, the last_write_sequence is restored. This commit fixes a bug in
DTLS1.2 where the write_sequence was being reset before last_write_sequence
was saved, and therefore retransmits are sent with incorrect sequence
numbers.

Reviewed-by: Richard Levitte <levitte@openssl.org>
ssl/t1_enc.c