Jakub Jelen
be9943132e
tests: Extend negative test cases for config Match keyword
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-24 15:15:39 +01:00
Jakub Jelen
893510db35
tests: Use assert_ssh_return_code() in config test
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-24 15:15:35 +01:00
Aris Adamantiadis
3b5f9ef8d6
pkd: dh-group-exchange testcases
2019-01-24 13:06:33 +01:00
Aris Adamantiadis
9407065879
tests: Added moduli file parsing tests
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-24 12:56:09 +01:00
Aris Adamantiadis
31da8025b2
tests: Add dh-group-exchange algorithm tests
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-24 11:56:23 +01:00
Anderson Toshiyuki Sasaki
fd5770973f
tests: Add test for server interactive authentication
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
2019-01-22 13:12:26 +01:00
Anderson Toshiyuki Sasaki
416d03b19e
tests: Add test for server auth method none
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-22 13:12:26 +01:00
Anderson Toshiyuki Sasaki
db1a999852
tests: Test server pubkey authentication
...
The default pubkey authentication callback is not checking
anything.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-22 13:12:25 +01:00
Anderson Toshiyuki Sasaki
29445e4ff1
tests: Added functions to get the default callbacks
...
This makes easier to create test cases using callbacks based on the
default callbacks (e.g. using the default callbacks but replacing one
specific callback)
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-22 13:12:25 +01:00
Anderson Toshiyuki Sasaki
13aa791e7b
tests: Provide the server state to callbacks
...
This aims to make it easier to implement custom callbacks.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-22 13:12:25 +01:00
Jakub Jelen
7f18a27504
tests: Reproducer for cockpit issue, where server provides an invalid signature
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-22 13:12:25 +01:00
Jakub Jelen
2113dc9d23
tests: Check return values
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
2019-01-22 13:12:25 +01:00
Jakub Jelen
1f7a15ffb1
tests: Initialize allocated memory
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
2019-01-22 13:12:25 +01:00
Anderson Toshiyuki Sasaki
37262b98ef
tests: Added test server
...
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 >
2019-01-22 13:12:25 +01:00
Andreas Schneider
98a8bf771d
tests: Fix uninitialized warning in torture_threads_pki_rsa
...
Error: CLANG_WARNING: tests/unittests/torture_threads_pki_rsa.c:520:5:
warning: 1st function call argument is an uninitialized value
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-22 13:12:25 +01:00
Tilo Eckert
f118ea010b
tests: Refactor test so that all RSA + hash combinations are tested
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-11 15:56:02 +01:00
Tilo Eckert
481d749559
tests: Fix incorrect hash type parameter on signature import
...
RSA with SHA-256/512 signatures have been interpreted as RSA with SHA-1
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-11 15:56:02 +01:00
Jakub Jelen
c7aba3a716
tests: Refactor the sftp initilization to avoid invalid memory access on sftp failures
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-11 15:06:56 +01:00
Jakub Jelen
531b80a60b
kex: List also the SHA2 extension when ordering hostkey algorithms
...
By default, the list of already stored known host types is preferred,
but this selection so far ignored the SHA2 extension and excluded these
keys in the KEXINIT list leading to not using this extension if not
explicitly enabled from configuration.
This commit extends the default list with the SHA2 signatures algoritms
and compares only base types so they can be listed in the KEXINIT list.
This adjust the tests to expect the full list of algorithms to pass.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-09 13:18:05 +01:00
Jakub Jelen
40b63f7c39
tests: Verify rekeying initialized by the server works
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-09 13:15:44 +01:00
Jakub Jelen
8012afd5e4
tests: Allow to modify sshd config from the test
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-09 13:15:44 +01:00
Jakub Jelen
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
Jakub Jelen
c86a00d06b
packet: Provide a function to switch crypto in separate directions
...
This also fixes the test using the crypto directly
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Daiki Ueno <dueno@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-09 10:31:45 +01:00
Jakub Jelen
92e978f2f3
tests: Verify we can parse RekeyLimit configuration option
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Daiki Ueno <dueno@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-09 10:14:56 +01:00
Jakub Jelen
b3ae5e06ee
tests: Allow to generate unencrypted PCAP files from testsuite
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Daiki Ueno <dueno@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-09 10:14:56 +01:00
Jakub Jelen
d4e5644e21
tests: Reproducer for T122
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Daiki Ueno <dueno@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-09 10:14:56 +01:00
Jakub Jelen
42c92074b9
tests: Do not run SSHD with PAM when not needed
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Daiki Ueno <dueno@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2019-01-09 10:14:56 +01:00
Andreas Schneider
dea6fe3d89
crypto: Disable blowfish support by default
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2018-12-19 14:57:29 +01:00
Jakub Jelen
c9bdb9a01e
tests: Do not segfault when built without ZLIB
...
Signed-off-by: Jakub Jelen <jakuje@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-10 20:28:01 +01:00
Jakub Jelen
973da84a47
tests: Verify we can parse the ProxyJump configuration option
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-10 17:56:07 +01:00
Jakub Jelen
9b1852f728
tests: Verify ProxyCommand works with ssh
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-10 17:52:56 +01:00
Jakub Jelen
055bf830db
tests: Use torture_server_address() in proxycommand test
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-10 17:52:56 +01:00
Jakub Jelen
8c812dbfa3
tests: Verify all the options are copied over
...
The ssh_options_copy() function was missing several options that were added
in recent years.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-10 17:52:56 +01:00
Anderson Toshiyuki Sasaki
fe309ba43f
packet: Allow SSH2_MSG_EXT_INFO when authenticated
...
When the server requests rekey, it can send the SSH2_MSG_EXT_INFO. This
message was being filtered out by the packet filtering. This includes a
test to enforce the filtering rules for this packet type.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-10 16:42:26 +01:00
Jakub Jelen
21e2522360
config: Get rid of the dynamic seen array
...
* 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-12-07 14:08:27 +01:00
Jakub Jelen
cf6f1e7a64
tests: Cover also compression with unit tests
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-07 14:07:31 +01:00
Jakub Jelen
31bc83f366
tests: Do not recreate unnecessary files for every test case
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-07 13:57:03 +01:00
Jakub Jelen
42ce989488
tests: Cover missing parts of the config parsing
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-12-07 13:28:11 +01:00
Anderson Toshiyuki Sasaki
f427a975b8
tests: Fix a clang possible memory leak warning
...
clang was reporting a possible memory leak after mkdtemp() call, which
was a false positive, since mkdtemp() returns the same pointer provided
as the parameter, in case of success. This changes the code so that the
static analyser don't get confused.
Found by csbuild runner.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-30 18:28:40 +01:00
Anderson Toshiyuki Sasaki
c413834764
tests: Test calling ssh_init() after ssh_finalize()
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-30 18:26:55 +01:00
Andreas Schneider
a08a97f9c7
tests: Use UNUSED macros in torture_threads_init
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-30 18:25:12 +01:00
Tilo Eckert
95f83c2391
src: Fix multiple typos
...
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-30 16:29:17 +01:00
Jakub Jelen
130256c348
tests: Verify that signatures are sane and can not be verified by non-matching key
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-30 16:26:48 +01:00
Jakub Jelen
968fdf4e18
tests: Do not require base RSA type for SHA2 extension whitelist
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-30 16:22:13 +01:00
Jakub Jelen
46d8840f7e
The largest ECDSA key has 521 bits
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-30 16:20:04 +01:00
Anderson Toshiyuki Sasaki
312084731e
tests: Use temporary directories in torture_pki_ed25519.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-28 15:51:06 +01:00
Anderson Toshiyuki Sasaki
500bf54a34
tests: Use temporary directories in torture_pki_ecdsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-28 15:51:06 +01:00
Anderson Toshiyuki Sasaki
a56fa14fda
tests: Use temporary directories in torture_pki_dsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-28 15:51:06 +01:00
Anderson Toshiyuki Sasaki
ac1377148f
tests: Use temporary directories in torture_threads_pki_rsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-28 15:51:06 +01:00
Anderson Toshiyuki Sasaki
f38c6fcc6e
tests: Use temporary directories in torture_pki_rsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-28 15:51:06 +01:00