Commit Graph

1174 Commits

Author SHA1 Message Date
Daniel Stenberg
d4a768af4e removed libssh2_error()'s forth argument
libssh2_error() no longer allocates a string and only accepts a const
error string. I also made a lot of functions use the construct of
return libssh2_error(...) instead of having one call to
libssh2_error() and then a separate return call. In several of those
cases I then also changed the former -1 return code to a more
detailed one - something that I think will not change behaviors
anywhere but it's worth keeping an eye open for any such.
2010-03-03 23:04:05 +01:00
Daniel Stenberg
d377c3065a repaired --enable-debug 2010-03-03 22:51:15 +01:00
Simon Josefsson
51fcb11d60 Make ./configure output a summary of build options. 2010-03-01 17:01:47 +01:00
Daniel Stenberg
8bbc109e52 let the err_msg in the session struct be const too 2010-03-01 13:16:19 +01:00
Simon Josefsson
0ef84144ac Revert #ifdef change that pulled in AES-CTR code when explicitly disabled. 2010-03-01 13:09:18 +01:00
Daniel Stenberg
ef27023eb9 fix #ifdefs 2010-03-01 11:42:38 +01:00
Daniel Stenberg
a9621548f8 make function match the new proto 2010-03-01 11:42:04 +01:00
Simon Josefsson
a925bdd5bb Improve AES-CTR check. 2010-03-01 11:38:50 +01:00
Daniel Stenberg
3420e9858c use const to silence a bazillion warnings 2010-03-01 11:05:40 +01:00
Simon Josefsson
2de339b2f7 Use AES-CTR from OpenSSL when available.
Reported by Lars Nordin <Lars.Nordin@SDlabs.se>.
2010-03-01 10:34:00 +01:00
Simon Josefsson
c46cbd46e2 Make it possible to disable DSA.
Patch from Lars Nordin <Lars.Nordin@SDlabs.se>.
2010-03-01 10:30:22 +01:00
Peter Stuge
16af813b81 Send and receive channel EOF before sending SSH_MSG_CHANNEL_CLOSE
Sending SSH_MSG_CHANNEL_CLOSE without channel EOF is explicitly allowed
in RFC 4254, but some non-conforming servers will hang or time out when
the channel is closed before EOF.

Other common clients send and receive EOF before closing, there are no
drawbacks, and some servers need it to work correctly.
2010-03-01 06:43:53 +01:00
Alexander Lamaison
a2157c8391 Style improvements to knownhost error handling.
Made improvements as suggested by Peter Stuge: http://www.libssh2.org/mail/libssh2-devel-archive-2010-02/0161.shtml.
2010-02-26 18:47:54 +00:00
Alexander Lamaison
942a40b482 Call libssh2_error for every knownhost API failure.
The libssh2 API calls should set the last error code and a message when
returning a failure by calling libssh2_error.  This changeset adds these
calls to the libssh2_knownhost_* API as well as libssh2_base64_decode.

This change also makes libssh2_error into a function rather than a macro.
Its implementation is moved to misc.c.  This function returns the error
code passed to it allowing callers to return the error value directly
without duplicating the error code.
2010-02-24 13:45:00 +00:00
Alexander Lamaison
ef096220ce Fix LIBSSH2_ALLOC checks.
These appear to be cut-and paste errors where the wrong variable is checked
for NULLness after calling LIBSSH2_ALLOC.
2010-02-23 22:00:40 +00:00
Simon Josefsson
e4232e531b Silence compiler warning. 2010-02-23 15:49:47 +01:00
Simon Josefsson
cdc1366b2c Make it portable; test uses = for string comparison (not ==). Indent. 2010-02-23 15:27:18 +01:00
Alexander Lamaison
3e1a95392e libssh2_knownhost_del: fix write to freed memory.
When removing a known host, libssh2_knownhost_del would remove the node from the linked list, free its memory and then overwrite the struct parameter (which indicated which node to remove) with 0.  However, this struct is actually allocated within the just-freed node meaning we're writing to freed memory.  This made Windows very upset.

The fix is simply to overwrite the struct first before freeing the memory.
2010-02-22 14:50:08 +00:00
Daniel Stenberg
b4f12e153a show more verbose error when SCP send fails 2010-02-21 19:29:23 +01:00
Daniel Stenberg
bd5519c7a2 libssh2_socket_t is done, a library-free function is needed 2010-02-21 19:20:07 +01:00
Daniel Stenberg
05b1bb3cd3 clarify that this frees all data associated with a session 2010-02-21 19:16:30 +01:00
Daniel Stenberg
dea503df73 improved error handling 2010-02-21 19:08:14 +01:00
Daniel Stenberg
c5609acb17 add missing libssh2_error() calls
To make sure the public API is functional and that the
BLOCK_ADJUST_ERRNO() macro works correctly we MUST make sure to
call libssh2_error() when we return errors.
2010-02-18 13:20:11 +01:00
Daniel Stenberg
37c08983a3 fix memory leak in userauth_keyboard_interactive()
Mr anonymous in bug #125 pointed out that the userauth_keyboard_interactive()
function does in fact assign the same pointer a second time to a new allocated
buffer without properly freeing the previous one, which caused a memory leak.
2010-02-18 13:04:29 +01:00
Daniel Stenberg
72ae0866cb added missing error codes
To allow the libssh2_session_last_error() function to work as
documented, userauth_password() now better makes sure to call
libssh2_error() everywhere before it returns error.

Pointed out by mr anonymous in bug #128
2010-02-18 00:01:33 +01:00
Peter Stuge
2149244cfe Fix resource and memory leaks in examples as reported by cppcheck
Thanks to Ettl Martin for the report and patch. This fixes #132
2010-02-16 13:21:57 +01:00
Daniel Stenberg
a491017f5a mention the new man pages for macros 2010-02-15 14:29:04 +01:00
Daniel Stenberg
ec699ef684 added man pages for API macros
all #defined macros in the public headers are considered to be part
of the API and I've generated individual man pages for each of them
to A) make it easier to figure out what each function/macro actually
is for so that automated lookups work better and for B) make sure we
have all public functions document (both macros and functions) to
make it easier for us to work away from all the macros in a future
release.
2010-02-15 14:24:40 +01:00
Daniel Stenberg
514104b37d Committed the patch by Yoichi Iwaki in bug #2929647
Committed the patch by Yoichi Iwaki in bug #2929647, which fixed a memory
leak when an 'outbuf' was still allocated when a session was freed.
2010-02-15 00:15:30 +01:00
Daniel Stenberg
4d13c6e59b free "outbuf" when killing a session
Fix memoary leak: if there was an "output" still allocated when a
session was torn down it needs to be freed in session_free()

Patch by Yoichi Iwaki in bug #2929647
2010-02-15 00:12:10 +01:00
Daniel Stenberg
72a28f6b16 the working version name is now 1.2.5_DEV 2010-02-13 17:18:55 +01:00
Daniel Stenberg
c889058cb3 updated info for 1.2.4 2010-02-13 17:10:30 +01:00
Dan Fandrich
69c876e210 Allow compiling with OpenSSL when AES isn't available. 2010-02-10 14:49:17 -08:00
Dave McCaldon
10f5c70ac0 Fix Tru64 socklen_t compile issue with example/direct_tcpip.c
Building libssh2-1.2.3 on Tru64 fails at line 48 and 166 because socklen_t
isn't defined on Tru64 unless _POSIX_PII_SOCKET is defined.

This patch updates configure.ac to add -D_POSIX_PII_SOCKET when building
on Tru64 platform(s).
2010-02-09 11:45:40 +01:00
Dave McCaldon
ea914c8b72 Resolve compile issues on Solaris x64 and UltraSPARC
Solaris builds of libssh2-1.2.3 failed on both x64 and UltraSPARC
platforms because of two problems:

1) src/agent.c:145 sun is a reserved word when using the SUNWspro compiler
2) example/direct_tcpip.c:84 INADDR_NONE is not defined
2010-02-09 11:19:52 +01:00
Daniel Stenberg
64a6c255ec towards 1.2.4 now 2010-02-03 19:36:19 +01:00
Daniel Stenberg
e09d6ac653 Version 1.2.3 (February 3, 2010) 2010-02-03 19:23:28 +01:00
Daniel Stenberg
91841731af fix building out of source tree by proving better include path
when building out of source tree, we provide -I$(top_builddir)/example
since the libssh2_config.h gets generated in that dir
2010-02-03 19:21:12 +01:00
Sofian Brabez
a190437c4a Replace : in hexdump with " " (two spaces) 2010-02-01 16:30:47 +01:00
Peter Stuge
68a900d27a Detect when the forwarded connection is closed in example/direct_tcpip.c 2010-01-30 00:45:56 +01:00
Peter Stuge
e4b7baa885 Fix example/direct_tcpip.c to work also on WIN32
read() and write() are no good for WIN32 sockets, use recv() and send().
2010-01-30 00:35:05 +01:00
Peter Stuge
2622bbaf33 Ignore libssh2_config.h.in and stamp-h2 in example/ and remove .cvsignore 2010-01-30 00:25:46 +01:00
Peter Stuge
d3dbe4c81e Simplify WIN32 ifdefs in example/direct_tcpip.c to allow standalone compile 2010-01-30 00:01:51 +01:00
Peter Stuge
095ccbf825 Always #define INVALID_SOCKET -1 in libssh2_priv.h when not on win32
Fix broken builds since commit abd9bd0bbe
for all non-win32 platforms.
2010-01-29 23:51:38 +01:00
Peter Stuge
8eafded280 Include hmac-md5 and hmac-md5-96 only if crypto backend supports MD5 2010-01-29 23:22:56 +01:00
Peter Stuge
6df87e64b7 Use LIBSSH2_HOSTKEY_HASH_SHA1 instead of _MD5 in examples and tests
MD5 support is optional and may not always be available, while SHA1 is both
required and recommended.
2010-01-29 23:06:31 +01:00
Peter Stuge
3ddac8ac66 Update mailing list address in configure.ac to @cool.haxx.se 2010-01-29 22:31:40 +01:00
Peter Stuge
6c543545fe Make example/direct_tcpip.c compile for win32
One warning from FD_SET() remains, it is also in some other examples.
2010-01-29 20:35:24 +01:00
Peter Stuge
abd9bd0bbe Correctly check for an invalid socket in session_startup() 2010-01-29 20:29:01 +01:00
Peter Stuge
5dd4005ace Small documentation fix after Dave's _USERAUTH_FAILURE improvement 2010-01-29 09:16:39 +01:00