kex: Make existing convenience features available

Signed-off-by: David Wedderwille <davidwe@posteo.de>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
David Wedderwille
2025-03-28 00:26:52 +01:00
committed by Jakub Jelen
parent 0b91ba779c
commit 84d02e7440
7 changed files with 30 additions and 10 deletions

View File

@@ -310,6 +310,25 @@ const char *ssh_kex_get_fips_methods(enum ssh_kex_types_e type)
return fips_methods[type];
}
/**
* @brief Get a list of supported algorithms of a given type. This respects the
* FIPS mode status.
*
* @param[in] type The type of the algorithm to query (SSH_KEX, SSH_MAC_C_S,
* ...).
*
* @return The list of supported methods as comma-separated string, or NULL for
* unknown type.
*/
const char *ssh_get_supported_methods(enum ssh_kex_types_e type)
{
if (ssh_fips_mode()) {
return ssh_kex_get_fips_methods(type);
} else {
return ssh_kex_get_supported_method(type);
}
}
/**
* @internal
* @brief returns whether the first client key exchange algorithm or