1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00

3028 Commits

Author SHA1 Message Date
f76cd8b6d5 Fix gssapi credential handling.
- Properly acquire and inquitre credentials to get the list of available
credentials.
- Avoid enforcing a specific username it breaks some use cases (k5login).
- Remove confusing references to delegated credentials as there is no code
that actually uses delegated credentials in the initialization case.

Signed-off-by: Siom Sorce <simo@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-15 16:29:49 +01:00
2bbeebd505 socket: Fix connect if we pass in a fd.
BUG: https://red.libssh.org/issues/106

Thanks to Saju Panikulam.
2013-11-15 08:54:18 +01:00
fef32b4c14 packet: Remove dead code. 2013-11-14 11:44:12 +01:00
2eaff2b363 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:44:11 +01:00
2b3e69fd5f dh: Fix wrong assignment.
Ups, sorry.
2013-11-14 08:09:42 +01:00
cd992a90fb poll: Fix realloc in ssh_poll_ctx_resize(). 2013-11-13 16:29:41 +01:00
6ea111fd8a dh: Avoid possible memory leaks with realloc. 2013-11-13 16:29:41 +01:00
cda641176d packet: Refactor ssh_packet_socket_callback().
Make error checking more readable and add additional NULL checks.
2013-11-13 16:29:41 +01:00
5581645500 server: Fix malloc call. 2013-11-13 16:29:41 +01:00
3e64ef3bf5 session: Always request POLLIN
The assumption is that if libssh functions are being invoked, we want
to read data.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-09 12:29:26 +01:00
7372cd837a 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:29:25 +01:00
1ecf7003f6 client: If we have a pre-connected FD, set state to SOCKET_CONNECTED
Otherwise applications providing their own fd end up tripping an
assertion, since the session is just in _CONNECTING.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-09 12:29:24 +01:00
70c54d9445 example: Use ssh_get_publickey_hash(). 2013-11-06 17:11:26 +01:00
e52ff2c8ff dh: Move ssh_get_hexa() and ssh_print_hexa() down.
This way they are in the documentation block for the session and we get
documentation for them.
2013-11-06 17:11:25 +01:00
9bf9d52e21 dh: Add new ssh_get_publickey_hash() function. 2013-11-06 17:11:24 +01:00
965000129e doc: Fix doxygen warnings. 2013-11-04 21:55:58 +01:00
0940c6f1b0 Fix cast warnings on 64bits 2013-11-04 10:51:17 +01:00
2e6dbe8d3d remove warnings on OSX (workaround) 2013-11-04 10:51:09 +01:00
8bf6907c1d curve25519: include reference implementation 2013-11-03 14:58:47 +01:00
6e9e13cc24 examples: fix forktty() warning on OSX 2013-11-03 14:09:28 +01:00
5bc32bfd88 Fix examples compilation on OSX (libargp) 2013-11-03 13:51:03 +01:00
7c8a793b0a socket: Fix check for pending data.
BUG: https://red.libssh.org/issues/119

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-03 12:48:12 +01:00
e9b0a8210d server: Fix ssh_execute_server_callbacks() client execution
When the public key auth handler is executed and returns SSH_OK,
ssh_execute_server_callbacks() still runs some client callbacks,
which may set rc to SSH_AGAIN, which triggers a default reply on
auth, denying auth.

Signed-off-by: Nicolas Viennot <nicolas@viennot.biz>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-03 10:53:44 +01:00
fb63887c16 server kex: enable delayed compression
The code is careful to reenable compression when rekeying.

Signed-off-by: Nicolas Viennot <nicolas@viennot.biz>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-03 10:53:42 +01:00
b113b78dfc session: Make sure we correctly burn the buffer. 2013-11-03 10:53:41 +01:00
646112b4e4 wrapper: Make sure we really burn the buffer. 2013-11-03 10:53:40 +01:00
ba4346f089 priv: Fix brackets of burn macros. 2013-11-03 10:53:38 +01:00
401865d725 server: fix pubkey reply for key probes
Per RFC 4252, it is required to send back only one of either
SSH_MSG_USERAUTH_PK_OK or SSH_MSG_USERAUTH_FAILURE for public
key probes.

Update the handling of 'auth_pubkey_function' to send back PK_OK
instead of SSH_MSG_USERAUTH_SUCCESS for the case that the state
of the message at hand is SSH_PUBLICKEY_STATE_NONE.

With this change, it is now possible to process an initial key probe
and then subsequent signature validation using the server callbacks.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-02 21:03:20 +01:00
d312af1ed5 ssh_options_get can now return ProxyCommand
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-02 21:03:19 +01:00
3cfd8a126b connect: fix memory leak in ssh_select
Balance 'ssh_event_add_fd' with 'ssh_event_remove_fd' in 'ssh_select'.

BUG: https://red.libssh.org/issues/128

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-10-31 12:48:56 +01:00
24ebbb8b39 tests: Add a test for ssh_channel(). 2013-10-31 12:48:55 +01:00
447ee309b0 poll: fix leak in ssh_poll_ctx_free
Fix a memory leak in 'ssh_poll_ctx_free': issue 'ssh_poll_free'
to remove the poll handle from its context and free it.

BUG: https://red.libssh.org/issues/128

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-10-31 11:55:27 +01:00
6c213c913b SSH_AUTH_OK -> SSH_AUTH_SUCCESS in comments
A few callback descriptions refer to a non-existent value SSH_AUTH_OK,
which should be SSH_AUTH_SUCCESS.  This commit fixes these.

Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-10-31 08:19:35 +01:00
f8f6eb0ce6 cmake: Check for isblank(). 2013-10-30 17:33:32 +01:00
54f89af6d3 bind: fix leak in ssh_bind_accept error path
Use 'ssh_socket_free' to cleanup if 'ssh_bind_accept_fd'
fails, to be sure to free the ssh_socket in/out buffers.
2013-10-24 10:37:59 +02:00
0e4a1b1f66 tests: Add a sftp_read blocking test. 2013-10-23 15:54:40 +02:00
5eeadf533f auth: docs: Fix typo optoins -> options
I'm just getting my feet wet with this codebase.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-10-23 09:55:39 +02:00
a4e2e01d3e doc: Improve sftp_read_sync() example. 2013-10-23 09:55:38 +02:00
3911046f7e include: Fix build on platforms without ECC. 2013-10-21 07:16:26 +02:00
2727af0fe6 tests: Add a test for ssh_channel_request_env(). 2013-10-20 17:06:23 +02:00
c42da23348 tests: We can't test the accept right now. 2013-10-20 17:06:22 +02:00
e0adcea90d tests: Fix torture_forward. 2013-10-20 17:06:21 +02:00
a62399fcd5 channel: Reinit the buffer and reset the state on error.
BUG: https://red.libssh.org/issues/126
2013-10-20 12:47:17 +02:00
0ee68ac2a1 channel: Fix ssh_global_request_termination().
BUG: https://red.libssh.org/issues/126
2013-10-20 12:47:16 +02:00
796d285eaf tests: Add torture forward test. 2013-10-20 12:47:16 +02:00
b5f71f35a3 pki: Don't leak a buffer. 2013-10-19 10:42:18 +02:00
b98ea81903 wrapper: Fix compilation with gcrypt. 2013-10-19 10:39:44 +02:00
beeca3c650 pki_crpypto: Fix ecdsa signature to blob.
BUG: https://red.libssh.org/issues/118
2013-10-18 23:50:09 +02:00
9f5abdb526 pki: Add support for ECDSA private key signing. 2013-10-18 23:50:08 +02:00
02f80eb288 pki: Add the type as a char pointer. 2013-10-18 23:50:08 +02:00