summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>2014-08-26 22:50:34 -0400
committerRich Salz <rsalz@openssl.org>2014-09-08 11:22:35 -0400
commitaf4c6e348e4bad6303e7d214cdcf2536487aabe4 (patch)
tree861df3c6ce386a161594e1f54b0162e62e0d6c0b
parent98ecf60ba62fd0b8a3b3cadddf5e8dad59b3e056 (diff)
RT3301: Discard too-long heartbeat requests
Reviewed-by: Tim Hudson <tjh@openssl.org>
-rw-r--r--ssl/d1_both.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index 33d0ae3ce4..f2ff943001 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -1363,6 +1363,9 @@ dtls1_process_heartbeat(SSL *s)
/* Read type and payload length first */
if (1 + 2 + 16 > s->s3->rrec.length)
return 0; /* silently discard */
+ if (s->s3->rrec.length > SSL3_RT_MAX_PLAIN_LENGTH)
+ return 0; /* silently discard per RFC 6520 sec. 4 */
+
hbtype = *p++;
n2s(p, payload);
if (1 + 2 + payload + 16 > s->s3->rrec.length)