aboutsummaryrefslogtreecommitdiff
path: root/tests/torture.h
AgeCommit message (Collapse)AuthorFilesLines
2023-06-01torture_connect: Test bad IPv6 connection trying IPv4Norbert Pocs1-0/+1
If IPv6 address fail to connect IPv4 should be tried in non-blocking mode. Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-05-09Avoid memory leaks from the server_auth_kbdintJakub Jelen1-0/+2
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-05-09tests: Wait longer for the serverJakub Jelen1-0/+2
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-03-01Add support for PKCS#11 provider in OpenSSL 3.0Jakub Jelen1-0/+1
The engine API in OpenSSL 3.0 is deprecated so we are in the progress of working on a PKCS#11 provider for OpenSSL. This commit introduces a conditional build with the pkcs11-provider support (instead of engines) with all the changes required for the provider to work with existing code and tests. The CI modification is only temporary before we will have the real package in Fedora or somewhere to use. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Norbert Pocs <npocs@redhat.com>
2022-10-12Fix libsofthsm.so path detectionNorbert Pocs1-0/+2
libsofthsm detection is broken in i686 architecture. The approach is to export the path found by cmake to `tests_config.h` and the script setup-softhsm-tokens.sh gets that value through cli parameters. Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2022-08-31tests: Use weak attribute for torture_run_tests() if availableAndreas Schneider1-3/+3
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2022-08-30Do not force GNU_SOURCE during build to fix #141Jakub Jelen1-4/+0
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2021-11-09tests: Add condition for SSHD_EXECUTABLENorbert Pocs1-4/+7
Do not compile tests which need SSHD_EXECUTABLE when it is not available Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2021-03-18tests: Cover sftp_new_channel functionJakub Jelen1-0/+1
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Sahana Prasad <sahana@redhat.com>
2021-01-12tests/external_override: Add override test for internal implementationsAnderson Toshiyuki Sasaki1-0/+4
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-05-20tests/torture.c: update the definition of torture_setup_tokens() to take ↵Sahana Prasad1-1/+4
load_public as an option that determines if public keys must be loaded in pkcs #11 tokens or not. tests: Adds the load_public parameter in all files where torture_setup_tokens() was used. Signed-off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-03-29torture: Added a function to setup a libssh based serverAnderson Toshiyuki Sasaki1-0/+4
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-23tests: search for netcat binaryAris Adamantiadis1-0/+1
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-20clienttest: Adds a client test that authenticates to the ssh server using ↵Sahana Prasad1-0/+1
ssh_connect through key obtained through PKCS11 URIs. Signed-Off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-20torture: Add a helper function to setup tokens using softhsm.Sahana Prasad1-0/+1
Signed-off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-20etc: Adds a new user CharlieSahana Prasad1-0/+1
Signed-off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-01-09tests: Allow to modify sshd config from the testJakub Jelen1-0/+4
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-01-09tests: Allow to generate unencrypted PCAP files from testsuiteJakub Jelen1-1/+5
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Daiki Ueno <dueno@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-01-09tests: Do not run SSHD with PAM when not neededJakub Jelen1-1/+1
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Daiki Ueno <dueno@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-12-07config: Get rid of the dynamic seen arrayJakub Jelen1-0/+2
* This makes the array constant in the session structure, avoiding allocations and frees while parsing the file * It also drops passing the seen array to all the functions, because it is already part of the passed session * The test cases are adjusted to match these changes Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-28tests: Introduce functions to change directoriesAnderson Toshiyuki Sasaki1-0/+3
This introduces torture_get_current_working_dir() and torture_change_dir() to allow changing directories in tests. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-28tests: Introduce torture_create_temp_file()Anderson Toshiyuki Sasaki1-0/+1
Introduced torture_create_temp_file() and torture_close_fp() to allow creating temprary files transparently in Unix and Windows environment. This also adds a unit test for the added functions. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-28tests: Introduce torture_make_temp_dir()Anderson Toshiyuki Sasaki1-0/+2
Introduces a function to create temporary dir for testing purposes. Also adds a minimal test for the temporary directory creation. 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-0/+2
This allows us to print errors from ssh sessions. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10tests: Move torture keys to own fileAndreas Schneider1-8/+0
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14torture: Add sftp session pointer to torture_stateAndreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14tests: Migrate torture_auth as a cwrap testAndreas Schneider1-0/+4
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14torture: Create a torture_terminate_process() functionAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14tests: Convert torture_connect to a cwrap testAndreas Schneider1-0/+5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14torture: Add torture_teardown_sshd_server().Andreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14torture: Add function to setup sshd serverAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14torture: Add torture_teardown_socket_dir().Andreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14torture: Add torture_setup_socket_dir().Andreas Schneider1-0/+12
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14torture: Add server to get address and port.Andreas Schneider1-0/+3
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-09-07tests: Migrate to new cmocka APIAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-06torture: Move TORTURE_TESTKEY_PASSWORD to headerAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-12tests: workaround for compiling with older cmockaAris Adamantiadis1-0/+6
2015-02-02tests: allow conditionnal execution on patternAris Adamantiadis1-1/+4
Option can be used to filter out irrelevant tests usage: ./torture_pki '*ed25519' Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-21tests: Fix torture_server_x11().Andreas Schneider1-0/+1
2015-01-20tests: Add ssh server setup functionalityAlan Dunn1-0/+5
Add the ability to generate a keypair (RSA, but tests that focus on what occurs over a connection may well not care) and an ssh_bind easily. Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-20tests: Add port option to torture_ssh_sessionAlan Dunn1-0/+1
Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-08-15torture: Add public testkey passphrase function.Andreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-08-15torture: Add public testkey functions.Andreas Schneider1-0/+5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-08-15tests: Make write file a public torture function.Andreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-01-07src: Update my mail address.Andreas Schneider1-1/+1
2012-10-07test: Use cmocka instead of cmockery.Andreas Schneider1-1/+1
cmocka is the successor of cmockery. http://git.cryptomilk.org/projects/cmocka.git/
2011-12-27torture: Fix compilation with cmockery.Andreas Schneider1-1/+2
2011-02-06torture: Added a function to setup a sftp session.Andreas Schneider1-0/+9
2011-02-06torture: Added torture_isdir().Andreas Schneider1-0/+1
2011-02-06torture: Added torture_rmdirs().Andreas Schneider1-0/+2