From: Michael Tuexen <tuexen@fh-muenster.de>
Date: Thu, 8 Aug 2013 12:28:55 +0000 (+0100)
Subject: DTLS handshake fix.
X-Git-Tag: OpenSSL_1_0_0l~23
X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=799f203ff6933807f43e9e0692ec2741d4d83d59;p=oweals%2Fopenssl.git

DTLS handshake fix.

Reported by: Prashant Jaikumar <rmstar@gmail.com>

Fix handling of application data received before a handshake.
(cherry picked from commit 0c75eeacd3285b395dc75b65c3e6fe6ffbef59f0)
---

diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
index 9b013e491c..eb68030d14 100644
--- a/ssl/d1_pkt.c
+++ b/ssl/d1_pkt.c
@@ -812,6 +812,12 @@ start:
 			}
 		}
 
+	if (s->d1->listen && rr->type != SSL3_RT_HANDSHAKE)
+		{
+		rr->length = 0;
+		goto start;
+		}
+
 	/* we now have a packet which can be read and processed */
 
 	if (s->s3->change_cipher_spec /* set when we receive ChangeCipherSpec,