summaryrefslogtreecommitdiffstats
path: root/ssl/d1_both.c
diff options
context:
space:
mode:
authorErik Auerswald <auerswal@unix-ag.uni-kl.de>2014-08-27 04:50:34 +0200
committerRich Salz <rsalz@openssl.org>2014-09-08 17:22:35 +0200
commitaf4c6e348e4bad6303e7d214cdcf2536487aabe4 (patch)
tree861df3c6ce386a161594e1f54b0162e62e0d6c0b /ssl/d1_both.c
parentRT3291: Add -crl and -revoke options to CA.pl (diff)
downloadopenssl-af4c6e348e4bad6303e7d214cdcf2536487aabe4.tar.xz
openssl-af4c6e348e4bad6303e7d214cdcf2536487aabe4.zip
RT3301: Discard too-long heartbeat requests
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to '')
-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)