aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2015-06-24cmake: Do not use CMAKE_(SOURCE|BINARY)_DIRDouglas Heriot1-1/+1
2015-05-06valgrind: Add suppression for openssl FIPS dlopen leakAndreas Schneider1-0/+12
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-06valgrind: Ignore valgrind free bug on exitAndreas Schneider1-0/+12
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-06tests: Migrate torture_keyfiles to testkey functionsAndreas Schneider1-16/+31
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-06torture: Move TORTURE_TESTKEY_PASSWORD to headerAndreas Schneider2-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-06tests: Fix memory leak in torture_server_x11 testAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05tests: Only link against threading library if availableAndreas Schneider1-10/+14
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05cmake: Add missing OpenSSL include directoryAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05tests: Apply umask before calling mkstemp()Andreas Schneider2-1/+8
CID: #978660 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04tests: Fix ctest default scriptAndreas Schneider1-4/+4
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-02unittests: Fix memory leak in torture_pki_ed25519Andreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-14torture: fix includes for freebsd10Aris Adamantiadis1-1/+3
2015-02-12tests: torture-misc: check for NULL return codesAris Adamantiadis1-3/+17
Use the LOGNAME environment variable if USER is not set, as it sometimes happens in cron jobs.
2015-02-12tests: workaround for compiling with older cmockaAris Adamantiadis1-0/+6
2015-02-02tests: allow conditionnal execution on patternAris Adamantiadis25-26/+88
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-02-02ed25519: Add test for signatures and verificationAris Adamantiadis2-0/+122
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-02tests: Add ed25519 encrypted keys exportAris Adamantiadis1-0/+29
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-02tests: Add ed25519 encrypted keys importAris Adamantiadis2-1/+35
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-02tests: Add ed25519 OpenSSH key savingAris Adamantiadis1-4/+47
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-02tests: Add ed25519 OpenSSH key loading and operationsAris Adamantiadis2-2/+206
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-21tests: Fix torture_server_x11().Andreas Schneider3-4/+30
2015-01-20tests: Add torture_server_x11 test.Alan Dunn2-0/+214
torture_server_x11 tests whether a libssh server can correctly parse an X11 request. Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-20tests: Add ssh server setup functionalityAlan Dunn2-0/+49
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 Dunn6-4/+12
Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-14pkd: Make sure we do not pass -1 to close.Andreas Schneider1-1/+3
CID: #1245696 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2015-01-14pkd: Check return value of pkd_run_tests().Andreas Schneider1-0/+3
CID: #1245697 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-12-09torture: fix warning for SSH_KEYTYPE_ED25519Jon Simons1-0/+1
Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-10-15tests: fix pkd build breakagesJon Simons4-3/+9
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 Simons10-0/+1416
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-09-07buffer: Add a secure buffer mechanism to avoid memory spillsAris Adamantiadis1-0/+1
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-09-07buffer: Implement "t" for text in ssh_buffer_pack().Aris Adamantiadis1-2/+3
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-08-18tests: Fix writing the '\0'.Andreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2014-08-15tests: Use public testkey passphrase function in pki test.Andreas Schneider1-7/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-08-15torture: Add public testkey passphrase function.Andreas Schneider2-0/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-08-15tests: Use public testkeys in pki test.Andreas Schneider1-178/+74
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-08-15torture: Add public testkey functions.Andreas Schneider2-0/+218
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 Schneider3-30/+32
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-08-15tests: Make sure we null terminate the buffer.Andreas Schneider1-3/+4
CID: 1230359 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-08-15tests: Fix memory leak in buffer test.Andreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-08-06torture_pki: avoid generating keys with ssh-keygenAris Adamantiadis1-96/+212
ssh-keygen makes the tests very slow because new keys are generated at the start of every test. ssh-keygen on OSX doesn't support ecdsa keys, even if libcrypto does. Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-06tests: test the canary feature in buffer_(un)pack()Aris Adamantiadis1-1/+27
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-08-06tests: test for ssh_buffer_(un)packAris Adamantiadis1-0/+98
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-07-06examples: cast arguments of connect(2)Aris Adamantiadis1-1/+1
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-06-10tests: Add test for the logging function.Andreas Schneider1-0/+40
2014-04-22Add tests for SHA2 HMAC algorithmsDirkjan Bussink1-25/+111
BUG: https://red.libssh.org/issues/91 Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-04-09pki crypto: expose new ssh_pki_key_ecdsa_name APIJon Simons1-10/+142
Enable retrieving the "ecdsa-sha2-nistpNNN" name of ECDSA keys with a new 'ssh_pki_key_ecdsa_name' API. This gives more information than the 'ssh_key_type_to_char' API, which yields "ssh-ecdsa" for ECDSA keys. The motivation is that this info is useful to have in a server context. The torture_pki unit test is updated to include the new API, and a few more passes are added to additionally test 384 and 521-bit keys. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27tests: torture_connect: add test for user provided socketLuka Perkov1-0/+25
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27tests: torture_connect: fix coding styleLuka Perkov1-8/+7
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27tests: Check the the ecdsa_nid is the same.Andreas Schneider1-0/+2
2014-03-27tests: Add test case for bug #147Alan Dunn1-0/+34
Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>