From 9ec692347983907df174f09fe27f4f9dd664fd94 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Wed, 16 Oct 2019 11:16:17 +0200 Subject: [PATCH] pkd: use detected OpenSSH supported key types Signed-off-by: Aris Adamantiadis Reviewed-by: Andreas Schneider (cherry picked from commit 3d2570ff5ffa5be69df01dfcf46d1213a3acfbd4) --- tests/CMakeLists.txt | 3 ++- tests/pkd/pkd_client.h | 28 +++------------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0acbde3d..6df750c7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,7 +12,8 @@ include_directories(${OPENSSL_INCLUDE_DIR} ${libssh_BINARY_DIR}/include ${libssh_BINARY_DIR} ${libssh_SOURCE_DIR}/src - ${CMAKE_CURRENT_SOURCE_DIR}) + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/tests) set(TORTURE_LINK_LIBRARIES ${CMOCKA_LIBRARY} diff --git a/tests/pkd/pkd_client.h b/tests/pkd/pkd_client.h index 474ca174..63bf0f29 100644 --- a/tests/pkd/pkd_client.h +++ b/tests/pkd/pkd_client.h @@ -9,42 +9,20 @@ #define __PKD_CLIENT_H__ #include "config.h" +#include "tests_config.h" /* OpenSSH */ #define OPENSSH_BINARY "ssh" #define OPENSSH_KEYGEN "ssh-keygen" -#define OPENSSH_HOSTKEY_ALGOS_DEFAULT "ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa" -#define OPENSSH_PKACCEPTED_DEFAULT "ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-rsa-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com" - -#if HAVE_ECC -#define OPENSSH_HOSTKEY_ALGOS_ECDSA ",ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521" -#define OPENSSH_PKACCEPTED_ECDSA ",ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com" -#else /* HAVE_ECC */ -#define OPENSSH_HOSTKEY_ALGOS_ECDSA "" -#define OPENSSH_PKACCEPTED_ECDSA "" -#endif /* HAVE_ECC */ - -#if HAVE_DSA -#define OPENSSH_HOSTKEY_ALGOS_DSA ",ssh-dss" -#define OPENSSH_PKACCEPTED_DSA ",ssh-dss,ssh-dss-cert-v01@openssh.com" -#else /* HAVE_DSA */ -#define OPENSSH_HOSTKEY_ALGOS_DSA "" -#define OPENSSH_PKACCEPTED_DSA "" -#endif /* HAVE_DSA */ - #define OPENSSH_HOSTKEY_ALGOS \ "-o HostKeyAlgorithms=" \ - OPENSSH_HOSTKEY_ALGOS_DEFAULT \ - OPENSSH_HOSTKEY_ALGOS_ECDSA \ - OPENSSH_HOSTKEY_ALGOS_DSA + OPENSSH_KEYS #define OPENSSH_PKACCEPTED_TYPES \ "-o PubkeyAcceptedKeyTypes=" \ - OPENSSH_PKACCEPTED_DEFAULT \ - OPENSSH_PKACCEPTED_ECDSA \ - OPENSSH_PKACCEPTED_DSA + OPENSSH_KEYS #define OPENSSH_CMD_START(hostkey_algos) \ OPENSSH_BINARY " " \