From 2f60c9297cfa1fd34b4ab9b9a415a8e97a4cdfd7 Mon Sep 17 00:00:00 2001 From: Panos Date: Sat, 4 Oct 2025 18:28:15 +0100 Subject: [PATCH 1/3] Added new libssh2 error codes as python exceptions. Updated error handling for new error codes and exceptions. Updated tests. --- ssh2/error_codes.c | 205 ++++++++++----- ssh2/error_codes.pxd | 6 + ssh2/error_codes.pyx | 6 + ssh2/exceptions.c | 534 +++++++++++++++++++++++++++------------ ssh2/exceptions.pyx | 24 ++ ssh2/utils.c | 390 ++++++++++++++++++++-------- ssh2/utils.pyx | 12 + tests/test_exceptions.py | 13 +- 8 files changed, 863 insertions(+), 327 deletions(-) diff --git a/ssh2/error_codes.c b/ssh2/error_codes.c index c43478f3..1e16be10 100644 --- a/ssh2/error_codes.c +++ b/ssh2/error_codes.c @@ -1932,14 +1932,18 @@ static const char __pyx_k_LIBSSH2CHANNEL_EAGAIN[] = "LIBSSH2CHANNEL_EAGAIN"; static const char __pyx_k_LIBSSH2_ERROR_BAD_USE[] = "LIBSSH2_ERROR_BAD_USE"; static const char __pyx_k_LIBSSH2_ERROR_DECRYPT[] = "LIBSSH2_ERROR_DECRYPT"; static const char __pyx_k_LIBSSH2_ERROR_ENCRYPT[] = "LIBSSH2_ERROR_ENCRYPT"; +static const char __pyx_k_LIBSSH2_ERROR_RANDGEN[] = "LIBSSH2_ERROR_RANDGEN"; static const char __pyx_k_LIBSSH2_ERROR_TIMEOUT[] = "LIBSSH2_ERROR_TIMEOUT"; static const char __pyx_k_LIBSSH2_ERROR_COMPRESS[] = "LIBSSH2_ERROR_COMPRESS"; +static const char __pyx_k_LIBSSH2_ERROR_HASH_CALC[] = "LIBSSH2_ERROR_HASH_CALC"; +static const char __pyx_k_LIBSSH2_ERROR_HASH_INIT[] = "LIBSSH2_ERROR_HASH_INIT"; static const char __pyx_k_LIBSSH2_ERROR_BAD_SOCKET[] = "LIBSSH2_ERROR_BAD_SOCKET"; static const char __pyx_k_LIBSSH2_ERROR_BANNER_RECV[] = "LIBSSH2_ERROR_BANNER_RECV"; static const char __pyx_k_LIBSSH2_ERROR_BANNER_SEND[] = "LIBSSH2_ERROR_BANNER_SEND"; static const char __pyx_k_LIBSSH2_ERROR_INVALID_MAC[] = "LIBSSH2_ERROR_INVALID_MAC"; static const char __pyx_k_LIBSSH2_ERROR_KEX_FAILURE[] = "LIBSSH2_ERROR_KEX_FAILURE"; static const char __pyx_k_LIBSSH2_ERROR_KNOWN_HOSTS[] = "LIBSSH2_ERROR_KNOWN_HOSTS"; +static const char __pyx_k_LIBSSH2_ERROR_MAC_FAILURE[] = "LIBSSH2_ERROR_MAC_FAILURE"; static const char __pyx_k_LIBSSH2_ERROR_METHOD_NONE[] = "LIBSSH2_ERROR_METHOD_NONE"; static const char __pyx_k_LIBSSH2_ERROR_SOCKET_NONE[] = "LIBSSH2_ERROR_SOCKET_NONE"; static const char __pyx_k_LIBSSH2_ERROR_SOCKET_RECV[] = "LIBSSH2_ERROR_SOCKET_RECV"; @@ -1955,6 +1959,7 @@ static const char __pyx_k_LIBSSH2_ERROR_SOCKET_TIMEOUT[] = "LIBSSH2_ERROR_SOCKET static const char __pyx_k_LIBSSH2_ERROR_CHANNEL_FAILURE[] = "LIBSSH2_ERROR_CHANNEL_FAILURE"; static const char __pyx_k_LIBSSH2_ERROR_CHANNEL_UNKNOWN[] = "LIBSSH2_ERROR_CHANNEL_UNKNOWN"; static const char __pyx_k_LIBSSH2_ERROR_OUT_OF_BOUNDARY[] = "LIBSSH2_ERROR_OUT_OF_BOUNDARY"; +static const char __pyx_k_LIBSSH2_ERROR_ALGO_UNSUPPORTED[] = "LIBSSH2_ERROR_ALGO_UNSUPPORTED"; static const char __pyx_k_LIBSSH2_ERROR_BUFFER_TOO_SMALL[] = "LIBSSH2_ERROR_BUFFER_TOO_SMALL"; static const char __pyx_k_LIBSSH2_ERROR_CHANNEL_EOF_SENT[] = "LIBSSH2_ERROR_CHANNEL_EOF_SENT"; static const char __pyx_k_LIBSSH2_ERROR_PASSWORD_EXPIRED[] = "LIBSSH2_ERROR_PASSWORD_EXPIRED"; @@ -1969,6 +1974,7 @@ static const char __pyx_k_LIBSSH2_ERROR_CHANNEL_WINDOW_FUL[] = "LIBSSH2_ERROR_CH static const char __pyx_k_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE[] = "LIBSSH2_ERROR_KEYFILE_AUTH_FAILED"; static const char __pyx_k_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU[] = "LIBSSH2_ERROR_KEY_EXCHANGE_FAILURE"; static const char __pyx_k_LIBSSH2_ERROR_METHOD_NOT_SUPPORT[] = "LIBSSH2_ERROR_METHOD_NOT_SUPPORTED"; +static const char __pyx_k_LIBSSH2_ERROR_MISSING_USERAUTH_B[] = "LIBSSH2_ERROR_MISSING_USERAUTH_BANNER"; static const char __pyx_k_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL[] = "LIBSSH2_ERROR_PUBLICKEY_PROTOCOL"; static const char __pyx_k_LIBSSH2_ERROR_PUBLICKEY_UNRECOGN[] = "LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED"; static const char __pyx_k_LIBSSH2_ERROR_PUBLICKEY_UNVERIFI[] = "LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED"; @@ -2011,7 +2017,7 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - PyObject *__pyx_string_tab[58]; + PyObject *__pyx_string_tab[64]; /* #### Code section: module_state_contents ### */ /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -2044,61 +2050,67 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_kp_u_ __pyx_string_tab[0] #define __pyx_n_u_LIBSSH2CHANNEL_EAGAIN __pyx_string_tab[1] #define __pyx_n_u_LIBSSH2_ERROR_AGENT_PROTOCOL __pyx_string_tab[2] -#define __pyx_n_u_LIBSSH2_ERROR_ALLOC __pyx_string_tab[3] -#define __pyx_n_u_LIBSSH2_ERROR_AUTHENTICATION_FAI __pyx_string_tab[4] -#define __pyx_n_u_LIBSSH2_ERROR_BAD_SOCKET __pyx_string_tab[5] -#define __pyx_n_u_LIBSSH2_ERROR_BAD_USE __pyx_string_tab[6] -#define __pyx_n_u_LIBSSH2_ERROR_BANNER_RECV __pyx_string_tab[7] -#define __pyx_n_u_LIBSSH2_ERROR_BANNER_SEND __pyx_string_tab[8] -#define __pyx_n_u_LIBSSH2_ERROR_BUFFER_TOO_SMALL __pyx_string_tab[9] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_CLOSED __pyx_string_tab[10] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_EOF_SENT __pyx_string_tab[11] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_FAILURE __pyx_string_tab[12] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_OUTOFORDER __pyx_string_tab[13] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_PACKET_EXC __pyx_string_tab[14] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_REQUEST_DE __pyx_string_tab[15] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_UNKNOWN __pyx_string_tab[16] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_WINDOW_EXC __pyx_string_tab[17] -#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_WINDOW_FUL __pyx_string_tab[18] -#define __pyx_n_u_LIBSSH2_ERROR_COMPRESS __pyx_string_tab[19] -#define __pyx_n_u_LIBSSH2_ERROR_DECRYPT __pyx_string_tab[20] -#define __pyx_n_u_LIBSSH2_ERROR_EAGAIN __pyx_string_tab[21] -#define __pyx_n_u_LIBSSH2_ERROR_ENCRYPT __pyx_string_tab[22] -#define __pyx_n_u_LIBSSH2_ERROR_FILE __pyx_string_tab[23] -#define __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_INIT __pyx_string_tab[24] -#define __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_SIGN __pyx_string_tab[25] -#define __pyx_n_u_LIBSSH2_ERROR_INVAL __pyx_string_tab[26] -#define __pyx_n_u_LIBSSH2_ERROR_INVALID_MAC __pyx_string_tab[27] -#define __pyx_n_u_LIBSSH2_ERROR_INVALID_POLL_TYPE __pyx_string_tab[28] -#define __pyx_n_u_LIBSSH2_ERROR_KEX_FAILURE __pyx_string_tab[29] -#define __pyx_n_u_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE __pyx_string_tab[30] -#define __pyx_n_u_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU __pyx_string_tab[31] -#define __pyx_n_u_LIBSSH2_ERROR_KNOWN_HOSTS __pyx_string_tab[32] -#define __pyx_n_u_LIBSSH2_ERROR_METHOD_NONE __pyx_string_tab[33] -#define __pyx_n_u_LIBSSH2_ERROR_METHOD_NOT_SUPPORT __pyx_string_tab[34] -#define __pyx_n_u_LIBSSH2_ERROR_NONE __pyx_string_tab[35] -#define __pyx_n_u_LIBSSH2_ERROR_OUT_OF_BOUNDARY __pyx_string_tab[36] -#define __pyx_n_u_LIBSSH2_ERROR_PASSWORD_EXPIRED __pyx_string_tab[37] -#define __pyx_n_u_LIBSSH2_ERROR_PROTO __pyx_string_tab[38] -#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL __pyx_string_tab[39] -#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNRECOGN __pyx_string_tab[40] -#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNVERIFI __pyx_string_tab[41] -#define __pyx_n_u_LIBSSH2_ERROR_REQUEST_DENIED __pyx_string_tab[42] -#define __pyx_n_u_LIBSSH2_ERROR_SCP_PROTOCOL __pyx_string_tab[43] -#define __pyx_n_u_LIBSSH2_ERROR_SFTP_PROTOCOL __pyx_string_tab[44] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_DISCONNECT __pyx_string_tab[45] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_NONE __pyx_string_tab[46] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_RECV __pyx_string_tab[47] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_SEND __pyx_string_tab[48] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_TIMEOUT __pyx_string_tab[49] -#define __pyx_n_u_LIBSSH2_ERROR_TIMEOUT __pyx_string_tab[50] -#define __pyx_n_u_LIBSSH2_ERROR_ZLIB __pyx_string_tab[51] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[52] -#define __pyx_n_u_main __pyx_string_tab[53] -#define __pyx_n_u_module __pyx_string_tab[54] -#define __pyx_n_u_name __pyx_string_tab[55] -#define __pyx_n_u_qualname __pyx_string_tab[56] -#define __pyx_n_u_test __pyx_string_tab[57] +#define __pyx_n_u_LIBSSH2_ERROR_ALGO_UNSUPPORTED __pyx_string_tab[3] +#define __pyx_n_u_LIBSSH2_ERROR_ALLOC __pyx_string_tab[4] +#define __pyx_n_u_LIBSSH2_ERROR_AUTHENTICATION_FAI __pyx_string_tab[5] +#define __pyx_n_u_LIBSSH2_ERROR_BAD_SOCKET __pyx_string_tab[6] +#define __pyx_n_u_LIBSSH2_ERROR_BAD_USE __pyx_string_tab[7] +#define __pyx_n_u_LIBSSH2_ERROR_BANNER_RECV __pyx_string_tab[8] +#define __pyx_n_u_LIBSSH2_ERROR_BANNER_SEND __pyx_string_tab[9] +#define __pyx_n_u_LIBSSH2_ERROR_BUFFER_TOO_SMALL __pyx_string_tab[10] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_CLOSED __pyx_string_tab[11] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_EOF_SENT __pyx_string_tab[12] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_FAILURE __pyx_string_tab[13] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_OUTOFORDER __pyx_string_tab[14] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_PACKET_EXC __pyx_string_tab[15] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_REQUEST_DE __pyx_string_tab[16] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_UNKNOWN __pyx_string_tab[17] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_WINDOW_EXC __pyx_string_tab[18] +#define __pyx_n_u_LIBSSH2_ERROR_CHANNEL_WINDOW_FUL __pyx_string_tab[19] +#define __pyx_n_u_LIBSSH2_ERROR_COMPRESS __pyx_string_tab[20] +#define __pyx_n_u_LIBSSH2_ERROR_DECRYPT __pyx_string_tab[21] +#define __pyx_n_u_LIBSSH2_ERROR_EAGAIN __pyx_string_tab[22] +#define __pyx_n_u_LIBSSH2_ERROR_ENCRYPT __pyx_string_tab[23] +#define __pyx_n_u_LIBSSH2_ERROR_FILE __pyx_string_tab[24] +#define __pyx_n_u_LIBSSH2_ERROR_HASH_CALC __pyx_string_tab[25] +#define __pyx_n_u_LIBSSH2_ERROR_HASH_INIT __pyx_string_tab[26] +#define __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_INIT __pyx_string_tab[27] +#define __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_SIGN __pyx_string_tab[28] +#define __pyx_n_u_LIBSSH2_ERROR_INVAL __pyx_string_tab[29] +#define __pyx_n_u_LIBSSH2_ERROR_INVALID_MAC __pyx_string_tab[30] +#define __pyx_n_u_LIBSSH2_ERROR_INVALID_POLL_TYPE __pyx_string_tab[31] +#define __pyx_n_u_LIBSSH2_ERROR_KEX_FAILURE __pyx_string_tab[32] +#define __pyx_n_u_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE __pyx_string_tab[33] +#define __pyx_n_u_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU __pyx_string_tab[34] +#define __pyx_n_u_LIBSSH2_ERROR_KNOWN_HOSTS __pyx_string_tab[35] +#define __pyx_n_u_LIBSSH2_ERROR_MAC_FAILURE __pyx_string_tab[36] +#define __pyx_n_u_LIBSSH2_ERROR_METHOD_NONE __pyx_string_tab[37] +#define __pyx_n_u_LIBSSH2_ERROR_METHOD_NOT_SUPPORT __pyx_string_tab[38] +#define __pyx_n_u_LIBSSH2_ERROR_MISSING_USERAUTH_B __pyx_string_tab[39] +#define __pyx_n_u_LIBSSH2_ERROR_NONE __pyx_string_tab[40] +#define __pyx_n_u_LIBSSH2_ERROR_OUT_OF_BOUNDARY __pyx_string_tab[41] +#define __pyx_n_u_LIBSSH2_ERROR_PASSWORD_EXPIRED __pyx_string_tab[42] +#define __pyx_n_u_LIBSSH2_ERROR_PROTO __pyx_string_tab[43] +#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL __pyx_string_tab[44] +#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNRECOGN __pyx_string_tab[45] +#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNVERIFI __pyx_string_tab[46] +#define __pyx_n_u_LIBSSH2_ERROR_RANDGEN __pyx_string_tab[47] +#define __pyx_n_u_LIBSSH2_ERROR_REQUEST_DENIED __pyx_string_tab[48] +#define __pyx_n_u_LIBSSH2_ERROR_SCP_PROTOCOL __pyx_string_tab[49] +#define __pyx_n_u_LIBSSH2_ERROR_SFTP_PROTOCOL __pyx_string_tab[50] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_DISCONNECT __pyx_string_tab[51] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_NONE __pyx_string_tab[52] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_RECV __pyx_string_tab[53] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_SEND __pyx_string_tab[54] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_TIMEOUT __pyx_string_tab[55] +#define __pyx_n_u_LIBSSH2_ERROR_TIMEOUT __pyx_string_tab[56] +#define __pyx_n_u_LIBSSH2_ERROR_ZLIB __pyx_string_tab[57] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[58] +#define __pyx_n_u_main __pyx_string_tab[59] +#define __pyx_n_u_module __pyx_string_tab[60] +#define __pyx_n_u_name __pyx_string_tab[61] +#define __pyx_n_u_qualname __pyx_string_tab[62] +#define __pyx_n_u_test __pyx_string_tab[63] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2119,7 +2131,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif - for (int i=0; i<58; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<64; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -2140,7 +2152,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - for (int i=0; i<58; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<64; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -3114,12 +3126,83 @@ __Pyx_RefNannySetupContext("PyInit_error_codes", 0); * error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL * LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ * error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN + * LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER */ __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_KEYFILE_AUTH_FAILED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "ssh2/error_codes.pyx":84 + * LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ + * error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED + * LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER + * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED +*/ + __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_RANDGEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_RANDGEN, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/error_codes.pyx":85 + * error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED + * LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN + * LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED + * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE +*/ + __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_MISSING_USERAUTH_BANNER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_MISSING_USERAUTH_B, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/error_codes.pyx":86 + * LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN + * LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER + * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE + * LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT +*/ + __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_ALGO_UNSUPPORTED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_ALGO_UNSUPPORTED, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/error_codes.pyx":87 + * LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER + * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED + * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT + * LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC +*/ + __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_MAC_FAILURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_MAC_FAILURE, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/error_codes.pyx":88 + * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED + * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE + * LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT # <<<<<<<<<<<<<< + * LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC +*/ + __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_HASH_INIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_HASH_INIT, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh2/error_codes.pyx":89 + * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE + * LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT + * LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC # <<<<<<<<<<<<<< +*/ + __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_HASH_CALC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_HASH_CALC, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "ssh2/error_codes.pyx":1 * # This file is part of ssh2-python. # <<<<<<<<<<<<<< * # Copyright (C) 2017-2020 Panos Kittenis @@ -3191,6 +3274,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ {__pyx_k_LIBSSH2CHANNEL_EAGAIN, sizeof(__pyx_k_LIBSSH2CHANNEL_EAGAIN), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2CHANNEL_EAGAIN */ {__pyx_k_LIBSSH2_ERROR_AGENT_PROTOCOL, sizeof(__pyx_k_LIBSSH2_ERROR_AGENT_PROTOCOL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_AGENT_PROTOCOL */ + {__pyx_k_LIBSSH2_ERROR_ALGO_UNSUPPORTED, sizeof(__pyx_k_LIBSSH2_ERROR_ALGO_UNSUPPORTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_ALGO_UNSUPPORTED */ {__pyx_k_LIBSSH2_ERROR_ALLOC, sizeof(__pyx_k_LIBSSH2_ERROR_ALLOC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_ALLOC */ {__pyx_k_LIBSSH2_ERROR_AUTHENTICATION_FAI, sizeof(__pyx_k_LIBSSH2_ERROR_AUTHENTICATION_FAI), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_AUTHENTICATION_FAI */ {__pyx_k_LIBSSH2_ERROR_BAD_SOCKET, sizeof(__pyx_k_LIBSSH2_ERROR_BAD_SOCKET), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_BAD_SOCKET */ @@ -3212,6 +3296,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_LIBSSH2_ERROR_EAGAIN, sizeof(__pyx_k_LIBSSH2_ERROR_EAGAIN), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_EAGAIN */ {__pyx_k_LIBSSH2_ERROR_ENCRYPT, sizeof(__pyx_k_LIBSSH2_ERROR_ENCRYPT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_ENCRYPT */ {__pyx_k_LIBSSH2_ERROR_FILE, sizeof(__pyx_k_LIBSSH2_ERROR_FILE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_FILE */ + {__pyx_k_LIBSSH2_ERROR_HASH_CALC, sizeof(__pyx_k_LIBSSH2_ERROR_HASH_CALC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_HASH_CALC */ + {__pyx_k_LIBSSH2_ERROR_HASH_INIT, sizeof(__pyx_k_LIBSSH2_ERROR_HASH_INIT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_HASH_INIT */ {__pyx_k_LIBSSH2_ERROR_HOSTKEY_INIT, sizeof(__pyx_k_LIBSSH2_ERROR_HOSTKEY_INIT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_INIT */ {__pyx_k_LIBSSH2_ERROR_HOSTKEY_SIGN, sizeof(__pyx_k_LIBSSH2_ERROR_HOSTKEY_SIGN), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_SIGN */ {__pyx_k_LIBSSH2_ERROR_INVAL, sizeof(__pyx_k_LIBSSH2_ERROR_INVAL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_INVAL */ @@ -3221,8 +3307,10 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE, sizeof(__pyx_k_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE */ {__pyx_k_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU, sizeof(__pyx_k_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU */ {__pyx_k_LIBSSH2_ERROR_KNOWN_HOSTS, sizeof(__pyx_k_LIBSSH2_ERROR_KNOWN_HOSTS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_KNOWN_HOSTS */ + {__pyx_k_LIBSSH2_ERROR_MAC_FAILURE, sizeof(__pyx_k_LIBSSH2_ERROR_MAC_FAILURE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_MAC_FAILURE */ {__pyx_k_LIBSSH2_ERROR_METHOD_NONE, sizeof(__pyx_k_LIBSSH2_ERROR_METHOD_NONE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_METHOD_NONE */ {__pyx_k_LIBSSH2_ERROR_METHOD_NOT_SUPPORT, sizeof(__pyx_k_LIBSSH2_ERROR_METHOD_NOT_SUPPORT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_METHOD_NOT_SUPPORT */ + {__pyx_k_LIBSSH2_ERROR_MISSING_USERAUTH_B, sizeof(__pyx_k_LIBSSH2_ERROR_MISSING_USERAUTH_B), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_MISSING_USERAUTH_B */ {__pyx_k_LIBSSH2_ERROR_NONE, sizeof(__pyx_k_LIBSSH2_ERROR_NONE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_NONE */ {__pyx_k_LIBSSH2_ERROR_OUT_OF_BOUNDARY, sizeof(__pyx_k_LIBSSH2_ERROR_OUT_OF_BOUNDARY), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_OUT_OF_BOUNDARY */ {__pyx_k_LIBSSH2_ERROR_PASSWORD_EXPIRED, sizeof(__pyx_k_LIBSSH2_ERROR_PASSWORD_EXPIRED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_PASSWORD_EXPIRED */ @@ -3230,6 +3318,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL, sizeof(__pyx_k_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL */ {__pyx_k_LIBSSH2_ERROR_PUBLICKEY_UNRECOGN, sizeof(__pyx_k_LIBSSH2_ERROR_PUBLICKEY_UNRECOGN), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNRECOGN */ {__pyx_k_LIBSSH2_ERROR_PUBLICKEY_UNVERIFI, sizeof(__pyx_k_LIBSSH2_ERROR_PUBLICKEY_UNVERIFI), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNVERIFI */ + {__pyx_k_LIBSSH2_ERROR_RANDGEN, sizeof(__pyx_k_LIBSSH2_ERROR_RANDGEN), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_RANDGEN */ {__pyx_k_LIBSSH2_ERROR_REQUEST_DENIED, sizeof(__pyx_k_LIBSSH2_ERROR_REQUEST_DENIED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_REQUEST_DENIED */ {__pyx_k_LIBSSH2_ERROR_SCP_PROTOCOL, sizeof(__pyx_k_LIBSSH2_ERROR_SCP_PROTOCOL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_SCP_PROTOCOL */ {__pyx_k_LIBSSH2_ERROR_SFTP_PROTOCOL, sizeof(__pyx_k_LIBSSH2_ERROR_SFTP_PROTOCOL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_SFTP_PROTOCOL */ diff --git a/ssh2/error_codes.pxd b/ssh2/error_codes.pxd index 3ac36330..2622416d 100644 --- a/ssh2/error_codes.pxd +++ b/ssh2/error_codes.pxd @@ -77,5 +77,11 @@ cdef extern from "libssh2.h" nogil: _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" + _LIBSSH2_ERROR_RANDGEN "LIBSSH2_ERROR_RANDGEN" + _LIBSSH2_ERROR_MISSING_USERAUTH_BANNER "LIBSSH2_ERROR_MISSING_USERAUTH_BANNER" + _LIBSSH2_ERROR_ALGO_UNSUPPORTED "LIBSSH2_ERROR_ALGO_UNSUPPORTED" + _LIBSSH2_ERROR_MAC_FAILURE "LIBSSH2_ERROR_MAC_FAILURE" + _LIBSSH2_ERROR_HASH_INIT "LIBSSH2_ERROR_HASH_INIT" + _LIBSSH2_ERROR_HASH_CALC "LIBSSH2_ERROR_HASH_CALC" _LIBSSH2CHANNEL_EAGAIN "LIBSSH2_ERROR_EAGAIN" diff --git a/ssh2/error_codes.pyx b/ssh2/error_codes.pyx index 0fa974f9..139059c4 100644 --- a/ssh2/error_codes.pyx +++ b/ssh2/error_codes.pyx @@ -81,3 +81,9 @@ LIBSSH2_ERROR_CHANNEL_WINDOW_FULL = \ error_codes._LIBSSH2_ERROR_CHANNEL_WINDOW_FULL LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED +LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN +LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER +LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED +LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE +LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT +LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC diff --git a/ssh2/exceptions.c b/ssh2/exceptions.c index 258af02d..2c8590d4 100644 --- a/ssh2/exceptions.c +++ b/ssh2/exceptions.c @@ -1967,9 +1967,12 @@ static const char __pyx_k_mro_entries[] = "__mro_entries__"; static const char __pyx_k_ChannelError[] = "ChannelError"; static const char __pyx_k_DecryptError[] = "DecryptError"; static const char __pyx_k_EncryptError[] = "EncryptError"; +static const char __pyx_k_RandGenError[] = "RandGenError"; static const char __pyx_k_SessionError[] = "SessionError"; static const char __pyx_k_UnknownError[] = "UnknownError"; static const char __pyx_k_CompressError[] = "CompressError"; +static const char __pyx_k_HashCalcError[] = "HashCalcError"; +static const char __pyx_k_HashInitError[] = "HashInitError"; static const char __pyx_k_ProtocolError[] = "ProtocolError"; static const char __pyx_k_SocketTimeout[] = "SocketTimeout"; static const char __pyx_k_BadSocketError[] = "BadSocketError"; @@ -1980,6 +1983,7 @@ static const char __pyx_k_BannerRecvError[] = "BannerRecvError"; static const char __pyx_k_BannerSendError[] = "BannerSendError"; static const char __pyx_k_InvalidMACError[] = "InvalidMACError"; static const char __pyx_k_KexFailureError[] = "KexFailureError"; +static const char __pyx_k_MacFailureError[] = "MacFailureError"; static const char __pyx_k_MethodNoneError[] = "MethodNoneError"; static const char __pyx_k_SFTPHandleError[] = "SFTPHandleError"; static const char __pyx_k_SocketRecvError[] = "SocketRecvError"; @@ -2009,6 +2013,7 @@ static const char __pyx_k_KnownHostCheckError[] = "KnownHostCheckError"; static const char __pyx_k_SessionHostKeyError[] = "SessionHostKeyError"; static const char __pyx_k_SessionStartupError[] = "SessionStartupError"; static const char __pyx_k_AgentConnectionError[] = "AgentConnectionError"; +static const char __pyx_k_AlgoUnsupportedError[] = "AlgoUnsupportedError"; static const char __pyx_k_ChannelRequestDenied[] = "ChannelRequestDenied"; static const char __pyx_k_InvalidPollTypeError[] = "InvalidPollTypeError"; static const char __pyx_k_KnownHostDeleteError[] = "KnownHostDeleteError"; @@ -2037,10 +2042,12 @@ static const char __pyx_k_PublickeyUnverifiedError[] = "PublickeyUnverifiedError static const char __pyx_k_Raised_on_protocol_errors[] = "Raised on protocol errors"; static const char __pyx_k_Raised_on_socket_timeouts[] = "Raised on socket timeouts"; static const char __pyx_k_Base_class_for_SFTP_errors[] = "Base class for SFTP errors"; +static const char __pyx_k_MissingUserAuthBannerError[] = "MissingUserAuthBannerError"; static const char __pyx_k_Raised_on_allocation_error[] = "Raised on allocation error"; static const char __pyx_k_Raised_on_channel_failures[] = "Raised on channel failures"; static const char __pyx_k_KnownHostCheckMisMatchError[] = "KnownHostCheckMisMatchError"; static const char __pyx_k_KnownHostCheckNotFoundError[] = "KnownHostCheckNotFoundError"; +static const char __pyx_k_Raised_on_MAC_failure_error[] = "Raised on MAC failure error"; static const char __pyx_k_Raised_on_decryption_errors[] = "Raised on decryption errors"; static const char __pyx_k_Raised_on_encryption_errors[] = "Raised on encryption errors"; static const char __pyx_k_Raised_on_API_bad_use_errors[] = "Raised on API bad use errors"; @@ -2060,6 +2067,7 @@ static const char __pyx_k_Raised_on_invalid_method_errors[] = "Raised on invalid static const char __pyx_k_Raised_on_keys_do_not_match_for[] = "Raised on keys do not match for known host"; static const char __pyx_k_Raised_on_request_denied_errors[] = "Raised on request denied errors"; static const char __pyx_k_Raised_on_socket_receive_errors[] = "Raised on socket receive errors"; +static const char __pyx_k_Raised_on_unsupported_algorithm[] = "Raised on unsupported algorithm error"; static const char __pyx_k_Base_class_for_all_SSH_Agent_err[] = "Base class for all SSH Agent errors"; static const char __pyx_k_Base_class_for_all_authenticatio[] = "Base class for all authentication errors"; static const char __pyx_k_Base_class_for_all_channel_error[] = "Base class for all channel errors"; @@ -2089,15 +2097,19 @@ static const char __pyx_k_Raised_on_errors_retrieving_know[] = "Raised on errors static const char __pyx_k_Raised_on_errors_signing_host_ke[] = "Raised on errors signing host key"; static const char __pyx_k_Raised_on_errors_writing_line_to[] = "Raised on errors writing line to known hosts file"; static const char __pyx_k_Raised_on_errors_writing_to_know[] = "Raised on errors writing to known hosts file"; +static const char __pyx_k_Raised_on_hash_calculation_error[] = "Raised on hash calculation error"; +static const char __pyx_k_Raised_on_hash_initialisation_er[] = "Raised on hash initialisation error"; static const char __pyx_k_Raised_on_invalid_poll_type_erro[] = "Raised on invalid poll type errors"; static const char __pyx_k_Raised_on_invalid_request_errors[] = "Raised on invalid request errors"; static const char __pyx_k_Raised_on_key_file_authenticatio[] = "Raised on key file authentication error"; +static const char __pyx_k_Raised_on_missing_user_authentic[] = "Raised on missing user authentication banner error"; static const char __pyx_k_Raised_on_no_match_for_known_hos[] = "Raised on no match for known host check"; static const char __pyx_k_Raised_on_non_specific_or_unknow[] = "Raised on non-specific or unknown errors"; static const char __pyx_k_Raised_on_out_of_boundary_errors[] = "Raised on out of boundary errors"; static const char __pyx_k_Raised_on_password_expired_error[] = "Raised on password expired errors"; static const char __pyx_k_Raised_on_public_key_protocol_er[] = "Raised on public key protocol errors"; static const char __pyx_k_Raised_on_public_key_verificatio[] = "Raised on public key verification errors"; +static const char __pyx_k_Raised_on_randon_number_generato[] = "Raised on randon number generator errors"; static const char __pyx_k_Raised_on_session_handshake_erro[] = "Raised on session handshake errors"; static const char __pyx_k_Raised_on_session_startup_errors[] = "Raised on session startup errors"; static const char __pyx_k_Raised_on_socket_disconnection_e[] = "Raised on socket disconnection errors"; @@ -2143,7 +2155,7 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - PyObject *__pyx_string_tab[158]; + PyObject *__pyx_string_tab[170]; /* #### Code section: module_state_contents ### */ /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -2180,157 +2192,169 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_AgentGetIdentityError __pyx_string_tab[4] #define __pyx_n_u_AgentListIdentitiesError __pyx_string_tab[5] #define __pyx_n_u_AgentProtocolError __pyx_string_tab[6] -#define __pyx_n_u_AllocError __pyx_string_tab[7] -#define __pyx_n_u_AuthenticationError __pyx_string_tab[8] -#define __pyx_n_u_BadSocketError __pyx_string_tab[9] -#define __pyx_n_u_BadUseError __pyx_string_tab[10] -#define __pyx_n_u_BannerRecvError __pyx_string_tab[11] -#define __pyx_n_u_BannerSendError __pyx_string_tab[12] -#define __pyx_kp_u_Base_class_for_KnownHost_errors __pyx_string_tab[13] -#define __pyx_kp_u_Base_class_for_SFTP_errors __pyx_string_tab[14] -#define __pyx_kp_u_Base_class_for_all_SSH_Agent_err __pyx_string_tab[15] -#define __pyx_kp_u_Base_class_for_all_authenticatio __pyx_string_tab[16] -#define __pyx_kp_u_Base_class_for_all_channel_error __pyx_string_tab[17] -#define __pyx_kp_u_Base_class_for_all_public_key_pr __pyx_string_tab[18] -#define __pyx_kp_u_Base_class_for_all_session_error __pyx_string_tab[19] -#define __pyx_kp_u_Base_class_for_all_ssh2_python_e __pyx_string_tab[20] -#define __pyx_n_u_BufferTooSmallError __pyx_string_tab[21] -#define __pyx_n_u_ChannelClosedError __pyx_string_tab[22] -#define __pyx_n_u_ChannelEOFSentError __pyx_string_tab[23] -#define __pyx_n_u_ChannelError __pyx_string_tab[24] -#define __pyx_n_u_ChannelFailure __pyx_string_tab[25] -#define __pyx_n_u_ChannelOutOfOrderError __pyx_string_tab[26] -#define __pyx_n_u_ChannelPacketExceeded __pyx_string_tab[27] -#define __pyx_n_u_ChannelRequestDenied __pyx_string_tab[28] -#define __pyx_n_u_ChannelUnknownError __pyx_string_tab[29] -#define __pyx_n_u_ChannelWindowExceeded __pyx_string_tab[30] -#define __pyx_n_u_ChannelWindowFullError __pyx_string_tab[31] -#define __pyx_n_u_CompressError __pyx_string_tab[32] -#define __pyx_n_u_DecryptError __pyx_string_tab[33] -#define __pyx_n_u_EncryptError __pyx_string_tab[34] -#define __pyx_n_u_FileError __pyx_string_tab[35] -#define __pyx_n_u_HostkeyInitError __pyx_string_tab[36] -#define __pyx_n_u_HostkeySignError __pyx_string_tab[37] -#define __pyx_n_u_InvalidMACError __pyx_string_tab[38] -#define __pyx_n_u_InvalidPollTypeError __pyx_string_tab[39] -#define __pyx_n_u_InvalidRequestError __pyx_string_tab[40] -#define __pyx_n_u_KexFailureError __pyx_string_tab[41] -#define __pyx_n_u_KeyExchangeError __pyx_string_tab[42] -#define __pyx_n_u_KeyfileAuthFailedError __pyx_string_tab[43] -#define __pyx_n_u_KnownHostAddError __pyx_string_tab[44] -#define __pyx_n_u_KnownHostCheckError __pyx_string_tab[45] -#define __pyx_n_u_KnownHostCheckFailure __pyx_string_tab[46] -#define __pyx_n_u_KnownHostCheckMisMatchError __pyx_string_tab[47] -#define __pyx_n_u_KnownHostCheckNotFoundError __pyx_string_tab[48] -#define __pyx_n_u_KnownHostDeleteError __pyx_string_tab[49] -#define __pyx_n_u_KnownHostError __pyx_string_tab[50] -#define __pyx_n_u_KnownHostGetError __pyx_string_tab[51] -#define __pyx_n_u_KnownHostReadFileError __pyx_string_tab[52] -#define __pyx_n_u_KnownHostReadLineError __pyx_string_tab[53] -#define __pyx_n_u_KnownHostWriteFileError __pyx_string_tab[54] -#define __pyx_n_u_KnownHostWriteLineError __pyx_string_tab[55] -#define __pyx_n_u_MethodNoneError __pyx_string_tab[56] -#define __pyx_n_u_MethodNotSupported __pyx_string_tab[57] -#define __pyx_n_u_OutOfBoundaryError __pyx_string_tab[58] -#define __pyx_n_u_PasswordExpiredError __pyx_string_tab[59] -#define __pyx_n_u_ProtocolError __pyx_string_tab[60] -#define __pyx_n_u_PublicKeyError __pyx_string_tab[61] -#define __pyx_n_u_PublicKeyInitError __pyx_string_tab[62] -#define __pyx_n_u_PublicKeyProtocolError __pyx_string_tab[63] -#define __pyx_n_u_PublickeyUnverifiedError __pyx_string_tab[64] -#define __pyx_kp_u_Raised_on_API_bad_use_errors __pyx_string_tab[65] -#define __pyx_kp_u_Raised_on_KEX_failure __pyx_string_tab[66] -#define __pyx_kp_u_Raised_on_SCP_protocol_errors __pyx_string_tab[67] -#define __pyx_kp_u_Raised_on_SFTP_handle_errors __pyx_string_tab[68] -#define __pyx_kp_u_Raised_on_SFTP_protocol_errors __pyx_string_tab[69] -#define __pyx_kp_u_Raised_on_SSH_Agent_authenticati __pyx_string_tab[70] -#define __pyx_kp_u_Raised_on_SSH_Agent_connection_e __pyx_string_tab[71] -#define __pyx_kp_u_Raised_on_SSH_Agent_get_identity __pyx_string_tab[72] -#define __pyx_kp_u_Raised_on_SSH_Agent_list_identit __pyx_string_tab[73] -#define __pyx_kp_u_Raised_on_SSH_agent_protocol_err __pyx_string_tab[74] -#define __pyx_kp_u_Raised_on_allocation_error __pyx_string_tab[75] -#define __pyx_kp_u_Raised_on_any_known_host_check_e __pyx_string_tab[76] -#define __pyx_kp_u_Raised_on_authentication_method __pyx_string_tab[77] -#define __pyx_kp_u_Raised_on_buffer_too_small_error __pyx_string_tab[78] -#define __pyx_kp_u_Raised_on_channel_EOF_errors __pyx_string_tab[79] -#define __pyx_kp_u_Raised_on_channel_closed_errors __pyx_string_tab[80] -#define __pyx_kp_u_Raised_on_channel_commands_out_o __pyx_string_tab[81] -#define __pyx_kp_u_Raised_on_channel_failures __pyx_string_tab[82] -#define __pyx_kp_u_Raised_on_channel_max_packet_len __pyx_string_tab[83] -#define __pyx_kp_u_Raised_on_channel_request_denied __pyx_string_tab[84] -#define __pyx_kp_u_Raised_on_channel_window_exceede __pyx_string_tab[85] -#define __pyx_kp_u_Raised_on_channel_window_full_er __pyx_string_tab[86] -#define __pyx_kp_u_Raised_on_compression_errors __pyx_string_tab[87] -#define __pyx_kp_u_Raised_on_decryption_errors __pyx_string_tab[88] -#define __pyx_kp_u_Raised_on_encryption_errors __pyx_string_tab[89] -#define __pyx_kp_u_Raised_on_errors_adding_known_ho __pyx_string_tab[90] -#define __pyx_kp_u_Raised_on_errors_deleting_known __pyx_string_tab[91] -#define __pyx_kp_u_Raised_on_errors_exchanging_keys __pyx_string_tab[92] -#define __pyx_kp_u_Raised_on_errors_getting_server __pyx_string_tab[93] -#define __pyx_kp_u_Raised_on_errors_initialiasing_h __pyx_string_tab[94] -#define __pyx_kp_u_Raised_on_errors_initialising_pu __pyx_string_tab[95] -#define __pyx_kp_u_Raised_on_errors_reading_from_kn __pyx_string_tab[96] -#define __pyx_kp_u_Raised_on_errors_reading_line_fr __pyx_string_tab[97] -#define __pyx_kp_u_Raised_on_errors_receiving_banne __pyx_string_tab[98] -#define __pyx_kp_u_Raised_on_errors_retrieving_know __pyx_string_tab[99] -#define __pyx_kp_u_Raised_on_errors_sending_banner __pyx_string_tab[100] -#define __pyx_kp_u_Raised_on_errors_signing_host_ke __pyx_string_tab[101] -#define __pyx_kp_u_Raised_on_errors_writing_line_to __pyx_string_tab[102] -#define __pyx_kp_u_Raised_on_errors_writing_to_know __pyx_string_tab[103] -#define __pyx_kp_u_Raised_on_file_errors __pyx_string_tab[104] -#define __pyx_kp_u_Raised_on_invalid_MAC __pyx_string_tab[105] -#define __pyx_kp_u_Raised_on_invalid_method_errors __pyx_string_tab[106] -#define __pyx_kp_u_Raised_on_invalid_poll_type_erro __pyx_string_tab[107] -#define __pyx_kp_u_Raised_on_invalid_request_errors __pyx_string_tab[108] -#define __pyx_kp_u_Raised_on_key_file_authenticatio __pyx_string_tab[109] -#define __pyx_kp_u_Raised_on_keys_do_not_match_for __pyx_string_tab[110] -#define __pyx_kp_u_Raised_on_no_match_for_known_hos __pyx_string_tab[111] -#define __pyx_kp_u_Raised_on_non_specific_or_unknow __pyx_string_tab[112] -#define __pyx_kp_u_Raised_on_out_of_boundary_errors __pyx_string_tab[113] -#define __pyx_kp_u_Raised_on_password_expired_error __pyx_string_tab[114] -#define __pyx_kp_u_Raised_on_protocol_errors __pyx_string_tab[115] -#define __pyx_kp_u_Raised_on_public_key_protocol_er __pyx_string_tab[116] -#define __pyx_kp_u_Raised_on_public_key_verificatio __pyx_string_tab[117] -#define __pyx_kp_u_Raised_on_request_denied_errors __pyx_string_tab[118] -#define __pyx_kp_u_Raised_on_session_handshake_erro __pyx_string_tab[119] -#define __pyx_kp_u_Raised_on_session_startup_errors __pyx_string_tab[120] -#define __pyx_kp_u_Raised_on_socket_disconnection_e __pyx_string_tab[121] -#define __pyx_kp_u_Raised_on_socket_receive_errors __pyx_string_tab[122] -#define __pyx_kp_u_Raised_on_socket_send_errors __pyx_string_tab[123] -#define __pyx_kp_u_Raised_on_socket_timeouts __pyx_string_tab[124] -#define __pyx_kp_u_Raised_on_something_preventing_k __pyx_string_tab[125] -#define __pyx_kp_u_Raised_on_timeouts __pyx_string_tab[126] -#define __pyx_kp_u_Raised_on_unknown_channel_errors __pyx_string_tab[127] -#define __pyx_kp_u_Raised_on_use_of_bad_socket_erro __pyx_string_tab[128] -#define __pyx_kp_u_Raised_on_zlib_errors __pyx_string_tab[129] -#define __pyx_n_u_RequestDeniedError __pyx_string_tab[130] -#define __pyx_n_u_SCPProtocolError __pyx_string_tab[131] -#define __pyx_n_u_SFTPError __pyx_string_tab[132] -#define __pyx_n_u_SFTPHandleError __pyx_string_tab[133] -#define __pyx_n_u_SFTPProtocolError __pyx_string_tab[134] -#define __pyx_n_u_SSH2Error __pyx_string_tab[135] -#define __pyx_n_u_SessionError __pyx_string_tab[136] -#define __pyx_n_u_SessionHandshakeError __pyx_string_tab[137] -#define __pyx_n_u_SessionHostKeyError __pyx_string_tab[138] -#define __pyx_n_u_SessionStartupError __pyx_string_tab[139] -#define __pyx_n_u_SocketDisconnectError __pyx_string_tab[140] -#define __pyx_n_u_SocketRecvError __pyx_string_tab[141] -#define __pyx_n_u_SocketSendError __pyx_string_tab[142] -#define __pyx_n_u_SocketTimeout __pyx_string_tab[143] -#define __pyx_n_u_Timeout __pyx_string_tab[144] -#define __pyx_n_u_UnknownError __pyx_string_tab[145] -#define __pyx_n_u_ZlibError __pyx_string_tab[146] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[147] -#define __pyx_n_u_doc __pyx_string_tab[148] -#define __pyx_n_u_main __pyx_string_tab[149] -#define __pyx_n_u_metaclass __pyx_string_tab[150] -#define __pyx_n_u_module __pyx_string_tab[151] -#define __pyx_n_u_mro_entries __pyx_string_tab[152] -#define __pyx_n_u_name __pyx_string_tab[153] -#define __pyx_n_u_prepare __pyx_string_tab[154] -#define __pyx_n_u_qualname __pyx_string_tab[155] -#define __pyx_n_u_ssh2_exceptions __pyx_string_tab[156] -#define __pyx_n_u_test __pyx_string_tab[157] +#define __pyx_n_u_AlgoUnsupportedError __pyx_string_tab[7] +#define __pyx_n_u_AllocError __pyx_string_tab[8] +#define __pyx_n_u_AuthenticationError __pyx_string_tab[9] +#define __pyx_n_u_BadSocketError __pyx_string_tab[10] +#define __pyx_n_u_BadUseError __pyx_string_tab[11] +#define __pyx_n_u_BannerRecvError __pyx_string_tab[12] +#define __pyx_n_u_BannerSendError __pyx_string_tab[13] +#define __pyx_kp_u_Base_class_for_KnownHost_errors __pyx_string_tab[14] +#define __pyx_kp_u_Base_class_for_SFTP_errors __pyx_string_tab[15] +#define __pyx_kp_u_Base_class_for_all_SSH_Agent_err __pyx_string_tab[16] +#define __pyx_kp_u_Base_class_for_all_authenticatio __pyx_string_tab[17] +#define __pyx_kp_u_Base_class_for_all_channel_error __pyx_string_tab[18] +#define __pyx_kp_u_Base_class_for_all_public_key_pr __pyx_string_tab[19] +#define __pyx_kp_u_Base_class_for_all_session_error __pyx_string_tab[20] +#define __pyx_kp_u_Base_class_for_all_ssh2_python_e __pyx_string_tab[21] +#define __pyx_n_u_BufferTooSmallError __pyx_string_tab[22] +#define __pyx_n_u_ChannelClosedError __pyx_string_tab[23] +#define __pyx_n_u_ChannelEOFSentError __pyx_string_tab[24] +#define __pyx_n_u_ChannelError __pyx_string_tab[25] +#define __pyx_n_u_ChannelFailure __pyx_string_tab[26] +#define __pyx_n_u_ChannelOutOfOrderError __pyx_string_tab[27] +#define __pyx_n_u_ChannelPacketExceeded __pyx_string_tab[28] +#define __pyx_n_u_ChannelRequestDenied __pyx_string_tab[29] +#define __pyx_n_u_ChannelUnknownError __pyx_string_tab[30] +#define __pyx_n_u_ChannelWindowExceeded __pyx_string_tab[31] +#define __pyx_n_u_ChannelWindowFullError __pyx_string_tab[32] +#define __pyx_n_u_CompressError __pyx_string_tab[33] +#define __pyx_n_u_DecryptError __pyx_string_tab[34] +#define __pyx_n_u_EncryptError __pyx_string_tab[35] +#define __pyx_n_u_FileError __pyx_string_tab[36] +#define __pyx_n_u_HashCalcError __pyx_string_tab[37] +#define __pyx_n_u_HashInitError __pyx_string_tab[38] +#define __pyx_n_u_HostkeyInitError __pyx_string_tab[39] +#define __pyx_n_u_HostkeySignError __pyx_string_tab[40] +#define __pyx_n_u_InvalidMACError __pyx_string_tab[41] +#define __pyx_n_u_InvalidPollTypeError __pyx_string_tab[42] +#define __pyx_n_u_InvalidRequestError __pyx_string_tab[43] +#define __pyx_n_u_KexFailureError __pyx_string_tab[44] +#define __pyx_n_u_KeyExchangeError __pyx_string_tab[45] +#define __pyx_n_u_KeyfileAuthFailedError __pyx_string_tab[46] +#define __pyx_n_u_KnownHostAddError __pyx_string_tab[47] +#define __pyx_n_u_KnownHostCheckError __pyx_string_tab[48] +#define __pyx_n_u_KnownHostCheckFailure __pyx_string_tab[49] +#define __pyx_n_u_KnownHostCheckMisMatchError __pyx_string_tab[50] +#define __pyx_n_u_KnownHostCheckNotFoundError __pyx_string_tab[51] +#define __pyx_n_u_KnownHostDeleteError __pyx_string_tab[52] +#define __pyx_n_u_KnownHostError __pyx_string_tab[53] +#define __pyx_n_u_KnownHostGetError __pyx_string_tab[54] +#define __pyx_n_u_KnownHostReadFileError __pyx_string_tab[55] +#define __pyx_n_u_KnownHostReadLineError __pyx_string_tab[56] +#define __pyx_n_u_KnownHostWriteFileError __pyx_string_tab[57] +#define __pyx_n_u_KnownHostWriteLineError __pyx_string_tab[58] +#define __pyx_n_u_MacFailureError __pyx_string_tab[59] +#define __pyx_n_u_MethodNoneError __pyx_string_tab[60] +#define __pyx_n_u_MethodNotSupported __pyx_string_tab[61] +#define __pyx_n_u_MissingUserAuthBannerError __pyx_string_tab[62] +#define __pyx_n_u_OutOfBoundaryError __pyx_string_tab[63] +#define __pyx_n_u_PasswordExpiredError __pyx_string_tab[64] +#define __pyx_n_u_ProtocolError __pyx_string_tab[65] +#define __pyx_n_u_PublicKeyError __pyx_string_tab[66] +#define __pyx_n_u_PublicKeyInitError __pyx_string_tab[67] +#define __pyx_n_u_PublicKeyProtocolError __pyx_string_tab[68] +#define __pyx_n_u_PublickeyUnverifiedError __pyx_string_tab[69] +#define __pyx_kp_u_Raised_on_API_bad_use_errors __pyx_string_tab[70] +#define __pyx_kp_u_Raised_on_KEX_failure __pyx_string_tab[71] +#define __pyx_kp_u_Raised_on_MAC_failure_error __pyx_string_tab[72] +#define __pyx_kp_u_Raised_on_SCP_protocol_errors __pyx_string_tab[73] +#define __pyx_kp_u_Raised_on_SFTP_handle_errors __pyx_string_tab[74] +#define __pyx_kp_u_Raised_on_SFTP_protocol_errors __pyx_string_tab[75] +#define __pyx_kp_u_Raised_on_SSH_Agent_authenticati __pyx_string_tab[76] +#define __pyx_kp_u_Raised_on_SSH_Agent_connection_e __pyx_string_tab[77] +#define __pyx_kp_u_Raised_on_SSH_Agent_get_identity __pyx_string_tab[78] +#define __pyx_kp_u_Raised_on_SSH_Agent_list_identit __pyx_string_tab[79] +#define __pyx_kp_u_Raised_on_SSH_agent_protocol_err __pyx_string_tab[80] +#define __pyx_kp_u_Raised_on_allocation_error __pyx_string_tab[81] +#define __pyx_kp_u_Raised_on_any_known_host_check_e __pyx_string_tab[82] +#define __pyx_kp_u_Raised_on_authentication_method __pyx_string_tab[83] +#define __pyx_kp_u_Raised_on_buffer_too_small_error __pyx_string_tab[84] +#define __pyx_kp_u_Raised_on_channel_EOF_errors __pyx_string_tab[85] +#define __pyx_kp_u_Raised_on_channel_closed_errors __pyx_string_tab[86] +#define __pyx_kp_u_Raised_on_channel_commands_out_o __pyx_string_tab[87] +#define __pyx_kp_u_Raised_on_channel_failures __pyx_string_tab[88] +#define __pyx_kp_u_Raised_on_channel_max_packet_len __pyx_string_tab[89] +#define __pyx_kp_u_Raised_on_channel_request_denied __pyx_string_tab[90] +#define __pyx_kp_u_Raised_on_channel_window_exceede __pyx_string_tab[91] +#define __pyx_kp_u_Raised_on_channel_window_full_er __pyx_string_tab[92] +#define __pyx_kp_u_Raised_on_compression_errors __pyx_string_tab[93] +#define __pyx_kp_u_Raised_on_decryption_errors __pyx_string_tab[94] +#define __pyx_kp_u_Raised_on_encryption_errors __pyx_string_tab[95] +#define __pyx_kp_u_Raised_on_errors_adding_known_ho __pyx_string_tab[96] +#define __pyx_kp_u_Raised_on_errors_deleting_known __pyx_string_tab[97] +#define __pyx_kp_u_Raised_on_errors_exchanging_keys __pyx_string_tab[98] +#define __pyx_kp_u_Raised_on_errors_getting_server __pyx_string_tab[99] +#define __pyx_kp_u_Raised_on_errors_initialiasing_h __pyx_string_tab[100] +#define __pyx_kp_u_Raised_on_errors_initialising_pu __pyx_string_tab[101] +#define __pyx_kp_u_Raised_on_errors_reading_from_kn __pyx_string_tab[102] +#define __pyx_kp_u_Raised_on_errors_reading_line_fr __pyx_string_tab[103] +#define __pyx_kp_u_Raised_on_errors_receiving_banne __pyx_string_tab[104] +#define __pyx_kp_u_Raised_on_errors_retrieving_know __pyx_string_tab[105] +#define __pyx_kp_u_Raised_on_errors_sending_banner __pyx_string_tab[106] +#define __pyx_kp_u_Raised_on_errors_signing_host_ke __pyx_string_tab[107] +#define __pyx_kp_u_Raised_on_errors_writing_line_to __pyx_string_tab[108] +#define __pyx_kp_u_Raised_on_errors_writing_to_know __pyx_string_tab[109] +#define __pyx_kp_u_Raised_on_file_errors __pyx_string_tab[110] +#define __pyx_kp_u_Raised_on_hash_calculation_error __pyx_string_tab[111] +#define __pyx_kp_u_Raised_on_hash_initialisation_er __pyx_string_tab[112] +#define __pyx_kp_u_Raised_on_invalid_MAC __pyx_string_tab[113] +#define __pyx_kp_u_Raised_on_invalid_method_errors __pyx_string_tab[114] +#define __pyx_kp_u_Raised_on_invalid_poll_type_erro __pyx_string_tab[115] +#define __pyx_kp_u_Raised_on_invalid_request_errors __pyx_string_tab[116] +#define __pyx_kp_u_Raised_on_key_file_authenticatio __pyx_string_tab[117] +#define __pyx_kp_u_Raised_on_keys_do_not_match_for __pyx_string_tab[118] +#define __pyx_kp_u_Raised_on_missing_user_authentic __pyx_string_tab[119] +#define __pyx_kp_u_Raised_on_no_match_for_known_hos __pyx_string_tab[120] +#define __pyx_kp_u_Raised_on_non_specific_or_unknow __pyx_string_tab[121] +#define __pyx_kp_u_Raised_on_out_of_boundary_errors __pyx_string_tab[122] +#define __pyx_kp_u_Raised_on_password_expired_error __pyx_string_tab[123] +#define __pyx_kp_u_Raised_on_protocol_errors __pyx_string_tab[124] +#define __pyx_kp_u_Raised_on_public_key_protocol_er __pyx_string_tab[125] +#define __pyx_kp_u_Raised_on_public_key_verificatio __pyx_string_tab[126] +#define __pyx_kp_u_Raised_on_randon_number_generato __pyx_string_tab[127] +#define __pyx_kp_u_Raised_on_request_denied_errors __pyx_string_tab[128] +#define __pyx_kp_u_Raised_on_session_handshake_erro __pyx_string_tab[129] +#define __pyx_kp_u_Raised_on_session_startup_errors __pyx_string_tab[130] +#define __pyx_kp_u_Raised_on_socket_disconnection_e __pyx_string_tab[131] +#define __pyx_kp_u_Raised_on_socket_receive_errors __pyx_string_tab[132] +#define __pyx_kp_u_Raised_on_socket_send_errors __pyx_string_tab[133] +#define __pyx_kp_u_Raised_on_socket_timeouts __pyx_string_tab[134] +#define __pyx_kp_u_Raised_on_something_preventing_k __pyx_string_tab[135] +#define __pyx_kp_u_Raised_on_timeouts __pyx_string_tab[136] +#define __pyx_kp_u_Raised_on_unknown_channel_errors __pyx_string_tab[137] +#define __pyx_kp_u_Raised_on_unsupported_algorithm __pyx_string_tab[138] +#define __pyx_kp_u_Raised_on_use_of_bad_socket_erro __pyx_string_tab[139] +#define __pyx_kp_u_Raised_on_zlib_errors __pyx_string_tab[140] +#define __pyx_n_u_RandGenError __pyx_string_tab[141] +#define __pyx_n_u_RequestDeniedError __pyx_string_tab[142] +#define __pyx_n_u_SCPProtocolError __pyx_string_tab[143] +#define __pyx_n_u_SFTPError __pyx_string_tab[144] +#define __pyx_n_u_SFTPHandleError __pyx_string_tab[145] +#define __pyx_n_u_SFTPProtocolError __pyx_string_tab[146] +#define __pyx_n_u_SSH2Error __pyx_string_tab[147] +#define __pyx_n_u_SessionError __pyx_string_tab[148] +#define __pyx_n_u_SessionHandshakeError __pyx_string_tab[149] +#define __pyx_n_u_SessionHostKeyError __pyx_string_tab[150] +#define __pyx_n_u_SessionStartupError __pyx_string_tab[151] +#define __pyx_n_u_SocketDisconnectError __pyx_string_tab[152] +#define __pyx_n_u_SocketRecvError __pyx_string_tab[153] +#define __pyx_n_u_SocketSendError __pyx_string_tab[154] +#define __pyx_n_u_SocketTimeout __pyx_string_tab[155] +#define __pyx_n_u_Timeout __pyx_string_tab[156] +#define __pyx_n_u_UnknownError __pyx_string_tab[157] +#define __pyx_n_u_ZlibError __pyx_string_tab[158] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[159] +#define __pyx_n_u_doc __pyx_string_tab[160] +#define __pyx_n_u_main __pyx_string_tab[161] +#define __pyx_n_u_metaclass __pyx_string_tab[162] +#define __pyx_n_u_module __pyx_string_tab[163] +#define __pyx_n_u_mro_entries __pyx_string_tab[164] +#define __pyx_n_u_name __pyx_string_tab[165] +#define __pyx_n_u_prepare __pyx_string_tab[166] +#define __pyx_n_u_qualname __pyx_string_tab[167] +#define __pyx_n_u_ssh2_exceptions __pyx_string_tab[168] +#define __pyx_n_u_test __pyx_string_tab[169] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2351,7 +2375,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif - for (int i=0; i<158; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<170; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -2372,7 +2396,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - for (int i=0; i<158; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<170; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -4905,8 +4929,9 @@ __Pyx_RefNannySetupContext("PyInit_exceptions", 0); /* "ssh2/exceptions.pyx":306 * * - * class UnknownError(SSH2Error): # <<<<<<<<<<<<<< - * """Raised on non-specific or unknown errors""" + * class RandGenError(SSH2Error): # <<<<<<<<<<<<<< + * """Raised on randon number generator errors""" + * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -4917,15 +4942,194 @@ __Pyx_RefNannySetupContext("PyInit_exceptions", 0); __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_mstate_global->__pyx_n_u_UnknownError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_non_specific_or_unknow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_RandGenError, __pyx_mstate_global->__pyx_n_u_RandGenError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_randon_number_generato); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 306, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RandGenError, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RandGenError, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "ssh2/exceptions.pyx":310 + * + * + * class MissingUserAuthBannerError(SSH2Error): # <<<<<<<<<<<<<< + * """Raised on missing user authentication banner error""" + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MissingUserAuthBannerError, __pyx_mstate_global->__pyx_n_u_MissingUserAuthBannerError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_missing_user_authentic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_3 != __pyx_t_4) { + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 310, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MissingUserAuthBannerError, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MissingUserAuthBannerError, __pyx_t_4) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "ssh2/exceptions.pyx":314 + * + * + * class AlgoUnsupportedError(SSH2Error): # <<<<<<<<<<<<<< + * """Raised on unsupported algorithm error""" + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_AlgoUnsupportedError, __pyx_mstate_global->__pyx_n_u_AlgoUnsupportedError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_unsupported_algorithm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 314, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_AlgoUnsupportedError, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AlgoUnsupportedError, __pyx_t_5) < 0) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "ssh2/exceptions.pyx":318 + * + * + * class MacFailureError(SSH2Error): # <<<<<<<<<<<<<< + * """Raised on MAC failure error""" + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MacFailureError, __pyx_mstate_global->__pyx_n_u_MacFailureError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_MAC_failure_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3 != __pyx_t_2) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 318, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MacFailureError, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MacFailureError, __pyx_t_2) < 0) __PYX_ERR(0, 318, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "ssh2/exceptions.pyx":322 + * + * + * class HashInitError(SSH2Error): # <<<<<<<<<<<<<< + * """Raised on hash initialisation error""" + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_HashInitError, __pyx_mstate_global->__pyx_n_u_HashInitError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_hash_initialisation_er); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__pyx_t_3 != __pyx_t_4) { + if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 322, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HashInitError, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HashInitError, __pyx_t_4) < 0) __PYX_ERR(0, 322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "ssh2/exceptions.pyx":326 + * + * + * class HashCalcError(SSH2Error): # <<<<<<<<<<<<<< + * """Raised on hash calculation error""" + * +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_HashCalcError, __pyx_mstate_global->__pyx_n_u_HashCalcError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_hash_calculation_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (__pyx_t_3 != __pyx_t_5) { + if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 326, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_HashCalcError, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HashCalcError, __pyx_t_5) < 0) __PYX_ERR(0, 326, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "ssh2/exceptions.pyx":330 + * + * + * class UnknownError(SSH2Error): # <<<<<<<<<<<<<< + * """Raised on non-specific or unknown errors""" +*/ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_mstate_global->__pyx_n_u_UnknownError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_non_specific_or_unknow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (__pyx_t_3 != __pyx_t_2) { + if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 330, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_t_2) < 0) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5009,6 +5213,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_AgentGetIdentityError, sizeof(__pyx_k_AgentGetIdentityError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AgentGetIdentityError */ {__pyx_k_AgentListIdentitiesError, sizeof(__pyx_k_AgentListIdentitiesError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AgentListIdentitiesError */ {__pyx_k_AgentProtocolError, sizeof(__pyx_k_AgentProtocolError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AgentProtocolError */ + {__pyx_k_AlgoUnsupportedError, sizeof(__pyx_k_AlgoUnsupportedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AlgoUnsupportedError */ {__pyx_k_AllocError, sizeof(__pyx_k_AllocError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllocError */ {__pyx_k_AuthenticationError, sizeof(__pyx_k_AuthenticationError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AuthenticationError */ {__pyx_k_BadSocketError, sizeof(__pyx_k_BadSocketError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BadSocketError */ @@ -5038,6 +5243,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_DecryptError, sizeof(__pyx_k_DecryptError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DecryptError */ {__pyx_k_EncryptError, sizeof(__pyx_k_EncryptError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncryptError */ {__pyx_k_FileError, sizeof(__pyx_k_FileError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FileError */ + {__pyx_k_HashCalcError, sizeof(__pyx_k_HashCalcError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HashCalcError */ + {__pyx_k_HashInitError, sizeof(__pyx_k_HashInitError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HashInitError */ {__pyx_k_HostkeyInitError, sizeof(__pyx_k_HostkeyInitError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HostkeyInitError */ {__pyx_k_HostkeySignError, sizeof(__pyx_k_HostkeySignError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HostkeySignError */ {__pyx_k_InvalidMACError, sizeof(__pyx_k_InvalidMACError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InvalidMACError */ @@ -5058,8 +5265,10 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_KnownHostReadLineError, sizeof(__pyx_k_KnownHostReadLineError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnownHostReadLineError */ {__pyx_k_KnownHostWriteFileError, sizeof(__pyx_k_KnownHostWriteFileError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnownHostWriteFileError */ {__pyx_k_KnownHostWriteLineError, sizeof(__pyx_k_KnownHostWriteLineError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnownHostWriteLineError */ + {__pyx_k_MacFailureError, sizeof(__pyx_k_MacFailureError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MacFailureError */ {__pyx_k_MethodNoneError, sizeof(__pyx_k_MethodNoneError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodNoneError */ {__pyx_k_MethodNotSupported, sizeof(__pyx_k_MethodNotSupported), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodNotSupported */ + {__pyx_k_MissingUserAuthBannerError, sizeof(__pyx_k_MissingUserAuthBannerError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MissingUserAuthBannerError */ {__pyx_k_OutOfBoundaryError, sizeof(__pyx_k_OutOfBoundaryError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OutOfBoundaryError */ {__pyx_k_PasswordExpiredError, sizeof(__pyx_k_PasswordExpiredError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PasswordExpiredError */ {__pyx_k_ProtocolError, sizeof(__pyx_k_ProtocolError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ProtocolError */ @@ -5069,6 +5278,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_PublickeyUnverifiedError, sizeof(__pyx_k_PublickeyUnverifiedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PublickeyUnverifiedError */ {__pyx_k_Raised_on_API_bad_use_errors, sizeof(__pyx_k_Raised_on_API_bad_use_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_API_bad_use_errors */ {__pyx_k_Raised_on_KEX_failure, sizeof(__pyx_k_Raised_on_KEX_failure), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_KEX_failure */ + {__pyx_k_Raised_on_MAC_failure_error, sizeof(__pyx_k_Raised_on_MAC_failure_error), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_MAC_failure_error */ {__pyx_k_Raised_on_SCP_protocol_errors, sizeof(__pyx_k_Raised_on_SCP_protocol_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_SCP_protocol_errors */ {__pyx_k_Raised_on_SFTP_handle_errors, sizeof(__pyx_k_Raised_on_SFTP_handle_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_SFTP_handle_errors */ {__pyx_k_Raised_on_SFTP_protocol_errors, sizeof(__pyx_k_Raised_on_SFTP_protocol_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_SFTP_protocol_errors */ @@ -5107,12 +5317,15 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_Raised_on_errors_writing_line_to, sizeof(__pyx_k_Raised_on_errors_writing_line_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_errors_writing_line_to */ {__pyx_k_Raised_on_errors_writing_to_know, sizeof(__pyx_k_Raised_on_errors_writing_to_know), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_errors_writing_to_know */ {__pyx_k_Raised_on_file_errors, sizeof(__pyx_k_Raised_on_file_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_file_errors */ + {__pyx_k_Raised_on_hash_calculation_error, sizeof(__pyx_k_Raised_on_hash_calculation_error), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_hash_calculation_error */ + {__pyx_k_Raised_on_hash_initialisation_er, sizeof(__pyx_k_Raised_on_hash_initialisation_er), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_hash_initialisation_er */ {__pyx_k_Raised_on_invalid_MAC, sizeof(__pyx_k_Raised_on_invalid_MAC), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_invalid_MAC */ {__pyx_k_Raised_on_invalid_method_errors, sizeof(__pyx_k_Raised_on_invalid_method_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_invalid_method_errors */ {__pyx_k_Raised_on_invalid_poll_type_erro, sizeof(__pyx_k_Raised_on_invalid_poll_type_erro), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_invalid_poll_type_erro */ {__pyx_k_Raised_on_invalid_request_errors, sizeof(__pyx_k_Raised_on_invalid_request_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_invalid_request_errors */ {__pyx_k_Raised_on_key_file_authenticatio, sizeof(__pyx_k_Raised_on_key_file_authenticatio), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_key_file_authenticatio */ {__pyx_k_Raised_on_keys_do_not_match_for, sizeof(__pyx_k_Raised_on_keys_do_not_match_for), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_keys_do_not_match_for */ + {__pyx_k_Raised_on_missing_user_authentic, sizeof(__pyx_k_Raised_on_missing_user_authentic), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_missing_user_authentic */ {__pyx_k_Raised_on_no_match_for_known_hos, sizeof(__pyx_k_Raised_on_no_match_for_known_hos), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_no_match_for_known_hos */ {__pyx_k_Raised_on_non_specific_or_unknow, sizeof(__pyx_k_Raised_on_non_specific_or_unknow), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_non_specific_or_unknow */ {__pyx_k_Raised_on_out_of_boundary_errors, sizeof(__pyx_k_Raised_on_out_of_boundary_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_out_of_boundary_errors */ @@ -5120,6 +5333,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_Raised_on_protocol_errors, sizeof(__pyx_k_Raised_on_protocol_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_protocol_errors */ {__pyx_k_Raised_on_public_key_protocol_er, sizeof(__pyx_k_Raised_on_public_key_protocol_er), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_public_key_protocol_er */ {__pyx_k_Raised_on_public_key_verificatio, sizeof(__pyx_k_Raised_on_public_key_verificatio), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_public_key_verificatio */ + {__pyx_k_Raised_on_randon_number_generato, sizeof(__pyx_k_Raised_on_randon_number_generato), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_randon_number_generato */ {__pyx_k_Raised_on_request_denied_errors, sizeof(__pyx_k_Raised_on_request_denied_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_request_denied_errors */ {__pyx_k_Raised_on_session_handshake_erro, sizeof(__pyx_k_Raised_on_session_handshake_erro), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_session_handshake_erro */ {__pyx_k_Raised_on_session_startup_errors, sizeof(__pyx_k_Raised_on_session_startup_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_session_startup_errors */ @@ -5130,8 +5344,10 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_Raised_on_something_preventing_k, sizeof(__pyx_k_Raised_on_something_preventing_k), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_something_preventing_k */ {__pyx_k_Raised_on_timeouts, sizeof(__pyx_k_Raised_on_timeouts), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_timeouts */ {__pyx_k_Raised_on_unknown_channel_errors, sizeof(__pyx_k_Raised_on_unknown_channel_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_unknown_channel_errors */ + {__pyx_k_Raised_on_unsupported_algorithm, sizeof(__pyx_k_Raised_on_unsupported_algorithm), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_unsupported_algorithm */ {__pyx_k_Raised_on_use_of_bad_socket_erro, sizeof(__pyx_k_Raised_on_use_of_bad_socket_erro), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_use_of_bad_socket_erro */ {__pyx_k_Raised_on_zlib_errors, sizeof(__pyx_k_Raised_on_zlib_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_zlib_errors */ + {__pyx_k_RandGenError, sizeof(__pyx_k_RandGenError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RandGenError */ {__pyx_k_RequestDeniedError, sizeof(__pyx_k_RequestDeniedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RequestDeniedError */ {__pyx_k_SCPProtocolError, sizeof(__pyx_k_SCPProtocolError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SCPProtocolError */ {__pyx_k_SFTPError, sizeof(__pyx_k_SFTPError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SFTPError */ diff --git a/ssh2/exceptions.pyx b/ssh2/exceptions.pyx index 44622c1e..e80092c4 100644 --- a/ssh2/exceptions.pyx +++ b/ssh2/exceptions.pyx @@ -303,5 +303,29 @@ class KeyfileAuthFailedError(SSH2Error): """Raised on key file authentication error""" +class RandGenError(SSH2Error): + """Raised on randon number generator errors""" + + +class MissingUserAuthBannerError(SSH2Error): + """Raised on missing user authentication banner error""" + + +class AlgoUnsupportedError(SSH2Error): + """Raised on unsupported algorithm error""" + + +class MacFailureError(SSH2Error): + """Raised on MAC failure error""" + + +class HashInitError(SSH2Error): + """Raised on hash initialisation error""" + + +class HashCalcError(SSH2Error): + """Raised on hash calculation error""" + + class UnknownError(SSH2Error): """Raised on non-specific or unknown errors""" diff --git a/ssh2/utils.c b/ssh2/utils.c index 26c69ec8..7f3bb590 100644 --- a/ssh2/utils.c +++ b/ssh2/utils.c @@ -2362,9 +2362,12 @@ static const char __pyx_k_BadUseError[] = "BadUseError"; static const char __pyx_k_wait_socket[] = "wait_socket"; static const char __pyx_k_DecryptError[] = "DecryptError"; static const char __pyx_k_EncryptError[] = "EncryptError"; +static const char __pyx_k_RandGenError[] = "RandGenError"; static const char __pyx_k_UnknownError[] = "UnknownError"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_CompressError[] = "CompressError"; +static const char __pyx_k_HashCalcError[] = "HashCalcError"; +static const char __pyx_k_HashInitError[] = "HashInitError"; static const char __pyx_k_ProtocolError[] = "ProtocolError"; static const char __pyx_k_SocketTimeout[] = "SocketTimeout"; static const char __pyx_k_BadSocketError[] = "BadSocketError"; @@ -2375,6 +2378,7 @@ static const char __pyx_k_BannerRecvError[] = "BannerRecvError"; static const char __pyx_k_BannerSendError[] = "BannerSendError"; static const char __pyx_k_InvalidMACError[] = "InvalidMACError"; static const char __pyx_k_KexFailureError[] = "KexFailureError"; +static const char __pyx_k_MacFailureError[] = "MacFailureError"; static const char __pyx_k_MethodNoneError[] = "MethodNoneError"; static const char __pyx_k_SocketRecvError[] = "SocketRecvError"; static const char __pyx_k_SocketSendError[] = "SocketSendError"; @@ -2399,6 +2403,7 @@ static const char __pyx_k_ChannelEOFSentError[] = "ChannelEOFSentError"; static const char __pyx_k_ChannelUnknownError[] = "ChannelUnknownError"; static const char __pyx_k_InvalidRequestError[] = "InvalidRequestError"; static const char __pyx_k_c_xs_q_1_AT_q_7_1_7[] = "\200\001\360\034\000\005\037\230c\240\021\240!\330\004\007\200x\210s\220!\330\010\017\210q\220\003\2201\330\004\031\230\023\230A\230T\240\021\330\004\027\220q\360\006\000\n\013\330\010\022\220!\330\010\020\220\n\230!\2307\240!\2401\330\004\013\2107\220!"; +static const char __pyx_k_AlgoUnsupportedError[] = "AlgoUnsupportedError"; static const char __pyx_k_ChannelRequestDenied[] = "ChannelRequestDenied"; static const char __pyx_k_InvalidPollTypeError[] = "InvalidPollTypeError"; static const char __pyx_k_PasswordExpiredError[] = "PasswordExpiredError"; @@ -2411,8 +2416,9 @@ static const char __pyx_k_Error_code_s_not_known[] = "Error code %s not known"; static const char __pyx_k_KeyfileAuthFailedError[] = "KeyfileAuthFailedError"; static const char __pyx_k_PublicKeyProtocolError[] = "PublicKeyProtocolError"; static const char __pyx_k_PublickeyUnverifiedError[] = "PublickeyUnverifiedError"; +static const char __pyx_k_MissingUserAuthBannerError[] = "MissingUserAuthBannerError"; static const char __pyx_k_31_2_Q_q_aq_x_DA_q_x_EQ_6_T[] = "\320\0003\2601\360\014\000\005\033\230'\320!2\260!\330\004\007\200{\220#\220Q\330\010\017\210q\330\004\016\210a\210q\330\014\027\220x\320\037D\300A\330\004\017\210q\220\001\330\014\027\220x\320\037E\300Q\330\004\013\2106\220\021\220)\230:\240T\250\021"; -static const char __pyx_k_2_xs_q_q_q_q_j_q_j_q_j_q_j_q_j[] = "\320\0002\260!\360\026\000\005\010\200x\210s\220!\330\010\017\210q\330\t\021\220\036\230q\330\010\017\210q\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036""\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\360\006\000\t\014\2108\2202\220Q\330\014\022\220*\230M\250\021\320*E\300Q\330\010\017\210q"; +static const char __pyx_k_2_xs_q_q_q_q_j_q_j_q_j_q_j_q_j[] = "\320\0002\260!\360\026\000\005\010\200x\210s\220!\330\010\017\210q\330\t\021\220\036\230q\330\010\017\210q\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036""\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\360\006\000\t\014\2108\2202\220Q\330\014\022\220*\230M\250\021\320*E\300Q\330\010\017\210q"; static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4ssh2_5utils_find_eol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, Py_ssize_t __pyx_v_pos); /* proto */ @@ -2464,7 +2470,7 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; PyObject *__pyx_tuple[1]; PyObject *__pyx_codeobj_tab[5]; - PyObject *__pyx_string_tab[94]; + PyObject *__pyx_string_tab[100]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; @@ -2507,98 +2513,104 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati /* #### Code section: constant_name_defines ### */ #define __pyx_kp_u_ __pyx_string_tab[0] #define __pyx_n_u_AgentProtocolError __pyx_string_tab[1] -#define __pyx_n_u_AllocError __pyx_string_tab[2] -#define __pyx_n_u_AuthenticationError __pyx_string_tab[3] -#define __pyx_n_u_BadSocketError __pyx_string_tab[4] -#define __pyx_n_u_BadUseError __pyx_string_tab[5] -#define __pyx_n_u_BannerRecvError __pyx_string_tab[6] -#define __pyx_n_u_BannerSendError __pyx_string_tab[7] -#define __pyx_n_u_BufferTooSmallError __pyx_string_tab[8] -#define __pyx_n_u_ChannelClosedError __pyx_string_tab[9] -#define __pyx_n_u_ChannelEOFSentError __pyx_string_tab[10] -#define __pyx_n_u_ChannelFailure __pyx_string_tab[11] -#define __pyx_n_u_ChannelOutOfOrderError __pyx_string_tab[12] -#define __pyx_n_u_ChannelPacketExceeded __pyx_string_tab[13] -#define __pyx_n_u_ChannelRequestDenied __pyx_string_tab[14] -#define __pyx_n_u_ChannelUnknownError __pyx_string_tab[15] -#define __pyx_n_u_ChannelWindowExceeded __pyx_string_tab[16] -#define __pyx_n_u_ChannelWindowFullError __pyx_string_tab[17] -#define __pyx_n_u_CompressError __pyx_string_tab[18] -#define __pyx_n_u_DecryptError __pyx_string_tab[19] -#define __pyx_n_u_ENCODING __pyx_string_tab[20] -#define __pyx_n_u_EncryptError __pyx_string_tab[21] -#define __pyx_kp_u_Error_code_s_not_known __pyx_string_tab[22] -#define __pyx_n_u_FileError __pyx_string_tab[23] -#define __pyx_n_u_HostkeyInitError __pyx_string_tab[24] -#define __pyx_n_u_HostkeySignError __pyx_string_tab[25] -#define __pyx_n_u_InvalidMACError __pyx_string_tab[26] -#define __pyx_n_u_InvalidPollTypeError __pyx_string_tab[27] -#define __pyx_n_u_InvalidRequestError __pyx_string_tab[28] -#define __pyx_n_u_KexFailureError __pyx_string_tab[29] -#define __pyx_n_u_KeyExchangeError __pyx_string_tab[30] -#define __pyx_n_u_KeyfileAuthFailedError __pyx_string_tab[31] -#define __pyx_n_u_KnownHostError __pyx_string_tab[32] -#define __pyx_n_u_MethodNoneError __pyx_string_tab[33] -#define __pyx_n_u_MethodNotSupported __pyx_string_tab[34] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[35] -#define __pyx_n_u_OutOfBoundaryError __pyx_string_tab[36] -#define __pyx_n_u_PasswordExpiredError __pyx_string_tab[37] -#define __pyx_n_u_ProtocolError __pyx_string_tab[38] -#define __pyx_n_u_PublicKeyProtocolError __pyx_string_tab[39] -#define __pyx_n_u_PublickeyUnverifiedError __pyx_string_tab[40] -#define __pyx_n_u_RequestDeniedError __pyx_string_tab[41] -#define __pyx_n_u_SCPProtocolError __pyx_string_tab[42] -#define __pyx_n_u_SFTPProtocolError __pyx_string_tab[43] -#define __pyx_n_u_SSH2Error __pyx_string_tab[44] -#define __pyx_n_u_SocketDisconnectError __pyx_string_tab[45] -#define __pyx_n_u_SocketRecvError __pyx_string_tab[46] -#define __pyx_n_u_SocketSendError __pyx_string_tab[47] -#define __pyx_n_u_SocketTimeout __pyx_string_tab[48] -#define __pyx_n_u_Timeout __pyx_string_tab[49] -#define __pyx_n_u_UnknownError __pyx_string_tab[50] -#define __pyx_n_u_ZlibError __pyx_string_tab[51] -#define __pyx_n_u__2 __pyx_string_tab[52] -#define __pyx_kp_u__3 __pyx_string_tab[53] -#define __pyx_kp_u_add_note __pyx_string_tab[54] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[55] -#define __pyx_n_u_block_directions __pyx_string_tab[56] -#define __pyx_n_u_buf __pyx_string_tab[57] -#define __pyx_n_u_buf_len __pyx_string_tab[58] -#define __pyx_n_u_c_buf __pyx_string_tab[59] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[60] -#define __pyx_n_u_cur_buf __pyx_string_tab[61] -#define __pyx_n_u_decode __pyx_string_tab[62] -#define __pyx_n_u_directions __pyx_string_tab[63] -#define __pyx_n_u_encode __pyx_string_tab[64] -#define __pyx_n_u_errcode __pyx_string_tab[65] -#define __pyx_n_u_exceptions __pyx_string_tab[66] -#define __pyx_n_u_find_eol __pyx_string_tab[67] -#define __pyx_n_u_func __pyx_string_tab[68] -#define __pyx_n_u_handle_error_codes __pyx_string_tab[69] -#define __pyx_n_u_index __pyx_string_tab[70] -#define __pyx_n_u_is_coroutine __pyx_string_tab[71] -#define __pyx_n_u_main __pyx_string_tab[72] -#define __pyx_n_u_module __pyx_string_tab[73] -#define __pyx_n_u_name __pyx_string_tab[74] -#define __pyx_n_u_new_pos __pyx_string_tab[75] -#define __pyx_n_u_pop __pyx_string_tab[76] -#define __pyx_n_u_pos __pyx_string_tab[77] -#define __pyx_n_u_qualname __pyx_string_tab[78] -#define __pyx_n_u_readfds __pyx_string_tab[79] -#define __pyx_n_u_required_version __pyx_string_tab[80] -#define __pyx_n_u_select __pyx_string_tab[81] -#define __pyx_n_u_session __pyx_string_tab[82] -#define __pyx_n_u_set_name __pyx_string_tab[83] -#define __pyx_n_u_socket __pyx_string_tab[84] -#define __pyx_n_u_ssh2_exit __pyx_string_tab[85] -#define __pyx_n_u_ssh2_utils __pyx_string_tab[86] -#define __pyx_kp_u_ssh2_utils_pyx __pyx_string_tab[87] -#define __pyx_n_u_test __pyx_string_tab[88] -#define __pyx_n_u_timeout __pyx_string_tab[89] -#define __pyx_kp_u_utf_8 __pyx_string_tab[90] -#define __pyx_n_u_version __pyx_string_tab[91] -#define __pyx_n_u_wait_socket __pyx_string_tab[92] -#define __pyx_n_u_writefds __pyx_string_tab[93] +#define __pyx_n_u_AlgoUnsupportedError __pyx_string_tab[2] +#define __pyx_n_u_AllocError __pyx_string_tab[3] +#define __pyx_n_u_AuthenticationError __pyx_string_tab[4] +#define __pyx_n_u_BadSocketError __pyx_string_tab[5] +#define __pyx_n_u_BadUseError __pyx_string_tab[6] +#define __pyx_n_u_BannerRecvError __pyx_string_tab[7] +#define __pyx_n_u_BannerSendError __pyx_string_tab[8] +#define __pyx_n_u_BufferTooSmallError __pyx_string_tab[9] +#define __pyx_n_u_ChannelClosedError __pyx_string_tab[10] +#define __pyx_n_u_ChannelEOFSentError __pyx_string_tab[11] +#define __pyx_n_u_ChannelFailure __pyx_string_tab[12] +#define __pyx_n_u_ChannelOutOfOrderError __pyx_string_tab[13] +#define __pyx_n_u_ChannelPacketExceeded __pyx_string_tab[14] +#define __pyx_n_u_ChannelRequestDenied __pyx_string_tab[15] +#define __pyx_n_u_ChannelUnknownError __pyx_string_tab[16] +#define __pyx_n_u_ChannelWindowExceeded __pyx_string_tab[17] +#define __pyx_n_u_ChannelWindowFullError __pyx_string_tab[18] +#define __pyx_n_u_CompressError __pyx_string_tab[19] +#define __pyx_n_u_DecryptError __pyx_string_tab[20] +#define __pyx_n_u_ENCODING __pyx_string_tab[21] +#define __pyx_n_u_EncryptError __pyx_string_tab[22] +#define __pyx_kp_u_Error_code_s_not_known __pyx_string_tab[23] +#define __pyx_n_u_FileError __pyx_string_tab[24] +#define __pyx_n_u_HashCalcError __pyx_string_tab[25] +#define __pyx_n_u_HashInitError __pyx_string_tab[26] +#define __pyx_n_u_HostkeyInitError __pyx_string_tab[27] +#define __pyx_n_u_HostkeySignError __pyx_string_tab[28] +#define __pyx_n_u_InvalidMACError __pyx_string_tab[29] +#define __pyx_n_u_InvalidPollTypeError __pyx_string_tab[30] +#define __pyx_n_u_InvalidRequestError __pyx_string_tab[31] +#define __pyx_n_u_KexFailureError __pyx_string_tab[32] +#define __pyx_n_u_KeyExchangeError __pyx_string_tab[33] +#define __pyx_n_u_KeyfileAuthFailedError __pyx_string_tab[34] +#define __pyx_n_u_KnownHostError __pyx_string_tab[35] +#define __pyx_n_u_MacFailureError __pyx_string_tab[36] +#define __pyx_n_u_MethodNoneError __pyx_string_tab[37] +#define __pyx_n_u_MethodNotSupported __pyx_string_tab[38] +#define __pyx_n_u_MissingUserAuthBannerError __pyx_string_tab[39] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[40] +#define __pyx_n_u_OutOfBoundaryError __pyx_string_tab[41] +#define __pyx_n_u_PasswordExpiredError __pyx_string_tab[42] +#define __pyx_n_u_ProtocolError __pyx_string_tab[43] +#define __pyx_n_u_PublicKeyProtocolError __pyx_string_tab[44] +#define __pyx_n_u_PublickeyUnverifiedError __pyx_string_tab[45] +#define __pyx_n_u_RandGenError __pyx_string_tab[46] +#define __pyx_n_u_RequestDeniedError __pyx_string_tab[47] +#define __pyx_n_u_SCPProtocolError __pyx_string_tab[48] +#define __pyx_n_u_SFTPProtocolError __pyx_string_tab[49] +#define __pyx_n_u_SSH2Error __pyx_string_tab[50] +#define __pyx_n_u_SocketDisconnectError __pyx_string_tab[51] +#define __pyx_n_u_SocketRecvError __pyx_string_tab[52] +#define __pyx_n_u_SocketSendError __pyx_string_tab[53] +#define __pyx_n_u_SocketTimeout __pyx_string_tab[54] +#define __pyx_n_u_Timeout __pyx_string_tab[55] +#define __pyx_n_u_UnknownError __pyx_string_tab[56] +#define __pyx_n_u_ZlibError __pyx_string_tab[57] +#define __pyx_n_u__2 __pyx_string_tab[58] +#define __pyx_kp_u__3 __pyx_string_tab[59] +#define __pyx_kp_u_add_note __pyx_string_tab[60] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[61] +#define __pyx_n_u_block_directions __pyx_string_tab[62] +#define __pyx_n_u_buf __pyx_string_tab[63] +#define __pyx_n_u_buf_len __pyx_string_tab[64] +#define __pyx_n_u_c_buf __pyx_string_tab[65] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[66] +#define __pyx_n_u_cur_buf __pyx_string_tab[67] +#define __pyx_n_u_decode __pyx_string_tab[68] +#define __pyx_n_u_directions __pyx_string_tab[69] +#define __pyx_n_u_encode __pyx_string_tab[70] +#define __pyx_n_u_errcode __pyx_string_tab[71] +#define __pyx_n_u_exceptions __pyx_string_tab[72] +#define __pyx_n_u_find_eol __pyx_string_tab[73] +#define __pyx_n_u_func __pyx_string_tab[74] +#define __pyx_n_u_handle_error_codes __pyx_string_tab[75] +#define __pyx_n_u_index __pyx_string_tab[76] +#define __pyx_n_u_is_coroutine __pyx_string_tab[77] +#define __pyx_n_u_main __pyx_string_tab[78] +#define __pyx_n_u_module __pyx_string_tab[79] +#define __pyx_n_u_name __pyx_string_tab[80] +#define __pyx_n_u_new_pos __pyx_string_tab[81] +#define __pyx_n_u_pop __pyx_string_tab[82] +#define __pyx_n_u_pos __pyx_string_tab[83] +#define __pyx_n_u_qualname __pyx_string_tab[84] +#define __pyx_n_u_readfds __pyx_string_tab[85] +#define __pyx_n_u_required_version __pyx_string_tab[86] +#define __pyx_n_u_select __pyx_string_tab[87] +#define __pyx_n_u_session __pyx_string_tab[88] +#define __pyx_n_u_set_name __pyx_string_tab[89] +#define __pyx_n_u_socket __pyx_string_tab[90] +#define __pyx_n_u_ssh2_exit __pyx_string_tab[91] +#define __pyx_n_u_ssh2_utils __pyx_string_tab[92] +#define __pyx_kp_u_ssh2_utils_pyx __pyx_string_tab[93] +#define __pyx_n_u_test __pyx_string_tab[94] +#define __pyx_n_u_timeout __pyx_string_tab[95] +#define __pyx_kp_u_utf_8 __pyx_string_tab[96] +#define __pyx_n_u_version __pyx_string_tab[97] +#define __pyx_n_u_wait_socket __pyx_string_tab[98] +#define __pyx_n_u_writefds __pyx_string_tab[99] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2624,7 +2636,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_ptype_4ssh2_7session_FlagType); for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<94; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<100; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_neg_1); @@ -2653,7 +2665,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_ptype_4ssh2_7session_FlagType); for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<94; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<100; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1); @@ -5206,8 +5218,8 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U * raise exceptions.ChannelWindowFullError * elif errcode == error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED: * raise exceptions.KeyfileAuthFailedError # <<<<<<<<<<<<<< - * else: - * # Switch default + * elif errcode == error_codes._LIBSSH2_ERROR_RANDGEN: + * raise exceptions.RandGenError */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); @@ -5223,12 +5235,168 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U * raise exceptions.ChannelWindowFullError * elif errcode == error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED: # <<<<<<<<<<<<<< * raise exceptions.KeyfileAuthFailedError + * elif errcode == error_codes._LIBSSH2_ERROR_RANDGEN: +*/ + break; + case LIBSSH2_ERROR_RANDGEN: + + /* "ssh2/utils.pyx":226 + * raise exceptions.KeyfileAuthFailedError + * elif errcode == error_codes._LIBSSH2_ERROR_RANDGEN: + * raise exceptions.RandGenError # <<<<<<<<<<<<<< + * elif errcode == error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER: + * raise exceptions.MissingUserAuthBannerError +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RandGenError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 226, __pyx_L1_error) + + /* "ssh2/utils.pyx":225 + * elif errcode == error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED: + * raise exceptions.KeyfileAuthFailedError + * elif errcode == error_codes._LIBSSH2_ERROR_RANDGEN: # <<<<<<<<<<<<<< + * raise exceptions.RandGenError + * elif errcode == error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER: +*/ + break; + case LIBSSH2_ERROR_MISSING_USERAUTH_BANNER: + + /* "ssh2/utils.pyx":228 + * raise exceptions.RandGenError + * elif errcode == error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER: + * raise exceptions.MissingUserAuthBannerError # <<<<<<<<<<<<<< + * elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: + * raise exceptions.AlgoUnsupportedError +*/ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MissingUserAuthBannerError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 228, __pyx_L1_error) + + /* "ssh2/utils.pyx":227 + * elif errcode == error_codes._LIBSSH2_ERROR_RANDGEN: + * raise exceptions.RandGenError + * elif errcode == error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER: # <<<<<<<<<<<<<< + * raise exceptions.MissingUserAuthBannerError + * elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: +*/ + break; + case LIBSSH2_ERROR_ALGO_UNSUPPORTED: + + /* "ssh2/utils.pyx":230 + * raise exceptions.MissingUserAuthBannerError + * elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: + * raise exceptions.AlgoUnsupportedError # <<<<<<<<<<<<<< + * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: + * raise exceptions.MacFailureError +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_AlgoUnsupportedError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 230, __pyx_L1_error) + + /* "ssh2/utils.pyx":229 + * elif errcode == error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER: + * raise exceptions.MissingUserAuthBannerError + * elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: # <<<<<<<<<<<<<< + * raise exceptions.AlgoUnsupportedError + * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: +*/ + break; + case LIBSSH2_ERROR_MAC_FAILURE: + + /* "ssh2/utils.pyx":232 + * raise exceptions.AlgoUnsupportedError + * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: + * raise exceptions.MacFailureError # <<<<<<<<<<<<<< + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: + * raise exceptions.HashInitError +*/ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MacFailureError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 232, __pyx_L1_error) + + /* "ssh2/utils.pyx":231 + * elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: + * raise exceptions.AlgoUnsupportedError + * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: # <<<<<<<<<<<<<< + * raise exceptions.MacFailureError + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: +*/ + break; + case LIBSSH2_ERROR_HASH_INIT: + + /* "ssh2/utils.pyx":234 + * raise exceptions.MacFailureError + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: + * raise exceptions.HashInitError # <<<<<<<<<<<<<< + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: + * raise exceptions.HashCalcError +*/ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_HashInitError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 234, __pyx_L1_error) + + /* "ssh2/utils.pyx":233 + * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: + * raise exceptions.MacFailureError + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: # <<<<<<<<<<<<<< + * raise exceptions.HashInitError + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: +*/ + break; + case LIBSSH2_ERROR_HASH_CALC: + + /* "ssh2/utils.pyx":236 + * raise exceptions.HashInitError + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: + * raise exceptions.HashCalcError # <<<<<<<<<<<<<< + * else: + * # Switch default +*/ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_HashCalcError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(0, 236, __pyx_L1_error) + + /* "ssh2/utils.pyx":235 + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: + * raise exceptions.HashInitError + * elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: # <<<<<<<<<<<<<< + * raise exceptions.HashCalcError * else: */ break; default: - /* "ssh2/utils.pyx":227 + /* "ssh2/utils.pyx":239 * else: * # Switch default * if errcode < 0: # <<<<<<<<<<<<<< @@ -5238,19 +5406,19 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U __pyx_t_3 = (__pyx_v_errcode < 0); if (unlikely(__pyx_t_3)) { - /* "ssh2/utils.pyx":228 + /* "ssh2/utils.pyx":240 * # Switch default * if errcode < 0: * raise exceptions.UnknownError("Error code %s not known", errcode) # <<<<<<<<<<<<<< * return errcode */ __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnknownError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnknownError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_errcode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_errcode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -5270,14 +5438,14 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 228, __pyx_L1_error) + __PYX_ERR(0, 240, __pyx_L1_error) - /* "ssh2/utils.pyx":227 + /* "ssh2/utils.pyx":239 * else: * # Switch default * if errcode < 0: # <<<<<<<<<<<<<< @@ -5286,7 +5454,7 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U */ } - /* "ssh2/utils.pyx":229 + /* "ssh2/utils.pyx":241 * if errcode < 0: * raise exceptions.UnknownError("Error code %s not known", errcode) * return errcode # <<<<<<<<<<<<<< @@ -6028,6 +6196,7 @@ static const char * const __pyx_string_tab_encodings[] = { 0 }; static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ {__pyx_k_AgentProtocolError, sizeof(__pyx_k_AgentProtocolError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AgentProtocolError */ + {__pyx_k_AlgoUnsupportedError, sizeof(__pyx_k_AlgoUnsupportedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AlgoUnsupportedError */ {__pyx_k_AllocError, sizeof(__pyx_k_AllocError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AllocError */ {__pyx_k_AuthenticationError, sizeof(__pyx_k_AuthenticationError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_AuthenticationError */ {__pyx_k_BadSocketError, sizeof(__pyx_k_BadSocketError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BadSocketError */ @@ -6050,6 +6219,8 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_EncryptError, sizeof(__pyx_k_EncryptError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncryptError */ {__pyx_k_Error_code_s_not_known, sizeof(__pyx_k_Error_code_s_not_known), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Error_code_s_not_known */ {__pyx_k_FileError, sizeof(__pyx_k_FileError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FileError */ + {__pyx_k_HashCalcError, sizeof(__pyx_k_HashCalcError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HashCalcError */ + {__pyx_k_HashInitError, sizeof(__pyx_k_HashInitError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HashInitError */ {__pyx_k_HostkeyInitError, sizeof(__pyx_k_HostkeyInitError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HostkeyInitError */ {__pyx_k_HostkeySignError, sizeof(__pyx_k_HostkeySignError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HostkeySignError */ {__pyx_k_InvalidMACError, sizeof(__pyx_k_InvalidMACError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InvalidMACError */ @@ -6059,14 +6230,17 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_KeyExchangeError, sizeof(__pyx_k_KeyExchangeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KeyExchangeError */ {__pyx_k_KeyfileAuthFailedError, sizeof(__pyx_k_KeyfileAuthFailedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KeyfileAuthFailedError */ {__pyx_k_KnownHostError, sizeof(__pyx_k_KnownHostError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnownHostError */ + {__pyx_k_MacFailureError, sizeof(__pyx_k_MacFailureError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MacFailureError */ {__pyx_k_MethodNoneError, sizeof(__pyx_k_MethodNoneError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodNoneError */ {__pyx_k_MethodNotSupported, sizeof(__pyx_k_MethodNotSupported), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodNotSupported */ + {__pyx_k_MissingUserAuthBannerError, sizeof(__pyx_k_MissingUserAuthBannerError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MissingUserAuthBannerError */ {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ {__pyx_k_OutOfBoundaryError, sizeof(__pyx_k_OutOfBoundaryError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_OutOfBoundaryError */ {__pyx_k_PasswordExpiredError, sizeof(__pyx_k_PasswordExpiredError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PasswordExpiredError */ {__pyx_k_ProtocolError, sizeof(__pyx_k_ProtocolError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ProtocolError */ {__pyx_k_PublicKeyProtocolError, sizeof(__pyx_k_PublicKeyProtocolError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PublicKeyProtocolError */ {__pyx_k_PublickeyUnverifiedError, sizeof(__pyx_k_PublickeyUnverifiedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PublickeyUnverifiedError */ + {__pyx_k_RandGenError, sizeof(__pyx_k_RandGenError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RandGenError */ {__pyx_k_RequestDeniedError, sizeof(__pyx_k_RequestDeniedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RequestDeniedError */ {__pyx_k_SCPProtocolError, sizeof(__pyx_k_SCPProtocolError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SCPProtocolError */ {__pyx_k_SFTPProtocolError, sizeof(__pyx_k_SFTPProtocolError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SFTPProtocolError */ @@ -6214,7 +6388,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_utils_pyx, __pyx_mstate->__pyx_n_u_wait_socket, __pyx_k_31_2_Q_q_aq_x_DA_q_x_EQ_6_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116, 721}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116, 805}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_errcode}; __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_utils_pyx, __pyx_mstate->__pyx_n_u_handle_error_codes, __pyx_k_2_xs_q_q_q_q_j_q_j_q_j_q_j_q_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } diff --git a/ssh2/utils.pyx b/ssh2/utils.pyx index 23483e6e..8ee40efe 100644 --- a/ssh2/utils.pyx +++ b/ssh2/utils.pyx @@ -222,6 +222,18 @@ cpdef int handle_error_codes(int errcode) except -1: raise exceptions.ChannelWindowFullError elif errcode == error_codes._LIBSSH2_ERROR_KEYFILE_AUTH_FAILED: raise exceptions.KeyfileAuthFailedError + elif errcode == error_codes._LIBSSH2_ERROR_RANDGEN: + raise exceptions.RandGenError + elif errcode == error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER: + raise exceptions.MissingUserAuthBannerError + elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: + raise exceptions.AlgoUnsupportedError + elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: + raise exceptions.MacFailureError + elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: + raise exceptions.HashInitError + elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: + raise exceptions.HashCalcError else: # Switch default if errcode < 0: diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index 0bdd2e12..c2f6c294 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -21,7 +21,9 @@ LIBSSH2_ERROR_COMPRESS, LIBSSH2_ERROR_OUT_OF_BOUNDARY, \ LIBSSH2_ERROR_AGENT_PROTOCOL, LIBSSH2_ERROR_SOCKET_RECV, \ LIBSSH2_ERROR_SOCKET_SEND, LIBSSH2_ERROR_ENCRYPT, \ - LIBSSH2_ERROR_BAD_SOCKET, LIBSSH2_ERROR_KNOWN_HOSTS + LIBSSH2_ERROR_BAD_SOCKET, LIBSSH2_ERROR_KNOWN_HOSTS, \ + LIBSSH2_ERROR_RANDGEN, LIBSSH2_ERROR_MISSING_USERAUTH_BANNER, LIBSSH2_ERROR_ALGO_UNSUPPORTED, \ + LIBSSH2_ERROR_MAC_FAILURE, LIBSSH2_ERROR_HASH_INIT, LIBSSH2_ERROR_HASH_CALC from ssh2.exceptions import SSH2Error, AgentError, AuthenticationError, \ AgentConnectionError, AgentAuthenticationError, AgentListIdentitiesError, \ AgentGetIdentityError, AgentProtocolError, SessionError, \ @@ -38,7 +40,8 @@ InvalidPollTypeError, PublicKeyProtocolError, BufferTooSmallError, \ BadUseError, CompressError, OutOfBoundaryError, SocketRecvError, \ SocketSendError, EncryptError, BadSocketError, SFTPError, SFTPProtocolError, \ - KnownHostError, UnknownError + KnownHostError, UnknownError, RandGenError, MissingUserAuthBannerError, \ + AlgoUnsupportedError, MacFailureError, HashInitError, HashCalcError from ssh2.utils import handle_error_codes @@ -65,6 +68,12 @@ def test_general_errors(self): self.assertRaises(MethodNoneError, handle_error_codes, LIBSSH2_ERROR_METHOD_NONE) self.assertRaises(AuthenticationError, handle_error_codes, LIBSSH2_ERROR_AUTHENTICATION_FAILED) self.assertRaises(PublickeyUnverifiedError, handle_error_codes, LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED) + self.assertRaises(RandGenError, handle_error_codes, LIBSSH2_ERROR_RANDGEN) + self.assertRaises(MissingUserAuthBannerError, handle_error_codes, LIBSSH2_ERROR_MISSING_USERAUTH_BANNER) + self.assertRaises(AlgoUnsupportedError, handle_error_codes, LIBSSH2_ERROR_ALGO_UNSUPPORTED) + self.assertRaises(MacFailureError, handle_error_codes, LIBSSH2_ERROR_MAC_FAILURE) + self.assertRaises(HashInitError, handle_error_codes, LIBSSH2_ERROR_HASH_INIT) + self.assertRaises(HashCalcError, handle_error_codes, LIBSSH2_ERROR_HASH_CALC) def test_channel_errors(self): self.assertRaises(ChannelOutOfOrderError, handle_error_codes, LIBSSH2_ERROR_CHANNEL_OUTOFORDER) From c9d7250ff0abd1d3fc6a8e06560bffed53b3a751 Mon Sep 17 00:00:00 2001 From: Panos Date: Sat, 4 Oct 2025 18:39:42 +0100 Subject: [PATCH 2/3] Updated changelog, docstrings --- Changelog.rst | 2 ++ ssh2/exceptions.pyx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog.rst b/Changelog.rst index a1fb70d8..36aa6a26 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -16,6 +16,8 @@ Changes * Added `ssh2.channel.Channel.signal` function for sending signals over SSH to an open channel - #221 * Added `ssh2.session.Session.direct_streamlocal_ex` for creating `Channel` objects tunneling a local UNIX socket via the remote host to a third party. +* Added new `libssh2` error codes under `ssh2.error_codes`, equivalent Python exceptions under `ssh2.exceptions` + and updated error code handling for all functions. Packaging diff --git a/ssh2/exceptions.pyx b/ssh2/exceptions.pyx index e80092c4..40516592 100644 --- a/ssh2/exceptions.pyx +++ b/ssh2/exceptions.pyx @@ -304,7 +304,7 @@ class KeyfileAuthFailedError(SSH2Error): class RandGenError(SSH2Error): - """Raised on randon number generator errors""" + """Raised on randon number generator error""" class MissingUserAuthBannerError(SSH2Error): From a73aebd8d55a776b1d12ce19e61576f262ec3657 Mon Sep 17 00:00:00 2001 From: Panos Date: Sat, 4 Oct 2025 19:33:41 +0100 Subject: [PATCH 3/3] Updates for missing osx error types --- ssh2/error_codes.c | 123 ++++--------- ssh2/error_codes.pxd | 3 - ssh2/error_codes.pyx | 3 - ssh2/exceptions.c | 382 ++++++++++++++------------------------- ssh2/exceptions.pyx | 12 -- ssh2/utils.c | 283 ++++++++++------------------- ssh2/utils.pyx | 6 - tests/test_exceptions.py | 8 +- 8 files changed, 276 insertions(+), 544 deletions(-) diff --git a/ssh2/error_codes.c b/ssh2/error_codes.c index 1e16be10..1b34280f 100644 --- a/ssh2/error_codes.c +++ b/ssh2/error_codes.c @@ -1935,15 +1935,12 @@ static const char __pyx_k_LIBSSH2_ERROR_ENCRYPT[] = "LIBSSH2_ERROR_ENCRYPT"; static const char __pyx_k_LIBSSH2_ERROR_RANDGEN[] = "LIBSSH2_ERROR_RANDGEN"; static const char __pyx_k_LIBSSH2_ERROR_TIMEOUT[] = "LIBSSH2_ERROR_TIMEOUT"; static const char __pyx_k_LIBSSH2_ERROR_COMPRESS[] = "LIBSSH2_ERROR_COMPRESS"; -static const char __pyx_k_LIBSSH2_ERROR_HASH_CALC[] = "LIBSSH2_ERROR_HASH_CALC"; -static const char __pyx_k_LIBSSH2_ERROR_HASH_INIT[] = "LIBSSH2_ERROR_HASH_INIT"; static const char __pyx_k_LIBSSH2_ERROR_BAD_SOCKET[] = "LIBSSH2_ERROR_BAD_SOCKET"; static const char __pyx_k_LIBSSH2_ERROR_BANNER_RECV[] = "LIBSSH2_ERROR_BANNER_RECV"; static const char __pyx_k_LIBSSH2_ERROR_BANNER_SEND[] = "LIBSSH2_ERROR_BANNER_SEND"; static const char __pyx_k_LIBSSH2_ERROR_INVALID_MAC[] = "LIBSSH2_ERROR_INVALID_MAC"; static const char __pyx_k_LIBSSH2_ERROR_KEX_FAILURE[] = "LIBSSH2_ERROR_KEX_FAILURE"; static const char __pyx_k_LIBSSH2_ERROR_KNOWN_HOSTS[] = "LIBSSH2_ERROR_KNOWN_HOSTS"; -static const char __pyx_k_LIBSSH2_ERROR_MAC_FAILURE[] = "LIBSSH2_ERROR_MAC_FAILURE"; static const char __pyx_k_LIBSSH2_ERROR_METHOD_NONE[] = "LIBSSH2_ERROR_METHOD_NONE"; static const char __pyx_k_LIBSSH2_ERROR_SOCKET_NONE[] = "LIBSSH2_ERROR_SOCKET_NONE"; static const char __pyx_k_LIBSSH2_ERROR_SOCKET_RECV[] = "LIBSSH2_ERROR_SOCKET_RECV"; @@ -2017,7 +2014,7 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - PyObject *__pyx_string_tab[64]; + PyObject *__pyx_string_tab[61]; /* #### Code section: module_state_contents ### */ /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -2072,45 +2069,42 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_LIBSSH2_ERROR_EAGAIN __pyx_string_tab[22] #define __pyx_n_u_LIBSSH2_ERROR_ENCRYPT __pyx_string_tab[23] #define __pyx_n_u_LIBSSH2_ERROR_FILE __pyx_string_tab[24] -#define __pyx_n_u_LIBSSH2_ERROR_HASH_CALC __pyx_string_tab[25] -#define __pyx_n_u_LIBSSH2_ERROR_HASH_INIT __pyx_string_tab[26] -#define __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_INIT __pyx_string_tab[27] -#define __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_SIGN __pyx_string_tab[28] -#define __pyx_n_u_LIBSSH2_ERROR_INVAL __pyx_string_tab[29] -#define __pyx_n_u_LIBSSH2_ERROR_INVALID_MAC __pyx_string_tab[30] -#define __pyx_n_u_LIBSSH2_ERROR_INVALID_POLL_TYPE __pyx_string_tab[31] -#define __pyx_n_u_LIBSSH2_ERROR_KEX_FAILURE __pyx_string_tab[32] -#define __pyx_n_u_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE __pyx_string_tab[33] -#define __pyx_n_u_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU __pyx_string_tab[34] -#define __pyx_n_u_LIBSSH2_ERROR_KNOWN_HOSTS __pyx_string_tab[35] -#define __pyx_n_u_LIBSSH2_ERROR_MAC_FAILURE __pyx_string_tab[36] -#define __pyx_n_u_LIBSSH2_ERROR_METHOD_NONE __pyx_string_tab[37] -#define __pyx_n_u_LIBSSH2_ERROR_METHOD_NOT_SUPPORT __pyx_string_tab[38] -#define __pyx_n_u_LIBSSH2_ERROR_MISSING_USERAUTH_B __pyx_string_tab[39] -#define __pyx_n_u_LIBSSH2_ERROR_NONE __pyx_string_tab[40] -#define __pyx_n_u_LIBSSH2_ERROR_OUT_OF_BOUNDARY __pyx_string_tab[41] -#define __pyx_n_u_LIBSSH2_ERROR_PASSWORD_EXPIRED __pyx_string_tab[42] -#define __pyx_n_u_LIBSSH2_ERROR_PROTO __pyx_string_tab[43] -#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL __pyx_string_tab[44] -#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNRECOGN __pyx_string_tab[45] -#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNVERIFI __pyx_string_tab[46] -#define __pyx_n_u_LIBSSH2_ERROR_RANDGEN __pyx_string_tab[47] -#define __pyx_n_u_LIBSSH2_ERROR_REQUEST_DENIED __pyx_string_tab[48] -#define __pyx_n_u_LIBSSH2_ERROR_SCP_PROTOCOL __pyx_string_tab[49] -#define __pyx_n_u_LIBSSH2_ERROR_SFTP_PROTOCOL __pyx_string_tab[50] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_DISCONNECT __pyx_string_tab[51] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_NONE __pyx_string_tab[52] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_RECV __pyx_string_tab[53] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_SEND __pyx_string_tab[54] -#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_TIMEOUT __pyx_string_tab[55] -#define __pyx_n_u_LIBSSH2_ERROR_TIMEOUT __pyx_string_tab[56] -#define __pyx_n_u_LIBSSH2_ERROR_ZLIB __pyx_string_tab[57] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[58] -#define __pyx_n_u_main __pyx_string_tab[59] -#define __pyx_n_u_module __pyx_string_tab[60] -#define __pyx_n_u_name __pyx_string_tab[61] -#define __pyx_n_u_qualname __pyx_string_tab[62] -#define __pyx_n_u_test __pyx_string_tab[63] +#define __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_INIT __pyx_string_tab[25] +#define __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_SIGN __pyx_string_tab[26] +#define __pyx_n_u_LIBSSH2_ERROR_INVAL __pyx_string_tab[27] +#define __pyx_n_u_LIBSSH2_ERROR_INVALID_MAC __pyx_string_tab[28] +#define __pyx_n_u_LIBSSH2_ERROR_INVALID_POLL_TYPE __pyx_string_tab[29] +#define __pyx_n_u_LIBSSH2_ERROR_KEX_FAILURE __pyx_string_tab[30] +#define __pyx_n_u_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE __pyx_string_tab[31] +#define __pyx_n_u_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU __pyx_string_tab[32] +#define __pyx_n_u_LIBSSH2_ERROR_KNOWN_HOSTS __pyx_string_tab[33] +#define __pyx_n_u_LIBSSH2_ERROR_METHOD_NONE __pyx_string_tab[34] +#define __pyx_n_u_LIBSSH2_ERROR_METHOD_NOT_SUPPORT __pyx_string_tab[35] +#define __pyx_n_u_LIBSSH2_ERROR_MISSING_USERAUTH_B __pyx_string_tab[36] +#define __pyx_n_u_LIBSSH2_ERROR_NONE __pyx_string_tab[37] +#define __pyx_n_u_LIBSSH2_ERROR_OUT_OF_BOUNDARY __pyx_string_tab[38] +#define __pyx_n_u_LIBSSH2_ERROR_PASSWORD_EXPIRED __pyx_string_tab[39] +#define __pyx_n_u_LIBSSH2_ERROR_PROTO __pyx_string_tab[40] +#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_PROTOCOL __pyx_string_tab[41] +#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNRECOGN __pyx_string_tab[42] +#define __pyx_n_u_LIBSSH2_ERROR_PUBLICKEY_UNVERIFI __pyx_string_tab[43] +#define __pyx_n_u_LIBSSH2_ERROR_RANDGEN __pyx_string_tab[44] +#define __pyx_n_u_LIBSSH2_ERROR_REQUEST_DENIED __pyx_string_tab[45] +#define __pyx_n_u_LIBSSH2_ERROR_SCP_PROTOCOL __pyx_string_tab[46] +#define __pyx_n_u_LIBSSH2_ERROR_SFTP_PROTOCOL __pyx_string_tab[47] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_DISCONNECT __pyx_string_tab[48] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_NONE __pyx_string_tab[49] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_RECV __pyx_string_tab[50] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_SEND __pyx_string_tab[51] +#define __pyx_n_u_LIBSSH2_ERROR_SOCKET_TIMEOUT __pyx_string_tab[52] +#define __pyx_n_u_LIBSSH2_ERROR_TIMEOUT __pyx_string_tab[53] +#define __pyx_n_u_LIBSSH2_ERROR_ZLIB __pyx_string_tab[54] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[55] +#define __pyx_n_u_main __pyx_string_tab[56] +#define __pyx_n_u_module __pyx_string_tab[57] +#define __pyx_n_u_name __pyx_string_tab[58] +#define __pyx_n_u_qualname __pyx_string_tab[59] +#define __pyx_n_u_test __pyx_string_tab[60] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2131,7 +2125,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif - for (int i=0; i<64; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<61; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -2152,7 +2146,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - for (int i=0; i<64; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<61; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -3151,7 +3145,6 @@ __Pyx_RefNannySetupContext("PyInit_error_codes", 0); * LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN * LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER # <<<<<<<<<<<<<< * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED - * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE */ __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_MISSING_USERAUTH_BANNER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -3162,47 +3155,12 @@ __Pyx_RefNannySetupContext("PyInit_error_codes", 0); * LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN * LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED # <<<<<<<<<<<<<< - * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE - * LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT */ __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_ALGO_UNSUPPORTED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_ALGO_UNSUPPORTED, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/error_codes.pyx":87 - * LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER - * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED - * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE # <<<<<<<<<<<<<< - * LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT - * LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC -*/ - __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_MAC_FAILURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_MAC_FAILURE, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "ssh2/error_codes.pyx":88 - * LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED - * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE - * LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT # <<<<<<<<<<<<<< - * LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC -*/ - __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_HASH_INIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_HASH_INIT, __pyx_t_2) < 0) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "ssh2/error_codes.pyx":89 - * LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE - * LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT - * LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC # <<<<<<<<<<<<<< -*/ - __pyx_t_2 = __Pyx_PyLong_From___pyx_anon_enum(LIBSSH2_ERROR_HASH_CALC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LIBSSH2_ERROR_HASH_CALC, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh2/error_codes.pyx":1 * # This file is part of ssh2-python. # <<<<<<<<<<<<<< * # Copyright (C) 2017-2020 Panos Kittenis @@ -3296,8 +3254,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_LIBSSH2_ERROR_EAGAIN, sizeof(__pyx_k_LIBSSH2_ERROR_EAGAIN), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_EAGAIN */ {__pyx_k_LIBSSH2_ERROR_ENCRYPT, sizeof(__pyx_k_LIBSSH2_ERROR_ENCRYPT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_ENCRYPT */ {__pyx_k_LIBSSH2_ERROR_FILE, sizeof(__pyx_k_LIBSSH2_ERROR_FILE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_FILE */ - {__pyx_k_LIBSSH2_ERROR_HASH_CALC, sizeof(__pyx_k_LIBSSH2_ERROR_HASH_CALC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_HASH_CALC */ - {__pyx_k_LIBSSH2_ERROR_HASH_INIT, sizeof(__pyx_k_LIBSSH2_ERROR_HASH_INIT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_HASH_INIT */ {__pyx_k_LIBSSH2_ERROR_HOSTKEY_INIT, sizeof(__pyx_k_LIBSSH2_ERROR_HOSTKEY_INIT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_INIT */ {__pyx_k_LIBSSH2_ERROR_HOSTKEY_SIGN, sizeof(__pyx_k_LIBSSH2_ERROR_HOSTKEY_SIGN), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_HOSTKEY_SIGN */ {__pyx_k_LIBSSH2_ERROR_INVAL, sizeof(__pyx_k_LIBSSH2_ERROR_INVAL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_INVAL */ @@ -3307,7 +3263,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE, sizeof(__pyx_k_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_KEYFILE_AUTH_FAILE */ {__pyx_k_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU, sizeof(__pyx_k_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_KEY_EXCHANGE_FAILU */ {__pyx_k_LIBSSH2_ERROR_KNOWN_HOSTS, sizeof(__pyx_k_LIBSSH2_ERROR_KNOWN_HOSTS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_KNOWN_HOSTS */ - {__pyx_k_LIBSSH2_ERROR_MAC_FAILURE, sizeof(__pyx_k_LIBSSH2_ERROR_MAC_FAILURE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_MAC_FAILURE */ {__pyx_k_LIBSSH2_ERROR_METHOD_NONE, sizeof(__pyx_k_LIBSSH2_ERROR_METHOD_NONE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_METHOD_NONE */ {__pyx_k_LIBSSH2_ERROR_METHOD_NOT_SUPPORT, sizeof(__pyx_k_LIBSSH2_ERROR_METHOD_NOT_SUPPORT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_METHOD_NOT_SUPPORT */ {__pyx_k_LIBSSH2_ERROR_MISSING_USERAUTH_B, sizeof(__pyx_k_LIBSSH2_ERROR_MISSING_USERAUTH_B), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LIBSSH2_ERROR_MISSING_USERAUTH_B */ diff --git a/ssh2/error_codes.pxd b/ssh2/error_codes.pxd index 2622416d..7fdfcef1 100644 --- a/ssh2/error_codes.pxd +++ b/ssh2/error_codes.pxd @@ -80,8 +80,5 @@ cdef extern from "libssh2.h" nogil: _LIBSSH2_ERROR_RANDGEN "LIBSSH2_ERROR_RANDGEN" _LIBSSH2_ERROR_MISSING_USERAUTH_BANNER "LIBSSH2_ERROR_MISSING_USERAUTH_BANNER" _LIBSSH2_ERROR_ALGO_UNSUPPORTED "LIBSSH2_ERROR_ALGO_UNSUPPORTED" - _LIBSSH2_ERROR_MAC_FAILURE "LIBSSH2_ERROR_MAC_FAILURE" - _LIBSSH2_ERROR_HASH_INIT "LIBSSH2_ERROR_HASH_INIT" - _LIBSSH2_ERROR_HASH_CALC "LIBSSH2_ERROR_HASH_CALC" _LIBSSH2CHANNEL_EAGAIN "LIBSSH2_ERROR_EAGAIN" diff --git a/ssh2/error_codes.pyx b/ssh2/error_codes.pyx index 139059c4..abf97ae0 100644 --- a/ssh2/error_codes.pyx +++ b/ssh2/error_codes.pyx @@ -84,6 +84,3 @@ LIBSSH2_ERROR_KEYFILE_AUTH_FAILED = \ LIBSSH2_ERROR_RANDGEN = error_codes._LIBSSH2_ERROR_RANDGEN LIBSSH2_ERROR_MISSING_USERAUTH_BANNER = error_codes._LIBSSH2_ERROR_MISSING_USERAUTH_BANNER LIBSSH2_ERROR_ALGO_UNSUPPORTED = error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED -LIBSSH2_ERROR_MAC_FAILURE = error_codes._LIBSSH2_ERROR_MAC_FAILURE -LIBSSH2_ERROR_HASH_INIT = error_codes._LIBSSH2_ERROR_HASH_INIT -LIBSSH2_ERROR_HASH_CALC = error_codes._LIBSSH2_ERROR_HASH_CALC diff --git a/ssh2/exceptions.c b/ssh2/exceptions.c index 2c8590d4..0fa212be 100644 --- a/ssh2/exceptions.c +++ b/ssh2/exceptions.c @@ -1971,8 +1971,6 @@ static const char __pyx_k_RandGenError[] = "RandGenError"; static const char __pyx_k_SessionError[] = "SessionError"; static const char __pyx_k_UnknownError[] = "UnknownError"; static const char __pyx_k_CompressError[] = "CompressError"; -static const char __pyx_k_HashCalcError[] = "HashCalcError"; -static const char __pyx_k_HashInitError[] = "HashInitError"; static const char __pyx_k_ProtocolError[] = "ProtocolError"; static const char __pyx_k_SocketTimeout[] = "SocketTimeout"; static const char __pyx_k_BadSocketError[] = "BadSocketError"; @@ -1983,7 +1981,6 @@ static const char __pyx_k_BannerRecvError[] = "BannerRecvError"; static const char __pyx_k_BannerSendError[] = "BannerSendError"; static const char __pyx_k_InvalidMACError[] = "InvalidMACError"; static const char __pyx_k_KexFailureError[] = "KexFailureError"; -static const char __pyx_k_MacFailureError[] = "MacFailureError"; static const char __pyx_k_MethodNoneError[] = "MethodNoneError"; static const char __pyx_k_SFTPHandleError[] = "SFTPHandleError"; static const char __pyx_k_SocketRecvError[] = "SocketRecvError"; @@ -2047,7 +2044,6 @@ static const char __pyx_k_Raised_on_allocation_error[] = "Raised on allocation e static const char __pyx_k_Raised_on_channel_failures[] = "Raised on channel failures"; static const char __pyx_k_KnownHostCheckMisMatchError[] = "KnownHostCheckMisMatchError"; static const char __pyx_k_KnownHostCheckNotFoundError[] = "KnownHostCheckNotFoundError"; -static const char __pyx_k_Raised_on_MAC_failure_error[] = "Raised on MAC failure error"; static const char __pyx_k_Raised_on_decryption_errors[] = "Raised on decryption errors"; static const char __pyx_k_Raised_on_encryption_errors[] = "Raised on encryption errors"; static const char __pyx_k_Raised_on_API_bad_use_errors[] = "Raised on API bad use errors"; @@ -2097,8 +2093,6 @@ static const char __pyx_k_Raised_on_errors_retrieving_know[] = "Raised on errors static const char __pyx_k_Raised_on_errors_signing_host_ke[] = "Raised on errors signing host key"; static const char __pyx_k_Raised_on_errors_writing_line_to[] = "Raised on errors writing line to known hosts file"; static const char __pyx_k_Raised_on_errors_writing_to_know[] = "Raised on errors writing to known hosts file"; -static const char __pyx_k_Raised_on_hash_calculation_error[] = "Raised on hash calculation error"; -static const char __pyx_k_Raised_on_hash_initialisation_er[] = "Raised on hash initialisation error"; static const char __pyx_k_Raised_on_invalid_poll_type_erro[] = "Raised on invalid poll type errors"; static const char __pyx_k_Raised_on_invalid_request_errors[] = "Raised on invalid request errors"; static const char __pyx_k_Raised_on_key_file_authenticatio[] = "Raised on key file authentication error"; @@ -2109,7 +2103,7 @@ static const char __pyx_k_Raised_on_out_of_boundary_errors[] = "Raised on out of static const char __pyx_k_Raised_on_password_expired_error[] = "Raised on password expired errors"; static const char __pyx_k_Raised_on_public_key_protocol_er[] = "Raised on public key protocol errors"; static const char __pyx_k_Raised_on_public_key_verificatio[] = "Raised on public key verification errors"; -static const char __pyx_k_Raised_on_randon_number_generato[] = "Raised on randon number generator errors"; +static const char __pyx_k_Raised_on_randon_number_generato[] = "Raised on randon number generator error"; static const char __pyx_k_Raised_on_session_handshake_erro[] = "Raised on session handshake errors"; static const char __pyx_k_Raised_on_session_startup_errors[] = "Raised on session startup errors"; static const char __pyx_k_Raised_on_socket_disconnection_e[] = "Raised on socket disconnection errors"; @@ -2155,7 +2149,7 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - PyObject *__pyx_string_tab[170]; + PyObject *__pyx_string_tab[164]; /* #### Code section: module_state_contents ### */ /* CodeObjectCache.module_state_decls */ struct __Pyx_CodeObjectCache __pyx_code_cache; @@ -2222,139 +2216,133 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_DecryptError __pyx_string_tab[34] #define __pyx_n_u_EncryptError __pyx_string_tab[35] #define __pyx_n_u_FileError __pyx_string_tab[36] -#define __pyx_n_u_HashCalcError __pyx_string_tab[37] -#define __pyx_n_u_HashInitError __pyx_string_tab[38] -#define __pyx_n_u_HostkeyInitError __pyx_string_tab[39] -#define __pyx_n_u_HostkeySignError __pyx_string_tab[40] -#define __pyx_n_u_InvalidMACError __pyx_string_tab[41] -#define __pyx_n_u_InvalidPollTypeError __pyx_string_tab[42] -#define __pyx_n_u_InvalidRequestError __pyx_string_tab[43] -#define __pyx_n_u_KexFailureError __pyx_string_tab[44] -#define __pyx_n_u_KeyExchangeError __pyx_string_tab[45] -#define __pyx_n_u_KeyfileAuthFailedError __pyx_string_tab[46] -#define __pyx_n_u_KnownHostAddError __pyx_string_tab[47] -#define __pyx_n_u_KnownHostCheckError __pyx_string_tab[48] -#define __pyx_n_u_KnownHostCheckFailure __pyx_string_tab[49] -#define __pyx_n_u_KnownHostCheckMisMatchError __pyx_string_tab[50] -#define __pyx_n_u_KnownHostCheckNotFoundError __pyx_string_tab[51] -#define __pyx_n_u_KnownHostDeleteError __pyx_string_tab[52] -#define __pyx_n_u_KnownHostError __pyx_string_tab[53] -#define __pyx_n_u_KnownHostGetError __pyx_string_tab[54] -#define __pyx_n_u_KnownHostReadFileError __pyx_string_tab[55] -#define __pyx_n_u_KnownHostReadLineError __pyx_string_tab[56] -#define __pyx_n_u_KnownHostWriteFileError __pyx_string_tab[57] -#define __pyx_n_u_KnownHostWriteLineError __pyx_string_tab[58] -#define __pyx_n_u_MacFailureError __pyx_string_tab[59] -#define __pyx_n_u_MethodNoneError __pyx_string_tab[60] -#define __pyx_n_u_MethodNotSupported __pyx_string_tab[61] -#define __pyx_n_u_MissingUserAuthBannerError __pyx_string_tab[62] -#define __pyx_n_u_OutOfBoundaryError __pyx_string_tab[63] -#define __pyx_n_u_PasswordExpiredError __pyx_string_tab[64] -#define __pyx_n_u_ProtocolError __pyx_string_tab[65] -#define __pyx_n_u_PublicKeyError __pyx_string_tab[66] -#define __pyx_n_u_PublicKeyInitError __pyx_string_tab[67] -#define __pyx_n_u_PublicKeyProtocolError __pyx_string_tab[68] -#define __pyx_n_u_PublickeyUnverifiedError __pyx_string_tab[69] -#define __pyx_kp_u_Raised_on_API_bad_use_errors __pyx_string_tab[70] -#define __pyx_kp_u_Raised_on_KEX_failure __pyx_string_tab[71] -#define __pyx_kp_u_Raised_on_MAC_failure_error __pyx_string_tab[72] -#define __pyx_kp_u_Raised_on_SCP_protocol_errors __pyx_string_tab[73] -#define __pyx_kp_u_Raised_on_SFTP_handle_errors __pyx_string_tab[74] -#define __pyx_kp_u_Raised_on_SFTP_protocol_errors __pyx_string_tab[75] -#define __pyx_kp_u_Raised_on_SSH_Agent_authenticati __pyx_string_tab[76] -#define __pyx_kp_u_Raised_on_SSH_Agent_connection_e __pyx_string_tab[77] -#define __pyx_kp_u_Raised_on_SSH_Agent_get_identity __pyx_string_tab[78] -#define __pyx_kp_u_Raised_on_SSH_Agent_list_identit __pyx_string_tab[79] -#define __pyx_kp_u_Raised_on_SSH_agent_protocol_err __pyx_string_tab[80] -#define __pyx_kp_u_Raised_on_allocation_error __pyx_string_tab[81] -#define __pyx_kp_u_Raised_on_any_known_host_check_e __pyx_string_tab[82] -#define __pyx_kp_u_Raised_on_authentication_method __pyx_string_tab[83] -#define __pyx_kp_u_Raised_on_buffer_too_small_error __pyx_string_tab[84] -#define __pyx_kp_u_Raised_on_channel_EOF_errors __pyx_string_tab[85] -#define __pyx_kp_u_Raised_on_channel_closed_errors __pyx_string_tab[86] -#define __pyx_kp_u_Raised_on_channel_commands_out_o __pyx_string_tab[87] -#define __pyx_kp_u_Raised_on_channel_failures __pyx_string_tab[88] -#define __pyx_kp_u_Raised_on_channel_max_packet_len __pyx_string_tab[89] -#define __pyx_kp_u_Raised_on_channel_request_denied __pyx_string_tab[90] -#define __pyx_kp_u_Raised_on_channel_window_exceede __pyx_string_tab[91] -#define __pyx_kp_u_Raised_on_channel_window_full_er __pyx_string_tab[92] -#define __pyx_kp_u_Raised_on_compression_errors __pyx_string_tab[93] -#define __pyx_kp_u_Raised_on_decryption_errors __pyx_string_tab[94] -#define __pyx_kp_u_Raised_on_encryption_errors __pyx_string_tab[95] -#define __pyx_kp_u_Raised_on_errors_adding_known_ho __pyx_string_tab[96] -#define __pyx_kp_u_Raised_on_errors_deleting_known __pyx_string_tab[97] -#define __pyx_kp_u_Raised_on_errors_exchanging_keys __pyx_string_tab[98] -#define __pyx_kp_u_Raised_on_errors_getting_server __pyx_string_tab[99] -#define __pyx_kp_u_Raised_on_errors_initialiasing_h __pyx_string_tab[100] -#define __pyx_kp_u_Raised_on_errors_initialising_pu __pyx_string_tab[101] -#define __pyx_kp_u_Raised_on_errors_reading_from_kn __pyx_string_tab[102] -#define __pyx_kp_u_Raised_on_errors_reading_line_fr __pyx_string_tab[103] -#define __pyx_kp_u_Raised_on_errors_receiving_banne __pyx_string_tab[104] -#define __pyx_kp_u_Raised_on_errors_retrieving_know __pyx_string_tab[105] -#define __pyx_kp_u_Raised_on_errors_sending_banner __pyx_string_tab[106] -#define __pyx_kp_u_Raised_on_errors_signing_host_ke __pyx_string_tab[107] -#define __pyx_kp_u_Raised_on_errors_writing_line_to __pyx_string_tab[108] -#define __pyx_kp_u_Raised_on_errors_writing_to_know __pyx_string_tab[109] -#define __pyx_kp_u_Raised_on_file_errors __pyx_string_tab[110] -#define __pyx_kp_u_Raised_on_hash_calculation_error __pyx_string_tab[111] -#define __pyx_kp_u_Raised_on_hash_initialisation_er __pyx_string_tab[112] -#define __pyx_kp_u_Raised_on_invalid_MAC __pyx_string_tab[113] -#define __pyx_kp_u_Raised_on_invalid_method_errors __pyx_string_tab[114] -#define __pyx_kp_u_Raised_on_invalid_poll_type_erro __pyx_string_tab[115] -#define __pyx_kp_u_Raised_on_invalid_request_errors __pyx_string_tab[116] -#define __pyx_kp_u_Raised_on_key_file_authenticatio __pyx_string_tab[117] -#define __pyx_kp_u_Raised_on_keys_do_not_match_for __pyx_string_tab[118] -#define __pyx_kp_u_Raised_on_missing_user_authentic __pyx_string_tab[119] -#define __pyx_kp_u_Raised_on_no_match_for_known_hos __pyx_string_tab[120] -#define __pyx_kp_u_Raised_on_non_specific_or_unknow __pyx_string_tab[121] -#define __pyx_kp_u_Raised_on_out_of_boundary_errors __pyx_string_tab[122] -#define __pyx_kp_u_Raised_on_password_expired_error __pyx_string_tab[123] -#define __pyx_kp_u_Raised_on_protocol_errors __pyx_string_tab[124] -#define __pyx_kp_u_Raised_on_public_key_protocol_er __pyx_string_tab[125] -#define __pyx_kp_u_Raised_on_public_key_verificatio __pyx_string_tab[126] -#define __pyx_kp_u_Raised_on_randon_number_generato __pyx_string_tab[127] -#define __pyx_kp_u_Raised_on_request_denied_errors __pyx_string_tab[128] -#define __pyx_kp_u_Raised_on_session_handshake_erro __pyx_string_tab[129] -#define __pyx_kp_u_Raised_on_session_startup_errors __pyx_string_tab[130] -#define __pyx_kp_u_Raised_on_socket_disconnection_e __pyx_string_tab[131] -#define __pyx_kp_u_Raised_on_socket_receive_errors __pyx_string_tab[132] -#define __pyx_kp_u_Raised_on_socket_send_errors __pyx_string_tab[133] -#define __pyx_kp_u_Raised_on_socket_timeouts __pyx_string_tab[134] -#define __pyx_kp_u_Raised_on_something_preventing_k __pyx_string_tab[135] -#define __pyx_kp_u_Raised_on_timeouts __pyx_string_tab[136] -#define __pyx_kp_u_Raised_on_unknown_channel_errors __pyx_string_tab[137] -#define __pyx_kp_u_Raised_on_unsupported_algorithm __pyx_string_tab[138] -#define __pyx_kp_u_Raised_on_use_of_bad_socket_erro __pyx_string_tab[139] -#define __pyx_kp_u_Raised_on_zlib_errors __pyx_string_tab[140] -#define __pyx_n_u_RandGenError __pyx_string_tab[141] -#define __pyx_n_u_RequestDeniedError __pyx_string_tab[142] -#define __pyx_n_u_SCPProtocolError __pyx_string_tab[143] -#define __pyx_n_u_SFTPError __pyx_string_tab[144] -#define __pyx_n_u_SFTPHandleError __pyx_string_tab[145] -#define __pyx_n_u_SFTPProtocolError __pyx_string_tab[146] -#define __pyx_n_u_SSH2Error __pyx_string_tab[147] -#define __pyx_n_u_SessionError __pyx_string_tab[148] -#define __pyx_n_u_SessionHandshakeError __pyx_string_tab[149] -#define __pyx_n_u_SessionHostKeyError __pyx_string_tab[150] -#define __pyx_n_u_SessionStartupError __pyx_string_tab[151] -#define __pyx_n_u_SocketDisconnectError __pyx_string_tab[152] -#define __pyx_n_u_SocketRecvError __pyx_string_tab[153] -#define __pyx_n_u_SocketSendError __pyx_string_tab[154] -#define __pyx_n_u_SocketTimeout __pyx_string_tab[155] -#define __pyx_n_u_Timeout __pyx_string_tab[156] -#define __pyx_n_u_UnknownError __pyx_string_tab[157] -#define __pyx_n_u_ZlibError __pyx_string_tab[158] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[159] -#define __pyx_n_u_doc __pyx_string_tab[160] -#define __pyx_n_u_main __pyx_string_tab[161] -#define __pyx_n_u_metaclass __pyx_string_tab[162] -#define __pyx_n_u_module __pyx_string_tab[163] -#define __pyx_n_u_mro_entries __pyx_string_tab[164] -#define __pyx_n_u_name __pyx_string_tab[165] -#define __pyx_n_u_prepare __pyx_string_tab[166] -#define __pyx_n_u_qualname __pyx_string_tab[167] -#define __pyx_n_u_ssh2_exceptions __pyx_string_tab[168] -#define __pyx_n_u_test __pyx_string_tab[169] +#define __pyx_n_u_HostkeyInitError __pyx_string_tab[37] +#define __pyx_n_u_HostkeySignError __pyx_string_tab[38] +#define __pyx_n_u_InvalidMACError __pyx_string_tab[39] +#define __pyx_n_u_InvalidPollTypeError __pyx_string_tab[40] +#define __pyx_n_u_InvalidRequestError __pyx_string_tab[41] +#define __pyx_n_u_KexFailureError __pyx_string_tab[42] +#define __pyx_n_u_KeyExchangeError __pyx_string_tab[43] +#define __pyx_n_u_KeyfileAuthFailedError __pyx_string_tab[44] +#define __pyx_n_u_KnownHostAddError __pyx_string_tab[45] +#define __pyx_n_u_KnownHostCheckError __pyx_string_tab[46] +#define __pyx_n_u_KnownHostCheckFailure __pyx_string_tab[47] +#define __pyx_n_u_KnownHostCheckMisMatchError __pyx_string_tab[48] +#define __pyx_n_u_KnownHostCheckNotFoundError __pyx_string_tab[49] +#define __pyx_n_u_KnownHostDeleteError __pyx_string_tab[50] +#define __pyx_n_u_KnownHostError __pyx_string_tab[51] +#define __pyx_n_u_KnownHostGetError __pyx_string_tab[52] +#define __pyx_n_u_KnownHostReadFileError __pyx_string_tab[53] +#define __pyx_n_u_KnownHostReadLineError __pyx_string_tab[54] +#define __pyx_n_u_KnownHostWriteFileError __pyx_string_tab[55] +#define __pyx_n_u_KnownHostWriteLineError __pyx_string_tab[56] +#define __pyx_n_u_MethodNoneError __pyx_string_tab[57] +#define __pyx_n_u_MethodNotSupported __pyx_string_tab[58] +#define __pyx_n_u_MissingUserAuthBannerError __pyx_string_tab[59] +#define __pyx_n_u_OutOfBoundaryError __pyx_string_tab[60] +#define __pyx_n_u_PasswordExpiredError __pyx_string_tab[61] +#define __pyx_n_u_ProtocolError __pyx_string_tab[62] +#define __pyx_n_u_PublicKeyError __pyx_string_tab[63] +#define __pyx_n_u_PublicKeyInitError __pyx_string_tab[64] +#define __pyx_n_u_PublicKeyProtocolError __pyx_string_tab[65] +#define __pyx_n_u_PublickeyUnverifiedError __pyx_string_tab[66] +#define __pyx_kp_u_Raised_on_API_bad_use_errors __pyx_string_tab[67] +#define __pyx_kp_u_Raised_on_KEX_failure __pyx_string_tab[68] +#define __pyx_kp_u_Raised_on_SCP_protocol_errors __pyx_string_tab[69] +#define __pyx_kp_u_Raised_on_SFTP_handle_errors __pyx_string_tab[70] +#define __pyx_kp_u_Raised_on_SFTP_protocol_errors __pyx_string_tab[71] +#define __pyx_kp_u_Raised_on_SSH_Agent_authenticati __pyx_string_tab[72] +#define __pyx_kp_u_Raised_on_SSH_Agent_connection_e __pyx_string_tab[73] +#define __pyx_kp_u_Raised_on_SSH_Agent_get_identity __pyx_string_tab[74] +#define __pyx_kp_u_Raised_on_SSH_Agent_list_identit __pyx_string_tab[75] +#define __pyx_kp_u_Raised_on_SSH_agent_protocol_err __pyx_string_tab[76] +#define __pyx_kp_u_Raised_on_allocation_error __pyx_string_tab[77] +#define __pyx_kp_u_Raised_on_any_known_host_check_e __pyx_string_tab[78] +#define __pyx_kp_u_Raised_on_authentication_method __pyx_string_tab[79] +#define __pyx_kp_u_Raised_on_buffer_too_small_error __pyx_string_tab[80] +#define __pyx_kp_u_Raised_on_channel_EOF_errors __pyx_string_tab[81] +#define __pyx_kp_u_Raised_on_channel_closed_errors __pyx_string_tab[82] +#define __pyx_kp_u_Raised_on_channel_commands_out_o __pyx_string_tab[83] +#define __pyx_kp_u_Raised_on_channel_failures __pyx_string_tab[84] +#define __pyx_kp_u_Raised_on_channel_max_packet_len __pyx_string_tab[85] +#define __pyx_kp_u_Raised_on_channel_request_denied __pyx_string_tab[86] +#define __pyx_kp_u_Raised_on_channel_window_exceede __pyx_string_tab[87] +#define __pyx_kp_u_Raised_on_channel_window_full_er __pyx_string_tab[88] +#define __pyx_kp_u_Raised_on_compression_errors __pyx_string_tab[89] +#define __pyx_kp_u_Raised_on_decryption_errors __pyx_string_tab[90] +#define __pyx_kp_u_Raised_on_encryption_errors __pyx_string_tab[91] +#define __pyx_kp_u_Raised_on_errors_adding_known_ho __pyx_string_tab[92] +#define __pyx_kp_u_Raised_on_errors_deleting_known __pyx_string_tab[93] +#define __pyx_kp_u_Raised_on_errors_exchanging_keys __pyx_string_tab[94] +#define __pyx_kp_u_Raised_on_errors_getting_server __pyx_string_tab[95] +#define __pyx_kp_u_Raised_on_errors_initialiasing_h __pyx_string_tab[96] +#define __pyx_kp_u_Raised_on_errors_initialising_pu __pyx_string_tab[97] +#define __pyx_kp_u_Raised_on_errors_reading_from_kn __pyx_string_tab[98] +#define __pyx_kp_u_Raised_on_errors_reading_line_fr __pyx_string_tab[99] +#define __pyx_kp_u_Raised_on_errors_receiving_banne __pyx_string_tab[100] +#define __pyx_kp_u_Raised_on_errors_retrieving_know __pyx_string_tab[101] +#define __pyx_kp_u_Raised_on_errors_sending_banner __pyx_string_tab[102] +#define __pyx_kp_u_Raised_on_errors_signing_host_ke __pyx_string_tab[103] +#define __pyx_kp_u_Raised_on_errors_writing_line_to __pyx_string_tab[104] +#define __pyx_kp_u_Raised_on_errors_writing_to_know __pyx_string_tab[105] +#define __pyx_kp_u_Raised_on_file_errors __pyx_string_tab[106] +#define __pyx_kp_u_Raised_on_invalid_MAC __pyx_string_tab[107] +#define __pyx_kp_u_Raised_on_invalid_method_errors __pyx_string_tab[108] +#define __pyx_kp_u_Raised_on_invalid_poll_type_erro __pyx_string_tab[109] +#define __pyx_kp_u_Raised_on_invalid_request_errors __pyx_string_tab[110] +#define __pyx_kp_u_Raised_on_key_file_authenticatio __pyx_string_tab[111] +#define __pyx_kp_u_Raised_on_keys_do_not_match_for __pyx_string_tab[112] +#define __pyx_kp_u_Raised_on_missing_user_authentic __pyx_string_tab[113] +#define __pyx_kp_u_Raised_on_no_match_for_known_hos __pyx_string_tab[114] +#define __pyx_kp_u_Raised_on_non_specific_or_unknow __pyx_string_tab[115] +#define __pyx_kp_u_Raised_on_out_of_boundary_errors __pyx_string_tab[116] +#define __pyx_kp_u_Raised_on_password_expired_error __pyx_string_tab[117] +#define __pyx_kp_u_Raised_on_protocol_errors __pyx_string_tab[118] +#define __pyx_kp_u_Raised_on_public_key_protocol_er __pyx_string_tab[119] +#define __pyx_kp_u_Raised_on_public_key_verificatio __pyx_string_tab[120] +#define __pyx_kp_u_Raised_on_randon_number_generato __pyx_string_tab[121] +#define __pyx_kp_u_Raised_on_request_denied_errors __pyx_string_tab[122] +#define __pyx_kp_u_Raised_on_session_handshake_erro __pyx_string_tab[123] +#define __pyx_kp_u_Raised_on_session_startup_errors __pyx_string_tab[124] +#define __pyx_kp_u_Raised_on_socket_disconnection_e __pyx_string_tab[125] +#define __pyx_kp_u_Raised_on_socket_receive_errors __pyx_string_tab[126] +#define __pyx_kp_u_Raised_on_socket_send_errors __pyx_string_tab[127] +#define __pyx_kp_u_Raised_on_socket_timeouts __pyx_string_tab[128] +#define __pyx_kp_u_Raised_on_something_preventing_k __pyx_string_tab[129] +#define __pyx_kp_u_Raised_on_timeouts __pyx_string_tab[130] +#define __pyx_kp_u_Raised_on_unknown_channel_errors __pyx_string_tab[131] +#define __pyx_kp_u_Raised_on_unsupported_algorithm __pyx_string_tab[132] +#define __pyx_kp_u_Raised_on_use_of_bad_socket_erro __pyx_string_tab[133] +#define __pyx_kp_u_Raised_on_zlib_errors __pyx_string_tab[134] +#define __pyx_n_u_RandGenError __pyx_string_tab[135] +#define __pyx_n_u_RequestDeniedError __pyx_string_tab[136] +#define __pyx_n_u_SCPProtocolError __pyx_string_tab[137] +#define __pyx_n_u_SFTPError __pyx_string_tab[138] +#define __pyx_n_u_SFTPHandleError __pyx_string_tab[139] +#define __pyx_n_u_SFTPProtocolError __pyx_string_tab[140] +#define __pyx_n_u_SSH2Error __pyx_string_tab[141] +#define __pyx_n_u_SessionError __pyx_string_tab[142] +#define __pyx_n_u_SessionHandshakeError __pyx_string_tab[143] +#define __pyx_n_u_SessionHostKeyError __pyx_string_tab[144] +#define __pyx_n_u_SessionStartupError __pyx_string_tab[145] +#define __pyx_n_u_SocketDisconnectError __pyx_string_tab[146] +#define __pyx_n_u_SocketRecvError __pyx_string_tab[147] +#define __pyx_n_u_SocketSendError __pyx_string_tab[148] +#define __pyx_n_u_SocketTimeout __pyx_string_tab[149] +#define __pyx_n_u_Timeout __pyx_string_tab[150] +#define __pyx_n_u_UnknownError __pyx_string_tab[151] +#define __pyx_n_u_ZlibError __pyx_string_tab[152] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[153] +#define __pyx_n_u_doc __pyx_string_tab[154] +#define __pyx_n_u_main __pyx_string_tab[155] +#define __pyx_n_u_metaclass __pyx_string_tab[156] +#define __pyx_n_u_module __pyx_string_tab[157] +#define __pyx_n_u_mro_entries __pyx_string_tab[158] +#define __pyx_n_u_name __pyx_string_tab[159] +#define __pyx_n_u_prepare __pyx_string_tab[160] +#define __pyx_n_u_qualname __pyx_string_tab[161] +#define __pyx_n_u_ssh2_exceptions __pyx_string_tab[162] +#define __pyx_n_u_test __pyx_string_tab[163] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2375,7 +2363,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { #if CYTHON_PEP489_MULTI_PHASE_INIT __Pyx_State_RemoveModule(NULL); #endif - for (int i=0; i<170; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<164; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -2396,7 +2384,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - for (int i=0; i<170; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<164; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } return 0; } #endif @@ -4930,7 +4918,7 @@ __Pyx_RefNannySetupContext("PyInit_exceptions", 0); * * * class RandGenError(SSH2Error): # <<<<<<<<<<<<<< - * """Raised on randon number generator errors""" + * """Raised on randon number generator error""" * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) @@ -5019,9 +5007,8 @@ __Pyx_RefNannySetupContext("PyInit_exceptions", 0); /* "ssh2/exceptions.pyx":318 * * - * class MacFailureError(SSH2Error): # <<<<<<<<<<<<<< - * """Raised on MAC failure error""" - * + * class UnknownError(SSH2Error): # <<<<<<<<<<<<<< + * """Raised on non-specific or unknown errors""" */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); @@ -5032,104 +5019,15 @@ __Pyx_RefNannySetupContext("PyInit_exceptions", 0); __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_MacFailureError, __pyx_mstate_global->__pyx_n_u_MacFailureError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_MAC_failure_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_mstate_global->__pyx_n_u_UnknownError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_non_specific_or_unknow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3 != __pyx_t_2) { if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 318, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MacFailureError, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MacFailureError, __pyx_t_2) < 0) __PYX_ERR(0, 318, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "ssh2/exceptions.pyx":322 - * - * - * class HashInitError(SSH2Error): # <<<<<<<<<<<<<< - * """Raised on hash initialisation error""" - * -*/ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_HashInitError, __pyx_mstate_global->__pyx_n_u_HashInitError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_hash_initialisation_er); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__pyx_t_3 != __pyx_t_4) { - if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 322, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HashInitError, __pyx_t_3, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HashInitError, __pyx_t_4) < 0) __PYX_ERR(0, 322, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "ssh2/exceptions.pyx":326 - * - * - * class HashCalcError(SSH2Error): # <<<<<<<<<<<<<< - * """Raised on hash calculation error""" - * -*/ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_HashCalcError, __pyx_mstate_global->__pyx_n_u_HashCalcError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_hash_calculation_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (__pyx_t_3 != __pyx_t_5) { - if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 326, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_HashCalcError, __pyx_t_3, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_HashCalcError, __pyx_t_5) < 0) __PYX_ERR(0, 326, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "ssh2/exceptions.pyx":330 - * - * - * class UnknownError(SSH2Error): # <<<<<<<<<<<<<< - * """Raised on non-specific or unknown errors""" -*/ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_SSH2Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_Pack(1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_mstate_global->__pyx_n_u_UnknownError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_ssh2_exceptions, __pyx_mstate_global->__pyx_kp_u_Raised_on_non_specific_or_unknow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 330, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_3 != __pyx_t_2) { - if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 330, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_t_3, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_t_2) < 0) __PYX_ERR(0, 330, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_UnknownError, __pyx_t_2) < 0) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -5243,8 +5141,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_DecryptError, sizeof(__pyx_k_DecryptError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DecryptError */ {__pyx_k_EncryptError, sizeof(__pyx_k_EncryptError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncryptError */ {__pyx_k_FileError, sizeof(__pyx_k_FileError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FileError */ - {__pyx_k_HashCalcError, sizeof(__pyx_k_HashCalcError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HashCalcError */ - {__pyx_k_HashInitError, sizeof(__pyx_k_HashInitError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HashInitError */ {__pyx_k_HostkeyInitError, sizeof(__pyx_k_HostkeyInitError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HostkeyInitError */ {__pyx_k_HostkeySignError, sizeof(__pyx_k_HostkeySignError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HostkeySignError */ {__pyx_k_InvalidMACError, sizeof(__pyx_k_InvalidMACError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InvalidMACError */ @@ -5265,7 +5161,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_KnownHostReadLineError, sizeof(__pyx_k_KnownHostReadLineError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnownHostReadLineError */ {__pyx_k_KnownHostWriteFileError, sizeof(__pyx_k_KnownHostWriteFileError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnownHostWriteFileError */ {__pyx_k_KnownHostWriteLineError, sizeof(__pyx_k_KnownHostWriteLineError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnownHostWriteLineError */ - {__pyx_k_MacFailureError, sizeof(__pyx_k_MacFailureError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MacFailureError */ {__pyx_k_MethodNoneError, sizeof(__pyx_k_MethodNoneError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodNoneError */ {__pyx_k_MethodNotSupported, sizeof(__pyx_k_MethodNotSupported), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodNotSupported */ {__pyx_k_MissingUserAuthBannerError, sizeof(__pyx_k_MissingUserAuthBannerError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MissingUserAuthBannerError */ @@ -5278,7 +5173,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_PublickeyUnverifiedError, sizeof(__pyx_k_PublickeyUnverifiedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PublickeyUnverifiedError */ {__pyx_k_Raised_on_API_bad_use_errors, sizeof(__pyx_k_Raised_on_API_bad_use_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_API_bad_use_errors */ {__pyx_k_Raised_on_KEX_failure, sizeof(__pyx_k_Raised_on_KEX_failure), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_KEX_failure */ - {__pyx_k_Raised_on_MAC_failure_error, sizeof(__pyx_k_Raised_on_MAC_failure_error), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_MAC_failure_error */ {__pyx_k_Raised_on_SCP_protocol_errors, sizeof(__pyx_k_Raised_on_SCP_protocol_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_SCP_protocol_errors */ {__pyx_k_Raised_on_SFTP_handle_errors, sizeof(__pyx_k_Raised_on_SFTP_handle_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_SFTP_handle_errors */ {__pyx_k_Raised_on_SFTP_protocol_errors, sizeof(__pyx_k_Raised_on_SFTP_protocol_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_SFTP_protocol_errors */ @@ -5317,8 +5211,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_Raised_on_errors_writing_line_to, sizeof(__pyx_k_Raised_on_errors_writing_line_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_errors_writing_line_to */ {__pyx_k_Raised_on_errors_writing_to_know, sizeof(__pyx_k_Raised_on_errors_writing_to_know), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_errors_writing_to_know */ {__pyx_k_Raised_on_file_errors, sizeof(__pyx_k_Raised_on_file_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_file_errors */ - {__pyx_k_Raised_on_hash_calculation_error, sizeof(__pyx_k_Raised_on_hash_calculation_error), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_hash_calculation_error */ - {__pyx_k_Raised_on_hash_initialisation_er, sizeof(__pyx_k_Raised_on_hash_initialisation_er), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_hash_initialisation_er */ {__pyx_k_Raised_on_invalid_MAC, sizeof(__pyx_k_Raised_on_invalid_MAC), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_invalid_MAC */ {__pyx_k_Raised_on_invalid_method_errors, sizeof(__pyx_k_Raised_on_invalid_method_errors), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_invalid_method_errors */ {__pyx_k_Raised_on_invalid_poll_type_erro, sizeof(__pyx_k_Raised_on_invalid_poll_type_erro), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Raised_on_invalid_poll_type_erro */ diff --git a/ssh2/exceptions.pyx b/ssh2/exceptions.pyx index 40516592..646ae779 100644 --- a/ssh2/exceptions.pyx +++ b/ssh2/exceptions.pyx @@ -315,17 +315,5 @@ class AlgoUnsupportedError(SSH2Error): """Raised on unsupported algorithm error""" -class MacFailureError(SSH2Error): - """Raised on MAC failure error""" - - -class HashInitError(SSH2Error): - """Raised on hash initialisation error""" - - -class HashCalcError(SSH2Error): - """Raised on hash calculation error""" - - class UnknownError(SSH2Error): """Raised on non-specific or unknown errors""" diff --git a/ssh2/utils.c b/ssh2/utils.c index 7f3bb590..9093fbb6 100644 --- a/ssh2/utils.c +++ b/ssh2/utils.c @@ -2366,8 +2366,6 @@ static const char __pyx_k_RandGenError[] = "RandGenError"; static const char __pyx_k_UnknownError[] = "UnknownError"; static const char __pyx_k_is_coroutine[] = "_is_coroutine"; static const char __pyx_k_CompressError[] = "CompressError"; -static const char __pyx_k_HashCalcError[] = "HashCalcError"; -static const char __pyx_k_HashInitError[] = "HashInitError"; static const char __pyx_k_ProtocolError[] = "ProtocolError"; static const char __pyx_k_SocketTimeout[] = "SocketTimeout"; static const char __pyx_k_BadSocketError[] = "BadSocketError"; @@ -2378,7 +2376,6 @@ static const char __pyx_k_BannerRecvError[] = "BannerRecvError"; static const char __pyx_k_BannerSendError[] = "BannerSendError"; static const char __pyx_k_InvalidMACError[] = "InvalidMACError"; static const char __pyx_k_KexFailureError[] = "KexFailureError"; -static const char __pyx_k_MacFailureError[] = "MacFailureError"; static const char __pyx_k_MethodNoneError[] = "MethodNoneError"; static const char __pyx_k_SocketRecvError[] = "SocketRecvError"; static const char __pyx_k_SocketSendError[] = "SocketSendError"; @@ -2418,7 +2415,7 @@ static const char __pyx_k_PublicKeyProtocolError[] = "PublicKeyProtocolError"; static const char __pyx_k_PublickeyUnverifiedError[] = "PublickeyUnverifiedError"; static const char __pyx_k_MissingUserAuthBannerError[] = "MissingUserAuthBannerError"; static const char __pyx_k_31_2_Q_q_aq_x_DA_q_x_EQ_6_T[] = "\320\0003\2601\360\014\000\005\033\230'\320!2\260!\330\004\007\200{\220#\220Q\330\010\017\210q\330\004\016\210a\210q\330\014\027\220x\320\037D\300A\330\004\017\210q\220\001\330\014\027\220x\320\037E\300Q\330\004\013\2106\220\021\220)\230:\240T\250\021"; -static const char __pyx_k_2_xs_q_q_q_q_j_q_j_q_j_q_j_q_j[] = "\320\0002\260!\360\026\000\005\010\200x\210s\220!\330\010\017\210q\330\t\021\220\036\230q\330\010\017\210q\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036""\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\360\006\000\t\014\2108\2202\220Q\330\014\022\220*\230M\250\021\320*E\300Q\330\010\017\210q"; +static const char __pyx_k_2_xs_q_q_q_q_j_q_j_q_j_q_j_q_j[] = "\320\0002\260!\360\026\000\005\010\200x\210s\220!\330\010\017\210q\330\t\021\220\036\230q\330\010\017\210q\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036""\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\330\t\021\220\036\230q\330\010\016\210j\230\001\360\006\000\t\014\2108\2202\220Q\330\014\022\220*\230M\250\021\320*E\300Q\330\010\017\210q"; static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_4ssh2_5utils_find_eol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_buf, Py_ssize_t __pyx_v_pos); /* proto */ @@ -2470,7 +2467,7 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; PyObject *__pyx_tuple[1]; PyObject *__pyx_codeobj_tab[5]; - PyObject *__pyx_string_tab[100]; + PyObject *__pyx_string_tab[97]; PyObject *__pyx_int_0; PyObject *__pyx_int_1; PyObject *__pyx_int_neg_1; @@ -2536,81 +2533,78 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_EncryptError __pyx_string_tab[22] #define __pyx_kp_u_Error_code_s_not_known __pyx_string_tab[23] #define __pyx_n_u_FileError __pyx_string_tab[24] -#define __pyx_n_u_HashCalcError __pyx_string_tab[25] -#define __pyx_n_u_HashInitError __pyx_string_tab[26] -#define __pyx_n_u_HostkeyInitError __pyx_string_tab[27] -#define __pyx_n_u_HostkeySignError __pyx_string_tab[28] -#define __pyx_n_u_InvalidMACError __pyx_string_tab[29] -#define __pyx_n_u_InvalidPollTypeError __pyx_string_tab[30] -#define __pyx_n_u_InvalidRequestError __pyx_string_tab[31] -#define __pyx_n_u_KexFailureError __pyx_string_tab[32] -#define __pyx_n_u_KeyExchangeError __pyx_string_tab[33] -#define __pyx_n_u_KeyfileAuthFailedError __pyx_string_tab[34] -#define __pyx_n_u_KnownHostError __pyx_string_tab[35] -#define __pyx_n_u_MacFailureError __pyx_string_tab[36] -#define __pyx_n_u_MethodNoneError __pyx_string_tab[37] -#define __pyx_n_u_MethodNotSupported __pyx_string_tab[38] -#define __pyx_n_u_MissingUserAuthBannerError __pyx_string_tab[39] -#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[40] -#define __pyx_n_u_OutOfBoundaryError __pyx_string_tab[41] -#define __pyx_n_u_PasswordExpiredError __pyx_string_tab[42] -#define __pyx_n_u_ProtocolError __pyx_string_tab[43] -#define __pyx_n_u_PublicKeyProtocolError __pyx_string_tab[44] -#define __pyx_n_u_PublickeyUnverifiedError __pyx_string_tab[45] -#define __pyx_n_u_RandGenError __pyx_string_tab[46] -#define __pyx_n_u_RequestDeniedError __pyx_string_tab[47] -#define __pyx_n_u_SCPProtocolError __pyx_string_tab[48] -#define __pyx_n_u_SFTPProtocolError __pyx_string_tab[49] -#define __pyx_n_u_SSH2Error __pyx_string_tab[50] -#define __pyx_n_u_SocketDisconnectError __pyx_string_tab[51] -#define __pyx_n_u_SocketRecvError __pyx_string_tab[52] -#define __pyx_n_u_SocketSendError __pyx_string_tab[53] -#define __pyx_n_u_SocketTimeout __pyx_string_tab[54] -#define __pyx_n_u_Timeout __pyx_string_tab[55] -#define __pyx_n_u_UnknownError __pyx_string_tab[56] -#define __pyx_n_u_ZlibError __pyx_string_tab[57] -#define __pyx_n_u__2 __pyx_string_tab[58] -#define __pyx_kp_u__3 __pyx_string_tab[59] -#define __pyx_kp_u_add_note __pyx_string_tab[60] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[61] -#define __pyx_n_u_block_directions __pyx_string_tab[62] -#define __pyx_n_u_buf __pyx_string_tab[63] -#define __pyx_n_u_buf_len __pyx_string_tab[64] -#define __pyx_n_u_c_buf __pyx_string_tab[65] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[66] -#define __pyx_n_u_cur_buf __pyx_string_tab[67] -#define __pyx_n_u_decode __pyx_string_tab[68] -#define __pyx_n_u_directions __pyx_string_tab[69] -#define __pyx_n_u_encode __pyx_string_tab[70] -#define __pyx_n_u_errcode __pyx_string_tab[71] -#define __pyx_n_u_exceptions __pyx_string_tab[72] -#define __pyx_n_u_find_eol __pyx_string_tab[73] -#define __pyx_n_u_func __pyx_string_tab[74] -#define __pyx_n_u_handle_error_codes __pyx_string_tab[75] -#define __pyx_n_u_index __pyx_string_tab[76] -#define __pyx_n_u_is_coroutine __pyx_string_tab[77] -#define __pyx_n_u_main __pyx_string_tab[78] -#define __pyx_n_u_module __pyx_string_tab[79] -#define __pyx_n_u_name __pyx_string_tab[80] -#define __pyx_n_u_new_pos __pyx_string_tab[81] -#define __pyx_n_u_pop __pyx_string_tab[82] -#define __pyx_n_u_pos __pyx_string_tab[83] -#define __pyx_n_u_qualname __pyx_string_tab[84] -#define __pyx_n_u_readfds __pyx_string_tab[85] -#define __pyx_n_u_required_version __pyx_string_tab[86] -#define __pyx_n_u_select __pyx_string_tab[87] -#define __pyx_n_u_session __pyx_string_tab[88] -#define __pyx_n_u_set_name __pyx_string_tab[89] -#define __pyx_n_u_socket __pyx_string_tab[90] -#define __pyx_n_u_ssh2_exit __pyx_string_tab[91] -#define __pyx_n_u_ssh2_utils __pyx_string_tab[92] -#define __pyx_kp_u_ssh2_utils_pyx __pyx_string_tab[93] -#define __pyx_n_u_test __pyx_string_tab[94] -#define __pyx_n_u_timeout __pyx_string_tab[95] -#define __pyx_kp_u_utf_8 __pyx_string_tab[96] -#define __pyx_n_u_version __pyx_string_tab[97] -#define __pyx_n_u_wait_socket __pyx_string_tab[98] -#define __pyx_n_u_writefds __pyx_string_tab[99] +#define __pyx_n_u_HostkeyInitError __pyx_string_tab[25] +#define __pyx_n_u_HostkeySignError __pyx_string_tab[26] +#define __pyx_n_u_InvalidMACError __pyx_string_tab[27] +#define __pyx_n_u_InvalidPollTypeError __pyx_string_tab[28] +#define __pyx_n_u_InvalidRequestError __pyx_string_tab[29] +#define __pyx_n_u_KexFailureError __pyx_string_tab[30] +#define __pyx_n_u_KeyExchangeError __pyx_string_tab[31] +#define __pyx_n_u_KeyfileAuthFailedError __pyx_string_tab[32] +#define __pyx_n_u_KnownHostError __pyx_string_tab[33] +#define __pyx_n_u_MethodNoneError __pyx_string_tab[34] +#define __pyx_n_u_MethodNotSupported __pyx_string_tab[35] +#define __pyx_n_u_MissingUserAuthBannerError __pyx_string_tab[36] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[37] +#define __pyx_n_u_OutOfBoundaryError __pyx_string_tab[38] +#define __pyx_n_u_PasswordExpiredError __pyx_string_tab[39] +#define __pyx_n_u_ProtocolError __pyx_string_tab[40] +#define __pyx_n_u_PublicKeyProtocolError __pyx_string_tab[41] +#define __pyx_n_u_PublickeyUnverifiedError __pyx_string_tab[42] +#define __pyx_n_u_RandGenError __pyx_string_tab[43] +#define __pyx_n_u_RequestDeniedError __pyx_string_tab[44] +#define __pyx_n_u_SCPProtocolError __pyx_string_tab[45] +#define __pyx_n_u_SFTPProtocolError __pyx_string_tab[46] +#define __pyx_n_u_SSH2Error __pyx_string_tab[47] +#define __pyx_n_u_SocketDisconnectError __pyx_string_tab[48] +#define __pyx_n_u_SocketRecvError __pyx_string_tab[49] +#define __pyx_n_u_SocketSendError __pyx_string_tab[50] +#define __pyx_n_u_SocketTimeout __pyx_string_tab[51] +#define __pyx_n_u_Timeout __pyx_string_tab[52] +#define __pyx_n_u_UnknownError __pyx_string_tab[53] +#define __pyx_n_u_ZlibError __pyx_string_tab[54] +#define __pyx_n_u__2 __pyx_string_tab[55] +#define __pyx_kp_u__3 __pyx_string_tab[56] +#define __pyx_kp_u_add_note __pyx_string_tab[57] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[58] +#define __pyx_n_u_block_directions __pyx_string_tab[59] +#define __pyx_n_u_buf __pyx_string_tab[60] +#define __pyx_n_u_buf_len __pyx_string_tab[61] +#define __pyx_n_u_c_buf __pyx_string_tab[62] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[63] +#define __pyx_n_u_cur_buf __pyx_string_tab[64] +#define __pyx_n_u_decode __pyx_string_tab[65] +#define __pyx_n_u_directions __pyx_string_tab[66] +#define __pyx_n_u_encode __pyx_string_tab[67] +#define __pyx_n_u_errcode __pyx_string_tab[68] +#define __pyx_n_u_exceptions __pyx_string_tab[69] +#define __pyx_n_u_find_eol __pyx_string_tab[70] +#define __pyx_n_u_func __pyx_string_tab[71] +#define __pyx_n_u_handle_error_codes __pyx_string_tab[72] +#define __pyx_n_u_index __pyx_string_tab[73] +#define __pyx_n_u_is_coroutine __pyx_string_tab[74] +#define __pyx_n_u_main __pyx_string_tab[75] +#define __pyx_n_u_module __pyx_string_tab[76] +#define __pyx_n_u_name __pyx_string_tab[77] +#define __pyx_n_u_new_pos __pyx_string_tab[78] +#define __pyx_n_u_pop __pyx_string_tab[79] +#define __pyx_n_u_pos __pyx_string_tab[80] +#define __pyx_n_u_qualname __pyx_string_tab[81] +#define __pyx_n_u_readfds __pyx_string_tab[82] +#define __pyx_n_u_required_version __pyx_string_tab[83] +#define __pyx_n_u_select __pyx_string_tab[84] +#define __pyx_n_u_session __pyx_string_tab[85] +#define __pyx_n_u_set_name __pyx_string_tab[86] +#define __pyx_n_u_socket __pyx_string_tab[87] +#define __pyx_n_u_ssh2_exit __pyx_string_tab[88] +#define __pyx_n_u_ssh2_utils __pyx_string_tab[89] +#define __pyx_kp_u_ssh2_utils_pyx __pyx_string_tab[90] +#define __pyx_n_u_test __pyx_string_tab[91] +#define __pyx_n_u_timeout __pyx_string_tab[92] +#define __pyx_kp_u_utf_8 __pyx_string_tab[93] +#define __pyx_n_u_version __pyx_string_tab[94] +#define __pyx_n_u_wait_socket __pyx_string_tab[95] +#define __pyx_n_u_writefds __pyx_string_tab[96] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { @@ -2636,7 +2630,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_ptype_4ssh2_7session_FlagType); for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } for (int i=0; i<5; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<100; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<97; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } Py_CLEAR(clear_module_state->__pyx_int_0); Py_CLEAR(clear_module_state->__pyx_int_1); Py_CLEAR(clear_module_state->__pyx_int_neg_1); @@ -2665,7 +2659,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_ptype_4ssh2_7session_FlagType); for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } for (int i=0; i<5; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<100; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<97; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1); __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_neg_1); @@ -5296,8 +5290,8 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U * raise exceptions.MissingUserAuthBannerError * elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: * raise exceptions.AlgoUnsupportedError # <<<<<<<<<<<<<< - * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: - * raise exceptions.MacFailureError + * else: + * # Switch default */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -5313,90 +5307,12 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U * raise exceptions.MissingUserAuthBannerError * elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: # <<<<<<<<<<<<<< * raise exceptions.AlgoUnsupportedError - * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: -*/ - break; - case LIBSSH2_ERROR_MAC_FAILURE: - - /* "ssh2/utils.pyx":232 - * raise exceptions.AlgoUnsupportedError - * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: - * raise exceptions.MacFailureError # <<<<<<<<<<<<<< - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: - * raise exceptions.HashInitError -*/ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_MacFailureError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 232, __pyx_L1_error) - - /* "ssh2/utils.pyx":231 - * elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: - * raise exceptions.AlgoUnsupportedError - * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: # <<<<<<<<<<<<<< - * raise exceptions.MacFailureError - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: -*/ - break; - case LIBSSH2_ERROR_HASH_INIT: - - /* "ssh2/utils.pyx":234 - * raise exceptions.MacFailureError - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: - * raise exceptions.HashInitError # <<<<<<<<<<<<<< - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: - * raise exceptions.HashCalcError -*/ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_HashInitError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 234, __pyx_L1_error) - - /* "ssh2/utils.pyx":233 - * elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: - * raise exceptions.MacFailureError - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: # <<<<<<<<<<<<<< - * raise exceptions.HashInitError - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: -*/ - break; - case LIBSSH2_ERROR_HASH_CALC: - - /* "ssh2/utils.pyx":236 - * raise exceptions.HashInitError - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: - * raise exceptions.HashCalcError # <<<<<<<<<<<<<< - * else: - * # Switch default -*/ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_HashCalcError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 236, __pyx_L1_error) - - /* "ssh2/utils.pyx":235 - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: - * raise exceptions.HashInitError - * elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: # <<<<<<<<<<<<<< - * raise exceptions.HashCalcError * else: */ break; default: - /* "ssh2/utils.pyx":239 + /* "ssh2/utils.pyx":233 * else: * # Switch default * if errcode < 0: # <<<<<<<<<<<<<< @@ -5406,46 +5322,46 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U __pyx_t_3 = (__pyx_v_errcode < 0); if (unlikely(__pyx_t_3)) { - /* "ssh2/utils.pyx":240 + /* "ssh2/utils.pyx":234 * # Switch default * if errcode < 0: * raise exceptions.UnknownError("Error code %s not known", errcode) # <<<<<<<<<<<<<< * return errcode */ - __pyx_t_1 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exceptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnknownError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UnknownError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_errcode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_errcode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5); - assert(__pyx_t_1); + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); + assert(__pyx_t_2); PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx__function); __Pyx_DECREF_SET(__pyx_t_5, __pyx__function); __pyx_t_6 = 0; } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Error_code_s_not_known, __pyx_t_4}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Error_code_s_not_known, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 240, __pyx_L1_error) + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 234, __pyx_L1_error) - /* "ssh2/utils.pyx":239 + /* "ssh2/utils.pyx":233 * else: * # Switch default * if errcode < 0: # <<<<<<<<<<<<<< @@ -5454,7 +5370,7 @@ static int __pyx_f_4ssh2_5utils_handle_error_codes(int __pyx_v_errcode, CYTHON_U */ } - /* "ssh2/utils.pyx":241 + /* "ssh2/utils.pyx":235 * if errcode < 0: * raise exceptions.UnknownError("Error code %s not known", errcode) * return errcode # <<<<<<<<<<<<<< @@ -6219,8 +6135,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_EncryptError, sizeof(__pyx_k_EncryptError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncryptError */ {__pyx_k_Error_code_s_not_known, sizeof(__pyx_k_Error_code_s_not_known), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Error_code_s_not_known */ {__pyx_k_FileError, sizeof(__pyx_k_FileError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FileError */ - {__pyx_k_HashCalcError, sizeof(__pyx_k_HashCalcError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HashCalcError */ - {__pyx_k_HashInitError, sizeof(__pyx_k_HashInitError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HashInitError */ {__pyx_k_HostkeyInitError, sizeof(__pyx_k_HostkeyInitError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HostkeyInitError */ {__pyx_k_HostkeySignError, sizeof(__pyx_k_HostkeySignError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_HostkeySignError */ {__pyx_k_InvalidMACError, sizeof(__pyx_k_InvalidMACError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_InvalidMACError */ @@ -6230,7 +6144,6 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = { {__pyx_k_KeyExchangeError, sizeof(__pyx_k_KeyExchangeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KeyExchangeError */ {__pyx_k_KeyfileAuthFailedError, sizeof(__pyx_k_KeyfileAuthFailedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KeyfileAuthFailedError */ {__pyx_k_KnownHostError, sizeof(__pyx_k_KnownHostError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KnownHostError */ - {__pyx_k_MacFailureError, sizeof(__pyx_k_MacFailureError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MacFailureError */ {__pyx_k_MethodNoneError, sizeof(__pyx_k_MethodNoneError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodNoneError */ {__pyx_k_MethodNotSupported, sizeof(__pyx_k_MethodNotSupported), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MethodNotSupported */ {__pyx_k_MissingUserAuthBannerError, sizeof(__pyx_k_MissingUserAuthBannerError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MissingUserAuthBannerError */ @@ -6388,7 +6301,7 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_utils_pyx, __pyx_mstate->__pyx_n_u_wait_socket, __pyx_k_31_2_Q_q_aq_x_DA_q_x_EQ_6_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116, 805}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116, 763}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_errcode}; __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_ssh2_utils_pyx, __pyx_mstate->__pyx_n_u_handle_error_codes, __pyx_k_2_xs_q_q_q_q_j_q_j_q_j_q_j_q_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } diff --git a/ssh2/utils.pyx b/ssh2/utils.pyx index 8ee40efe..d96accff 100644 --- a/ssh2/utils.pyx +++ b/ssh2/utils.pyx @@ -228,12 +228,6 @@ cpdef int handle_error_codes(int errcode) except -1: raise exceptions.MissingUserAuthBannerError elif errcode == error_codes._LIBSSH2_ERROR_ALGO_UNSUPPORTED: raise exceptions.AlgoUnsupportedError - elif errcode == error_codes._LIBSSH2_ERROR_MAC_FAILURE: - raise exceptions.MacFailureError - elif errcode == error_codes._LIBSSH2_ERROR_HASH_INIT: - raise exceptions.HashInitError - elif errcode == error_codes._LIBSSH2_ERROR_HASH_CALC: - raise exceptions.HashCalcError else: # Switch default if errcode < 0: diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index c2f6c294..b2c9804b 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -22,8 +22,7 @@ LIBSSH2_ERROR_AGENT_PROTOCOL, LIBSSH2_ERROR_SOCKET_RECV, \ LIBSSH2_ERROR_SOCKET_SEND, LIBSSH2_ERROR_ENCRYPT, \ LIBSSH2_ERROR_BAD_SOCKET, LIBSSH2_ERROR_KNOWN_HOSTS, \ - LIBSSH2_ERROR_RANDGEN, LIBSSH2_ERROR_MISSING_USERAUTH_BANNER, LIBSSH2_ERROR_ALGO_UNSUPPORTED, \ - LIBSSH2_ERROR_MAC_FAILURE, LIBSSH2_ERROR_HASH_INIT, LIBSSH2_ERROR_HASH_CALC + LIBSSH2_ERROR_RANDGEN, LIBSSH2_ERROR_MISSING_USERAUTH_BANNER, LIBSSH2_ERROR_ALGO_UNSUPPORTED from ssh2.exceptions import SSH2Error, AgentError, AuthenticationError, \ AgentConnectionError, AgentAuthenticationError, AgentListIdentitiesError, \ AgentGetIdentityError, AgentProtocolError, SessionError, \ @@ -41,7 +40,7 @@ BadUseError, CompressError, OutOfBoundaryError, SocketRecvError, \ SocketSendError, EncryptError, BadSocketError, SFTPError, SFTPProtocolError, \ KnownHostError, UnknownError, RandGenError, MissingUserAuthBannerError, \ - AlgoUnsupportedError, MacFailureError, HashInitError, HashCalcError + AlgoUnsupportedError from ssh2.utils import handle_error_codes @@ -71,9 +70,6 @@ def test_general_errors(self): self.assertRaises(RandGenError, handle_error_codes, LIBSSH2_ERROR_RANDGEN) self.assertRaises(MissingUserAuthBannerError, handle_error_codes, LIBSSH2_ERROR_MISSING_USERAUTH_BANNER) self.assertRaises(AlgoUnsupportedError, handle_error_codes, LIBSSH2_ERROR_ALGO_UNSUPPORTED) - self.assertRaises(MacFailureError, handle_error_codes, LIBSSH2_ERROR_MAC_FAILURE) - self.assertRaises(HashInitError, handle_error_codes, LIBSSH2_ERROR_HASH_INIT) - self.assertRaises(HashCalcError, handle_error_codes, LIBSSH2_ERROR_HASH_CALC) def test_channel_errors(self): self.assertRaises(ChannelOutOfOrderError, handle_error_codes, LIBSSH2_ERROR_CHANNEL_OUTOFORDER)