mirror of https://github.com/OISF/suricata
ssh: fix record_left for oversized KEXINIT records
When an incomplete SSH_MSG_KEXINIT record has a body of at least SSH_MAX_REASSEMBLED_RECORD_LEN bytes and hassh is enabled, record_left was overwritten with the full body length even though the function returns ok() and thus consumes the body bytes already present in the input. The next call then over-skipped by that many bytes into the following record, desynchronising the parser for that direction so hassh was never computed and ssh.hassh keywords could not match. This patch keeps the record_left computed from the bytes actually consumed in the oversized path, and only use the full body length in the path that returns incomplete, where the body bytes are delivered again. Ticket #8837pull/16213/head
parent
76189e4526
commit
f13021e022
Loading…
Reference in New Issue