Initialise the epoch for the DTLS processed and unprocessed queues.
authorjsing <jsing@openbsd.org>
Sat, 19 Jun 2021 16:38:27 +0000 (16:38 +0000)
committerjsing <jsing@openbsd.org>
Sat, 19 Jun 2021 16:38:27 +0000 (16:38 +0000)
Currently these only get correctly initialised when
dtls1_process_buffered_records() is called - while this works it is more
accidental than intentional.

ok tb@

lib/libssl/d1_lib.c

index dbc89e6..bc00ab8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: d1_lib.c,v 1.54 2021/05/16 13:56:30 jsing Exp $ */
+/* $OpenBSD: d1_lib.c,v 1.55 2021/06/19 16:38:27 jsing Exp $ */
 /*
  * DTLS implementation written by Nagendra Modadugu
  * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.
@@ -197,6 +197,9 @@ dtls1_clear(SSL *s)
                memset(s->d1, 0, sizeof(*s->d1));
                s->d1->internal = internal;
 
+               D1I(s)->processed_rcds.epoch = D1I(s)->r_epoch;
+               D1I(s)->unprocessed_rcds.epoch = D1I(s)->r_epoch + 1;
+
                if (s->server) {
                        D1I(s)->cookie_len = sizeof(D1I(s)->cookie);
                }