Files
libssh/src
Carlos Martín Nieto 346e6db318 packet: do not enqueue outgoing packets after sending SSH2_MSG_NEWKEYS
When we decide we need to rekey, we enqueue any further packets until we've sent
our SSH2_MSG_NEWKEYS message, after which we dequeue these packets and send them
to the other side. This enqueueing is done based on ssh_packet_in_rekey checking
the session flags and whether DH handshake state is marked as finished.

However, the handshake state is not reset to DH_STATE_FINISHED until the other
side has sent us their new keys. This leaves a gap between sending our new keys
and receiving the other side's new keys where we would still decide to enqueue a
packet.

These enqueued packets will not be dequeued as we've already sent our new keys.
Once we've received the other side's new keys, we'll go back to a finished
handshake and we will send out our caller's new data, skipping however much data
we've enqueued.

Fix this by changing ssh_packet_in_rekey to return false once we've sent our new
keys.

Signed-off-by: Carlos Martín Nieto <carlosmn@github.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2022-10-07 10:26:38 +02:00
..
2022-07-02 07:04:48 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2019-12-09 16:08:03 +01:00
2021-08-18 14:13:56 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-07-04 11:55:40 +02:00
2022-06-15 14:47:06 +02:00
2022-09-22 12:29:08 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2019-01-24 11:56:23 +01:00
2022-10-07 09:13:19 +02:00
2022-06-15 14:47:06 +02:00
2022-09-07 14:37:29 +02:00
2022-10-07 09:13:19 +02:00
2022-07-02 07:04:48 +02:00
2022-06-15 14:47:06 +02:00
2022-10-07 09:13:19 +02:00
2022-09-22 12:31:48 +02:00
2022-07-04 11:55:40 +02:00
2022-05-10 12:39:26 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-10-07 09:13:19 +02:00
2022-08-30 13:24:20 +02:00