1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-29 13:01:13 +03:00

3028 Commits

Author SHA1 Message Date
6e0dee7845 poll: Fix compilation with struct ssh_timestamp
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit e0a73d3dbe)
2015-05-06 10:07:38 +02:00
9e99408dba Bump version to 0.6.5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
libssh-0.6.5
2015-04-29 12:24:33 +02:00
6b49863bb0 Update Changelog
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-29 12:23:50 +02:00
e9d16bd343 buffers: Fix a possible null pointer dereference
This is an addition to CVE-2015-3146 to fix the null pointer
dereference. The patch is not required to fix the CVE but prevents
issues in future.

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 3091025472)
2015-04-23 10:34:13 +02:00
94f6955fba CVE-2015-3146: Fix state validation in packet handlers
The state validation in the packet handlers for SSH_MSG_NEWKEYS and
SSH_MSG_KEXDH_REPLY had a bug which did not raise an error.

The issue has been found and reported by Mariusz Ziule.

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit bf0c7ae0ae)
2015-04-23 10:34:12 +02:00
d2a990a68e Fix leak of sftp->ext when sftp_new() fails
Signed-off-by: Kevin Fan <kevinfan@google.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit b5dc8197f7)
2015-04-14 20:57:17 +02:00
584ab49b7b cmake: Detect network function correctly on Windows
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 195f25cfbd)
2015-04-10 14:32:53 +02:00
dc30183d8a cmake: Detect __func__ and __FUNCTION__ during configure step
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-02 13:42:12 +02:00
396f5e2110 include: We should use __func__ which is C99
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-02 10:57:18 +02:00
6b18f0b4b0 Locally restart ssh_poll() upon EINTR.
BUG: https://red.libssh.org/issues/186

Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
Signed-off-by: Sebastien Boving <seb@google.com>
2015-02-23 22:06:34 +01:00
8f2eee6509 Sending EOF on Socket that received a Broken Pipe makes call to poll to hang
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
Signed-off-by: Joao Pedro Almeida Pereira <joao.almeida@blue-tc.com>
2015-02-23 22:02:35 +01:00
4bd704295c examples: cast arguments of connect(2)
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-14 22:20:45 +01:00
be2f5399dd torture: fix includes for freebsd10 2015-02-14 22:13:58 +01:00
a672b3e7bb tests: torture-misc: check for NULL return codes
Use the LOGNAME environment variable if USER is not set, as it sometimes
happens in cron jobs.
2015-02-12 11:39:53 +01:00
ddc3f987a7 tests: workaround for compiling with older cmocka 2015-02-12 11:39:45 +01:00
e9ad0c3c69 sftp: fix endianess issue 2015-02-11 21:35:02 +01:00
2ccab05cba connect: Fix mingw build.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit a198193723)
2015-01-26 17:10:19 +01:00
58348fcc57 sftp: Fix sftp_get_new_id().
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-21 08:44:34 +01:00
0579b7d8b2 cmake: Add libsshpp.hpp to the distributed headers list.
BUG: https://red.libssh.org/issues/163

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 8db4520d89)
2015-01-20 19:33:16 +01:00
915d28ffa5 pki: Make sure sig is not used unintialized.
BUG: https://red.libssh.org/issues/167

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 9a7d450098)
2015-01-20 19:31:29 +01:00
884bff5bdc sftp: Fix sftp endianess bugs.
BUG: https://red.libssh.org/issues/179

This is a backport of 6019cf1bed.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-20 19:17:02 +01:00
08c33d6aeb threads: Fix building with POSIX threads in MinGW.
BUG: https://red.libssh.org/issues/181

Originally written by Patrick von Reth <vonreth () kde ! org>.

This patch is part of the larger patch:
https://projects.kde.org/projects/kdesupport/emerge/repository/revisions/master/changes/portage/win32libs/libssh/0002-add-a-way-to-test-ssh-connections-on-windows.patch

MinGW (in particular, the MinGW-w64 fork) can use either posix threads
or win32 threads. This patch fixes the MinGW build when using posix
threads.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 433f8fd550)
2015-01-20 19:03:08 +01:00
fa4740bdf5 channels1: Fix pty request state
Signed-off-by: Yanis Kurganov <YKurganov@ptsecurity.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit c6590bd189)
2015-01-20 18:59:01 +01:00
da91ca43c0 connect: Fix a memory leak.
CID: #1238618

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
(cherry picked from commit 06a0d8ff1c)
2015-01-14 15:21:41 +01:00
4de6a708ad sftp: Fix a possible integer overflow.
CID: #1238630

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
(cherry picked from commit af0dd3fb02)
2015-01-14 15:21:40 +01:00
fd3b1f63a1 sftp: Use a declared variable for data len.
CID: #1238632

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
(cherry picked from commit ce02f6576a)
2015-01-14 15:21:36 +01:00
914f8abde8 cmake: Fix ntohll and htonll macro detection.
BUG: https://red.libssh.org/issues/164

Thanks to Ryan Schmidt!

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 8536cd9808)
2015-01-13 08:55:07 +01:00
3880a8ed80 Fix the dh.c build with libgcrypt
Fixes bug reported by gentoo at https://bugs.gentoo.org/show_bug.cgi?id=533424
The function was only used by EDCSA backend which are not supported by the libgcrypt code anyway.
2014-12-29 16:06:33 +01:00
0e969e0316 connect: Check that errno is 0 to fix Windows build.
Thanks to Viktor Butskih.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit e051135a05)
2014-12-25 12:35:24 +01:00
a45dd8e000 options: Fix setting the port.
Make sure we correctly read the port from the config file.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit bb18442fe8)
2014-12-25 12:35:21 +01:00
319129399d Bump version to 0.6.4. libssh-0.6.4 2014-12-17 19:45:23 +01:00
87ae95eb3c CVE-2014-8132: Fixup error path in ssh_packet_kexinit()
Before this change, dangling pointers can be unintentionally left in the
respective next_crypto kex methods slots.  Ensure to set all slots to
NULL in the error-out path.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 2ced24ddd67a261dc364ad4d8958c068c1671ae7)
2014-12-17 19:45:23 +01:00
055f102601 libcrypto: Fix Windows build with ssh_reseed().
gettimeofday() is not available on Windows and we need it only in case
of forking.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit b7b535816d)
2014-12-17 19:40:57 +01:00
2d6862ddb9 cmake: Fix the build on Windows.
(cherry picked from commit a738507ad2)
2014-12-17 19:31:32 +01:00
22aa60d506 cmake: Fix config variable names.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit d8e691b58a)
2014-12-17 10:40:31 +01:00
4b02bbbd32 cmake: Fix libssh cmake-config files.
(cherry picked from commit 142b2e4ede)
2014-12-17 10:40:25 +01:00
31ded2070e config: Also tokenize on equal sign.
The ssh config specifies it as a valid separator.

BUG: https://red.libssh.org/issues/166

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 52968b1a11)
2014-12-17 10:35:17 +01:00
df3d53e561 doc: clarify tutorial error section
Signed-off-by: Davide "FunkyAss" Del Zompo <davide.delzompo@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit bb197de75d)
2014-12-05 11:09:34 +01:00
f28c3099da Set the correct error in ssh_options_set().
Signed-off-by: Hani Benhabiles <hani@linux.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 03095f1516)
2014-12-05 11:04:35 +01:00
32a106c70d messages: Fix a possible double free.
Thanks to Ramana Gampa.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2014-12-05 10:59:41 +01:00
5d75090d9f pki_crypto.c: plug ecdsa_sig->[r,s] bignum leaks
Per ecdsa(3ssl), ECDSA_SIG_new does allocate its 'r' and 's' bignum fields.
Fix a bug where the initial 'r' and 's' bignums were being overwritten with
newly-allocated bignums, resulting in a memory leak.

BUG: https://red.libssh.org/issues/175

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>

(cherry picked from commit 4745d652b5)
2014-12-05 10:46:31 +01:00
32a3cfe661 connect: Do not fail if the connect is in progress.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit a48711ae7e)
2014-10-28 10:33:47 +01:00
1c59844dfe gssapi: ssh_gssapi_set_creds() is a client side function
It should not be guarded by the WITH_SERVER #ifdef

Signed-off-by: Stef Walter <stefw@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit cd2dc3770a)
2014-10-12 15:47:13 +02:00
f071954a76 Check return code of connect(2).
Signed-off-by: William Orr <will@worrbase.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 250f506487)
2014-10-12 15:47:12 +02:00
a033b93c61 pki_gcrypt: Initialize 'type_c' in 'pki_do_sign_sessionid'
Add missing initialization of 'type_c' field of a SSH signature in
'pki_do_sign_sessionid' procedure.

If libssh is compiled with GCrypt, 'dh_handshake_server' fails with
"Could not sign the session id" error.  The change fixes that.

Signed-off-by: Artyom V. Poptsov <poptsov.artyom@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit aaae6cd97d)
2014-10-02 08:30:30 +02:00
b7856780a9 crypto: check malloc return in ssh_mac_ctx_init
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit af25c5e668)
2014-10-02 08:26:08 +02:00
8b3425865a wrapper: fix z_stream leak
Ensure to free the z_stream structures as allocated from
the gzip.c initcompress, initdecompress functions.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 092fe0b727)
2014-10-02 08:25:27 +02:00
a30e234c03 string: Correctly burn the string buffer.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
(cherry picked from commit 1ddb99c46f)
2014-09-15 20:46:06 +02:00
bbf172a79c session: fix ssh_session->srv.ecdsa_key leak
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-05-28 10:24:01 +02:00
f28748578d pki: Fix build without ECC support.
Signed-off-by: Andreas Schneider <asn@samba.org>
2014-05-09 08:56:10 +02:00