1
1
Граф коммитов

4341 Коммитов

Автор SHA1 Сообщение Дата
Jakub Jelen
c1fdb56d23 pki_gcrypt: Do not abort on bad signature
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-30 16:19:59 +01:00
Jakub Jelen
57bdc9cb20 Whitespace cleanup
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-29 14:22:08 +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
31527d4105 tests: Use torture_make_temp_dir() in torture_setup_socket_dir()
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
1f6b929735 tests: Replace tests filtering with cmocka builtin filter
This completely removes the tests filter code from torture.c and calls
cmocka_set_test_filter() instead, if available.  The checks for required
libraries, headers, and the availability of cmocka_set_test_filter()
were added to the cmake configuration.

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
Anderson Toshiyuki Sasaki
7960fbaabb tests: Add Windows alternatives for low level I/O
In Windows environment, there are available low level I/O operations in
io.h, such as _read(), _write(), _open(), and _close().

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-28 11:10:10 +01:00
Anderson Toshiyuki Sasaki
a2baf6e97b tests: Include config.h in torture_pki.c
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-27 11:52:12 +01:00
Anderson Toshiyuki Sasaki
f9ff53b494 tests: Include unistd.h only if available
Include the header in tests/torture_pki.c only if it is available.  It
is not available in Windows environment.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-27 11:52:12 +01:00
Andreas Schneider
98487f464b gitlab-ci: If there is not old sha check last 20 commits
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-23 17:30:16 +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
05417665b9 tests: Drop duplicate log level setup
Already done in the setup phase.

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
e639c9d0d8 kex,packet,packet_cb: Reformat
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
bf2c7128ab server: Do not send SSH_MSG_EXT_INFO after rekey
This should not be a problem for well-behaving clients that do not
append the ext-info-c to the rekey, but if they do, we should not
send it either.

Resolves: T121

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
83f2ac4abb kex: Do not negotiate extensions during rekey
The RFC 8308 clearly says, that the additional  ext-info-c  should
be added only to the first SSH_MSG_KEXINIT.

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
0b4c2a8e62 session: Reformat ssh_{set,is}_blocking
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
8418a1131e tests: Fix indentation
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
c18ed4eafa Drop unused header file
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
6709f2edf9 tests: Do not require all the crypto libs to build testsuite
This was failing when I tried to run the testsuite without
gcrypt devel libraries installed.

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
5bdb7a5079 crypto: Avoid unused parameter warnings
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
824c56067b config: Drop bogus newline in log
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
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
3da5fcbb56 options: Do not crash when setting knownhosts to NULL (T108)
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-23 17:30:16 +01:00
Andreas Schneider
9d8c943c68 Update INSTALL
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-23 17:30:16 +01:00
Andreas Schneider
21881cde34 libcrypto: Fix checking for config.h defines
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-21 18:17:56 +01:00
Aris Adamantiadis
55252e4d70 libcrypto: disable AES-NI engine when running inside valgrind
Valgrind detects many uninitialized memory false positives from
libcrypto's AES-NI internals. Roll back to software AES when running
tests.

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-21 16:54:36 +01:00
Aris Adamantiadis
8e002b9415 tests: Add tests for dh-group14, group16 and group18
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-21 16:54:24 +01:00
Aris Adamantiadis
f4339df577 packets: allow removal of callbacks
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-21 16:54:20 +01:00
Aris Adamantiadis
0197e5e1e5 libcrypto: detect non matching headers/shared lib
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-21 16:54:15 +01:00
Aris Adamantiadis
9546b20dec gcrypt: Bugfix for very slow ecdh
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-21 16:53:40 +01:00
Tilo Eckert
b227c12ad2 socket: Add missing braces
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-21 12:25:50 +01:00
Tilo Eckert
f369d02932 socket: Remove redundant code
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-20 07:59:32 +01:00
Tilo Eckert
0b9e07fbdc socket: Fix potential buffer overrun
If nread is < 0 and no exception callback is set,
the following code block would cause a buffer overrun.

Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-20 07:58:08 +01:00
Tilo Eckert
c47cdc0f97 pki: Fix typos in documentation
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-20 07:57:33 +01:00
Tilo Eckert
4b6eb05023 packet: Fix timeout on hostkey type mismatch instead of proper error
If the hostkey type was not in the list of acceptable hostkey
types, the function failed to set the error state. Due to the
fact that the calling function ssh_packet_process() does not
handle the SSH_ERROR return code, the newkeys packet from the
server was silently ignored, stalling the connection until a
timeout occurred.

Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-20 07:56:04 +01:00
Nicolas Viennot
59ada799d7 packets: Fix ssh_send_keepalive()
ssh_send_keepalive() should use global_request() to properly configure
the state machine for packet filtering.

Signed-off-by: Nicolas Viennot <nicolas@viennot.biz>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-20 07:55:08 +01:00
Andreas Schneider
bb5d46c190 COPYING: Reformat the last paragraph
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-17 20:11:51 +01:00
Andreas Schneider
aa56b8ca53 tests: Fix chroot_wrapper location
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-15 13:38:02 +01:00
Sanne Raymaekers
67f418218b knownhosts: Take StrictHostKeyChecking option into account
Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-08 16:19:18 +01:00
Sanne Raymaekers
03c30e9c8a tests: Ensure the ssh session fd is read-/writeable in torture_proxycommand
Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-11-08 16:18:16 +01:00
Rosen Penev
61cac32288 crypto: Fix compilation for OpenSSL without deprecated APIs
Added missing bn.h include.

Made engine.h include conditional, otherwise it would fail.

DSA_generate_parameters was deprecated long before 1.1.0.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-11-08 09:32:28 +01:00