Andreas Schneider
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
Andreas Schneider
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
Andreas Schneider
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
Yanis Kurganov
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
Andreas Schneider
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
Andreas Schneider
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
Andreas Schneider
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
Andreas Schneider
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
Aris Adamantiadis
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
Andreas Schneider
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
Andreas Schneider
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
Andreas Schneider
319129399d
Bump version to 0.6.4.
libssh-0.6.4
2014-12-17 19:45:23 +01:00
Jon Simons
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
Andreas Schneider
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
Andreas Schneider
2d6862ddb9
cmake: Fix the build on Windows.
...
(cherry picked from commit a738507ad2 )
2014-12-17 19:31:32 +01:00
Andreas Schneider
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
Andreas Schneider
4b02bbbd32
cmake: Fix libssh cmake-config files.
...
(cherry picked from commit 142b2e4ede )
2014-12-17 10:40:25 +01:00
William Orr
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
Davide \"FunkyAss\" Del Zompo
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
Hani Benhabiles
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
Andreas Schneider
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
Jon Simons
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
Andreas Schneider
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
Stef Walter
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
William Orr
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
Artyom V. Poptsov
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
Jon Simons
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
Jon Simons
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
Andreas Schneider
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
Jon Simons
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
Andreas Schneider
f28748578d
pki: Fix build without ECC support.
...
Signed-off-by: Andreas Schneider <asn@samba.org >
2014-05-09 08:56:10 +02:00
Andreas Schneider
36f7d1a614
pki: Add missing semi-colon.
2014-05-07 09:36:11 +02:00
Andreas Schneider
71241ca68c
pki: Move ssh_pki_key_ecdsa_name() to the correct file.
2014-05-07 09:35:49 +02:00
Andreas Schneider
bfbf9283d0
cmake: Fix doxygen.
2014-05-07 09:35:34 +02:00
Andreas Schneider
d75573e665
cmake: Update doxygen module.
2014-05-07 09:35:34 +02:00
Jon Simons
8fe36e3d07
pki crypto: expose new ssh_pki_key_ecdsa_name API
...
Enable retrieving the "ecdsa-sha2-nistpNNN" name of ECDSA keys with a
new 'ssh_pki_key_ecdsa_name' API. This gives more information than the
'ssh_key_type_to_char' API, which yields "ssh-ecdsa" for ECDSA keys.
The motivation is that this info is useful to have in a server context.
The torture_pki unit test is updated to include the new API, and a few
more passes are added to additionally test 384 and 521-bit keys.
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-05-07 09:35:06 +02:00
Alan Dunn
f2e9ce68e7
messages: Add missing ntohl on X11 request screen number
...
BUG: https://red.libssh.org/issues/160
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-05-06 08:56:55 +02:00
Andreas Schneider
cfb4d27c47
pki: Correctly update the ECDSA keytype.
...
(cherry picked from commit 2884bbf5b1 )
2014-05-06 08:54:11 +02:00
Andreas Schneider
d366e289f3
pki: Move ssh_pki_key_ecdsa_name() to the correct file.
...
(cherry picked from commit f48a99b97c )
2014-05-06 08:54:06 +02:00
Andreas Schneider
2fc8347504
pki: Make pki_key_ecdsa_nid_to_name() a shared function.
...
(cherry picked from commit 11cfb2903e )
2014-05-06 08:54:00 +02:00
Andreas Schneider
2691ed595e
cmake: Install cmake config files to the correct directory.
...
(cherry picked from commit 291312c5e4 )
2014-04-22 09:10:05 +02:00
Andreas Schneider
7b133cf9f5
doc: Improve docs for ssh_channel_get_exit_status().
...
BUG: https://red.libssh.org/issues/154
(cherry picked from commit adf23533e0 )
2014-04-22 09:09:57 +02:00
Andreas Schneider
9b59f1a222
channels: Fix exit-signal request.
...
BUG: https://red.libssh.org/issues/153
(cherry picked from commit 927cd90dc1 )
2014-04-22 09:09:56 +02:00
Andreas Schneider
8f21f879d3
session: Fix a memory leak with custom banner.
...
BUG: https://red.libssh.org/issues/152
(cherry picked from commit b5efbe75cd )
2014-04-22 09:09:39 +02:00
Andreas Schneider
67752dabfc
cmake: Enable creation of the compile command database by default.
...
(cherry picked from commit 437a39c798 )
2014-04-22 09:09:28 +02:00
Jon Simons
34ac4e4248
packet: elide two buffer_prepend calls into one
...
In packet_send2, rather than issue two separate buffer_prepend_data calls
(each of which may entail realloc + memmove + memcpy), elide the prepend
work into a single buffer_prepend_data: the header information is computed
locally, and a single 5 byte prepend operation is now done instead of
prepending 1, then 4 bytes.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit aa05248ca8 )
Conflicts:
src/packet.c
2014-03-27 11:25:15 +01:00
Andreas Schneider
1928fb6a85
doc: Fix ssh_userauth_none() function signature.
...
Thanks to David Tibbe!
BUG: https://red.libssh.org/issues/151
(cherry picked from commit 04543c9dbc )
2014-03-27 11:16:23 +01:00
Alan Dunn
5b1678f197
doc: Improve and consolidate ssh_bind_options_set docs
...
Signed-off-by: Alan Dunn <amdunn@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 47bd0b6d1f )
2014-03-27 11:15:39 +01:00
Petar Koretic
8aff91dfcb
libssh: libhpp: overload read function to support timeout parameter
...
Signed-off-by: Petar Koretic <petar.koretic@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit 8e2590b535 )
2014-03-27 11:15:39 +01:00
Petar Koretic
c0cc12d582
libssh: libhpp: avoid unnecessary call to ssh_channel_read
...
ssh_channel_read is a wrapper for ssh_channel_read_timeout with timeout
-1 (infinite) so we call that directly.
Signed-off-by: Petar Koretic <petar.koretic@sartura.hr >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
(cherry picked from commit c51f42a566 )
2014-03-27 11:15:39 +01:00