Skip to content

Method pref #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Change Log
=============


0.25.0
++++++

Changes
-------

* Added new in libssh2 `1.9.0` errors as exceptions.
* Added ``Session.methods``, ``Session.method_pref`` and ``Session.supported_algs`` functions.
* Added supported method types as ``ssh2.session.LIBSSH2_METHOD_*``.


0.24.0
++++++

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ If the examples seem long, this is not the right library. Use `parallel-ssh <htt
API Feature Set
________________

At this time all of the `libssh2`_ API has been implemented up to version ``1.8.2``.
At this time all of the `libssh2`_ API has been implemented up to the libssh2 version in the repository. Please report any missing implementation.

Complete example scripts for various operations can be found in the `examples directory`_.

Expand Down
11 changes: 11 additions & 0 deletions ssh2/c_ssh2.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ cdef extern from "libssh2.h" nogil:
LIBSSH2_HOSTKEY_TYPE_ECDSA_384
LIBSSH2_HOSTKEY_TYPE_ECDSA_521
LIBSSH2_HOSTKEY_TYPE_ED25519
LIBSSH2_METHOD_KEX
LIBSSH2_METHOD_HOSTKEY
LIBSSH2_METHOD_CRYPT_CS
LIBSSH2_METHOD_CRYPT_SC
LIBSSH2_METHOD_MAC_CS
LIBSSH2_METHOD_MAC_SC
LIBSSH2_METHOD_COMP_CS
LIBSSH2_METHOD_COMP_SC
LIBSSH2_METHOD_LANG_CS
LIBSSH2_METHOD_LANG_SC

# ctypedef libssh2_uint64_t libssh2_struct_stat_size
ctypedef struct libssh2_struct_stat:
Expand Down Expand Up @@ -468,5 +478,6 @@ cdef extern from "libssh2.h" nogil:
const char *libssh2_agent_get_identity_path(LIBSSH2_AGENT *agent)
void libssh2_agent_set_identity_path(LIBSSH2_AGENT *agent,
const char *path)
void libssh2_free(LIBSSH2_SESSION *session, void *ptr)
IF HAVE_AGENT_FWD:
int libssh2_channel_request_auth_agent(LIBSSH2_CHANNEL *channel)
343 changes: 209 additions & 134 deletions ssh2/error_codes.c

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions ssh2/error_codes.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ cdef extern from "libssh2.h" nogil:
_LIBSSH2_ERROR_SOCKET_NONE "LIBSSH2_ERROR_SOCKET_NONE"
_LIBSSH2_ERROR_BANNER_RECV "LIBSSH2_ERROR_BANNER_RECV"
_LIBSSH2_ERROR_BANNER_SEND "LIBSSH2_ERROR_BANNER_SEND"
_LIBSSH2_ERROR_INVALID_MAC "LIBSSH2_ERROR_INVALID_MAC"
_LIBSSH2_ERROR_KEX_FAILURE "LIBSSH2_ERROR_KEX_FAILURE"
_LIBSSH2_ERROR_ALLOC "LIBSSH2_ERROR_ALLOC"
_LIBSSH2_ERROR_SOCKET_SEND "LIBSSH2_ERROR_SOCKET_SEND"
_LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE "LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE"
_LIBSSH2_ERROR_TIMEOUT "LIBSSH2_ERROR_TIMEOUT"
_LIBSSH2_ERROR_HOSTKEY_INIT "LIBSSH2_ERROR_HOSTKEY_INIT"
Expand Down Expand Up @@ -62,14 +66,16 @@ cdef extern from "libssh2.h" nogil:
_LIBSSH2_ERROR_INVALID_POLL_TYPE "LIBSSH2_ERROR_INVALID_POLL_TYPE"
_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL "LIBSSH2_ERROR_PUBLICKEY_PROTOCOL"
_LIBSSH2_ERROR_EAGAIN "LIBSSH2_ERROR_EAGAIN"
_LIBSSH2CHANNEL_EAGAIN "LIBSSH2_ERROR_EAGAIN"
_LIBSSH2_ERROR_BUFFER_TOO_SMALL "LIBSSH2_ERROR_BUFFER_TOO_SMALL"
_LIBSSH2_ERROR_BAD_USE "LIBSSH2_ERROR_BAD_USE"
_LIBSSH2_ERROR_COMPRESS "LIBSSH2_ERROR_COMPRESS"
_LIBSSH2_ERROR_OUT_OF_BOUNDARY "LIBSSH2_ERROR_OUT_OF_BOUNDARY"
_LIBSSH2_ERROR_AGENT_PROTOCOL "LIBSSH2_ERROR_AGENT_PROTOCOL"
_LIBSSH2_ERROR_SOCKET_RECV "LIBSSH2_ERROR_SOCKET_RECV"
_LIBSSH2_ERROR_SOCKET_SEND "LIBSSH2_ERROR_SOCKET_SEND"
_LIBSSH2_ERROR_ENCRYPT "LIBSSH2_ERROR_ENCRYPT"
_LIBSSH2_ERROR_BAD_SOCKET "LIBSSH2_ERROR_BAD_SOCKET"
_LIBSSH2_ERROR_KNOWN_HOSTS "LIBSSH2_ERROR_KNOWN_HOSTS"
_LIBSSH2_ERROR_CHANNEL_WINDOW_FULL "LIBSSH2_ERROR_CHANNEL_WINDOW_FULL"
_LIBSSH2_ERROR_KEYFILE_AUTH_FAILED "LIBSSH2_ERROR_KEYFILE_AUTH_FAILED"

_LIBSSH2CHANNEL_EAGAIN "LIBSSH2_ERROR_EAGAIN"
10 changes: 9 additions & 1 deletion ssh2/error_codes.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE
LIBSSH2_ERROR_SOCKET_NONE = error_codes._LIBSSH2_ERROR_SOCKET_NONE
LIBSSH2_ERROR_BANNER_RECV = error_codes._LIBSSH2_ERROR_BANNER_RECV
LIBSSH2_ERROR_BANNER_SEND = error_codes._LIBSSH2_ERROR_BANNER_SEND
LIBSSH2_ERROR_SOCKET_SEND = error_codes._LIBSSH2_ERROR_SOCKET_SEND
LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE \
= error_codes._LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE
LIBSSH2_ERROR_TIMEOUT = error_codes._LIBSSH2_ERROR_TIMEOUT
Expand Down Expand Up @@ -69,8 +70,15 @@ LIBSSH2_ERROR_COMPRESS = error_codes._LIBSSH2_ERROR_COMPRESS
LIBSSH2_ERROR_OUT_OF_BOUNDARY = error_codes._LIBSSH2_ERROR_OUT_OF_BOUNDARY
LIBSSH2_ERROR_AGENT_PROTOCOL = error_codes._LIBSSH2_ERROR_AGENT_PROTOCOL
LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV
LIBSSH2_ERROR_SOCKET_SEND = error_codes._LIBSSH2_ERROR_SOCKET_SEND
LIBSSH2_ERROR_ENCRYPT = error_codes._LIBSSH2_ERROR_ENCRYPT
LIBSSH2_ERROR_BAD_SOCKET = error_codes._LIBSSH2_ERROR_BAD_SOCKET
IF EMBEDDED_LIB:
LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC
LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE
LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC

LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS
LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \
error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL
LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \
error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED
Loading