Jon Simons
dee8e5688b
channel: check for closed state in waitwindow loops
...
Signed-off-by: Jon Simons <jon@jonsimons.org >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-03-27 10:34:22 +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
Jon Simons
f7b61bf557
doc: correct ssh_channel_read_timeout units
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:46 +01:00
Oleksandr Shneyder
d904784489
Make function ssh_channel_accept() nonblocking if timeout is 0.
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-02-02 22:19:45 +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
Andreas Schneider
e745236ae5
doc: Fix channel documentation.
2014-01-17 11:08:49 +01:00
Andreas Schneider
5229253f86
channel: Fix the name scheme of the forward functions.
2014-01-16 09:13:06 +01:00
Oleksandr Shneyder
a1c4fc07d4
channel: Add ssh_channel_accept_forward().
...
This works same way as ssh_forward_accept() but can return a destination
port of the channel (useful if SSH connection forwarding several TCP/IP
ports).
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2014-01-16 09:12:03 +01:00
Andreas Schneider
6fe51b13fb
src: Update my mail address.
2014-01-07 16:08:23 +01:00
Aris Adamantiadis
aecd952d18
update copyright information
2014-01-07 15:18:15 +01:00
Jon Simons
20b5734649
channel: fix setting of channel->flags
...
Fix the setting of 'channel->flags' to use '|='. Before this
change, one bug symptom can be that channels are never fully
free'd via ssh_channel_free, resulting in memory leaks.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-12-11 21:02:47 +01:00
Andreas Schneider
d65777b570
channels: Add a ssh_channel_read_timeout function.
2013-12-04 20:34:13 +01:00
Jon Simons
3d934f3ddc
channel: fix infinite loop in channel_write_common
...
BUG: https://red.libssh.org/issues/130
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-11-22 10:34:23 +01:00
Rod Vagg
06cc94eecf
flush channel after EOF and CLOSE
2013-11-18 17:22:30 +01:00
Andreas Schneider
6f0f1ef292
doc: Fix doxygen warnings.
2013-11-04 21:55:29 +01:00
Andreas Schneider
e30acdb58a
channel: Reinit the buffer and reset the state on error.
...
BUG: https://red.libssh.org/issues/126
2013-10-20 12:46:57 +02:00
Andreas Schneider
b0cbe88b0b
channel: Fix ssh_global_request_termination().
...
BUG: https://red.libssh.org/issues/126
2013-10-20 12:46:17 +02:00
Andreas Schneider
423d8c9b6a
channel: Fix packets termination timeout in global_request().
...
BUG: https://red.libssh.org/issues/126
2013-10-01 14:50:56 +02:00
Andreas Schneider
4eae4d592c
channels: Correctly handle timeouts in channel functions.
2013-09-17 11:23:56 +02:00
Andreas Schneider
566d842405
channel: Use the correct timeout option in channel_open().
...
BUG: https://red.libssh.org/issues/124
2013-09-17 11:19:49 +02:00
Andreas Schneider
3e07359a35
channels: Correctly decrement timeout value in ssh_channel_accept().
...
BUG: https://red.libssh.org/issues/116
2013-09-16 10:38:14 +02:00
Andreas Schneider
e9242a7a31
channel: Document SSH_AGAIN in ssh_channel_read().
...
BUG: https://red.libssh.org/issues/115
2013-09-16 10:38:14 +02:00
Andreas Schneider
fc8081cd06
channel: Refactor channel_write_common() code.
...
This makes it easier to read and easier to debug.
2013-08-13 08:22:28 +02:00
Andreas Schneider
7a64dd1b9a
channel: Make channel_write_common() static.
2013-08-13 08:17:15 +02:00
Andreas Schneider
5045133dc2
channel: Use MIN macro in channel_write_common().
2013-08-13 08:15:37 +02:00
Nicolas Viennot
2f674aeec1
channels: allow channel_open() to return SSH_AGAIN
...
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz >
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-25 22:34:51 +02:00
Andreas Schneider
11c82a26a6
channels: Fix a SSH_LOG call.
2013-07-15 08:07:34 +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
Aris Adamantiadis
f528f71920
agent: the valid request is auth-agent@openssh.com
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:58:18 +02:00
Aris Adamantiadis
7e306a9ec6
server: implement server-side of agent forwarding
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:55:58 +02:00
Aris Adamantiadis
81e769ec6a
channels: implement callback for agent forwarding request
...
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:55:47 +02:00
Aris Adamantiadis
66b37c856c
session: Introduce SSH_TIMEOUT_DEFAULT
...
The default timeout of 30seconds is very nice when connecting to a new SSH
session, however it completely breaks the synchronous blocking API.
Use SSH_TIMEOUT_DEFAULT when in blocking mode so channel reads&write are blocking
as expected
Reviewed-by: Andreas Schneider <asn@cryptomilk.org >
2013-07-13 14:03:42 +02:00
Aris Adamantiadis
de096910b3
Report according status when errors are detected
2012-12-27 22:01:37 +01:00
Aris Adamantiadis
6d61c3ce4a
Fix channel_write to wait during key reexchanges
2012-12-23 23:10:29 +01:00
Andreas Schneider
ab8c7de6f8
BUG 94: Fix big endian issue.
2012-12-03 12:35:36 +01:00
Andreas Schneider
68d04c8e47
CVE-2012-4559: Ensure that we don't free req twice.
2012-11-14 17:36:24 +01:00
Xi Wang
d404ad7152
channels: Fix integer overflow in generate_cookie().
...
Since the type of rnd[i] is signed char, (rnd[i] >> 4), which is
considered as arithmetic shift by gcc, could be negative, leading
to out-of-bounds read.
2012-10-22 21:00:08 +02:00
Andreas Schneider
dde3deb9ea
channels: Don't leak memory in channel_rcv_request callback.
...
Found by Coverity.
2012-10-12 08:07:02 +02:00
Andreas Schneider
bb2848de5a
channels: Check return values of buffer functions.
...
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
ceb8072b34
channel: Fix a possible null pointer dereference.
2012-10-05 11:17:06 +02:00
Andreas Schneider
656fd60110
channels: Fix a possible null pointer dereference.
2012-10-05 11:16:03 +02:00
Andreas Schneider
332f1a2a51
channels: Fix a memory leak in ssh_channel_select().
2012-10-05 11:12:13 +02:00
Andreas Schneider
3739bd99c5
channels: Fix return value of ssh_channel_request_pty_size with SSHv1.
...
Thanks to Dmitriy Kuznetsov <dk@yandex.ru >.
2012-09-07 12:21:28 +02:00
Andreas Schneider
782b2e37c6
build: Fix missing struct in_addr warning.
2012-07-17 18:16:07 +02:00
Aris Adamantiadis
046aa02f39
Fix bugs found by clang
2011-09-23 22:27:46 +02:00
Aris Adamantiadis
dad35304b6
channels: fix embarrasing channel_read_nonblocking bug
2011-09-22 13:48:21 +03:00
Andreas Schneider
c19c638d74
error: Use macros for error functions.
2011-09-17 10:38:08 +02:00