1
1

1321 Коммитов

Автор SHA1 Сообщение Дата
Andreas Schneider
5b586fdfec cmake: Handle libssh threas library correctly
This should fix the build on Windows and would not install pkg files.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-09-07 07:46:11 +02:00
Michael Wilder
2f193b5cbb bignum: Fix OpenSSL crash in SAFE_FREE
Signed-off-by: Michael Wilder <wilder.michael@cimcor.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-09-07 07:45:02 +02:00
Michael Wilder
e6f93c887b crypto: Add OpenSSL EVP functions for FIPS compatibility
Signed-off-by: Michael Wilder <wilder.michael@cimcor.com>
2015-09-07 07:45:01 +02:00
Andreas Schneider
36d9b62f1f server: Fix return code check of ssh_buffer_pack()
Thanks to Andreas Gutschick <andreas.gutschick@mitel.com>

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-08-18 09:09:31 +02:00
Andreas Schneider
e1081796af pki: Fix return values of ssh_key_is_(public|private)
Thanks to Kevin Haake <khaake@red-cocoa.com>

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-08-10 13:57:28 +02:00
Tilo Eckert
672c3be9ed sftp: Fix incorrect handling of received length fields
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
2015-08-01 10:52:57 +03:00
Peter Volpe
dc9c4d22ab auth: Fix return status for ssh_userauth_agent()
BUG: https://red.libssh.org/issues/201

Return SSH_AUTH_DENIED instead of SSH_AUTH_ERROR when the provided agent
offers no public keys.

Signed-off-by: Peter Volpe <pvolpe@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-07-30 10:51:42 +02:00
Tilo Eckert
71d86be42e define our own platform-independent S_IF macros
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-07-30 10:47:34 +02:00
Tilo Eckert
267fe02088 fix file mode checks in sftp_open()
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-07-30 10:46:34 +02:00
Aris Adamantiadis
52b5258ed4 fix permissions 2015-07-08 16:33:34 +02:00
Fabiano Fidêncio
2bf6e66ffe client: handle agent forward open requests with callbacks
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Aris Adamantiadis <aris@badcode.be>
2015-07-07 13:24:55 +02:00
Andreas Schneider
728c2fbd01 cmake: Fix zlib include directory
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-07-03 12:36:26 +02:00
Tilo Eckert
0423057424 SSH_AUTH_PARTIAL is now correctly passed to the caller of ssh_userauth_publickey_auto().
Implicitly fixed unsafe return code handling that could result in use-after-free.

Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-29 11:10:45 +02:00
Tilo Eckert
cc25d747d4 available auth_methods must be reset on partial authentication
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-29 11:06:20 +02:00
Peter Volpe
7637351065 channels: Fix exit-signal data unpacking
Signed-off-by: Peter Volpe <pvolpe@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-29 09:50:09 +02:00
Peter Volpe
7aeba71a92 agent: Add ssh_set_agent_socket
Allow callers to specify their own socket
for an ssh agent.

Signed-off-by: Peter Volpe <pvolpe@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-29 09:47:02 +02:00
Seb Boving
e020dd8d59 Don't allocate a new identity list in the new session's options.
The previous list is not freed. Since the new session just got
created, an identity list is already allocated and empty.

Signed-off-by: Sebastien Boving <seb@google.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-24 18:28:36 +02:00
Douglas Heriot
a65af1b3b8 cmake: Do not use CMAKE_(SOURCE|BINARY)_DIR 2015-06-24 18:17:05 +02:00
Tiamo Laitakari
5478de1a64 pki: Fix allocation of ed25519 public keys
Signed-off-by: Tiamo Laitakari <tiamo.laitakari@cs.helsinki.fi>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-24 17:53:22 +02:00
Andreas Schneider
ef751a26d0 misc: Correctly guard the sys/time.h include
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-24 17:13:19 +02:00
Andreas Schneider
1d69e073af kex: Add comments to #if clauses
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-24 16:23:13 +02:00
Aris Adamantiadis
c480a29052 channels: fix exit-status not correctly set 2015-06-03 16:41:05 +02:00
Mike DePaulo
4aef82237d Comment that ssh_forward_cancel() is deprecated.
Signed-off-by: Aris Adamantiadis <aris@badcode.be>
2015-05-29 11:29:49 +02:00
Mike DePaulo
8a4a22d7b7 Reintroduce ssh_forward_listen() (Fixes: #194)
Signed-off-by: Aris Adamantiadis <aris@badcode.be>
2015-05-29 11:23:31 +02:00
Jon Simons
ee460dc04b kex: also compare host keys for 'first_kex_packet_follows'
Also consider the host key type at hand when computing whether a
'first_kex_packet_follows' packet matches the current server settings.
Without this change libssh may incorrectly believe that guessed
settings which match by kex algorithm alone fully match: the host
key types must also match.  Observed when testing with dropbear
clients.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05 22:03:47 +02:00
Jon Simons
f134cb3d57 server: return SSH_OK for ignored SSH_MSG_KEXDH_INIT case
Return SSH_OK for the case that an incoming SSH_MSG_KEXDH_INIT should be
ignored.  That is, for the case that the initial 'first_kex_packet_follows'
guess is incorrect.  Before this change sessions served with libssh can be
observed to error out unexpectedly early when testing with dropbear clients
that send an incompatible guess.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05 22:03:32 +02:00
Andreas Schneider
e8720a30e2 cmake: Add --enable-stdcall-fixup for MinGW builds
This fixes warnings for getaddrinfo() and freeaddrinfo().

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05 18:59:30 +02:00
Andreas Schneider
ca501df8c8 sftp: Fix size check
CID: #1296588

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05 11:26:40 +02:00
Andreas Schneider
a4cecf59d5 external: Fix resetting the state
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04 18:10:30 +02:00
Andreas Schneider
244881b87d external: Make sure we burn buffers in bcrypt
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04 17:54:01 +02:00
Andreas Schneider
cf05e653de external: Fix a possible buffer overrun in bcrypt_pbkdf
CID: #1250106

This fixes a 1 byte output overflow for large key length (not reachable
in libssh). Pulled from OpenBSD BCrypt PBKDF implementation.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04 17:54:01 +02:00
Andreas Schneider
4b9916136d sftp: Add bound check for size
CID: #1238630

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04 17:54:01 +02:00
Andreas Schneider
33ecff11dd buffer: Cleanup vaargs in ssh_buffer_unpack_va()
CID: #1267977

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04 17:54:01 +02:00
Andreas Schneider
83d3ee7fdb string: Improve ssh_string_len() to avoid tainted variables
CID: #1278978

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04 17:54:01 +02:00
Andreas Schneider
b1a3f4ee33 pki_container: Fix a memory leak
CID: #1267980

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04 17:54:01 +02:00
Andreas Schneider
05498e0e33 pki_container: Add check for return value
CID: #1267982

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-04 17:54:01 +02:00
Aris Adamantiadis
3091025472 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>
2015-04-23 10:33:52 +02:00
Aris Adamantiadis
bf0c7ae0ae 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>
2015-04-23 10:15:47 +02:00
Kevin Fan
b5dc8197f7 Fix leak of sftp->ext when sftp_new() fails
Signed-off-by: Kevin Fan <kevinfan@google.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-14 20:56:56 +02:00
Andreas Schneider
1cb940c44a socket: Cleanup ssh_socket_close() code.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-10 13:32:09 +02:00
Andreas Schneider
3f04367fb8 bind: Correctly close sockets and invalidate them.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-10 13:32:09 +02:00
Andreas Schneider
6c7e552509 cmake: Require cmake version 2.8.0 2015-04-10 13:32:09 +02:00
Andreas Schneider
b1cb8de385 cmake: Check for sys/param.h header file
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-10 13:07:12 +02:00
Andreas Schneider
69c9cd029f cmake: Check for arpa/inet.h header file
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-10 13:02:56 +02:00
Andreas Schneider
c699b9ca94 external: Use standard int types
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-10 13:02:56 +02:00
Andreas Schneider
5236358a48 messages: Don't leak memory after callback execution
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-02 16:13:20 +02:00
Andreas Schneider
e0a73d3dbe poll: Fix compilation with struct ssh_timestamp
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-02 15:02:29 +02:00
Andreas Schneider
a3357b8920 include: We should use __func__ which is C99
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-02 10:58:36 +02:00
Seb Boving
7ec798d3e7 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:05:54 +01:00
xjoaalm
f32e5f2191 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:01:15 +01:00