From ac02a4b68a77a8a6d9248cb0eb1542f8303cd23d Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 20 Jul 2011 15:17:20 +0000 Subject: [PATCH] PR: 2555 Submitted by: Robin Seggelmann Reviewed by: steve Fix DTLS sequence number bug --- ssl/d1_srvr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 2736c26e8e..c3144da0c2 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -165,6 +165,8 @@ int dtls1_accept(SSL *s) s->in_handshake++; if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s); + s->d1->listen = listen; + if (s->cert == NULL) { SSLerr(SSL_F_DTLS1_ACCEPT,SSL_R_NO_CERTIFICATE_SET); @@ -274,6 +276,12 @@ int dtls1_accept(SSL *s) s->init_num=0; + /* Reflect ClientHello sequence to remain stateless while listening */ + if (listen) + { + memcpy(s->s3->write_sequence, s->s3->read_sequence, sizeof(s->s3->write_sequence)); + } + /* If we're just listening, stop here */ if (listen && s->state == SSL3_ST_SW_SRVR_HELLO_A) { -- 2.25.1