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