1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00
Commit Graph

34 Commits

Author SHA1 Message Date
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
1cccfdf8a0 packet: Improve readablity of packet decrypt.
After discussion with Aris and it was not obvious enough to understand
the issue we decided to refactor it.

Reviewd-by: Aris Adamantiadis <aris@0xbadc0de.be>
2014-02-06 20:32:05 +01:00
Alan Dunn
e7f831f0a3 packet: Do not decrypt zero length rest of buffer
If we receive a packet of length exactly blocksize, then
packet_decrypt gets called on a buffer of size 0.  The check at the
beginning of packet_decrypt indicates that the function should be
called on buffers of at least one blocksize, though the check allows
through zero length.  As is packet_decrypt can return -1 when len is 0
because malloc can return NULL in this case: according to the ISO C
standard, malloc is free to return NULL or a pointer that can be freed
when size == 0, and uclibc by default will return NULL here (in
"non-glibc-compatible" mode).  The net result is that when using
uclibc connections with libssh can anomalously fail.

Alternatively, packet_decrypt (and probably packet_encrypt for
consistency) could be made to always succeed on len == 0 without
depending on the behavior of malloc.

Thanks to Josh Berlin for bringing conneciton failures with uclibc to
my attention.

Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-06 19:40:09 +01:00
Aris Adamantiadis
61e701caaa update copyright information 2014-01-07 15:18:44 +01:00
Andreas Schneider
84e29f9c06 packet: Remove logically dead code.
CID #1128796
2013-11-27 22:53:53 +01:00
Andreas Schneider
fef32b4c14 packet: Remove dead code. 2013-11-14 11:44:12 +01:00
Andreas Schneider
2eaff2b363 packet: Set the packet to the processed data position.
Else we could end up with packet - current_macsize if to_be_read is 0.
2013-11-14 11:44:11 +01:00
Andreas Schneider
cda641176d packet: Refactor ssh_packet_socket_callback().
Make error checking more readable and add additional NULL checks.
2013-11-13 16:29:41 +01:00
Andreas Schneider
da1eaea51a gassapi: Fix check if it is enabled. 2013-07-22 10:42:30 +02:00
Andreas Schneider
c64ec43eef src: Remove enter_function() and leave_function(). 2013-07-14 13:31:24 +02:00
Andreas Schneider
ebdd0c6ac1 src: Migrate to SSH_LOG. 2013-07-14 12:44:26 +02:00
Aris Adamantiadis
ad92740dc3 server: Fix compilation without WITH_SERVER 2013-07-14 09:30:59 +02:00
Andreas Schneider
1663917f71 cmake: Make GSSAPI optional. 2013-07-13 15:48:49 +02:00
Aris Adamantiadis
7cb6b15aaa auth: implement client-side gssapi
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:41:20 +02:00
Aris Adamantiadis
3b52e38a33 auth: adapt libssh to gssapi-with-mic server
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:21:36 +02:00
Andreas Schneider
6dae8baefc src: Add fall trough comments. 2013-06-18 17:17:23 +02:00
Andreas Schneider
ee47cab548 packet: Fix a possible segfault. 2013-06-17 13:04:27 +02:00
Andreas Schneider
41269874f5 packet: Check return values of buffer functions.
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
dc8103925c packet: Fix a possible segfault. 2012-10-05 11:12:13 +02:00
Andreas Schneider
782b2e37c6 build: Fix missing struct in_addr warning. 2012-07-17 18:16:07 +02:00
Andreas Schneider
3888a050f8 packet: Make default_packet_handlers static.
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
ce26b8d777 packet: Use a define for the macsize. 2011-11-09 10:13:26 +01:00
Aris Adamantiadis
c340192144 packet: cleaner logs with less redundant info 2011-10-03 13:52:19 +03:00
Andreas Schneider
6859e4f4ec build: Fix zlib support. 2011-09-23 22:57:21 +02:00
Andreas Schneider
dc42a1757f gzip: Fix zlib support. 2011-09-18 21:37:18 +02:00
Andreas Schneider
fb0f125351 packet: Don't (de)compress empty buffers.
This fixes bug #50.
2011-06-11 13:15:46 +02:00
Aris Adamantiadis
7ff69d9c48 packet: Abort session on fatal errors on packets 2011-06-09 23:27:41 +02:00
milo
3c0a4781e4 Added the keyboard-interactive authentication method 2011-02-10 14:39:20 +01:00
Andreas Schneider
48e4df4ac0 TODO server: Fixed server support. 2010-12-18 14:02:53 +01:00
Aris Adamantiadis
338a3d9b05 Removed references to ssh_buffer_get_begin 2010-10-03 12:07:00 +02:00
milo
26d40b5354 Handle global requests and reverse forwarding 2010-10-02 22:51:35 +02:00
Aris Adamantiadis
873e02fc6a First step getting rid of ssh_buffer_get_begin 2010-10-01 23:41:04 +02:00
Aris Adamantiadis
75a0281a6b Fixed outgoing flow control + writes behaviours 2010-09-26 22:33:58 +02:00
Andreas Schneider
f7842e3a4b misc: Rename libssh/ to src/ 2010-09-06 14:28:38 +02:00