aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-10Bump version to 0.9.5libssh-0.9.5Jakub Jelen4-3/+435
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-09-02Add a new location of sftp-server on TumbleweedJakub Jelen1-0/+1
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit ff599a9c53c908d7abfc6ea0f4b94d707fbb34fa)
2020-08-13tests: Enable all CASignatureAlgorithms as SHA1 certificates are now ↵Jakub Jelen1-0/+3
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> (cherry picked from commit 44de453b227115c0d60926302901ae0869ef5d1e)
2020-08-13tests: Enable RSA SHA1 certs for testing against older OpenSSHJakub Jelen1-0/+6
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> (cherry picked from commit db948bdac87ec9ad190cadbd9444902e5fbe691a)
2020-08-13CMakeLists: Shorten the keys lists passed to the ssh commandJakub Jelen1-0/+6
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit c106cd1f8365c871c798ffac8a384bfcbd48c6df)
2020-08-13tests: Use the path to SSH executable consistentlyJakub Jelen2-3/+3
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 2892b49a37e742cc6089c87cab6a89340a2e33a4)
2020-08-13pkd client run user executableAris Adamantiadis2-2/+3
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 9e7de14d5936d4e983b6945a4553c2dc0773e7d6)
2020-08-13pkd: fix snprintf compiler warningAris Adamantiadis1-1/+1
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit bba5fa18ed81fdac8f69e1d2389f8084d56b076b)
2020-08-13tests: use detected sshd pathAris Adamantiadis3-9/+10
The static sshd directory wasn't matching the detected sshd and prevented the testcases to be run against local OpenSSH builts Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 1089948346640061e3a723737cfdd8515d4986d5)
2020-08-13tests: use OpenSSH-provided ciphersAris Adamantiadis2-52/+25
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 7ec67011c5bb9cf700a76084550b095640605c85)
2020-08-13tests: search for netcat binaryAris Adamantiadis3-3/+19
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 177e76f7539aa9ba1769c2d46fd91fc776883dbe)
2020-08-13pkd: use detected OpenSSH supported key typesAris Adamantiadis2-26/+5
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 3d2570ff5ffa5be69df01dfcf46d1213a3acfbd4)
2020-08-13tests: detect OpenSSH supported ciphersAris Adamantiadis3-1/+135
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 3063a57fc8ac50d71cc2bbcfce4fc50662068275)
2020-08-13pki_crypto: Use temporary pointer when using i2d_*Anderson Toshiyuki Sasaki1-4/+35
These functions modify the provided pointer by advancing to the end of if (point to the byte after the last written). This makes the pointer invalid, making necessary to use a temporary variable. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit fe18ef279881b65434e3e44fc4743e4b1c7cb891)
2020-06-24tests: Do not parse configuration file in torture_knownhostsAnderson Toshiyuki Sasaki1-0/+8
The test might fail if there is a local configuration file that changes the location of the known_hosts file. The test should not be affected by configuration files present in the testing environment. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit f10d80047c660e33f5c365bf3cf436a0c2a300f1)
2020-06-23channel: Do not return error if the server closed the channelAnderson Toshiyuki Sasaki1-3/+4
If the server properly closed the channel, the client should not return error if it finds the channel closed. Fixes T231 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit 750e4f3f9d3ec879929801d65a500ec3ad84ff67)
2020-06-23examples: Tolerate incomplete writes in exec exampleAnderson Toshiyuki Sasaki1-7/+22
Previously, the exec example would fail if it could not write the whole read buffer to stdout. With this changes, the exec example will be able to write parts of the buffer until the whole buffer is written. This makes the exec example to run when the stdout buffer is small. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit b0518552f19fcf2da3dd265d892205dac23a1b8e)
2020-06-23tests: Add test for CVE-2019-14889Anderson Toshiyuki Sasaki1-0/+84
The test checks if a command appended to the file path is not executed. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 1694606e12d8950b003ff86248883732ef05e00c)
2020-06-08buffer: Add NULL check for 'buffer' argumentAndreas Schneider1-0/+4
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit 245ad744b5ab0582fef7cf3905a717b791d7e08b)
2020-06-08buffer: Reformat ssh_buffer_add_data()Andreas Schneider1-17/+18
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit 10b3ebbe61a7031a3dae97f05834442220447181)
2020-06-08sftpserver: Add missing return check for ssh_buffer_add_data()Andreas Schneider1-3/+8
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit 2782cb0495b7450bd8fe43ce4af886b66fea6c40)
2020-06-08sftpserver: Add missing NULL check for ssh_buffer_new()Andreas Schneider1-0/+6
Thanks to Ramin Farajpour Cami for spotting this. Fixes T232 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit 533d881b0f4b24c72b35ecc97fa35d295d063e53)
2020-05-15cmake: add _POSIX_SOURCEDavid Wedderwille1-0/+1
Fixes T228 Signed-off-by: David Wedderwille <davidwe@posteo.de> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit 641a80be74638be5b5114d148b5b3eb3e5c9293b)
2020-05-07cmake: Add autogenerated libssh_version.hHeiko Thiery9-18/+55
Set the cmake project verision to the autogenerated file to have a single point to set the version. This will be included in the libssh.h file. Pair-Programmed-With: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit bee8ed82abbc1ee8c631691a131c3d6ec6ba0836)
2020-05-05pki: Mark explicit fall throughJakub Jelen1-1/+1
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 7c20875891223e61b6be1509bd1458be5242678e)
2020-05-05external: Do not confuse new gccJakub Jelen1-1/+1
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 0c7a772301cb0ce16cd5ca119472a23695a1c578)
2020-05-05client: Properly indicate fall throughJakub Jelen1-1/+1
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit c45cfce166f3eb457357bd842b05c54fbb8872a0)
2020-05-05session: add missing return value documentationHeiko Thiery1-1/+2
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> (cherry picked from commit e76332bbd6177591f798d4b6b9f294fa46c8e066)
2020-05-05channels: Avoid returning SSH_AGAIN from ssh_channel_poll_timeout()Jakub Jelen1-0/+6
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> (cherry picked from commit 6417f5a3cac8537ac6f6ff7fc1642dfaa0917fb4)
2020-05-05channels: reformatJakub Jelen1-2/+2
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit fe0fcbbc67e32c0fc05581dec86a51e041f81a7a)
2020-05-05examples: Avoid unused parameter warnings and reformatJakub Jelen1-60/+116
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit c2f64108a1524be98562492f64885d937606b4e8)
2020-05-05examples: Add missing includesJakub Jelen1-0/+2
Fixes: T225 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit 58d53f1397c9f4af0748a07aef16c15bbd724038)
2020-05-05libcrypto-compat: Fix indentation and return valueJakub Jelen1-1/+2
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit eebb02fff52c18e3e42f8d82b3b166e1d6ed58a6)
2020-05-05libcrypto: remove deprecated API usageRosen Penev1-5/+4
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> (cherry picked from commit 54296787a79e96195a3b835c4ccbbfaae4f6189c)
2020-05-05libcrypto-compat: add extra functionsRosen Penev2-0/+20
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> (cherry picked from commit 70478619cec751d9ba6c87ac1d034f1cf8df47be)
2020-05-05Fix FTBFS on hurd-i386Laurent Bigonville1-0/+4
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> (cherry picked from commit a881c318ac27181cb2adca9f95fdfc45e4ec2667)
2020-05-05Make the documentation reproducibleLaurent Bigonville1-0/+1
Signed-off-by: Laurent Bigonville <bigon@bigon.be> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit 5f1d0c4795eda0ef8b19fcd39938349c02ee317e)
2020-05-05Correctly parse v4 subsecond timestampsStefanBruens1-15/+15
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> (cherry picked from commit 1ff6dda616ecb6327256003d5c0ee7ddd40bc783)
2020-05-05client: Check if the library is initialized in ssh_connect()Anderson Toshiyuki Sasaki2-0/+40
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> (cherry picked from commit e3e3a2786362f89fc72cd8a8a67fd52a435a1597)
2020-05-05client: Reformat ssh_connect()Anderson Toshiyuki Sasaki1-99/+111
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 0f33eecc0166205b1157b9897ab201b9b22d1dec)
2020-05-05init: Introduce internal is_ssh_initialized()Anderson Toshiyuki Sasaki3-0/+45
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> (cherry picked from commit dba2114ed78796caa06fc9d53268cb9cc302699f)
2020-05-05init: Clarify the need to call ssh_{init, finalize}()Anderson Toshiyuki Sasaki1-7/+18
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> (cherry picked from commit e3e52394c11e7b9bafa3086e7be937388540daeb)
2020-04-09Bump version to 0.9.4libssh-0.9.4Andreas Schneider4-3/+430
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-09CVE-2020-1730: Fix a possible segfault when zeroing AES-CTR keyAndreas Schneider1-2/+6
Fixes T213 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit b36272eac1b36982598c10de7af0a501582de07a)
2020-04-06kex: Add support for diffie-hellman-group14-sha256Anderson Toshiyuki Sasaki11-2/+44
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 9eb1ce88ae9222d092fa834b5594bdb9796e3f95)
2020-04-06dh-gex: Check return value of ssh_get_random()Andreas Schneider1-2/+7
CID #1422162 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit d2f0d3270a8733e3e8ad3788e8a315c533c765f9)
2020-04-06cmake: Fix building with threading support on MinGWAndreas Schneider1-0/+7
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> (cherry picked from commit a9a7c2dc29a27fb4c34490ff3488638563536ac5)
2020-03-29auth: Fix memory leak in ssh_userauth_publickey_auto()Anderson Toshiyuki Sasaki1-0/+5
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> (cherry picked from commit 6bd2b93f43dacceaf060d1aeb89749eba7df2cbb)
2020-03-27doc: Fix a doxygen warningAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit 46c54e5ddb361818d9e1d383493091b0ea620cfa)
2020-03-27doc: Make sure we parse the server and sftp documentationAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit bbfce454de4bf48e74d3e5a85df159d58f88eb28)