Colin Walters
4cc7f4ad03
Add ssh_get_poll_flags()
...
For integration with an external mainloop, we need to know how to
replicate libssh's internal poll() calls. We originally through
ssh_get_status() was that API, but it's not really - those flags only
get updated from the *result* of a poll(), where what we really need
is to know how libssh would *start* a poll().
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-09 12:26:19 +01:00
Andreas Schneider
a466a624e2
session: Make sure we correctly burn the buffer.
2013-11-03 10:45:02 +01:00
Andreas Schneider
685fe1d0b6
session: Try the ecdsa default key first.
2013-10-01 14:45:01 +02:00
Andreas Schneider
89853607c5
session: Document return value of ssh_get_serverbanner().
...
BUG: https://red.libssh.org/issues/122
2013-09-16 10:38:14 +02:00
Andreas Schneider
20658abc78
session: Remove obsolete status variables.
...
BUG: https://red.libssh.org/issues/121
2013-09-16 10:38:14 +02:00
Andreas Schneider
6da54688eb
doc: Update documentation of ssh_set_blocking().
...
This should work correctly in libssh 0.6.0. If not then you hit a bug.
2013-09-09 16:43:46 +02:00
Andreas Schneider
6efa55d154
session: Add parentheses to fix a build warning.
2013-07-26 07:50:37 +02:00
Andreas Schneider
f9b8395122
session: Handle session state in ssh_get_status().
...
BUG: https://red.libssh.org/issues/109
2013-07-25 22:43:09 +02:00
Nicolas Viennot
cdf193d8b5
session: ssh_handle_packets_termination() SSH_AGAIN bug fix
...
ssh_handle_packets_termination() must not return SSH_OK when exiting due to
a timeout while the termination function still returns 1.
Signed-off-by: Nicolas Viennot <nicolas@viennot.biz>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-25 22:35:03 +02:00
Andreas Schneider
461988b153
session: Add brackets to ssh_handle_packets_termination().
2013-07-21 10:35:18 +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
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
Andreas Schneider
166ccef8dc
session: Fix a possible use after free in ssh_free().
...
We need to cleanup the channels first cause we call ssh_channel_close()
on the channels which still require a working socket and poll context.
Thanks to sh4rm4!
2012-10-22 17:37:32 +02:00
Andreas Schneider
802e4133cb
session: Don't leak memory in ssh_send_debug().
...
Found by Coverity.
2012-10-12 08:07:02 +02:00
Andreas Schneider
c5782b7486
session: Make sure we don't segfault on freeing id.
2012-10-07 10:52:54 +02:00
Andreas Schneider
280ce3fe93
session: Fix a memory leak in ssh_new() on error.
2012-10-05 11:12:13 +02:00
Andreas Schneider
43e3a8e497
socket: Add a SSH_WRITE_PENDING socket status.
2012-07-17 18:05:51 +02:00
Andreas Schneider
ee774479de
session: Use a struct for all options.
2012-02-05 11:50:49 +01:00
Martin Drasar
31727bf33a
Ignore and debug messages can be sent using public API
...
Signed-off-by: Martin Drasar <drasar@ics.muni.cz>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2012-01-05 11:26:53 +01:00
rofl0r
2ffbdb0492
commit a7e14524c4f7903f607cdcd02b83782e89f0a82c
2012-01-02 16:31:37 +01:00
rofl0r
4305da29a1
session: Cleanup timeout functions.
...
It is possible that we get unrelated packets while waiting for
termination, thus waiting indefinitely. As a workaround we have to
check the user-supplied timeout.
2012-01-02 12:39:43 +01:00
Andreas Schneider
5083742192
packet: Move packet callbacks to packet_cb.c.
2011-09-18 21:37:18 +02:00
Andreas Schneider
acfc8ea83f
priv: Remove crypto.h and add correct includes to src files.
2011-09-18 21:37:17 +02:00
Aris Adamantiadis
ac41a083ef
kex: moved KEX structures to ssh_crypto_struct
2011-09-18 20:34:16 +02:00
Aris Adamantiadis
07abc3406d
kex: split key selection and sending
2011-09-18 20:34:15 +02:00
Aris Adamantiadis
20f8e73e3e
Update libssh to ssh_handle_packets_termination
...
cherry-picked from 0cb5248
Should resolve all timeout problems
Conflicts:
src/auth.c
src/channels.c
2011-09-02 13:58:37 +03:00
Aris Adamantiadis
ef5701a535
Channels: fix the "server specified invalid channel" bug
...
Resolved by introducing a flag entry in channel structure.
2011-09-02 13:50:06 +03:00
Aris Adamantiadis
6d8bb956c5
channels: replaced bugged lists with ssh_list
...
cherry-picked from 0aef5f
Conflicts:
src/session.c
2011-09-02 13:46:10 +03:00
Andreas Schneider
4de4520559
server: Use new pki infrastructure.
2011-08-22 14:29:39 +02:00
Andreas Schneider
5bcf36f098
session: Fix ssh_free() with NULL argument.
2011-08-20 10:47:59 +02:00
rofl0r
7949f2cdc6
session: Fix an infinite loop in the termination callback.
...
This happened due to the use of the buggy and obsolete timeout
funtions.
2011-08-10 15:41:36 +02:00
Andreas Schneider
2f87873642
channels: Handle SSH_AGAIN in channel_open().
2011-08-09 22:59:17 +02:00
rofl0r
af85337f5f
session: Fix timeout handling.
...
-2 now means to use the timeout specified in options. It wasn't used
earlier and poll only knows -1 and 0 anyway for special meanings.
2011-08-06 11:12:02 +02:00
Aris Adamantiadis
da954c2c5e
Fixes the ssh_log issue on ssh_bind handles.
2011-07-19 22:16:28 +02:00
Andreas Schneider
3c21281bf0
session: Fix return code of ssh_blocking_flush().
2011-05-28 13:27:14 +02:00
Aris Adamantiadis
59f7647cd9
Introduced ssh_timeout_elapsed functions
...
Functions to mesure elapsed time before and after a serie of
calls. Introduces a dependancy to clock_gettime() and librt,
hope this doesn't break anything. Porting to gettimeofday() should
not be too hard.
2011-05-24 23:26:18 +02:00
Oliver Stöneberg
671a982739
connect: Set timeout on connect
...
This also fixes error handling in ssh_poll_ctx_dopoll() and
ssh_handle_packets(), so it won't loop forever on an actual timeout.
2011-05-17 14:21:04 +02:00
Andreas Schneider
8b95328b1b
poll: Fix poll input events.
...
bug#38
2011-04-15 19:14:15 +02:00
Aris Adamantiadis
4bc9c96e4e
Change session state after receiving a Disconnect
2011-03-28 12:46:08 +02:00
Aris Adamantiadis
dff4e4e6d3
Implement ssh_blocking_flush()
...
Based on code from Jan Willamowius
2011-03-22 11:49:57 +01:00
milo
32e23a25da
Reverse commit 076dfb82 for the server side
2011-02-10 14:37:34 +01:00
Andreas Schneider
93a2d79459
session: Added ssh_is_connected().
2011-02-06 10:50:14 +01:00
Andreas Schneider
8f850585dd
session: Fixed possible uninitialized return of ret.
2011-02-05 15:23:19 +01:00
Aris Adamantiadis
5b6f048197
Use termination functions for event polling
2011-01-12 23:04:43 +01:00
Aris Adamantiadis
bcea8921ba
Change blocking parameter to a flag
2011-01-10 17:39:47 +01:00
Aris Adamantiadis
076dfb8294
Fix connection callbacks called at wrong time
2011-01-10 12:14:26 +01:00
Aris Adamantiadis
ac6278feb7
Fix leak when key exchange fails.
2011-01-09 22:27:55 +01:00
Aris Adamantiadis
4fa2e4dde1
Added compression options and allow "yes/no" setting
...
SSH_OPTION_COMPRESSION and SSH_OPTION_COMPRESSION_LEVEL options have been added. Now, end-level apps may simply choose to enable compression without knowing the relevant algorithms behind it.
2010-12-27 23:28:39 +01:00
Aris Adamantiadis
4f8907a524
Removed the global poll ctx in fav. of /session ctx
2010-10-12 17:57:15 +02:00