Andreas Schneider
c503bb572e
crytpo: Make sure we check return of ssh_get_random() correctly
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-05 12:12:14 +02:00
Jakub Jelen
d25b8fb550
packet: Avoid warnings by using correct template
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-07-04 07:48:32 +02:00
Andreas Schneider
206f3ff895
Rest in Peace SSHv1
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Jakub Jelen <jjelen@redhat.com >
2018-06-29 14:41:14 +02:00
Aris Adamantiadis
8a735d5eb7
chacha: packet decryption
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
d038c4dee7
chacha: packet encryption
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-28 09:06:30 +02:00
Aris Adamantiadis
0ad462102a
packet: Add more debugging
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2018-06-04 16:55:21 +02:00
Andreas Schneider
2493e962fe
packet: Fix fallthrough compiler warnings
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
2017-08-25 10:06:00 +02:00
Aris Adamantiadis
32eea120af
sockets: Fix callback registration bug
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 17:34:09 +02:00
Aris Adamantiadis
8e42d3959c
packet: Improve logging output
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 17:27:16 +02:00
Aris Adamantiadis
bbe437dbb1
callbacks: Implement list of callbacks for channels
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:56:54 +02:00
Aris Adamantiadis
80d88dd3d9
packets: Handle flow control callbacks
...
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-05-02 16:55:46 +02:00
Fabiano Fidêncio
05fd0acf45
buffer: do not use ssh_buffer_get_rest_len()
...
As ssh_buffer_get_len() actually calls ssh_buffer_get_rest_len(), let's
just use the first one. This is a preparatory step for removing
ssh_buffer_get_rest_len().
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:08 +01:00
Fabiano Fidêncio
954341dd1f
buffer: rename ssh_buffer_get_rest() to ssh_buffer_get()
...
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
e368d01385
cleanup: use ssh_ prefix in the packet (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Fabiano Fidêncio
adc8c20ac1
cleanup: use ssh_ prefix in the buffer (non-static) functions
...
Having "ssh_" prefix in the functions' name will avoid possible clashes
when compiling libssh statically.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2016-01-19 11:31:07 +01:00
Andreas Schneider
662217f409
packet: Check return value of ssh_buffer_unpack().
...
CID: 1230357
Signed-off-by: Andreas Schneider <asn@cryptomilk.org >
Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be >
2014-08-15 12:29:20 +02:00
Aris Adamantiadis
e9fd14c7f0
buffers: adapt packet.c to ssh_buffer_(un)pack()
...
Reviewed-by: Andreas Schneider <asn@samba.org >
2014-08-06 09:46:14 +02:00
Dirkjan Bussink
164b8e99cc
Add logic to support SHA2 HMAC algorithms
...
BUG: https://red.libssh.org/issues/91
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 10:56:46 +02:00
Gangadhar Sandrani
d6e6a453fc
log: Fix log levels.
...
Signed-off-by: Gangadhar Sandrani <gangadhar.sandrani@gmail.com >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-04-22 09:35:33 +02:00
Andreas Schneider
b3e6d5df53
packet: Fix function name.
2014-03-27 11:26:27 +01:00
Jon Simons
aa05248ca8
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 >
2014-03-27 11:19:50 +01:00
Audrius Butkevicius
a277dd9277
Add session/channel byte/packet counters
...
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@elastichosts.com >
2014-02-12 18:21:16 +01:00
Andreas Schneider
3e57b54688
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:30:29 +01:00
Alan Dunn
bb0023b7c7
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:41:00 +01:00
Andreas Schneider
cb9786b3ae
src: Rename buffer_add_data() to ssh_buffer_add_data().
2014-01-19 20:55:55 +01:00
Andreas Schneider
9c4144689d
src: Rename buffer_init to ssh_buffer_init().
2014-01-19 20:43:29 +01:00
Aris Adamantiadis
aecd952d18
update copyright information
2014-01-07 15:18:15 +01:00
Andreas Schneider
75e61f498b
packet: Remove logically dead code.
...
CID #1128796
2013-11-27 20:14:02 +01:00
Andreas Schneider
1972a27fe0
packet: Remove dead code.
2013-11-14 11:43:49 +01:00
Andreas Schneider
097760db17
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:42:21 +01:00
Andreas Schneider
387e26c837
packet: Refactor ssh_packet_socket_callback().
...
Make error checking more readable and add additional NULL checks.
2013-11-09 13:10: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