1
1

54 Коммитов

Автор SHA1 Сообщение Дата
Guenter Knauf
ddb935af3d non-gcc compilers break with var declarations in the middle of the code. 2007-06-14 00:38:35 +00:00
James Housley
4b8db8c1ab Modify the code to truely support non-blocking. Propogate the EAGAIN error
all the way up to the user interface.  All code modules bug sftp.c have
been completed.

Functions that return an "int", or similar return LIBSSH2CHANNEL_EAGAIN to
indicate some part of the call would block, in non-blocking mode.

Functions that return a structure, like "LIBSSH2_CHANNEL *", return NULL
and set the libssh2 error.  The error can be obtained with either
libssh2_session_last_error() or libssh2_session_last_errno().  Either of
these will return the error code of LIBSSH2_ERROR_EAGAIN if the
call would block, in non-blocking mode.

The current state of a function and some variable are keep in the
structures so that on the next call the operation that would block can
be retried again with the same data.
2007-06-06 12:34:06 +00:00
James Housley
412b25d971 Initially the libssh2 code was indented with tabs of 4 spaces. Some of
the recent commits converted the tabs to 4 spaces, which matched the
initial indent size.  Other commits converted the tabs to 8 spaces, this
didn't match.

All the code has been converted to 4 space indents.  No changes to line
lengths or actual code was performed.  This is in preperation to my up
coming non-blocking work so my commits should only be code changes and
line lengths in the code I am working on.
2007-05-28 17:56:08 +00:00
Dan Fandrich
5dd66e604f Made most internal tables 'static const'. 2007-04-17 18:12:41 +00:00
Guenter Knauf
f33375bc03 changed to configure defines to control inclusion of headers from libssh2_config.h. 2007-04-12 22:20:18 +00:00
Dan Fandrich
6dfb2e3009 Better handle out of memory situations. 2007-04-12 21:51:57 +00:00
Simon Josefsson
43e377c08e Fix AIX problem, based on patch from Michael Augustin <maugustin@gmx.net>. 2007-04-05 09:31:38 +00:00
Simon Josefsson
94a71fe995 (libssh2_packet_x11_open, libssh2_packet_queue_listener): Mark as
static functions.  Remove unnecessary prototypes.  Breaks Solaris 10
builds according to "Heiko Jansen" <jansen@hbz-nrw.de>.
2007-03-27 13:02:01 +00:00
Daniel Stenberg
b553f1087e fixed a memory leak in the packet handling (Dan Fandrich) 2007-03-15 20:56:45 +00:00
Daniel Stenberg
4f1cfb20a9 1 - new public function libssh2_trace() that enables tracing/debug output on
various stuff if libssh2 was built with debug. If built without debug, the
 function does nothing.
2 - configure --enable-debug is now enough to build a debug version (including
picky compiler options)
3 - internally, we no longer need/use #ifdef/#endif around all uses of the
_libssh2_debug() function/macro.

The scp.c example is the first application to test this new debug logging.
2007-02-02 23:23:36 +00:00
Daniel Stenberg
9d55db6501 Adding src/transport.c for the SECSH transport layer read/write in a non-
blocking way. The channel code is now responsible for enabling/disabling
blocking status and to work with it.

I've also modified indenting and fixed compiler warnings at places, and
added a bunch of new examples in example/simple that I've used to verify that
the code still runs like before.

libssh2_channel_{read|write}nb_ex() and libssh2_sftp_{read|write}nb() are the
four new functions that supposedly work non-blocking.
2007-02-02 16:21:20 +00:00
Simon Josefsson
79761a6455 Use generic APIs for (HMAC-)MD5/SHA1 and RNG, and implement them via OpenSSL/libgcrypt. 2007-01-15 21:12:00 +00:00
Simon Josefsson
75b5e06773 Fix indentation. 2006-12-09 09:06:06 +00:00
Simon Josefsson
14b9deef24 Move symmetric OpenSSL EVP crypto calls to crypt.c. 2006-12-07 15:44:07 +00:00
Mikhail Gusarov
82d762cae5 Improve detection of closed channel. Eleminates lock-ups on
multi-channel operation.
2006-11-27 07:37:40 +00:00
Mikhail Gusarov
1c1c74479e Reading bigger blocks from network before decryption.
Significantly increases performance.
2006-11-27 07:31:28 +00:00
Mikhail Gusarov
3a33680e14 write(2) may write only part of passed data under FreeBSD.
Make sure whole buffer is written.
2006-11-27 07:24:18 +00:00
James Housley
1baaa31792 Patch from Daniel Stenberg
1 - #include <inttypes.h> and uses uint32_t (this is not very portable and
    need attention as I mentioned in my separate mail)

2 - changes libssh2_blocking_read() to return ssize_t and all code that uses
    this function explicitly checks its return code (better).

3 - I fixed a bunch of compiler warnings where functions got called with
    unsigned char * when they expect char *. I strongly suggest we patch away
    all warnings - now.
2006-11-14 01:30:39 +00:00
James Housley
7063d24724 /* RFC4253 section 6.1 Maximum Packet Length says:
*
 * "All implementations MUST be able to process packets with
 * uncompressed payload length of 32768 bytes or less and
 * total packet size of 35000 bytes or less (including length,
 * padding length, payload, padding, and MAC.)."
 */
Protect against an improper packet from producing unreasonable values.
Credit goes to Daniel Stenberg
2006-11-10 13:47:13 +00:00
Sara Golemon
adee5e5653 Don't wait for KEX_INIT prior to sending our own packet.
Watch out for bad KEX_INIT guesses and burn packets if necessary.
2006-06-22 18:45:29 +00:00
Sara Golemon
5f85317efa Swap ordering of packet_add/packet-inspection to avoid inspect after free. Fix OpenSSL detection using pkg-config. 2006-05-26 22:36:48 +00:00
Sara Golemon
09b93e4bb6 Map Win32 errno values 2006-04-17 02:49:44 +00:00
Sara Golemon
c45992da55 Bump copyright year 2006-03-02 01:10:52 +00:00
Mikhail Gusarov
a4e61c265b Fixed errorneous flushing packets for unrelated channels when one is closed
(thanks to Alexander Holyapin)
2006-02-20 08:39:54 +00:00
Sara Golemon
f9d65b0984 Fix miscellaneous bugs in src/channel.c and src/packet.c
Courtessy David Robins
2005-11-02 00:26:24 +00:00
Mikhail Gusarov
dc446eff08 Debug output slightly fixed 2005-06-24 11:18:20 +00:00
Mikhail Gusarov
2e097c7760 Memory leak liquidated - free the SSH_MSG_CHANNEL_REQUEST packet data
after processing 'exit-status' message
2005-06-23 08:22:04 +00:00
Mikhail Gusarov
77bd3c1215 'exit-status' information packet handling added 2005-06-23 05:55:01 +00:00
Sara Golemon
6de7ed8a7b Drop these old references to initial window size, they were a mistake 2005-05-18 17:12:40 +00:00
Sara Golemon
cc7703092f Save up multiple small refunds in order to cut down on unnecessary WINDOW_ADJUST packets 2005-05-18 17:08:29 +00:00
Sara Golemon
e9b0710b4b Fix format specifiers 2005-05-11 05:26:12 +00:00
Sara Golemon
ebfbd22e59 Add debugging hooks for development diagnostics 2005-05-11 05:11:31 +00:00
Sara Golemon
cba673de6f Make blocking_read's polling loop less arbitrary 2005-05-04 18:48:47 +00:00
Sara Golemon
ba420fc7bf Block means block. 2005-04-05 23:08:41 +00:00
Sara Golemon
ae9ad1ef6f break; fallthroughs in win32 code 2005-04-02 05:43:17 +00:00
Sara Golemon
5d9c0d50f3 Another typo 2005-04-01 15:34:14 +00:00
Sara Golemon
15b8489046 Phase 1 of the Great Timeout Cleanup 2005-04-01 06:11:34 +00:00
Sara Golemon
dce388e9c5 Nix unused variable 2005-03-28 23:03:41 +00:00
Sara Golemon
d6039f39e4 Nix the memset loop
Speaking of which: Why wasn't it JUST a memset() call?

The encrypted version of packet_write fills in this data with OpenSSL
RAND_bytes() data, and as far as the unencrypted version goes?
Well, it's unencrypted, randomness doesn't help at that point.
2005-03-26 05:31:31 +00:00
Sara Golemon
141ac5b856 Add sys/uio.h for FBSD builds and remove old stdio references 2005-03-21 21:26:08 +00:00
Sara Golemon
ef7496b29a Update copyright year 2005-02-18 16:32:02 +00:00
Sara Golemon
c6bbe0d42f Added libssh2_session_flag() and LIBSSH2_FLAG_SIGPIPE with hooks 2005-02-03 05:57:43 +00:00
Sara Golemon
a05bf84ecf Collapse state flags into single bitmask attribute 2005-02-03 05:41:35 +00:00
Sara Golemon
5f7470700e Handle Client-To-Server channel windowing. 2005-01-20 21:33:30 +00:00
Sara Golemon
a119685410 Add X11 forwarding support 2005-01-06 00:51:30 +00:00
Wez Furlong
dc4bb1af96 Add support for win32.
Edit win32/config.mk to set the paths to your openssl and zlib headers and
libraries.

Then, from the root of the tree:

	nmake -f NMakefile

voila.
2005-01-03 22:46:15 +00:00
Sara Golemon
2e02ad041a Add remote tcp/ip forwarding. 2004-12-29 19:26:28 +00:00
Sara Golemon
596b62c027 use actual random data with KEX_INIT cookie and packet padding 2004-12-27 20:38:44 +00:00
Sara Golemon
f11c657a10 Make libssh2_packet_read() use a static buffer to avoid unnecessary
alloc and free calls.

Since the cipher and mac layers aren't runtime extensible (yet)
and we know neither of these works in sizes greater than 32,
we can safely set aside a 64 byte block of data on the stack
for crypting and hashing.

This will make a big difference during quasi-non-blocking reads
where libssh2_packet_read() is polled repeatedly.
2004-12-23 00:42:20 +00:00
Sara Golemon
aa8b8afe4f Update contact info with new domain 2004-12-22 20:56:06 +00:00