1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-14 04:18:54 +03:00

server: expose 'ssh_server_init_kex' API

Expose an API 'ssh_server_init_kex' which allows one to change the set of
key exchange, hostkey, ciphers, MACs, and compression algorithms currently
configured for the ssh_session at hand, after having started the
'ssh_handle_key_exchange' process.

One can use this API from the already-existing 'connect_status_function'
callback to dynamically modify the set of algorithms used after having
received the client banner, but before sending out the initial KEXINIT
message.

For example, one might want to prevent advertising the curve25519 key
exchange algorithm for older OpenSSH clients due to interop bugs.

Fixes T25

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jon Simons
2014-10-18 23:30:33 -07:00
committed by Andreas Schneider
parent f0ddde4826
commit 538f1bc00e
2 changed files with 39 additions and 6 deletions

View File

@@ -187,6 +187,24 @@ LIBSSH_API ssh_gssapi_creds ssh_gssapi_get_creds(ssh_session session);
*/
LIBSSH_API int ssh_handle_key_exchange(ssh_session session);
/**
* @brief Initialize the set of key exchange, hostkey, ciphers, MACs, and
* compression algorithms for the given ssh_session.
*
* The selection of algorithms and keys used are determined by the
* options that are currently set in the given ssh_session structure.
* May only be called before the initial key exchange has begun.
*
* @param session The session structure to initialize.
*
* @see ssh_handle_key_exchange
* @see ssh_options_set
*
* @return SSH_OK if initialization succeeds.
*/
LIBSSH_API int ssh_server_init_kex(ssh_session session);
/**
* @brief Free a ssh servers bind.
*