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
Andreas Schneider
b2c7fce968
cmake: Update compile flags for UndefinedSanitizer
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-03-30 09:46:18 +02:00
Jakub Jelen
960d952380
doc: Add a newly published RFC about Ed25519 keys
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-03-29 10:17:27 +02:00
Anderson Toshiyuki Sasaki
3845f77d76
tests: Mark unreachable points after fail_msg()
...
fail_msg() is not expected to return. Mark the points after calling it
as unreachable to clarify this to the compiler.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-03-29 10:00:57 +02:00
Anderson Toshiyuki Sasaki
b06b936819
torture_server_config: Run the server under timeout
...
Timeout will kill the server if it hangs.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-03-29 10:00:57 +02:00
Anderson Toshiyuki Sasaki
3feb6ebe28
torture_server: Run the server under timeout
...
Use the function which starts the test server under timeout. This way
timeout will kill the server if it hangs.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-03-29 10:00:57 +02:00
Anderson Toshiyuki Sasaki
a64737cef6
torture: Added a function to setup a libssh based server
...
The added function runs the test server under timeout program to kill it
if it elapses the default timeout of 5 minutes.
An auxiliary function to create a libssh server configuration file was
also added.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-03-29 10:00:57 +02:00
Anderson Toshiyuki Sasaki
f529659f76
test_server: Added an option to write PID to file
...
Using the added option it is possible to set a path to a file in which
the server will write its PID.
This can be used later to kill the server.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-03-29 10:00:57 +02:00
Anderson Toshiyuki Sasaki
3aea2ad53f
ssh_ping: Ignore system-wide configuration
...
Ignore the system-wide configuration when simply trying to reach the
host.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-03-29 10:00:57 +02:00
Anderson Toshiyuki Sasaki
6bd2b93f43
auth: Fix memory leak in ssh_userauth_publickey_auto()
...
When a key is rejected, free the allocated memory before returning.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-03-29 09:58:19 +02:00
Andreas Schneider
46c54e5ddb
doc: Fix a doxygen warning
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-03-27 12:10:07 +01:00
Andreas Schneider
bbfce454de
doc: Make sure we parse the server and sftp documentation
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-03-27 12:09:57 +01:00
Andreas Schneider
3e5dc99198
doc: Add SSH auth callback to libssh_auth doc group
...
Fixes T217
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-03-23 15:03:25 +01:00
Anderson Toshiyuki Sasaki
c8222dc1f6
tests: Verify error returned by kill
...
Verify the error code returned by kill() in torture_terminate_process().
The error code is raised when killing the process failed.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-25 10:54:43 +01:00
Anderson Toshiyuki Sasaki
c5fa08a2a4
tests: Close SFTP file opened during rekey tests
...
The SFTP files wouldn't be closed during the rekey tests leading to
memory leak.
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-24 19:30:35 +01:00
Anderson Toshiyuki Sasaki
89194e0d3a
tests: Do not leave temporary SFTP directory
...
The temporary directory created in torture_sftp_session() wouldn't be
removed. This removes such directory in torture_sftp_close().
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-24 19:30:35 +01:00
Anderson Toshiyuki Sasaki
35224092eb
tests: Use a common function to start sshd
...
In torture_reload_sshd_server(), instead of trying to use SIGHUP to
reload the configuration file, kill the original process and create a
new one with the new configuration. With this change, both
torture_setup_sshd_server() and torture_reload_sshd_server() need to
start sshd, with the only difference in the configuration setup. The
shared code to start the sshd server was moved to a new introduced
internal function torture_start_sshd_server().
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-24 19:29:57 +01:00
Andreas Schneider
a9e39a41ff
pki: Small code cleanup in ssh_pki_signature_verify()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-12 09:46:14 +01:00
Andreas Schneider
0ece6e52aa
pki: Use SSH_BUFFER_FREE() in ssh_pki_signature_verify()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-12 09:44:58 +01:00
Andreas Schneider
f208e4b332
pki: Add missing return check for ssh_buffer_pack()
...
CID #1419376
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-12 09:44:17 +01:00
Andreas Schneider
9fcb559301
pki: Fix memory leak of blob on error
...
CID #1419377
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-12 09:41:11 +01:00
Andreas Schneider
875b2a5b59
include: Remove PRIdS definitions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-12 09:39:06 +01:00
Andreas Schneider
702e7e4c85
channels: Replace PRIdS with ANSI C99 %zu
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-12 09:39:06 +01:00
Andreas Schneider
8542f675f4
sftp: Replace PRIdS with ANSI C99 %zu
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-12 09:39:06 +01:00
Andreas Schneider
faedadf2eb
packet: Replace PRIdS with ANSI C99 %zu
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-12 09:39:06 +01:00
Sahana Prasad
73f383a2e6
doc: Documents PKCS #11 URI support for libssh
...
Signed-off-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
2020-02-11 14:25:18 +01:00
Sahana Prasad
862b2341d7
src: updates documentation incorporate PKCS#11 URIs in import functions.
...
Signed-off-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
2020-02-11 14:25:18 +01:00
Sebastian Kinne
17b518a677
pki: add support for sk-ecdsa and sk-ed25519
...
This adds server-side support for the newly introduced OpenSSH
keytypes sk-ecdsa-sha2-nistp256@openssh.com and sk-ed25519@openssh.com
(including their corresponding certificates), which are backed
by U2F/FIDO2 tokens.
Change-Id: Ib73425c572601c3002be45974e6ea051f1d7efdc
Signed-off-by: Sebastian Kinne <skinne@google.com >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-11 10:08:26 +01:00
Jon Simons
3664ba2800
pki: fix pki_key_ecdsa_to_key_type thread-safety
...
Resolves https://bugs.libssh.org/T214 .
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-02-11 10:08:26 +01:00
Andreas Schneider
30d03498b4
gitlab-ci: Improve setting Fedora to FIPS mode
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
2020-01-24 09:39:44 +01:00
Andreas Schneider
022409e99c
channels: Fix ssh_channel_poll_timeout() not returing available bytes
...
Fixes T211
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com >
2020-01-23 10:20:59 +01:00
Jakub Jelen
07f571f1c0
Implement chacha20-poly1305 in mbedTLS
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-01-23 09:48:11 +01:00
Jakub Jelen
ac1c31bda1
tests: Skip chacha20-poly1305 tests in FIPS mode
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-01-23 09:48:11 +01:00
Jakub Jelen
60a987fd17
Implement ChaCha20-poly1305 cipher using native OpenSSL
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-01-23 09:48:11 +01:00
Jakub Jelen
94fe7634e1
Do not build in internal chacha implementation if gcrypt supports that
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-01-23 09:48:11 +01:00
Jakub Jelen
8670fb101b
chacha: Create common file to avoid code duplication
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-01-23 09:48:11 +01:00
Jakub Jelen
e31e7b0406
packet_crypt: Check return values from AEAD deciphering
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-01-23 09:48:11 +01:00
Jakub Jelen
6644f8ca3b
curve25519: Avoid memory leaks
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2020-01-23 09:48:11 +01:00
Andreas Schneider
06d25497ff
pki: Avoid uneeded memory duplication
...
CID #1412375
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-01-23 09:21:04 +01:00
Andreas Schneider
8215753402
misc: Make the src pointer const in ssh_strreplace()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-01-23 09:20:43 +01:00
Sahana Prasad
10d27a0d42
unittests: Extends testcases for ssh_strreplace().
...
Signed-off-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-01-23 09:19:07 +01:00
Sahana Prasad
240bf3236a
misc: Simplifies ssh_strreplace().
...
Signed-off-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-01-23 09:19:07 +01:00
Sahana Prasad
844f92efea
unittests: Removes extra empty lines.
...
Signed-off-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-01-23 09:19:07 +01:00
Sahana Prasad
dd8b6b1708
unitests: Removes unwanted comments.
...
Signed-off-by: Sahana Prasad <sahana@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-01-23 09:19:07 +01:00
Andreas Schneider
72498bac5f
pki_crypto: Fix possible memory leak on error
...
CID #1409680
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2020-01-23 09:19:07 +01:00