diff options
author | Erik Auerswald <auerswal@unix-ag.uni-kl.de> | 2014-08-26 22:50:34 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2014-09-08 11:23:02 -0400 |
commit | ff89be854e8e42df1a9e57ce255988acf11e629b (patch) | |
tree | 8762c0d9c7724661a413764c541e1cb9c635a845 | |
parent | 61a44b76a0abfc96e9abd902000ad3f5b7945c6a (diff) |
RT3301: Discard too-long heartbeat requests
Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit af4c6e348e4bad6303e7d214cdcf2536487aabe4)
-rw-r--r-- | ssl/d1_both.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c index fb524dafa0..3819527e74 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) |