-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for OpenSSH "hostkeys" extension
This commit adds client and server support for the OpenSSH "hostkeys" extension, which allows a server to advertise current and future server host keys, so that clients can update their known_hosts to support key rotation and migrating to stronger algorithms over time. This feature is disabled by default, to avoid problems with SSH implementations that don't always gracefully handle unrecognized global requests. To enable it, the option send_server_host_keys can be set to `True` when creating a server or the option server_host_keys_handler can be set to a callable or coroutine when starting a client. This callback will be called with four lists of keys (added, removed, retained, and revoked), representing the differences between what matched in the client's known hosts and what was provided by the server. Note that this feature requires the client-side known hosts checking to be enabled. The callback will only be called if a trusted server host key was matched in the SSH handshake. Thanks go to Matthijs Kooijman for getting me to take another look at this. I had some concerns about not wanting AsyncSSH to ever modify external config files like known_hosts. However, I think the approach chosen here provides the key functionality needed while leaving it up to the application to decide how the configuration should be updated.
- Loading branch information
Showing
2 changed files
with
279 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.