From d5fefe5146f472335c6828bd171834c9c206114b Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 25 Oct 2011 19:02:23 -0400 Subject: [PATCH] Enforce *double* our packet-size-limit temporarily. --- ssh-transport.rkt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ssh-transport.rkt b/ssh-transport.rkt index f5210c9..55e1491 100644 --- a/ssh-transport.rkt +++ b/ssh-transport.rkt @@ -229,6 +229,14 @@ (define (check-packet-length! actual-length limit block-size) (when (> actual-length limit) + (log-warning (format "Packet of length ~v exceeded our limit of ~v" + actual-length + limit))) + (when (> actual-length (* 2 limit)) + ;; TODO: For some reason, OpenSSH seems to occasionally slightly + ;; exceed the packet size limit! (For example, sending a packet of + ;; length 65564 when I'm expecting a max of 65536.) So we actually + ;; enforce twice our actual limit. (disconnect-with-error 0 ;; TODO: better reason code? "Packet of length ~v is longer than packet limit ~v" actual-length