1
1

pkd: use detected OpenSSH supported key types

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
Aris Adamantiadis 2019-10-16 11:16:17 +02:00 коммит произвёл Andreas Schneider
родитель 3063a57fc8
Коммит 3d2570ff5f
2 изменённых файлов: 5 добавлений и 26 удалений

Просмотреть файл

@ -11,7 +11,8 @@ include_directories(${OPENSSL_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}
${libssh_BINARY_DIR} ${libssh_BINARY_DIR}
${libssh_SOURCE_DIR}/src ${libssh_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}) ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/tests)
set(TORTURE_LINK_LIBRARIES set(TORTURE_LINK_LIBRARIES
${CMOCKA_LIBRARY} ${CMOCKA_LIBRARY}

Просмотреть файл

@ -9,42 +9,20 @@
#define __PKD_CLIENT_H__ #define __PKD_CLIENT_H__
#include "config.h" #include "config.h"
#include "tests_config.h"
/* OpenSSH */ /* OpenSSH */
#define OPENSSH_BINARY "ssh" #define OPENSSH_BINARY "ssh"
#define OPENSSH_KEYGEN "ssh-keygen" #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 \ #define OPENSSH_HOSTKEY_ALGOS \
"-o HostKeyAlgorithms=" \ "-o HostKeyAlgorithms=" \
OPENSSH_HOSTKEY_ALGOS_DEFAULT \ OPENSSH_KEYS
OPENSSH_HOSTKEY_ALGOS_ECDSA \
OPENSSH_HOSTKEY_ALGOS_DSA
#define OPENSSH_PKACCEPTED_TYPES \ #define OPENSSH_PKACCEPTED_TYPES \
"-o PubkeyAcceptedKeyTypes=" \ "-o PubkeyAcceptedKeyTypes=" \
OPENSSH_PKACCEPTED_DEFAULT \ OPENSSH_KEYS
OPENSSH_PKACCEPTED_ECDSA \
OPENSSH_PKACCEPTED_DSA
#define OPENSSH_CMD_START(hostkey_algos) \ #define OPENSSH_CMD_START(hostkey_algos) \
OPENSSH_BINARY " " \ OPENSSH_BINARY " " \