From b2ca8b07ec1c38d79192a1956f742c30d074f61b Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 4 Jan 2023 14:52:49 +0100 Subject: [PATCH] Clean up usage of HAVE_ECC and HAVE_ECDH they might be turned off and on independenty and each of them affects different part of libssh, authentication and key exchange respectively. But only HAVE_ECC is defined by the cmake. Signed-off-by: Jakub Jelen Reviewed-by: Norbert Pocs (cherry picked from commit 492f5d82b835e5ba9b28022bf07998429c77c214) --- src/kex.c | 6 +++--- src/knownhosts.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kex.c b/src/kex.c index 8e67501b..7d17317d 100644 --- a/src/kex.c +++ b/src/kex.c @@ -99,7 +99,7 @@ #define CURVE25519 "" #endif /* HAVE_CURVE25519 */ -#ifdef HAVE_ECDH +#ifdef HAVE_ECC #define ECDH "ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521," #define EC_HOSTKEYS "ecdsa-sha2-nistp521," \ "ecdsa-sha2-nistp384," \ @@ -111,12 +111,12 @@ #define EC_PUBLIC_KEY_ALGORITHMS EC_FIPS_PUBLIC_KEY_ALGOS \ "sk-ecdsa-sha2-nistp256-cert-v01@openssh.com," #else +#define ECDH "" #define EC_HOSTKEYS "" #define EC_SK_HOSTKEYS "" #define EC_FIPS_PUBLIC_KEY_ALGOS "" #define EC_PUBLIC_KEY_ALGORITHMS "" -#define ECDH "" -#endif /* HAVE_ECDH */ +#endif /* HAVE_ECC */ #ifdef HAVE_DSA #define DSA_HOSTKEYS ",ssh-dss" diff --git a/src/knownhosts.c b/src/knownhosts.c index d179d3f4..9f978096 100644 --- a/src/knownhosts.c +++ b/src/knownhosts.c @@ -489,7 +489,7 @@ static const char *ssh_known_host_sigs_from_hostkey_type(enum ssh_keytypes_e typ SSH_LOG(SSH_LOG_WARN, "DSS keys are not supported by this build"); break; #endif -#ifdef HAVE_ECDH +#ifdef HAVE_ECC case SSH_KEYTYPE_ECDSA_P256: return "ecdsa-sha2-nistp256"; case SSH_KEYTYPE_ECDSA_P384: