Skip to content

Commit ad1010f

Browse files
authored
Method pref (#140)
* Added new libssh2 1.9.0 error codes as exceptions. * Added session method and supported algorithm functions - resolves #128 * Updated changelog * Updated documentation
1 parent 6a61d07 commit ad1010f

14 files changed

+3870
-2054
lines changed

Diff for: Changelog.rst

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Change Log
22
=============
33

4+
5+
0.25.0
6+
++++++
7+
8+
Changes
9+
-------
10+
11+
* Added new in libssh2 `1.9.0` errors as exceptions.
12+
* Added ``Session.methods``, ``Session.method_pref`` and ``Session.supported_algs`` functions.
13+
* Added supported method types as ``ssh2.session.LIBSSH2_METHOD_*``.
14+
15+
416
0.24.0
517
++++++
618

Diff for: README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ If the examples seem long, this is not the right library. Use `parallel-ssh <htt
6161
API Feature Set
6262
________________
6363

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

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

Diff for: ssh2/c_ssh2.pxd

+11
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ cdef extern from "libssh2.h" nogil:
4646
LIBSSH2_HOSTKEY_TYPE_ECDSA_384
4747
LIBSSH2_HOSTKEY_TYPE_ECDSA_521
4848
LIBSSH2_HOSTKEY_TYPE_ED25519
49+
LIBSSH2_METHOD_KEX
50+
LIBSSH2_METHOD_HOSTKEY
51+
LIBSSH2_METHOD_CRYPT_CS
52+
LIBSSH2_METHOD_CRYPT_SC
53+
LIBSSH2_METHOD_MAC_CS
54+
LIBSSH2_METHOD_MAC_SC
55+
LIBSSH2_METHOD_COMP_CS
56+
LIBSSH2_METHOD_COMP_SC
57+
LIBSSH2_METHOD_LANG_CS
58+
LIBSSH2_METHOD_LANG_SC
4959

5060
# ctypedef libssh2_uint64_t libssh2_struct_stat_size
5161
ctypedef struct libssh2_struct_stat:
@@ -468,5 +478,6 @@ cdef extern from "libssh2.h" nogil:
468478
const char *libssh2_agent_get_identity_path(LIBSSH2_AGENT *agent)
469479
void libssh2_agent_set_identity_path(LIBSSH2_AGENT *agent,
470480
const char *path)
481+
void libssh2_free(LIBSSH2_SESSION *session, void *ptr)
471482
IF HAVE_AGENT_FWD:
472483
int libssh2_channel_request_auth_agent(LIBSSH2_CHANNEL *channel)

Diff for: ssh2/error_codes.c

+209-134
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ssh2/error_codes.pxd

+8-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ cdef extern from "libssh2.h" nogil:
2626
_LIBSSH2_ERROR_SOCKET_NONE "LIBSSH2_ERROR_SOCKET_NONE"
2727
_LIBSSH2_ERROR_BANNER_RECV "LIBSSH2_ERROR_BANNER_RECV"
2828
_LIBSSH2_ERROR_BANNER_SEND "LIBSSH2_ERROR_BANNER_SEND"
29+
_LIBSSH2_ERROR_INVALID_MAC "LIBSSH2_ERROR_INVALID_MAC"
30+
_LIBSSH2_ERROR_KEX_FAILURE "LIBSSH2_ERROR_KEX_FAILURE"
31+
_LIBSSH2_ERROR_ALLOC "LIBSSH2_ERROR_ALLOC"
32+
_LIBSSH2_ERROR_SOCKET_SEND "LIBSSH2_ERROR_SOCKET_SEND"
2933
_LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE "LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE"
3034
_LIBSSH2_ERROR_TIMEOUT "LIBSSH2_ERROR_TIMEOUT"
3135
_LIBSSH2_ERROR_HOSTKEY_INIT "LIBSSH2_ERROR_HOSTKEY_INIT"
@@ -62,14 +66,16 @@ cdef extern from "libssh2.h" nogil:
6266
_LIBSSH2_ERROR_INVALID_POLL_TYPE "LIBSSH2_ERROR_INVALID_POLL_TYPE"
6367
_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL "LIBSSH2_ERROR_PUBLICKEY_PROTOCOL"
6468
_LIBSSH2_ERROR_EAGAIN "LIBSSH2_ERROR_EAGAIN"
65-
_LIBSSH2CHANNEL_EAGAIN "LIBSSH2_ERROR_EAGAIN"
6669
_LIBSSH2_ERROR_BUFFER_TOO_SMALL "LIBSSH2_ERROR_BUFFER_TOO_SMALL"
6770
_LIBSSH2_ERROR_BAD_USE "LIBSSH2_ERROR_BAD_USE"
6871
_LIBSSH2_ERROR_COMPRESS "LIBSSH2_ERROR_COMPRESS"
6972
_LIBSSH2_ERROR_OUT_OF_BOUNDARY "LIBSSH2_ERROR_OUT_OF_BOUNDARY"
7073
_LIBSSH2_ERROR_AGENT_PROTOCOL "LIBSSH2_ERROR_AGENT_PROTOCOL"
7174
_LIBSSH2_ERROR_SOCKET_RECV "LIBSSH2_ERROR_SOCKET_RECV"
72-
_LIBSSH2_ERROR_SOCKET_SEND "LIBSSH2_ERROR_SOCKET_SEND"
7375
_LIBSSH2_ERROR_ENCRYPT "LIBSSH2_ERROR_ENCRYPT"
7476
_LIBSSH2_ERROR_BAD_SOCKET "LIBSSH2_ERROR_BAD_SOCKET"
7577
_LIBSSH2_ERROR_KNOWN_HOSTS "LIBSSH2_ERROR_KNOWN_HOSTS"
78+
_LIBSSH2_ERROR_CHANNEL_WINDOW_FULL "LIBSSH2_ERROR_CHANNEL_WINDOW_FULL"
79+
_LIBSSH2_ERROR_KEYFILE_AUTH_FAILED "LIBSSH2_ERROR_KEYFILE_AUTH_FAILED"
80+
81+
_LIBSSH2CHANNEL_EAGAIN "LIBSSH2_ERROR_EAGAIN"

Diff for: ssh2/error_codes.pyx

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ LIBSSH2_ERROR_NONE = error_codes._LIBSSH2_ERROR_NONE
2222
LIBSSH2_ERROR_SOCKET_NONE = error_codes._LIBSSH2_ERROR_SOCKET_NONE
2323
LIBSSH2_ERROR_BANNER_RECV = error_codes._LIBSSH2_ERROR_BANNER_RECV
2424
LIBSSH2_ERROR_BANNER_SEND = error_codes._LIBSSH2_ERROR_BANNER_SEND
25+
LIBSSH2_ERROR_SOCKET_SEND = error_codes._LIBSSH2_ERROR_SOCKET_SEND
2526
LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE \
2627
= error_codes._LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE
2728
LIBSSH2_ERROR_TIMEOUT = error_codes._LIBSSH2_ERROR_TIMEOUT
@@ -69,8 +70,15 @@ LIBSSH2_ERROR_COMPRESS = error_codes._LIBSSH2_ERROR_COMPRESS
6970
LIBSSH2_ERROR_OUT_OF_BOUNDARY = error_codes._LIBSSH2_ERROR_OUT_OF_BOUNDARY
7071
LIBSSH2_ERROR_AGENT_PROTOCOL = error_codes._LIBSSH2_ERROR_AGENT_PROTOCOL
7172
LIBSSH2_ERROR_SOCKET_RECV = error_codes._LIBSSH2_ERROR_SOCKET_RECV
72-
LIBSSH2_ERROR_SOCKET_SEND = error_codes._LIBSSH2_ERROR_SOCKET_SEND
7373
LIBSSH2_ERROR_ENCRYPT = error_codes._LIBSSH2_ERROR_ENCRYPT
7474
LIBSSH2_ERROR_BAD_SOCKET = error_codes._LIBSSH2_ERROR_BAD_SOCKET
7575
IF EMBEDDED_LIB:
76+
LIBSSH2_ERROR_INVALID_MAC = error_codes._LIBSSH2_ERROR_INVALID_MAC
77+
LIBSSH2_ERROR_KEX_FAILURE = error_codes._LIBSSH2_ERROR_KEX_FAILURE
78+
LIBSSH2_ERROR_ALLOC = error_codes._LIBSSH2_ERROR_ALLOC
79+
7680
LIBSSH2_ERROR_KNOWN_HOSTS = error_codes._LIBSSH2_ERROR_KNOWN_HOSTS
81+
LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \
82+
error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL
83+
LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \
84+
error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED

0 commit comments

Comments
 (0)