From 422eaa50242c997f794ca7948b10ab3c82c0c337 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Tue, 14 Feb 2017 10:02:36 +0800 Subject: [PATCH] Add back fragmentation detection --- src/server.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server.c b/src/server.c index 142cb980..cea6ad5c 100644 --- a/src/server.c +++ b/src/server.c @@ -591,6 +591,12 @@ server_recv_cb(EV_P_ ev_io *w, int revents) close_and_free_server(EV_A_ server); return; } else if (err == CRYPTO_NEED_MORE) { + if (server->stage != STAGE_STREAM && server->frag > 1) { + report_addr(server->fd, MALICIOUS, "malicious fragmentation"); + close_and_free_remote(EV_A_ remote); + close_and_free_server(EV_A_ server); + } + server->frag++; return; }