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:28:45 +0000 (12:28 +0000)
commit4285b851637a3da8bd6e96848f0deffb6be5e626
treeef13e0a720f99b146055972237c43e4b85f154f9
parentfe82be2b33714949e24f107af94b5b75206a28cd
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>
(cherry picked from commit d5d0a1cb1347d4a8547e78aec56c50c528186e50)
ssl/t1_enc.c