mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-21 14:00:51 +03:00
Notes: * Host Key RSA 256/512 support #536 * Client side key hash upgrading for RFC 8332 * Support for server-sig-algs, ext-info-c server messages * Customizing preferred server-sig-algs via the preference LIBSSH2_METHOD_SIGN_ALGO Credit: Anders Borum, Will Cosgrove
This commit is contained in:
22
src/kex.c
22
src/kex.c
@@ -3026,6 +3026,17 @@ kex_method_ssh_curve25519_sha256 = {
|
||||
};
|
||||
#endif
|
||||
|
||||
/* this kex method signals that client can receive extensions
|
||||
* as described in https://datatracker.ietf.org/doc/html/rfc8308
|
||||
*/
|
||||
|
||||
static const LIBSSH2_KEX_METHOD
|
||||
kex_method_extension_negotiation = {
|
||||
"ext-info-c",
|
||||
NULL,
|
||||
0,
|
||||
};
|
||||
|
||||
static const LIBSSH2_KEX_METHOD *libssh2_kex_methods[] = {
|
||||
#if LIBSSH2_ED25519
|
||||
&kex_method_ssh_curve25519_sha256,
|
||||
@@ -3043,6 +3054,7 @@ static const LIBSSH2_KEX_METHOD *libssh2_kex_methods[] = {
|
||||
&kex_method_diffie_helman_group14_sha1,
|
||||
&kex_method_diffie_helman_group1_sha1,
|
||||
&kex_method_diffie_helman_group_exchange_sha1,
|
||||
&kex_method_extension_negotiation,
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -3978,6 +3990,11 @@ libssh2_session_method_pref(LIBSSH2_SESSION * session, int method_type,
|
||||
mlist = NULL;
|
||||
break;
|
||||
|
||||
case LIBSSH2_METHOD_SIGN_ALGO:
|
||||
prefvar = &session->sign_algo_prefs;
|
||||
mlist = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
return _libssh2_error(session, LIBSSH2_ERROR_INVAL,
|
||||
"Invalid parameter specified for method_type");
|
||||
@@ -4073,6 +4090,11 @@ LIBSSH2_API int libssh2_session_supported_algs(LIBSSH2_SESSION* session,
|
||||
_libssh2_comp_methods(session);
|
||||
break;
|
||||
|
||||
case LIBSSH2_METHOD_SIGN_ALGO:
|
||||
/* no built-in supported list due to backend support */
|
||||
mlist = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
return _libssh2_error(session, LIBSSH2_ERROR_METHOD_NOT_SUPPORTED,
|
||||
"Unknown method type");
|
||||
|
||||
Reference in New Issue
Block a user