1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-09 15:41:10 +03:00
Commit Graph

6080 Commits

Author SHA1 Message Date
Eshan Kelkar
73c3d8965d Add tests for sftp_hardlink
For testing sftp_hardlink, torture_sftp_hardlink has been
introduced in tests/client.

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-04-24 10:29:13 +02:00
Eshan Kelkar
88335c8e07 Add support for hardlink@openssh.com
sftp_hardlink() has been introduced which when called
sends a SSH_FXP_EXTENDED request to server for creating
a hardlink.

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-04-24 10:29:12 +02:00
Jakub Jelen
804814b895 fuzz: Avoid the server fuzzer to proceed to the authentication and further
Thanks Phil Turnbull from GitHub

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-21 14:27:46 +02:00
Jakub Jelen
a12a8a0153 fuzz: Set smaller connection timeouts to avoid fuzzing timeouts
The client fuzzer can get stuck in poll call, when there is long connection
timeout and there are no usable message from the peer. Setting smaller user
timeout allows us spend more time productively fuzzing and exit early when there
is no message from peer.

Thanks oss-fuzz.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56935

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-21 14:25:03 +02:00
Adley Phu
2122fc3dcb Add callback to accept forwarded-tcpip requests
Signed-off-by: Adley Phu <aphu@janestreet.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-04-21 12:56:16 +02:00
Jakub Jelen
c3aa0cb182 options: Remove set-but-never read variable
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-14 19:11:24 +02:00
Jakub Jelen
fffdcfb373 ecdh: Avoid unused variable with OpenSSL 1.1.1
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-14 19:11:24 +02:00
Jakub Jelen
3058549bf7 cmake: Return back the DEFAULT_C_COMPILE_FLAGS
Accidentally removed in 1689b83d0f.

Reported in #185 by Peter Kästle

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-14 19:11:24 +02:00
Jakub Jelen
2c876464ab ecdh: Fix missing-prototype warning
Related to the accidental removal of compiler flags as reported in #185

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-14 19:11:24 +02:00
Jakub Jelen
7f40974802 ci: Add CentOS 8 as there are no other OpenSSL 1.1.1 platforms
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-14 19:11:24 +02:00
Jakub Jelen
f6f1bfaa4e ci: Suse is already on OpenSSL 3.0
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-14 19:11:24 +02:00
Jakub Jelen
91279e0aac ci: Actually build the package with x86 cross-compiler
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-14 19:11:24 +02:00
Jakub Jelen
2ba5a5e976 tests: Update to unbreak agent_cert test for CentOS 8
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-04-14 18:43:05 +02:00
Jakub Jelen
e0011a1970 pki: Avoid freeing static groups/points on OpenSSL<3
Fixup commit 49490ac06d

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-04-14 17:09:28 +02:00
Tom Deseyn
6f029598c7 Emit channel_write_wontblock when remote window becomes non-zero.
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-04-14 15:02:03 +02:00
roytak
49490ac06d pki_crypto: Fix memory leak
Fixed memory leak in pki_publickey_to_blob when using an EC type of
hostkey.

Signed-off-by: roytak <xjanot04@stud.fit.vutbr.cz>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-04-14 14:28:05 +02:00
khalid
f9147a3cf4 Remove zlib from the default compression methods and fips methods
Signed-off-by: Khalid Mamdouh <khalidmamdou7@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-28 11:36:44 +02:00
khalid
cb19677d2e Disabled preauth compression (zlib) by default
Removed it from the wanted methods list in the ssh_options_set function. Now users have to set the compression value to 'zlib' explicitly to enable it.
Updated unit tests to reflect removing zlib compression algo from the defaults compression algorithms.

Signed-off-by: Khalid Mamdouh <khalidmamdou7@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-28 11:36:44 +02:00
Andreas Schneider
0c6995b149 gitlab-ci: We have cmake in Windows runners in the default path now
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-21 14:41:59 +01:00
Norbert Pocs
7b12876f04 doc: Fix doxygen errors when QUIET=yes EXTRACT_ALL=yes
Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-15 10:21:31 +01:00
Norbert Pocs
45a8d1dbb1 gitlab-ci.yml: Add documentation coverage check
Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-15 10:21:31 +01:00
Norbert Pocs
8c3c21537d cmake: Add documentation coverage target into make
Convenient way to run doc coverage by `make docs_coverage`

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-15 10:21:31 +01:00
Norbert Pocs
3513c4bfc0 Add doc coverage script
Calculate the coverage of the documentation so we now where we are at.

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-15 10:21:31 +01:00
Norbert Pocs
46df3890e8 doc/cmakeLists: Fix exclude external dir
Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Sahana Prasad <sahana@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-15 10:21:31 +01:00
Andreas Schneider
0b826c986c gitlab-ci: Don't install CMake
The choco server is somtimes ratelimited. Avoid running into issues
and use cmake already installed on the runner.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-14 07:14:49 +01:00
Ahsen Kamal
6d3e7e1c44 fix null dereference of error
The Coverity scan CID 1506418 found the null pointer dereferencing

Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-10 10:21:51 +01:00
Andreas Schneider
2ed0525f40 poll: Rename lock to lock_cnt and make it unsigned
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-09 10:23:46 +01:00
Jakub Jelen
30b5a2e33b poll: Change the lock to block only POLLIN events
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-03-09 10:23:37 +01:00
Jakub Jelen
e15f493d4a socket: Reformat
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-03-09 10:10:18 +01:00
Jakub Jelen
19c4de7350 Reformat ssh_packet_socket_callback
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-03-09 10:10:18 +01:00
Jakub Jelen
832b94a660 Reformat ssh_connector_fd_out_cb
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-03-09 10:10:18 +01:00
Jakub Jelen
5506aadf05 config: Fix indentation
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-03-09 10:10:18 +01:00
Jakub Jelen
258560da16 bignum: Avoid bogus newline in the log
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2023-03-09 10:10:18 +01:00
Ahsen Kamal
e364b1e793 free memory of peer_discon_msg
Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-06 19:02:03 +01:00
Ahsen Kamal
49b34987d6 test for peer_discon_msg
Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-06 19:02:03 +01:00
Ahsen Kamal
4a7a7e3186 assign peer_discon_msg
Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-06 19:02:03 +01:00
Ahsen Kamal
e2b89dec9d rename discon_msg to peer_discon_msg
Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-06 19:02:03 +01:00
Andreas Schneider
e7b8de1363 gitlab-ci: Use CentOS9 for Coverity builds
The Fedora 34 container is not available anymore. And we need gcc 11
as scan.coverity.com is on version 2022.6 supporting only gcc 11.

See
https://dev.sig-docs.synopsys.com/polaris/topics/r_coverity-compatible-platforms_2022.6.html

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-03-01 14:40:05 +01:00
Jakub Jelen
f8d7fee588 pki: Use preference hints when loading keys from store
to avoid the need to login every time.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-03-01 11:35:28 +01:00
Jakub Jelen
2539d72b7c Add support for PKCS#11 provider in OpenSSL 3.0
The engine API in OpenSSL 3.0 is deprecated so we are in the progress of working
on a PKCS#11 provider for OpenSSL. This commit introduces a conditional build
with the pkcs11-provider support (instead of engines) with all the changes
required for the provider to work with existing code and tests.

The CI modification is only temporary before we will have the real package in
Fedora or somewhere to use.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-03-01 11:35:28 +01:00
Andreas Schneider
7291f2173c cmake: Add compiler warnings for Modern C (C99)
See https://fedoraproject.org/wiki/Changes/PortingToModernC

related: #179

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-09 10:42:21 +01:00
Ahsen Kamal
96aee531ff fixed argp missing error
Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-07 13:39:17 +01:00
Ahsen Kamal
cc4a11b2ba ignored gcovr parse error
Signed-off-by: Ahsen Kamal <itsahsenkamal@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-07 13:39:16 +01:00
Mohammad Shehar Yaar Tausif
a3a13eb3a8 Remove support for DSA Keys
Solving issue #110. The original work is at !231
Some changes were needed because the newly added features in master through time

Signed-off-by: Mohammad Shehar Yaar Tausif <sheharyaar48@gmail.com>
Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-02 14:49:06 +01:00
Norbert Pocs
486df37a84 src/options.c: Add documentation for default LogLevel
Libssh defaults to QUIET or SSH_LOG_NONE regarding of loglevel. Have it
documented to not confuse the users.

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-01 15:26:02 +01:00
Norbert Pocs
c9291ce878 doc/CMakeLists.txt: Exclude non-wanted symbols
(Some) structures, typedefs and macros don't need to be included in the
documentation.

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-01 15:26:02 +01:00
Norbert Pocs
9931f158e0 server: Add documentation to some functions
Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-01 15:26:02 +01:00
Norbert Pocs
b7c1f792cc documentation: Fix Missing param doxygen warnings
Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-01 15:26:02 +01:00
Norbert Pocs
4fb5af1da5 src/pki_crypto.c: Fix errors introduced by EC rework
- The nid is unused in the new context
- The variable `params` is defined locally in the function, fixing redefinition

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2023-02-01 15:25:54 +01:00
Jakub Jelen
bc2e99dc3f ecdh: Rewrite to use OSSL_PARAM_BLD
and improve debug logs and error checking. Thanks Norbert for the hints.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <npocs@redhat.com>
2023-01-25 16:53:19 +01:00