1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00
Commit Graph

56 Commits

Author SHA1 Message Date
74d42ca38b feat: add tests for gssapi-with-mic
feat: tests set hostname for sshd, make GSSAPIStrictAcceptorCheck yes pass

feat: add GSSAPI_TESTING cmake option

feat: gssapi libssh server test

feat: make kdc setup and teardown functions

feat: add kinit, kadmin scripts to kdc setup function

feat: add some client gssapi auth tests

Signed-off-by: Gauravsingh Sisodia <xaerru@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
2024-07-11 16:44:07 +02:00
6d1ed76c7a feat: implement proxy jump using libssh
tests: modify proxyjump tests to check for ssh_jump_info_struct

tests: add proxyjump functionality test

feat: add SSH_OPTIONS_PROXYJUMP

tests: proxyjump, check authentication

fix: ssh_socket_connect_proxyjump add exit label to exit on error

feat: implement io forwarding using pthread

feat: proxyjump: use threading instead of forking

feat: proxyjump: cancel forwarding threads on ssh_disconnect

fix: proxyjump remove ProxyJump bool and put pthread ifdefs

feat: use ssh_event for io forwarding instead of threads

reformat: tests to use assert_int_not_equal

fix: link to pthread

refactor: make function to free proxy jump list

docs: add comment for proxy jump channel

feat: add env variable to enable libssh proxy jump

feat: open channel for proxyjump like OpenSSH

feat: add more tests for proxy jump

fix: use a global variable to close io forwarding, this prevents segfaults

fix: handle proxy list in thread without creating copy
Signed-off-by: Gauravsingh Sisodia <xaerru@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
2024-07-11 14:46:13 +02:00
c662bcc466 tests: added a regression test to demonstrate that sftp_packet_read could run
into an infinite loop

Signed-off-by: Liu Husong <huliu@janestreet.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
2024-07-01 13:22:35 +00:00
efc1176232 tests: setstat and lsetstat
Signed-off-by: Abdelrahman Youssef <abdelrahmanyossef12@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2024-04-29 08:36:00 +02:00
a9c998c080 test: add tests for sftp extension "home-directory"
Signed-off-by: Debanga Sarma <deb737@proton.me>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2024-04-15 11:54:35 +00:00
cd6e84a6c3 Issue #157: Use the current TTY's settings by default.
When opening a PTY on the server, try to use the current TTY's settings
(i.e. based on STDIN). If that fails or STDIN isn't a TTY, use default
modes that avoid any character translation.

Don't rely on stdin to be a TTY (breaks CI). Instead, open a PTY and
temporarily use that as "fake" stdin.

Signed-off-by: Daniel Evers (daniel.evers@utimaco.com)
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2024-03-06 14:01:36 +01:00
1291ceb17d Fix #157: Allow to set terminal modes for PTYs
Added the new function `ssh_channel_request_pty_size_modes` which allows
to pass additional encoded SSH terminal modes (see opcodes in RFC 4245).

Signed-off-by: Daniel Evers (daniel.evers@utimaco.com)
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2024-03-06 14:01:36 +01:00
baa4eb1232 tests: Move tests with certificates to separate user
This avoids very-long test and false positives when using some
auto-pubkey authentication from picking up default keys, which are available in
bob's home directory when we want to test the certificate authentication.

The separate file is also needed because once we change to bob's UID, we can not
simply go back different UID and this sounds cleaner than setting up SSH_DIR to
different users ...

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
2023-12-05 14:45:51 +01:00
4768d2970a Add tests for sftp aio api
torture_sftp_aio.c has been added in tests/client/ directory.
It contains torture_sftp_aio_read(), torture_sftp_aio_write()
and torture_sftp_aio_negative().

torture_sftp_aio_read() tests sftp_aio_begin_read() and
sftp_aio_wait_read() to perform async reads.

torture_sftp_aio_write() tests sftp_aio_begin_write() and
sftp_aio_wait_write() to perform async writes.

torture_sftp_aio_negative() performs negative tests on the
sftp aio read/write API.

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-12-04 18:35:08 +01:00
a8fe05cc40 Adding expand-path@openssh.com extension for client
Signed-off-by: anshul agrawal <anshulagrawal2902@gmail.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-11-22 12:19:50 +01:00
5d792a3b5a Adding support for limits@openssh.com on client side
Signed-off-by: anfanite396 <dipamt1729@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-09-25 11:16:33 +02:00
c4a00ee430 torture_connect: Test bad IPv6 connection trying IPv4
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-06-01 10:14:37 +02:00
bfa988a7c7 Implement tests for sftp_rename
torture_sftp_rename has been added which
tries to rename an existing file (positive
test case) and tries to rename a file that
does not exist (negative test case).

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-04-25 12:13:49 +02:00
73c3d8965d Add tests for sftp_hardlink
For testing sftp_hardlink, torture_sftp_hardlink has been
introduced in tests/client.

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-04-24 10:29:13 +02:00
f297dc6ab8 Add callbacks for channel open response, and channel request response.
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-01-02 16:29:55 +01:00
25f9ca83a4 tests: Cover sftp_new_channel function
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
2021-03-18 14:44:35 +01:00
2b76abb74c clienttest: Adds a client test that authenticates to the ssh server using 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-20 16:18:31 +01:00
27bcac6845 CVE-2019-14889: tests: Add tests for SCP client
Fixes T181

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-09 16:08:03 +01:00
abf5712160 tests: Introduce torture_client_global_requests
Added a test case where invalid global requests are sent to the server
which should reject them, but not stop working.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-06-26 17:36:46 +02:00
347af845ab tests: Verify that rekey limits are effective from the client side
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Daiki Ueno <dueno@redhat.com>
2019-01-09 10:31:49 +01:00
6eb43fcbf3 tests: Verify the configuration reparsing with real client
This tests verifies that the only the first seen option is applied
throughout all the configuration files processed. It also verifies
that the configuration files are parsed automatically and that this
behavior can be overridden by configuration option.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-02 11:16:38 +01:00
a80caec19b cmake: Disable deprecation warnings for old known_hosts API
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-16 08:56:46 +02:00
667fb5f9a9 cmake: Rewritten AddCMockaTest.cmake
This changes add_cmocka_test() to receive compiler options, the
libraries to be linked to the test, and the linker options.  The way the
tests are declared in tests/unittests and tests/client were updated.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-26 16:27:22 +02:00
aaca395bd3 tests: Add a sftp benchmark test for write/read
The tests writes and reads a file of 128M.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-17 10:48:49 +02:00
7867126aa6 tests: Add a test for sftp_canonicalize_path()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-04 18:13:37 +02:00
a9a99fb31f cmake: Improve compiler flag detection
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-20 18:42:03 +02:00
8e211c0689 tests: Verify various host keys can be successfully negotiated and verified
This verifies that all the supported host keys can be used and
verified by the client, including the SHA2 extension in RFC 8332.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-07-04 07:52:50 +02:00
974e1831a0 knownhosts: Add ssh_session_export_known_hosts_entry()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-04 11:20:28 +02:00
1ec528b048 tests: Add test for sftp_fsync()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-08 13:38:56 +02:00
5bb9b570f4 tests: Rename torture_sftp_static to torture_sftp_ext
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
571f547556 tests: Migrate torture_sftp_read to a cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
af3de262b6 tests: Migrate torture_sftp_dir to cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
4bc6af6c17 tests: Migrate torture_request_env to cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
27834cce2c tests: Migrate torture_session to cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
e4653b82bd tests: Migrate torture_proxycommand to new cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
b65dcb3a35 tests: Migrate torture_knownhosts to new cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
be25b58380 tests: Migrate torture_forward to a cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
3014e3c458 tests: Migrate torture_algorithms to a cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
112d4cc7e6 tests: Migrate torture_auth as a cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
d403c01a30 tests: Convert torture_connect to a cwrap test
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
afd35fa98c tests: Add a sftp_read blocking test. 2013-10-23 15:49:07 +02:00
6a6e85752e tests: Add a test for ssh_channel_request_env(). 2013-10-20 17:05:35 +02:00
3afba83134 tests: Add torture forward test. 2013-10-20 12:46:17 +02:00
de096910b3 Report according status when errors are detected 2012-12-27 22:01:37 +01:00
c81010e2f7 test: Use cmocka instead of cmockery.
cmocka is the successor of cmockery.

http://git.cryptomilk.org/projects/cmocka.git/
2012-10-07 11:10:27 +02:00
22b1e5bc7c tests: Added test for sftp directory functions. 2011-02-06 16:35:54 +01:00
551b87b65b New testcases for nonblocking ssh_connect and double ssh_connect 2011-01-13 18:09:04 +01:00
361e37dc66 tests: Added a torture_sftp_static test. 2010-12-28 22:14:47 +01:00
df55918a41 tests: Migrated torture_proxycommand to cmockery. 2010-12-28 22:14:47 +01:00
e6329c72d1 tests: Migrated torture_knownhosts to cmockery. 2010-12-28 22:14:47 +01:00