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
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
Anderson Toshiyuki Sasaki
0dd2b375c7
tests: Introduce functions to change directories
...
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-28 15:51:06 +01:00
Anderson Toshiyuki Sasaki
77be4ce905
tests: use torture_create_temp_file() in torture_knownhosts_parsing
...
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
78b1f0ead3
tests: Introduce torture_create_temp_file()
...
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-28 15:51:06 +01:00
Anderson Toshiyuki Sasaki
65e16b8d9e
tests: Introduce torture_make_temp_dir()
...
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-11-28 15:51:06 +01:00
Anderson Toshiyuki Sasaki
74285d3aca
tests: Define flags not present in Windows
...
Define flags S_IRWXO and S_IRWXG in torture_knownhosts_parsing.c when
building for Windows. These flags don't exist in Windows and are not
used.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-28 11:10:29 +01:00
Jakub Jelen
b214f84538
tests: Avoid warnings about unused arguments
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-23 17:30:16 +01:00
Jakub Jelen
daabb084fe
tests: Check the new AES-GCM ciphers
...
Signed-off-by: Jakub Jelen <jakuje@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-23 17:30:16 +01:00
Jakub Jelen
db5721d041
tests: Verify setting NULL knownhosts does not crash
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-23 17:30:16 +01:00
Jakub Jelen
9aa47fef99
tests: Adjust test that require complete config re-parsing
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-02 11:16:38 +01:00
Jakub Jelen
5fc4d5b22a
tests: Typo -- the flags should be checked according to the comment
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-11-02 10:08:20 +01:00
Sanne Raymaekers
ced05eb6db
socket: Undouble socket fds
...
Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com >
2018-10-25 18:49:29 +02:00
Andreas Schneider
cf3c2ee5b3
tests: Improve asserts in torture_pki_ecdsa
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-24 09:48:35 +02:00
Andreas Schneider
57eb6a400a
tests: Init pubkey string with NULL in torture_keyfiles
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-24 09:48:35 +02:00
Andreas Schneider
8c77a49729
tests: Fix pointer arithmetic in torture_pki_*_publickey_base64
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-24 09:48:35 +02:00
Andreas Schneider
8c8026b892
tests: Init cipher structure in thread_crypto_aes256_cbc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-24 09:48:35 +02:00
Jakub Jelen
e91bb29e9d
tests: Global known_hosts are used for host key verification
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-19 17:43:20 +02:00
Jakub Jelen
bdb3bb9ccd
tests: Verify the hostkey ordering for negotiation is correct
...
Previously, not all of the host keys algorithms were used for algorithm
negotiation. This verifies the algorithms list is sane and ordered
with the key types from known hosts in the first place.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-19 17:43:20 +02:00
Jakub Jelen
32e502a79d
tests: Generate valid known_hosts file, fixing the current test
...
Previously, the file contained the known_hosts strings separated
by NULL bytes which somehow magically worked.
The test was also expecting all the keys from the file will have
the same key type, which was not indeed true.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-19 17:43:20 +02:00
Andreas Schneider
49e287006f
tests: Add option tests for global and user specific known_hosts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-19 12:31:04 +02:00
Anderson Toshiyuki Sasaki
e1548a71bd
CVE-2018-10933: Add tests for packet filtering
...
Created the test torture_packet_filter.c which tests if packets are
being correctly filtered.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-10-16 09:19:03 +02:00
Andreas Schneider
85a274ff3c
include: Add macros for bytearray handling
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2018-10-05 14:38:43 +02:00
Anderson Toshiyuki Sasaki
6eef4b4a3c
tests: Add frees to avoid memory leak errors
...
The added frees are unnecessary, but the static analyser does not know.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-27 15:21:30 +02:00
Anderson Toshiyuki Sasaki
79e907402e
tests: Replace ssh_buffer_free() with SSH_BUFFER_FREE()
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-27 15:21:30 +02:00
Anderson Toshiyuki Sasaki
ca7da823c3
tests: Replace ssh_string_free() with SSH_STRING_FREE()
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-27 15:21:30 +02:00
Anderson Toshiyuki Sasaki
2eaa23a20e
tests: Replace ssh_key_free() with SSH_KEY_FREE()
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-27 15:21:30 +02:00
Anderson Toshiyuki Sasaki
143b5e2e50
tests: Use SSH_STRING_FREE_CHAR
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-27 15:21:30 +02:00
Anderson Toshiyuki Sasaki
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
Andreas Schneider
8410f43d8b
tests: Add a test for ssh_pki_export_privkey_base64()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-20 16:35:13 +02:00
Andreas Schneider
5a198732a5
tests: Add test for ssh_get_fingerprint_hash()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-20 16:35:13 +02:00
Anderson Toshiyuki Sasaki
71594f9d6c
dh: Add diffie-hellman-group18-sha512 support
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
2018-09-20 15:37:23 +02:00
Anderson Toshiyuki Sasaki
d9d3b65df2
dh: Add diffie-hellman-group16-sha512 support
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-19 12:17:02 +02:00
Anderson Toshiyuki Sasaki
63aa274f4b
tests: Add null checks in torture_threads_pki_rsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 10:19:59 +02:00
Anderson Toshiyuki Sasaki
8170e30073
tests: Add null checks in torture_pki_rsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 10:19:59 +02:00
Anderson Toshiyuki Sasaki
77f58a225f
tests: Add null checks in torture_pki_ed25519.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 10:19:59 +02:00
Anderson Toshiyuki Sasaki
48459c37f6
tests: Add null checks in torture_pki_ecdsa.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 10:19:59 +02:00
Anderson Toshiyuki Sasaki
31f24ed23e
tests: Add null checks and frees in torture_pki_dsa.c
...
These frees are unnecessary because the negative tests should not
allocate the keys, but the static analyser reports memory leak errors.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 10:19:59 +02:00
Anderson Toshiyuki Sasaki
82c3faa44d
tests: Add return and null checks in torture_options.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 10:19:59 +02:00
Anderson Toshiyuki Sasaki
7c75e76d10
tests: Add null checks in torture_config.c
...
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 10:19:59 +02:00
Jakub Jelen
39975fdd6d
tests: Verify we can read public key from OpenSSH container
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 09:53:49 +02:00
Jakub Jelen
eaaa4131de
tests: Verify the keys loaded from new OpenSSH format
...
This runs the same test that are ran on the legacy PEM files
also with the new OpenSSH key files.
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-09-18 09:53:49 +02:00