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>
_ _ _ _
(_) (_) (_) (_)
(_) _ (_) _ _ _ _ _ (_) _
(_) (_) (_)(_) _ (_)(_) (_)(_) (_)(_) _
(_) (_) (_) (_) _ (_) _ (_) (_) (_)
(_) (_) (_)(_)(_) (_)(_) (_)(_) (_) (_).org
The SSH library
Why?
Why not ? :) I've began to work on my own implementation of the ssh protocol because i didn't like the currently public ones. Not any allowed you to import and use the functions as a powerful library, and so i worked on a library-based SSH implementation which was non-existing in the free and open source software world.
How/Who?
If you downloaded this file, you must know what it is : a library for accessing ssh client services through C libraries calls in a simple manner. Everybody can use this software under the terms of the LGPL - see the COPYING file
If you ask yourself how to compile libssh, please read INSTALL before anything.
Where ?
Contributing
Please read the file 'CONTRIBUTING.md' next to this README file. It explains our copyright policy and how you should send patches for upstream inclusion.
Have fun and happy libssh hacking!
The libssh Team