aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
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>
2014-02-04knownhosts: detect variations of ecdsaAris Adamantiadis1-10/+10
2014-02-02build: fix cmake bug introduced yesterdayAris Adamantiadis1-3/+3
Compilation failed on OSX because of the missing OR OSX
2014-02-01knownhosts: add test case for bug #138Aris Adamantiadis1-0/+43
2014-02-01known_hosts: add ssh_knownhosts_algorithms()Aris Adamantiadis1-3/+30
Goal of that function is to test the preferred key exchange methods based on what's available in the known_hosts file
2014-02-01Added known host test casesAris Adamantiadis1-0/+122
2014-02-01tests: fix compilation on OSX (libargp detection)Aris Adamantiadis1-1/+1
2014-01-21Test change to ssh_bind_accept_fdAlan Dunn1-0/+139
Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-01-19src: Rename buffer_add_data() to ssh_buffer_add_data().Andreas Schneider1-5/+5
2014-01-16src: Do not use deprecated functions.Andreas Schneider1-2/+2
2014-01-16channel: Fix the name scheme of the forward functions.Andreas Schneider1-1/+1
2014-01-07src: Update my mail address.Andreas Schneider2-2/+2
2014-01-07tests: avoid reading uninitialized bytesAris Adamantiadis1-2/+2
2014-01-07examples: Make sure buffer is initialized.Andreas Schneider1-1/+1
2014-01-06test: fixed torture_auth_none conditionAris Adamantiadis1-2/+2
2014-01-06test: test case for async auth_noneAris Adamantiadis1-0/+59
This test currently fails
2014-01-06tests: auth_agent_nonblocking should run in nonblockingAris Adamantiadis1-0/+2
2014-01-06tests: use LC_LIBSSH instead of LANG for env tests.Aris Adamantiadis1-2/+2
LANG is stripped and replaced on many distros and LC_* is accepted by default on debian
2013-12-15tests: Fix non-blocking auth tests.Andreas Schneider1-7/+15
The ssh_userauth_none() call should already be non-blocking. However this this function is broken in non-blocking mode. It should reveal the existing bug.
2013-12-15tests: Fix blocking mode in password auth test.Andreas Schneider1-1/+1
2013-12-15tests: Use new auth API in the torture_session test.Andreas Schneider1-2/+3
2013-12-15tests: Use new auth API in the torture_auth test.Andreas Schneider1-10/+19
2013-12-11tests: Fix pki test with gcrypt.Andreas Schneider1-0/+4
2013-12-04tests: Try to fix torture_forward.Andreas Schneider1-4/+4
2013-11-28tests: Fix memory leaks.Andreas Schneider1-0/+9
2013-11-28tests: Add missing line breaks.Andreas Schneider1-2/+2
2013-11-27tests: Add torture_pki_write_privkey_ecdsa test.Andreas Schneider1-0/+44