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

5166 Коммитов

Автор SHA1 Сообщение Дата
Jakub Jelen
b90131dfe6 tests: Verify functionality of none cipher and mac
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
4f976ce5c4 packet: Skip HMAC handling if none is selected
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
239eef6322 packet: Check if set_*_key functions exists before calling it
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
201fd66176 packet: Use temporary variables to avoid long lines
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
e6aee24a1e Add basic support for none cipher and MACs
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
46499b1b90 Drop none cipher and MAC as they are not implemented
or not intended for production

Related: T85

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
62a0229f16 fuzz: Simplify definition of fuzzing targets and build them also with gcc
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
5411e0821f fuzz: Correctly sort members initialization to prevent GCC warnings
tests/fuzz/ssh_client_fuzzer.cpp:45:1: error: designator order for field ‘ssh_callbacks_struct::userdata’ does not match declaration order in ‘ssh_callbacks_struct’

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
44de453b22 tests: Enable all CASignatureAlgorithms as SHA1 certificates are now disabled in OpenSSH 8.2p1
This option is unknown to older OpenSSH versions (for example CentOS 7
with OpenSSH 7.4) so we can not add it everywhere.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
7c20875891 pki: Mark explicit fall through
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
0c7a772301 external: Do not confuse new gcc
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Jakub Jelen
c45cfce166 client: Properly indicate fall through
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-05 14:23:06 +02:00
Heiko Thiery
e76332bbd6 session: add missing return value documentation
Add SSH_AGAIN as return value to ssh_handle_packets documentation.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-04-24 16:00:29 +02:00
Heiko Thiery
99e0ad75a6 tests: add testcases for ssh_channel_poll_timeout()
This adds testcases for the regression introduced in 3bad0607.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-04-24 15:57:38 +02:00
Jakub Jelen
154765ae8c config: Check null deref
As reported by LGTM

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
6417f5a3ca channels: Avoid returning SSH_AGAIN from ssh_channel_poll_timeout()
This addresses a regression introduced in 3bad0607, partially fixed in 022409e9,
but the function was still able to return SSH_AGAIN, which was not expected by
callers.

Based on discussion in [1] and [2]

[1] https://gitlab.com/libssh/libssh-mirror/-/merge_requests/101
[2] https://www.libssh.org/archive/libssh/2020-03/0000029.html

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
fe0fcbbc67 channels: reformat
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
c2f64108a1 examples: Avoid unused parameter warnings and reformat
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
59ac79c4dc gitlab-ci: Avoid passing artifacts between completely unrelated stages
The introduction of stages in gitlab-ci had quite a unfortune side
effect that is described in the documentation [1]. The whole artifacts
path (in our case obj/) is passed from one stage to another by default,
which is causing very odd behavior as the previous results are only
partially overwritten by the new cmake command and can even lead to
execution of tests that are not supposed to run in particular job.

[1] https://docs.gitlab.com/ee/ci/yaml/#dependencies

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
7f57717f84 gitlab-ci: Fix typo
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
db948bdac8 tests: Enable RSA SHA1 certs for testing against older OpenSSH
The OpenSSH 7.4 or 7.6 in Ubuntu and CentOS 7 does not support SHA2
RSA certificates and libssh automatically falls back to SHA1, which
is not allowed by default.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
6941958b49 tests: Update coverage of config_parser
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
1ba6ef689f config_parser: Allow equal sign as a separator and eat up trailing whitespace
Probably fixes T210

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
fecdc3cc0e Disable RSA and DSA keys with sha1 by default
Fixes: T218

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
04ae110c61 pkd: Enable all hostkeys
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
9ac2d14707 tests: Enable all host key algorithms in testing client
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
bab2c775da Make the testing ping use all supported algorithms
Previously, it would use only the default set, which makes some tests failing
including the DSA ones and disabled RSA with SHA1.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-20 14:14:33 +02:00
Jakub Jelen
945829a5dd Reformat ssh_bind_accept()
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-15 20:05:56 +02:00
Jakub Jelen
58d53f1397 examples: Add missing includes
Fixes: T225

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-15 20:05:56 +02:00
Jakub Jelen
eebb02fff5 libcrypto-compat: Fix indentation and return value
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-15 20:05:56 +02:00
Rosen Penev
54296787a7 libcrypto: remove deprecated API usage
EVP_CIPHER_CTX_init was replaced with _reset.

Removed EVP_CIPHER_CTX_cleanup. The successive _free call handles that.

Removed old SSLeay function usage.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-15 20:05:56 +02:00
Rosen Penev
70478619ce libcrypto-compat: add extra functions
Added extra functions. The next commit will switch to them.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-15 20:05:56 +02:00
Laurent Bigonville
a881c318ac Fix FTBFS on hurd-i386
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933015

Signed-off-by: Laurent Bigonville <bigon@bigon.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-04-15 13:23:09 +02:00
Laurent Bigonville
5f1d0c4795 Make the documentation reproducible
Signed-off-by: Laurent Bigonville <bigon@bigon.be>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-04-15 13:22:47 +02:00
StefanBruens
1ff6dda616 Correctly parse v4 subsecond timestamps
All subsecond timestamps are only in the packets if both the
SUBSECOND_TIMES flag and the timestamp flag, e.g. ATTR_ACCESSTIME
are set.

SUBSECOND_TIMES are not very common across server implementations
(e.g. openssh does not include it, nor does libssh's sftpserver
implementation), but this interpretation of the SFTP protocol draft
is used by WinSCP and lftp.

Fixes T219.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-04-15 13:21:28 +02:00
Anderson Toshiyuki Sasaki
e3e3a27863 client: Check if the library is initialized in ssh_connect()
If the library is not initialized, SSH_ERROR is returned and the error
message is set properly.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-04-09 11:25:49 +02:00
Anderson Toshiyuki Sasaki
0f33eecc01 client: Reformat ssh_connect()
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-04-09 11:25:49 +02:00
Anderson Toshiyuki Sasaki
dba2114ed7 init: Introduce internal is_ssh_initialized()
The introduced function returns whether the library is initialized or
not.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-04-09 11:25:49 +02:00
Anderson Toshiyuki Sasaki
e3e52394c1 init: Clarify the need to call ssh_{init, finalize}()
When libssh is statically linked, it is necessary to explicitly call
ssh_init() before calling any other provided API.  It is also necessary
to call ssh_finalize() before exiting to free allocated resources.

Fixes T222

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-04-09 11:25:49 +02:00
Andreas Schneider
b36272eac1 CVE-2020-1730: Fix a possible segfault when zeroing AES-CTR key
Fixes T213

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-09 09:28:03 +02:00
Sahana Prasad
cd15043656 src/pki_crypto.c corrects the incorrect usage of enum
Signed-off-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-04-06 09:27:55 +02:00
Anderson Toshiyuki Sasaki
9eb1ce88ae kex: Add support for diffie-hellman-group14-sha256
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-04-06 09:27:26 +02:00
Andreas Schneider
d2f0d3270a dh-gex: Check return value of ssh_get_random()
CID #1422162

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-04-02 07:25:53 +02:00
Andreas Schneider
a9a7c2dc29 cmake: Fix building with threading support on MinGW
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-01 14:35:17 +02:00
Andreas Schneider
8e00d1f0a8 gitlab-ci: Add Coverity Scan
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-03-30 09:46:18 +02:00
Andreas Schneider
fc694a5c49 gitlab-ci: Add stages
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-03-30 09:46:18 +02:00
Andreas Schneider
c79e67ca1e gitlab-ci: Use variables so we can keep before_script
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-03-30 09:46:18 +02:00
Andreas Schneider
9914809ae3 gitlab-ci: Remove the tumbleweed docs build
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-03-30 09:46:18 +02:00
Andreas Schneider
45d82b3e36 gitlab-ci: Add a simple fedora build and docs build
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-03-30 09:46:18 +02:00
Andreas Schneider
7f869e4c99 gitlab-ci: Add a build template
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-03-30 09:46:18 +02:00