aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
AgeCommit message (Collapse)AuthorFilesLines
2021-01-12tests/external_override: Add override test for internal implementationsAnderson Toshiyuki Sasaki1-0/+48
This adds a test to check if the internal implementation is not used when it is not supposed to be used. To be able to override functions using LD_PRELOAD, a shared version of the torture library was added, as well as a shared library for each of the algorithms implemented internally (ChaCha20, Poly1305, curve25519, and ed25519). Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-12-10auth: Add ssh_userauth_publickey_auto_get_current_identity()Marius Vollmer1-0/+3
Signed-off-by: Marius Vollmer <mvollmer@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-06cmake: Add autogenerated libssh_version.hHeiko Thiery1-0/+1
Set the cmake project verision to the autogenerated file to have a single point to set the version. This will be included in the libssh.h file. Pair-Programmed-With: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-04-20Make the testing ping use all supported algorithmsJakub Jelen1-1/+1
Previously, it would use only the default set, which makes some tests failing including the DSA ones and disabled RSA with SHA1. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-03-29torture: Added a function to setup a libssh based serverAnderson Toshiyuki Sasaki1-0/+11
The added function runs the test server under timeout program to kill it if it elapses the default timeout of 5 minutes. An auxiliary function to create a libssh server configuration file was also added. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-23CMakeLists: Shorten the keys lists passed to the ssh commandJakub Jelen1-0/+6
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-23tests: use detected sshd pathAris Adamantiadis1-8/+8
The static sshd directory wasn't matching the detected sshd and prevented the testcases to be run against local OpenSSH builts Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-23pkd: use detected OpenSSH supported key typesAris Adamantiadis1-1/+2
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-23tests: detect OpenSSH supported ciphersAris Adamantiadis1-0/+70
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-23tests: fix typosAris Adamantiadis1-1/+1
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-20tests/CMakeLists: Adds keys to authorized hosts list. copies script used to ↵Sahana Prasad1-0/+24
setup tokens. Signed-off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-11-07cmake: Fix setting up cwrap for server testingAndreas Schneider1-6/+8
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-11-07cmake: Do not use cached LIBSSH_PUBLIC_INCLUDE_DIRSAndreas Schneider1-9/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-11-07cmake: Rename static libraryAndreas Schneider1-1/+1
This is only compiled for tests and fuzzers! Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-11-07cmake: Create ssh library directly as libsshAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-07-08cmake: We don't have to define the ssh link librariesAndreas Schneider1-2/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-06-20tests: Filter out bogus output from openssh in FIPS ModeJakub Jelen1-2/+2
The OpenSSH in RHEL 8 in FIPS Mode outputs information about this on start and it needs to be skipped for the version detection (and build) to pass: $ ssh -V FIPS mode initialized OpenSSH_8.0p1, OpenSSL 1.1.1c FIPS 28 May 2019 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-04-17tests: add OpenSSL includes dir for torture testsBen Toews1-0/+1
Tests were failing to build on macOS with OpenSS installed using homebrew. Signed-off-by: Ben Toews <mastahyeti@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-01-22tests: Added test serverAnderson Toshiyuki Sasaki1-0/+1
The server can be configured through command line options or by providing a state structure with the desired values set. Currently supports only password based authentication. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2018-11-23tests: Do not require all the crypto libs to build testsuiteJakub Jelen1-2/+0
This was failing when I tried to run the testsuite without gcrypt devel libraries installed. Signed-off-by: Jakub Jelen <jakuje@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-15tests: Fix chroot_wrapper locationAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19tests: Verify we can authenticate using ed25519 keyJakub Jelen1-0/+6
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-18tests: Wait for the server to startJakub Jelen1-0/+8
The previous timeout of 500 ms was not enough on slower machines or while running the tests under valgrind. On much faster machines the sleep() was bringing unnecessary overhead. This method opens simple connection to the server verifying it is ready to accept the connection from the test for 5 seconds. It the server does not start until then, it fails the tests during initialization, rather than leaving the cases to run against missing server. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-17tests: Verify the pubkey authentication works with ECDSA keysJakub Jelen1-0/+5
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
2018-08-03threads: Automatically call ssh_init on loadAnderson Toshiyuki Sasaki1-7/+0
This makes unnecessary to call ssh_init() when the library is dynamically loaded. Also removes the threads shared library. The used threads implementation is chosen in configuration time, changing the ssh_threads_get_default() depending on the available threads library. Internally, it is expected a threads implementation providing: - void ssh_mutex_lock(void **mutex); - void ssh_mutex_unlock(void **mutex); - struct ssh_threads_callbacks_struct *ssh_threads_get_default(void); and a crypto implementation providing: - int crypto_thread_init(struct ssh_threads_callbacks_struct *user_callbacks); - void crypto_thread_finalize(void); This adds internal threads implementation for pthreads and noop. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-30torture: Add assert macros for ssh return codesAndreas Schneider1-1/+2
This allows us to print errors from ssh sessions. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29cmake: Add SERVER_TESTING optionAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-29cmake: Rename WITH_CLIENT_TESTING option to CLIENT_TESTINGAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-04cmake: Build ssh_server_fuzzer if enabledAndreas Schneider1-0/+4
Fixes T67 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10tests: Move torture keys to own fileAndreas Schneider1-4/+8
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10tests: Move helper functions to a common fileAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-12-15tests: Temporarily build chroot_wrapperJakub Jelen1-1/+10
2016-03-17cmake: Fix torture buildAndreas Schneider1-1/+3
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-03-17cmake: Try to fix FindArgp moduleAndreas Schneider1-4/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-03-15torture_auth: Add tests for client side certificate authenticationAxel Eppe1-0/+5
- enabled TrustedUserCAKeys option in torture.c - adds a new set of (signed) keys for bob in a separate dir The private key used to generate the certs is included, but not required. Signed-off-by: Axel Eppe <aeppe@google.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-02-03tests: Fix running ssh-agentAndreas Schneider1-1/+10
ssh-agent needs to be executed as the local user and not a fake user or we will not be able to add identies. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-02-03tests: Always start tests as root so we can switch to a userAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-18tests: Require pam_wrapper 1.0.1Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14tests: Turn on PAM support in sshd with pam_wrapperAndreas Schneider1-1/+7
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14tests: Support other openssh versions ...Andreas Schneider1-0/+8
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14tests: Add public keys for bobAndreas Schneider1-0/+7
This also allows bob to auth as alice. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14cmake: Configure nss_wrapper and uid_wrapperAndreas Schneider1-0/+20
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14cmake: Search for cwrap and sshd.Andreas Schneider1-0/+12
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-09-07cmake: Handle libssh threas library correctlyAndreas Schneider1-2/+2
This should fix the build on Windows and would not install pkg files. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-07-03cmake: Fix zlib include directoryAndreas Schneider1-3/+3
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-24cmake: Do not use CMAKE_(SOURCE|BINARY)_DIRDouglas Heriot1-1/+1
2015-05-05tests: Only link against threading library if availableAndreas Schneider1-10/+14
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2014-10-15tests: fix pkd build breakagesJon Simons1-1/+3
Fix a build breakage when '-DWITH_SERVER=OFF' is set: skip building the pkd test for that case. Add some missing includes for the OpenIndiana and FreeBSD builds. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-10-12tests: introduce pkd_helloJon Simons1-0/+2
Introduce a sample public-key testing daemon to the 'pkd' test directory, and add support code for cycling through various combinations of different key exchange, cipher, and MAC algorithms. The goal of the 'pkd_hello' test is to make it easy to test interactions between non-libssh clients and a libssh-server, and to provide a starting point for testing new implementations for key types, ciphers, MACs, and so on. The thinking is that testing a new algorithm should be as simple as adding a new line for it in the PKDTESTS_* lists. Macros are used to generate the tests and helper functions for a couple of clients -- here, OpenSSH and dropbear are included for the first cut. If binaries are found for these clients, their test lists will be enabled; when binaries are not found for a given client, those tests are skipped. Tests are run in one large batch by default, but can also be run individually to help with tracking down things like signature bugs that may take many iterations to reproduce. Each test logs its stdout and stderr to its own file, which is cleaned up when a test succeeds. For failures, those logs can be combined with verbose libssh output from pkd itself to start debugging things. Some example usages: pkd_hello Run all tests with default number of iterations. pkd_hello --list List available individual test names. pkd_hello -i 1000 -t torture_pkd_openssh_ecdsa_256_ecdh_sha2_nistp256 Run only the torture_pkd_openssh_ecdsa_256_ecdh_sha2_nistp256 testcase 1000 times. pkd_hello -v -v -v -v -e -o Run all tests with maximum libssh and pkd logging. Included in the tests are passes for all existing kex, cipher, and MAC algorithms. BUG: https://red.libssh.org/issues/144 Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-02build: fix cmake bug introduced yesterdayAris Adamantiadis1-3/+3
Compilation failed on OSX because of the missing OR OSX