diff --git a/.gitignore b/.gitignore index 0e4eef7..8899ac3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ local libssh/compile_commands.json wheelhouse .idea +tests/unit_test_cert_key-cert.pub diff --git a/examples/exec.py b/examples/exec.py new file mode 100644 index 0000000..38ba16f --- /dev/null +++ b/examples/exec.py @@ -0,0 +1,33 @@ +import os +import pwd +import socket + +from ssh.session import Session +from ssh import options + +# Linux only +USERNAME = pwd.getpwuid(os.geteuid()).pw_name +HOST = 'localhost' +PORT = 22 + +sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +sock.connect((HOST, PORT)) + +s = Session() +s.options_set(options.HOST, HOST) +s.options_set(options.USER, USERNAME) +s.options_set_port(PORT) +s.set_socket(sock) +s.connect() + +# Authenticate with agent +s.userauth_agent(USERNAME) + +chan = s.channel_new() +chan.open_session() +chan.request_exec('echo me') +size, data = chan.read() +while size > 0: + print(data.strip()) + size, data = chan.read() +chan.close() diff --git a/ssh/c_ssh.pxd b/ssh/c_ssh.pxd index 0b5eabe..cd3358d 100644 --- a/ssh/c_ssh.pxd +++ b/ssh/c_ssh.pxd @@ -175,7 +175,14 @@ cdef extern from "libssh/libssh.h" nogil: SSH_KEYTYPE_ECDSA, SSH_KEYTYPE_ED25519, SSH_KEYTYPE_DSS_CERT01, - SSH_KEYTYPE_RSA_CERT01 + SSH_KEYTYPE_RSA_CERT01, + SSH_KEYTYPE_ECDSA_P256, + SSH_KEYTYPE_ECDSA_P384, + SSH_KEYTYPE_ECDSA_P521, + SSH_KEYTYPE_ECDSA_P256_CERT01, + SSH_KEYTYPE_ECDSA_P384_CERT01, + SSH_KEYTYPE_ECDSA_P521_CERT01, + SSH_KEYTYPE_ED25519_CERT01 enum ssh_keycmp_e: SSH_KEY_CMP_PUBLIC, SSH_KEY_CMP_PRIVATE @@ -452,6 +459,12 @@ cdef extern from "libssh/libssh.h" nogil: const char *ssh_pki_key_ecdsa_name(const ssh_key key) + char *ssh_get_fingerprint_hash(ssh_publickey_hash_type type, + unsigned char *hash, + size_t len) + void ssh_print_hash(ssh_publickey_hash_type type, + unsigned char *hash, + size_t len) void ssh_print_hexa( const char *descr, const unsigned char *what, size_t len) int ssh_send_ignore(ssh_session session, const char *data) diff --git a/ssh/key.c b/ssh/key.c index 687e696..c1263bd 100644 --- a/ssh/key.c +++ b/ssh/key.c @@ -843,6 +843,13 @@ struct __pyx_obj_3ssh_8keytypes_RSA1Key; struct __pyx_obj_3ssh_8keytypes_ECDSAKey; struct __pyx_obj_3ssh_8keytypes_DSSCert01Key; struct __pyx_obj_3ssh_8keytypes_RSACert01Key; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P256; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P384; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P521; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01; +struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01; struct __pyx_obj_3ssh_3key_SSHKey; /* "keytypes.pxd":20 @@ -930,6 +937,90 @@ struct __pyx_obj_3ssh_8keytypes_RSACert01Key { }; +/* "keytypes.pxd":48 + * + * + * cdef class ECDSA_P256(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P256 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "keytypes.pxd":52 + * + * + * cdef class ECDSA_P384(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P384 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "keytypes.pxd":56 + * + * + * cdef class ECDSA_P521(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P521 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "keytypes.pxd":60 + * + * + * cdef class ECDSA_P256_CERT01(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "keytypes.pxd":64 + * + * + * cdef class ECDSA_P384_CERT01(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "keytypes.pxd":68 + * + * + * cdef class ECDSA_P521_CERT01(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "keytypes.pxd":72 + * + * + * cdef class ED25519_CERT01(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + /* "ssh/key.pxd":20 * * @@ -1146,6 +1237,51 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#else +#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectCallNoArg.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); +#else +#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) +#endif + +/* PyCFunctionFastCall.proto */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); +#else +#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) +#endif + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); @@ -1271,6 +1407,13 @@ static PyTypeObject *__pyx_ptype_3ssh_8keytypes_RSA1Key = 0; static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSAKey = 0; static PyTypeObject *__pyx_ptype_3ssh_8keytypes_DSSCert01Key = 0; static PyTypeObject *__pyx_ptype_3ssh_8keytypes_RSACert01Key = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P256 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P384 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P521 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P256_CERT01 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P384_CERT01 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P521_CERT01 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ED25519_CERT01 = 0; static struct __pyx_obj_3ssh_8keytypes_KeyType *(*__pyx_f_3ssh_8keytypes_from_keytype)(enum ssh_keytypes_e); /*proto*/ /* Module declarations from 'ssh.utils' */ @@ -1300,17 +1443,23 @@ static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_b64_key[] = "b64_key"; static const char __pyx_k_ssh_key[] = "ssh.key"; +static const char __pyx_k_b64_cert[] = "b64_cert"; +static const char __pyx_k_cert_key[] = "cert_key"; static const char __pyx_k_filepath[] = "filepath"; static const char __pyx_k_generate[] = "generate"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_key_type[] = "key_type"; +static const char __pyx_k_priv_key[] = "priv_key"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_b_filepath[] = "b_filepath"; static const char __pyx_k_c_filepath[] = "c_filepath"; +static const char __pyx_k_cert_key_2[] = "_cert_key"; static const char __pyx_k_exceptions[] = "exceptions"; +static const char __pyx_k_is_private[] = "is_private"; static const char __pyx_k_passphrase[] = "passphrase"; +static const char __pyx_k_priv_key_2[] = "_priv_key"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_ssh_key_pyx[] = "ssh/key.pyx"; @@ -1320,10 +1469,13 @@ static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_KeyExportError[] = "KeyExportError"; static const char __pyx_k_KeyImportError[] = "KeyImportError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_import_cert_file[] = "import_cert_file"; static const char __pyx_k_KeyGenerationError[] = "KeyGenerationError"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_import_cert_base64[] = "import_cert_base64"; static const char __pyx_k_import_pubkey_file[] = "import_pubkey_file"; static const char __pyx_k_import_privkey_file[] = "import_privkey_file"; +static const char __pyx_k_copy_cert_to_privkey[] = "copy_cert_to_privkey"; static const char __pyx_k_import_pubkey_base64[] = "import_pubkey_base64"; static const char __pyx_k_import_privkey_base64[] = "import_privkey_base64"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; @@ -1334,6 +1486,7 @@ static PyObject *__pyx_n_s_MemoryError; static PyObject *__pyx_n_s_SSHKey; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_b__3; +static PyObject *__pyx_n_s_b64_cert; static PyObject *__pyx_n_s_b64_key; static PyObject *__pyx_n_s_b_filepath; static PyObject *__pyx_n_s_b_passphrase; @@ -1341,16 +1494,22 @@ static PyObject *__pyx_n_s_bits; static PyObject *__pyx_n_s_c_filepath; static PyObject *__pyx_n_s_c_key; static PyObject *__pyx_n_s_c_passphrase; +static PyObject *__pyx_n_s_cert_key; +static PyObject *__pyx_n_s_cert_key_2; static PyObject *__pyx_n_s_cline_in_traceback; +static PyObject *__pyx_n_s_copy_cert_to_privkey; static PyObject *__pyx_n_s_exceptions; static PyObject *__pyx_n_s_filepath; static PyObject *__pyx_n_s_generate; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_import; +static PyObject *__pyx_n_s_import_cert_base64; +static PyObject *__pyx_n_s_import_cert_file; static PyObject *__pyx_n_s_import_privkey_base64; static PyObject *__pyx_n_s_import_privkey_file; static PyObject *__pyx_n_s_import_pubkey_base64; static PyObject *__pyx_n_s_import_pubkey_file; +static PyObject *__pyx_n_s_is_private; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_key_2; static PyObject *__pyx_n_s_key_type; @@ -1358,6 +1517,8 @@ static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_name; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_passphrase; +static PyObject *__pyx_n_s_priv_key; +static PyObject *__pyx_n_s_priv_key_2; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_rc; static PyObject *__pyx_n_s_reduce; @@ -1385,6 +1546,9 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath, PyObject *__pyx_v_passphrase); /* proto */ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b64_key, struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_key_type); /* proto */ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3ssh_3key_10import_cert_base64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b64_cert, struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_key_type); /* proto */ +static PyObject *__pyx_pf_3ssh_3key_12import_cert_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath); /* proto */ +static PyObject *__pyx_pf_3ssh_3key_14copy_cert_to_privkey(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_3ssh_3key_SSHKey *__pyx_v_cert_key, struct __pyx_obj_3ssh_3key_SSHKey *__pyx_v_priv_key); /* proto */ static PyObject *__pyx_tp_new_3ssh_3key_SSHKey(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; @@ -1393,11 +1557,17 @@ static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__14; +static PyObject *__pyx_tuple__16; +static PyObject *__pyx_tuple__18; static PyObject *__pyx_codeobj__5; static PyObject *__pyx_codeobj__7; static PyObject *__pyx_codeobj__9; static PyObject *__pyx_codeobj__11; static PyObject *__pyx_codeobj__13; +static PyObject *__pyx_codeobj__15; +static PyObject *__pyx_codeobj__17; +static PyObject *__pyx_codeobj__19; /* Late includes */ /* "ssh/key.pyx":30 @@ -2010,7 +2180,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_8__eq__(struct __pyx_obj_3ssh_3key_S * * def key_type(self): # <<<<<<<<<<<<<< * cdef c_ssh.ssh_keytypes_e _type - * with nogil: + * if self._key is NULL: */ /* Python wrapper */ @@ -2031,7 +2201,8 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_10key_type(struct __pyx_obj_3ssh_3ke enum ssh_keytypes_e __pyx_v__type; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -2040,59 +2211,54 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_10key_type(struct __pyx_obj_3ssh_3ke /* "ssh/key.pyx":72 * def key_type(self): * cdef c_ssh.ssh_keytypes_e _type - * with nogil: # <<<<<<<<<<<<<< - * _type = c_ssh.ssh_key_type(self._key) - * return from_keytype(_type) + * if self._key is NULL: # <<<<<<<<<<<<<< + * return + * _type = c_ssh.ssh_key_type(self._key) */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { + __pyx_t_1 = ((__pyx_v_self->_key == NULL) != 0); + if (__pyx_t_1) { - /* "ssh/key.pyx":73 + /* "ssh/key.pyx":73 * cdef c_ssh.ssh_keytypes_e _type - * with nogil: - * _type = c_ssh.ssh_key_type(self._key) # <<<<<<<<<<<<<< + * if self._key is NULL: + * return # <<<<<<<<<<<<<< + * _type = c_ssh.ssh_key_type(self._key) * return from_keytype(_type) - * */ - __pyx_v__type = ssh_key_type(__pyx_v_self->_key); - } + __Pyx_XDECREF(__pyx_r); + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; - /* "ssh/key.pyx":72 + /* "ssh/key.pyx":72 * def key_type(self): * cdef c_ssh.ssh_keytypes_e _type - * with nogil: # <<<<<<<<<<<<<< - * _type = c_ssh.ssh_key_type(self._key) - * return from_keytype(_type) + * if self._key is NULL: # <<<<<<<<<<<<<< + * return + * _type = c_ssh.ssh_key_type(self._key) */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } } /* "ssh/key.pyx":74 - * with nogil: - * _type = c_ssh.ssh_key_type(self._key) + * if self._key is NULL: + * return + * _type = c_ssh.ssh_key_type(self._key) # <<<<<<<<<<<<<< + * return from_keytype(_type) + * + */ + __pyx_v__type = ssh_key_type(__pyx_v_self->_key); + + /* "ssh/key.pyx":75 + * return + * _type = c_ssh.ssh_key_type(self._key) * return from_keytype(_type) # <<<<<<<<<<<<<< * * def ecdsa_name(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_3ssh_8keytypes_from_keytype(__pyx_v__type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = ((PyObject *)__pyx_f_3ssh_8keytypes_from_keytype(__pyx_v__type)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; /* "ssh/key.pyx":70 @@ -2100,12 +2266,12 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_10key_type(struct __pyx_obj_3ssh_3ke * * def key_type(self): # <<<<<<<<<<<<<< * cdef c_ssh.ssh_keytypes_e _type - * with nogil: + * if self._key is NULL: */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("ssh.key.SSHKey.key_type", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -2114,7 +2280,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_10key_type(struct __pyx_obj_3ssh_3ke return __pyx_r; } -/* "ssh/key.pyx":76 +/* "ssh/key.pyx":77 * return from_keytype(_type) * * def ecdsa_name(self): # <<<<<<<<<<<<<< @@ -2148,7 +2314,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_12ecdsa_name(struct __pyx_obj_3ssh_3 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ecdsa_name", 0); - /* "ssh/key.pyx":79 + /* "ssh/key.pyx":80 * cdef const_char *c_name * cdef bytes b_name * with nogil: # <<<<<<<<<<<<<< @@ -2163,7 +2329,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_12ecdsa_name(struct __pyx_obj_3ssh_3 #endif /*try:*/ { - /* "ssh/key.pyx":80 + /* "ssh/key.pyx":81 * cdef bytes b_name * with nogil: * c_name = c_ssh.ssh_pki_key_ecdsa_name(self._key) # <<<<<<<<<<<<<< @@ -2173,7 +2339,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_12ecdsa_name(struct __pyx_obj_3ssh_3 __pyx_v_c_name = ssh_pki_key_ecdsa_name(__pyx_v_self->_key); } - /* "ssh/key.pyx":79 + /* "ssh/key.pyx":80 * cdef const_char *c_name * cdef bytes b_name * with nogil: # <<<<<<<<<<<<<< @@ -2192,19 +2358,19 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_12ecdsa_name(struct __pyx_obj_3ssh_3 } } - /* "ssh/key.pyx":81 + /* "ssh/key.pyx":82 * with nogil: * c_name = c_ssh.ssh_pki_key_ecdsa_name(self._key) * b_name = c_name # <<<<<<<<<<<<<< * return to_str(b_name) * */ - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_name = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/key.pyx":82 + /* "ssh/key.pyx":83 * c_name = c_ssh.ssh_pki_key_ecdsa_name(self._key) * b_name = c_name * return to_str(b_name) # <<<<<<<<<<<<<< @@ -2212,14 +2378,14 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_12ecdsa_name(struct __pyx_obj_3ssh_3 * def export_privkey_file(self, filepath, passphrase=None): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_name); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_5utils_to_str(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_b_name); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3ssh_5utils_to_str(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh/key.pyx":76 + /* "ssh/key.pyx":77 * return from_keytype(_type) * * def ecdsa_name(self): # <<<<<<<<<<<<<< @@ -2239,7 +2405,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_12ecdsa_name(struct __pyx_obj_3ssh_3 return __pyx_r; } -/* "ssh/key.pyx":84 +/* "ssh/key.pyx":85 * return to_str(b_name) * * def export_privkey_file(self, filepath, passphrase=None): # <<<<<<<<<<<<<< @@ -2287,7 +2453,7 @@ static PyObject *__pyx_pw_3ssh_3key_6SSHKey_15export_privkey_file(PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "export_privkey_file") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "export_privkey_file") < 0)) __PYX_ERR(0, 85, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2303,7 +2469,7 @@ static PyObject *__pyx_pw_3ssh_3key_6SSHKey_15export_privkey_file(PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("export_privkey_file", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("export_privkey_file", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 85, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh.key.SSHKey.export_privkey_file", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2333,19 +2499,19 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("export_privkey_file", 0); - /* "ssh/key.pyx":86 + /* "ssh/key.pyx":87 * def export_privkey_file(self, filepath, passphrase=None): * cdef bytes b_passphrase * cdef bytes b_filepath = to_bytes(filepath) # <<<<<<<<<<<<<< * cdef const_char *c_passphrase = NULL * cdef const_char *c_filepath = b_filepath */ - __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filepath = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/key.pyx":87 + /* "ssh/key.pyx":88 * cdef bytes b_passphrase * cdef bytes b_filepath = to_bytes(filepath) * cdef const_char *c_passphrase = NULL # <<<<<<<<<<<<<< @@ -2354,7 +2520,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o */ __pyx_v_c_passphrase = NULL; - /* "ssh/key.pyx":88 + /* "ssh/key.pyx":89 * cdef bytes b_filepath = to_bytes(filepath) * cdef const_char *c_passphrase = NULL * cdef const_char *c_filepath = b_filepath # <<<<<<<<<<<<<< @@ -2363,12 +2529,12 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o */ if (unlikely(__pyx_v_b_filepath == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 88, __pyx_L1_error) + __PYX_ERR(0, 89, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_filepath); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_filepath); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) __pyx_v_c_filepath = __pyx_t_2; - /* "ssh/key.pyx":90 + /* "ssh/key.pyx":91 * cdef const_char *c_filepath = b_filepath * cdef int rc * if passphrase is not None: # <<<<<<<<<<<<<< @@ -2379,19 +2545,19 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "ssh/key.pyx":91 + /* "ssh/key.pyx":92 * cdef int rc * if passphrase is not None: * b_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< * c_passphrase = b_passphrase * with nogil: */ - __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/key.pyx":92 + /* "ssh/key.pyx":93 * if passphrase is not None: * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase # <<<<<<<<<<<<<< @@ -2400,12 +2566,12 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o */ if (unlikely(__pyx_v_b_passphrase == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 92, __pyx_L1_error) + __PYX_ERR(0, 93, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error) __pyx_v_c_passphrase = __pyx_t_2; - /* "ssh/key.pyx":90 + /* "ssh/key.pyx":91 * cdef const_char *c_filepath = b_filepath * cdef int rc * if passphrase is not None: # <<<<<<<<<<<<<< @@ -2414,7 +2580,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o */ } - /* "ssh/key.pyx":93 + /* "ssh/key.pyx":94 * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase * with nogil: # <<<<<<<<<<<<<< @@ -2429,7 +2595,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o #endif /*try:*/ { - /* "ssh/key.pyx":94 + /* "ssh/key.pyx":95 * c_passphrase = b_passphrase * with nogil: * rc = c_ssh.ssh_pki_export_privkey_file( # <<<<<<<<<<<<<< @@ -2439,7 +2605,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o __pyx_v_rc = ssh_pki_export_privkey_file(__pyx_v_self->_key, __pyx_v_c_passphrase, NULL, NULL, __pyx_v_c_filepath); } - /* "ssh/key.pyx":93 + /* "ssh/key.pyx":94 * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase * with nogil: # <<<<<<<<<<<<<< @@ -2458,7 +2624,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o } } - /* "ssh/key.pyx":96 + /* "ssh/key.pyx":97 * rc = c_ssh.ssh_pki_export_privkey_file( * self._key, c_passphrase, NULL, NULL, c_filepath) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -2468,20 +2634,20 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o __pyx_t_4 = ((__pyx_v_rc != SSH_OK) != 0); if (unlikely(__pyx_t_4)) { - /* "ssh/key.pyx":97 + /* "ssh/key.pyx":98 * self._key, c_passphrase, NULL, NULL, c_filepath) * if rc != c_ssh.SSH_OK: * raise KeyExportError # <<<<<<<<<<<<<< * * def export_privkey_to_pubkey(self): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyExportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyExportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 97, __pyx_L1_error) + __PYX_ERR(0, 98, __pyx_L1_error) - /* "ssh/key.pyx":96 + /* "ssh/key.pyx":97 * rc = c_ssh.ssh_pki_export_privkey_file( * self._key, c_passphrase, NULL, NULL, c_filepath) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -2490,7 +2656,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o */ } - /* "ssh/key.pyx":84 + /* "ssh/key.pyx":85 * return to_str(b_name) * * def export_privkey_file(self, filepath, passphrase=None): # <<<<<<<<<<<<<< @@ -2513,7 +2679,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_14export_privkey_file(struct __pyx_o return __pyx_r; } -/* "ssh/key.pyx":99 +/* "ssh/key.pyx":100 * raise KeyExportError * * def export_privkey_to_pubkey(self): # <<<<<<<<<<<<<< @@ -2548,7 +2714,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_16export_privkey_to_pubkey(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("export_privkey_to_pubkey", 0); - /* "ssh/key.pyx":103 + /* "ssh/key.pyx":104 * cdef c_ssh.ssh_key _pub_key * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2563,7 +2729,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_16export_privkey_to_pubkey(struct __ #endif /*try:*/ { - /* "ssh/key.pyx":104 + /* "ssh/key.pyx":105 * cdef int rc * with nogil: * rc = c_ssh.ssh_pki_export_privkey_to_pubkey(self._key, &_pub_key) # <<<<<<<<<<<<<< @@ -2573,7 +2739,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_16export_privkey_to_pubkey(struct __ __pyx_v_rc = ssh_pki_export_privkey_to_pubkey(__pyx_v_self->_key, (&__pyx_v__pub_key)); } - /* "ssh/key.pyx":103 + /* "ssh/key.pyx":104 * cdef c_ssh.ssh_key _pub_key * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -2592,7 +2758,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_16export_privkey_to_pubkey(struct __ } } - /* "ssh/key.pyx":105 + /* "ssh/key.pyx":106 * with nogil: * rc = c_ssh.ssh_pki_export_privkey_to_pubkey(self._key, &_pub_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -2602,20 +2768,20 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_16export_privkey_to_pubkey(struct __ __pyx_t_1 = ((__pyx_v_rc != SSH_OK) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh/key.pyx":106 + /* "ssh/key.pyx":107 * rc = c_ssh.ssh_pki_export_privkey_to_pubkey(self._key, &_pub_key) * if rc != c_ssh.SSH_OK: * raise KeyExportError # <<<<<<<<<<<<<< * pub_key = SSHKey.from_ptr(_pub_key) * return pub_key */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KeyExportError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KeyExportError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __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, 106, __pyx_L1_error) + __PYX_ERR(0, 107, __pyx_L1_error) - /* "ssh/key.pyx":105 + /* "ssh/key.pyx":106 * with nogil: * rc = c_ssh.ssh_pki_export_privkey_to_pubkey(self._key, &_pub_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -2624,19 +2790,19 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_16export_privkey_to_pubkey(struct __ */ } - /* "ssh/key.pyx":107 + /* "ssh/key.pyx":108 * if rc != c_ssh.SSH_OK: * raise KeyExportError * pub_key = SSHKey.from_ptr(_pub_key) # <<<<<<<<<<<<<< * return pub_key * */ - __pyx_t_2 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__pub_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__pub_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_pub_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh/key.pyx":108 + /* "ssh/key.pyx":109 * raise KeyExportError * pub_key = SSHKey.from_ptr(_pub_key) * return pub_key # <<<<<<<<<<<<<< @@ -2648,7 +2814,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_16export_privkey_to_pubkey(struct __ __pyx_r = ((PyObject *)__pyx_v_pub_key); goto __pyx_L0; - /* "ssh/key.pyx":99 + /* "ssh/key.pyx":100 * raise KeyExportError * * def export_privkey_to_pubkey(self): # <<<<<<<<<<<<<< @@ -2668,7 +2834,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_16export_privkey_to_pubkey(struct __ return __pyx_r; } -/* "ssh/key.pyx":110 +/* "ssh/key.pyx":111 * return pub_key * * def export_pubkey_base64(self): # <<<<<<<<<<<<<< @@ -2703,7 +2869,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("export_pubkey_base64", 0); - /* "ssh/key.pyx":115 + /* "ssh/key.pyx":116 * cdef bytes b_key * cdef size_t key_len * with nogil: # <<<<<<<<<<<<<< @@ -2718,7 +2884,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ #endif /*try:*/ { - /* "ssh/key.pyx":116 + /* "ssh/key.pyx":117 * cdef size_t key_len * with nogil: * rc = c_ssh.ssh_pki_export_pubkey_base64(self._key, &_key) # <<<<<<<<<<<<<< @@ -2727,7 +2893,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ */ __pyx_v_rc = ssh_pki_export_pubkey_base64(__pyx_v_self->_key, (&__pyx_v__key)); - /* "ssh/key.pyx":117 + /* "ssh/key.pyx":118 * with nogil: * rc = c_ssh.ssh_pki_export_pubkey_base64(self._key, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -2737,7 +2903,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ __pyx_t_1 = ((__pyx_v_rc != SSH_OK) != 0); if (__pyx_t_1) { - /* "ssh/key.pyx":118 + /* "ssh/key.pyx":119 * rc = c_ssh.ssh_pki_export_pubkey_base64(self._key, &_key) * if rc != c_ssh.SSH_OK: * with gil: # <<<<<<<<<<<<<< @@ -2750,21 +2916,21 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ #endif /*try:*/ { - /* "ssh/key.pyx":119 + /* "ssh/key.pyx":120 * if rc != c_ssh.SSH_OK: * with gil: * raise KeyExportError # <<<<<<<<<<<<<< * b_key = _key * c_ssh.ssh_string_free_char(_key) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KeyExportError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KeyExportError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L8_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, 119, __pyx_L8_error) + __PYX_ERR(0, 120, __pyx_L8_error) } - /* "ssh/key.pyx":118 + /* "ssh/key.pyx":119 * rc = c_ssh.ssh_pki_export_pubkey_base64(self._key, &_key) * if rc != c_ssh.SSH_OK: * with gil: # <<<<<<<<<<<<<< @@ -2781,7 +2947,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ } } - /* "ssh/key.pyx":117 + /* "ssh/key.pyx":118 * with nogil: * rc = c_ssh.ssh_pki_export_pubkey_base64(self._key, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -2791,7 +2957,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ } } - /* "ssh/key.pyx":115 + /* "ssh/key.pyx":116 * cdef bytes b_key * cdef size_t key_len * with nogil: # <<<<<<<<<<<<<< @@ -2817,19 +2983,19 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ } } - /* "ssh/key.pyx":120 + /* "ssh/key.pyx":121 * with gil: * raise KeyExportError * b_key = _key # <<<<<<<<<<<<<< * c_ssh.ssh_string_free_char(_key) * return b_key */ - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v__key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v__key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_b_key = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh/key.pyx":121 + /* "ssh/key.pyx":122 * raise KeyExportError * b_key = _key * c_ssh.ssh_string_free_char(_key) # <<<<<<<<<<<<<< @@ -2838,7 +3004,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ */ ssh_string_free_char(__pyx_v__key); - /* "ssh/key.pyx":122 + /* "ssh/key.pyx":123 * b_key = _key * c_ssh.ssh_string_free_char(_key) * return b_key # <<<<<<<<<<<<<< @@ -2850,7 +3016,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_18export_pubkey_base64(struct __pyx_ __pyx_r = __pyx_v_b_key; goto __pyx_L0; - /* "ssh/key.pyx":110 + /* "ssh/key.pyx":111 * return pub_key * * def export_pubkey_base64(self): # <<<<<<<<<<<<<< @@ -2985,7 +3151,7 @@ static PyObject *__pyx_pf_3ssh_3key_6SSHKey_22__setstate_cython__(CYTHON_UNUSED return __pyx_r; } -/* "ssh/key.pyx":125 +/* "ssh/key.pyx":127 * * * def generate(KeyType key_type, int bits): # <<<<<<<<<<<<<< @@ -3029,11 +3195,11 @@ static PyObject *__pyx_pw_3ssh_3key_1generate(PyObject *__pyx_self, PyObject *__ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bits)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("generate", 1, 2, 2, 1); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("generate", 1, 2, 2, 1); __PYX_ERR(0, 127, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generate") < 0)) __PYX_ERR(0, 125, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "generate") < 0)) __PYX_ERR(0, 127, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3042,17 +3208,17 @@ static PyObject *__pyx_pw_3ssh_3key_1generate(PyObject *__pyx_self, PyObject *__ values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)values[0]); - __pyx_v_bits = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_bits == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 125, __pyx_L3_error) + __pyx_v_bits = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_bits == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("generate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 125, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("generate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 127, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh.key.generate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key_type), __pyx_ptype_3ssh_8keytypes_KeyType, 1, "key_type", 0))) __PYX_ERR(0, 125, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key_type), __pyx_ptype_3ssh_8keytypes_KeyType, 1, "key_type", 0))) __PYX_ERR(0, 127, __pyx_L1_error) __pyx_r = __pyx_pf_3ssh_3key_generate(__pyx_self, __pyx_v_key_type, __pyx_v_bits); /* function exit code */ @@ -3077,7 +3243,7 @@ static PyObject *__pyx_pf_3ssh_3key_generate(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_clineno = 0; __Pyx_RefNannySetupContext("generate", 0); - /* "ssh/key.pyx":129 + /* "ssh/key.pyx":131 * cdef c_ssh.ssh_key _key * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3092,7 +3258,7 @@ static PyObject *__pyx_pf_3ssh_3key_generate(CYTHON_UNUSED PyObject *__pyx_self, #endif /*try:*/ { - /* "ssh/key.pyx":130 + /* "ssh/key.pyx":132 * cdef int rc * with nogil: * rc = c_ssh.ssh_pki_generate(key_type._type, bits, &_key) # <<<<<<<<<<<<<< @@ -3102,7 +3268,7 @@ static PyObject *__pyx_pf_3ssh_3key_generate(CYTHON_UNUSED PyObject *__pyx_self, __pyx_v_rc = ssh_pki_generate(__pyx_v_key_type->_type, __pyx_v_bits, (&__pyx_v__key)); } - /* "ssh/key.pyx":129 + /* "ssh/key.pyx":131 * cdef c_ssh.ssh_key _key * cdef int rc * with nogil: # <<<<<<<<<<<<<< @@ -3121,7 +3287,7 @@ static PyObject *__pyx_pf_3ssh_3key_generate(CYTHON_UNUSED PyObject *__pyx_self, } } - /* "ssh/key.pyx":131 + /* "ssh/key.pyx":133 * with nogil: * rc = c_ssh.ssh_pki_generate(key_type._type, bits, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -3131,20 +3297,20 @@ static PyObject *__pyx_pf_3ssh_3key_generate(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_1 = ((__pyx_v_rc != SSH_OK) != 0); if (unlikely(__pyx_t_1)) { - /* "ssh/key.pyx":132 + /* "ssh/key.pyx":134 * rc = c_ssh.ssh_pki_generate(key_type._type, bits, &_key) * if rc != c_ssh.SSH_OK: * raise KeyGenerationError # <<<<<<<<<<<<<< * key = SSHKey.from_ptr(_key) * return key */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KeyGenerationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_KeyGenerationError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __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, 132, __pyx_L1_error) + __PYX_ERR(0, 134, __pyx_L1_error) - /* "ssh/key.pyx":131 + /* "ssh/key.pyx":133 * with nogil: * rc = c_ssh.ssh_pki_generate(key_type._type, bits, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -3153,19 +3319,19 @@ static PyObject *__pyx_pf_3ssh_3key_generate(CYTHON_UNUSED PyObject *__pyx_self, */ } - /* "ssh/key.pyx":133 + /* "ssh/key.pyx":135 * if rc != c_ssh.SSH_OK: * raise KeyGenerationError * key = SSHKey.from_ptr(_key) # <<<<<<<<<<<<<< * return key * */ - __pyx_t_2 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)__pyx_t_2); __pyx_t_2 = 0; - /* "ssh/key.pyx":134 + /* "ssh/key.pyx":136 * raise KeyGenerationError * key = SSHKey.from_ptr(_key) * return key # <<<<<<<<<<<<<< @@ -3177,7 +3343,7 @@ static PyObject *__pyx_pf_3ssh_3key_generate(CYTHON_UNUSED PyObject *__pyx_self, __pyx_r = ((PyObject *)__pyx_v_key); goto __pyx_L0; - /* "ssh/key.pyx":125 + /* "ssh/key.pyx":127 * * * def generate(KeyType key_type, int bits): # <<<<<<<<<<<<<< @@ -3197,7 +3363,7 @@ static PyObject *__pyx_pf_3ssh_3key_generate(CYTHON_UNUSED PyObject *__pyx_self, return __pyx_r; } -/* "ssh/key.pyx":137 +/* "ssh/key.pyx":139 * * * def import_privkey_base64(bytes b64_key, passphrase=b''): # <<<<<<<<<<<<<< @@ -3246,7 +3412,7 @@ static PyObject *__pyx_pw_3ssh_3key_3import_privkey_base64(PyObject *__pyx_self, } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "import_privkey_base64") < 0)) __PYX_ERR(0, 137, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "import_privkey_base64") < 0)) __PYX_ERR(0, 139, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3262,13 +3428,13 @@ static PyObject *__pyx_pw_3ssh_3key_3import_privkey_base64(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("import_privkey_base64", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 137, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("import_privkey_base64", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh.key.import_privkey_base64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b64_key), (&PyBytes_Type), 1, "b64_key", 1))) __PYX_ERR(0, 137, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b64_key), (&PyBytes_Type), 1, "b64_key", 1))) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_r = __pyx_pf_3ssh_3key_2import_privkey_base64(__pyx_self, __pyx_v_b64_key, __pyx_v_passphrase); /* function exit code */ @@ -3298,7 +3464,7 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_privkey_base64", 0); - /* "ssh/key.pyx":138 + /* "ssh/key.pyx":140 * * def import_privkey_base64(bytes b64_key, passphrase=b''): * cdef const_char *c_key = b64_key # <<<<<<<<<<<<<< @@ -3307,12 +3473,12 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec */ if (unlikely(__pyx_v_b64_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 138, __pyx_L1_error) + __PYX_ERR(0, 140, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_b64_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_b64_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error) __pyx_v_c_key = __pyx_t_1; - /* "ssh/key.pyx":140 + /* "ssh/key.pyx":142 * cdef const_char *c_key = b64_key * cdef bytes b_passphrase * cdef const_char *c_passphrase = NULL # <<<<<<<<<<<<<< @@ -3321,7 +3487,7 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec */ __pyx_v_c_passphrase = NULL; - /* "ssh/key.pyx":144 + /* "ssh/key.pyx":146 * cdef SSHKey key * cdef c_ssh.ssh_key _key * if passphrase is not None: # <<<<<<<<<<<<<< @@ -3332,19 +3498,19 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { - /* "ssh/key.pyx":145 + /* "ssh/key.pyx":147 * cdef c_ssh.ssh_key _key * if passphrase is not None: * b_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< * c_passphrase = b_passphrase * with nogil: */ - __pyx_t_4 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_4 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "ssh/key.pyx":146 + /* "ssh/key.pyx":148 * if passphrase is not None: * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase # <<<<<<<<<<<<<< @@ -3353,12 +3519,12 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec */ if (unlikely(__pyx_v_b_passphrase == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 146, __pyx_L1_error) + __PYX_ERR(0, 148, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error) __pyx_v_c_passphrase = __pyx_t_1; - /* "ssh/key.pyx":144 + /* "ssh/key.pyx":146 * cdef SSHKey key * cdef c_ssh.ssh_key _key * if passphrase is not None: # <<<<<<<<<<<<<< @@ -3367,7 +3533,7 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec */ } - /* "ssh/key.pyx":147 + /* "ssh/key.pyx":149 * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase * with nogil: # <<<<<<<<<<<<<< @@ -3382,7 +3548,7 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec #endif /*try:*/ { - /* "ssh/key.pyx":148 + /* "ssh/key.pyx":150 * c_passphrase = b_passphrase * with nogil: * rc = c_ssh.ssh_pki_import_privkey_base64( # <<<<<<<<<<<<<< @@ -3392,7 +3558,7 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec __pyx_v_rc = ssh_pki_import_privkey_base64(__pyx_v_c_key, __pyx_v_c_passphrase, NULL, NULL, (&__pyx_v__key)); } - /* "ssh/key.pyx":147 + /* "ssh/key.pyx":149 * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase * with nogil: # <<<<<<<<<<<<<< @@ -3411,7 +3577,7 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec } } - /* "ssh/key.pyx":150 + /* "ssh/key.pyx":152 * rc = c_ssh.ssh_pki_import_privkey_base64( * c_key, c_passphrase, NULL, NULL, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -3421,20 +3587,20 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec __pyx_t_3 = ((__pyx_v_rc != SSH_OK) != 0); if (unlikely(__pyx_t_3)) { - /* "ssh/key.pyx":151 + /* "ssh/key.pyx":153 * c_key, c_passphrase, NULL, NULL, &_key) * if rc != c_ssh.SSH_OK: * raise KeyImportError # <<<<<<<<<<<<<< * key = SSHKey.from_ptr(_key) * return key */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 151, __pyx_L1_error) + __PYX_ERR(0, 153, __pyx_L1_error) - /* "ssh/key.pyx":150 + /* "ssh/key.pyx":152 * rc = c_ssh.ssh_pki_import_privkey_base64( * c_key, c_passphrase, NULL, NULL, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -3443,19 +3609,19 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec */ } - /* "ssh/key.pyx":152 + /* "ssh/key.pyx":154 * if rc != c_ssh.SSH_OK: * raise KeyImportError * key = SSHKey.from_ptr(_key) # <<<<<<<<<<<<<< * return key * */ - __pyx_t_4 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_4 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)__pyx_t_4); __pyx_t_4 = 0; - /* "ssh/key.pyx":153 + /* "ssh/key.pyx":155 * raise KeyImportError * key = SSHKey.from_ptr(_key) * return key # <<<<<<<<<<<<<< @@ -3467,7 +3633,7 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec __pyx_r = ((PyObject *)__pyx_v_key); goto __pyx_L0; - /* "ssh/key.pyx":137 + /* "ssh/key.pyx":139 * * * def import_privkey_base64(bytes b64_key, passphrase=b''): # <<<<<<<<<<<<<< @@ -3488,7 +3654,7 @@ static PyObject *__pyx_pf_3ssh_3key_2import_privkey_base64(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "ssh/key.pyx":156 +/* "ssh/key.pyx":158 * * * def import_privkey_file(filepath, passphrase=b''): # <<<<<<<<<<<<<< @@ -3537,7 +3703,7 @@ static PyObject *__pyx_pw_3ssh_3key_5import_privkey_file(PyObject *__pyx_self, P } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "import_privkey_file") < 0)) __PYX_ERR(0, 156, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "import_privkey_file") < 0)) __PYX_ERR(0, 158, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3553,7 +3719,7 @@ static PyObject *__pyx_pw_3ssh_3key_5import_privkey_file(PyObject *__pyx_self, P } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("import_privkey_file", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 156, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("import_privkey_file", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh.key.import_privkey_file", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3585,19 +3751,19 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_privkey_file", 0); - /* "ssh/key.pyx":158 + /* "ssh/key.pyx":160 * def import_privkey_file(filepath, passphrase=b''): * cdef bytes b_passphrase * cdef bytes b_filepath = to_bytes(filepath) # <<<<<<<<<<<<<< * cdef const_char *c_passphrase = NULL * cdef const_char *c_filepath = b_filepath */ - __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filepath = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/key.pyx":159 + /* "ssh/key.pyx":161 * cdef bytes b_passphrase * cdef bytes b_filepath = to_bytes(filepath) * cdef const_char *c_passphrase = NULL # <<<<<<<<<<<<<< @@ -3606,7 +3772,7 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject */ __pyx_v_c_passphrase = NULL; - /* "ssh/key.pyx":160 + /* "ssh/key.pyx":162 * cdef bytes b_filepath = to_bytes(filepath) * cdef const_char *c_passphrase = NULL * cdef const_char *c_filepath = b_filepath # <<<<<<<<<<<<<< @@ -3615,12 +3781,12 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject */ if (unlikely(__pyx_v_b_filepath == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 160, __pyx_L1_error) + __PYX_ERR(0, 162, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_filepath); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_filepath); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error) __pyx_v_c_filepath = __pyx_t_2; - /* "ssh/key.pyx":164 + /* "ssh/key.pyx":166 * cdef SSHKey key * cdef c_ssh.ssh_key _key * if passphrase is not None: # <<<<<<<<<<<<<< @@ -3631,19 +3797,19 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { - /* "ssh/key.pyx":165 + /* "ssh/key.pyx":167 * cdef c_ssh.ssh_key _key * if passphrase is not None: * b_passphrase = to_bytes(passphrase) # <<<<<<<<<<<<<< * c_passphrase = b_passphrase * with nogil: */ - __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_passphrase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_passphrase = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/key.pyx":166 + /* "ssh/key.pyx":168 * if passphrase is not None: * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase # <<<<<<<<<<<<<< @@ -3652,12 +3818,12 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject */ if (unlikely(__pyx_v_b_passphrase == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 166, __pyx_L1_error) + __PYX_ERR(0, 168, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_passphrase); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error) __pyx_v_c_passphrase = __pyx_t_2; - /* "ssh/key.pyx":164 + /* "ssh/key.pyx":166 * cdef SSHKey key * cdef c_ssh.ssh_key _key * if passphrase is not None: # <<<<<<<<<<<<<< @@ -3666,7 +3832,7 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject */ } - /* "ssh/key.pyx":167 + /* "ssh/key.pyx":169 * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase * with nogil: # <<<<<<<<<<<<<< @@ -3681,7 +3847,7 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "ssh/key.pyx":168 + /* "ssh/key.pyx":170 * c_passphrase = b_passphrase * with nogil: * rc = c_ssh.ssh_pki_import_privkey_file( # <<<<<<<<<<<<<< @@ -3691,7 +3857,7 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject __pyx_v_rc = ssh_pki_import_privkey_file(__pyx_v_c_filepath, __pyx_v_c_passphrase, NULL, NULL, (&__pyx_v__key)); } - /* "ssh/key.pyx":167 + /* "ssh/key.pyx":169 * b_passphrase = to_bytes(passphrase) * c_passphrase = b_passphrase * with nogil: # <<<<<<<<<<<<<< @@ -3710,7 +3876,7 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject } } - /* "ssh/key.pyx":170 + /* "ssh/key.pyx":172 * rc = c_ssh.ssh_pki_import_privkey_file( * c_filepath, c_passphrase, NULL, NULL, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -3720,20 +3886,20 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject __pyx_t_4 = ((__pyx_v_rc != SSH_OK) != 0); if (unlikely(__pyx_t_4)) { - /* "ssh/key.pyx":171 + /* "ssh/key.pyx":173 * c_filepath, c_passphrase, NULL, NULL, &_key) * if rc != c_ssh.SSH_OK: * raise KeyImportError # <<<<<<<<<<<<<< * key = SSHKey.from_ptr(_key) * return key */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 171, __pyx_L1_error) + __PYX_ERR(0, 173, __pyx_L1_error) - /* "ssh/key.pyx":170 + /* "ssh/key.pyx":172 * rc = c_ssh.ssh_pki_import_privkey_file( * c_filepath, c_passphrase, NULL, NULL, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -3742,19 +3908,19 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject */ } - /* "ssh/key.pyx":172 + /* "ssh/key.pyx":174 * if rc != c_ssh.SSH_OK: * raise KeyImportError * key = SSHKey.from_ptr(_key) # <<<<<<<<<<<<<< * return key * */ - __pyx_t_1 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/key.pyx":173 + /* "ssh/key.pyx":175 * raise KeyImportError * key = SSHKey.from_ptr(_key) * return key # <<<<<<<<<<<<<< @@ -3766,7 +3932,7 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject __pyx_r = ((PyObject *)__pyx_v_key); goto __pyx_L0; - /* "ssh/key.pyx":156 + /* "ssh/key.pyx":158 * * * def import_privkey_file(filepath, passphrase=b''): # <<<<<<<<<<<<<< @@ -3788,7 +3954,7 @@ static PyObject *__pyx_pf_3ssh_3key_4import_privkey_file(CYTHON_UNUSED PyObject return __pyx_r; } -/* "ssh/key.pyx":176 +/* "ssh/key.pyx":178 * * * def import_pubkey_base64(bytes b64_key, KeyType key_type): # <<<<<<<<<<<<<< @@ -3832,11 +3998,11 @@ static PyObject *__pyx_pw_3ssh_3key_7import_pubkey_base64(PyObject *__pyx_self, case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key_type)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("import_pubkey_base64", 1, 2, 2, 1); __PYX_ERR(0, 176, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("import_pubkey_base64", 1, 2, 2, 1); __PYX_ERR(0, 178, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "import_pubkey_base64") < 0)) __PYX_ERR(0, 176, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "import_pubkey_base64") < 0)) __PYX_ERR(0, 178, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3849,14 +4015,14 @@ static PyObject *__pyx_pw_3ssh_3key_7import_pubkey_base64(PyObject *__pyx_self, } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("import_pubkey_base64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 176, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("import_pubkey_base64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("ssh.key.import_pubkey_base64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b64_key), (&PyBytes_Type), 1, "b64_key", 1))) __PYX_ERR(0, 176, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key_type), __pyx_ptype_3ssh_8keytypes_KeyType, 1, "key_type", 0))) __PYX_ERR(0, 176, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b64_key), (&PyBytes_Type), 1, "b64_key", 1))) __PYX_ERR(0, 178, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key_type), __pyx_ptype_3ssh_8keytypes_KeyType, 1, "key_type", 0))) __PYX_ERR(0, 178, __pyx_L1_error) __pyx_r = __pyx_pf_3ssh_3key_6import_pubkey_base64(__pyx_self, __pyx_v_b64_key, __pyx_v_key_type); /* function exit code */ @@ -3883,7 +4049,7 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_pubkey_base64", 0); - /* "ssh/key.pyx":177 + /* "ssh/key.pyx":179 * * def import_pubkey_base64(bytes b64_key, KeyType key_type): * cdef const_char *c_key = b64_key # <<<<<<<<<<<<<< @@ -3892,12 +4058,12 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject */ if (unlikely(__pyx_v_b64_key == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 177, __pyx_L1_error) + __PYX_ERR(0, 179, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_b64_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_b64_key); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error) __pyx_v_c_key = __pyx_t_1; - /* "ssh/key.pyx":181 + /* "ssh/key.pyx":183 * cdef SSHKey key * cdef c_ssh.ssh_key _key * with nogil: # <<<<<<<<<<<<<< @@ -3912,7 +4078,7 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject #endif /*try:*/ { - /* "ssh/key.pyx":182 + /* "ssh/key.pyx":184 * cdef c_ssh.ssh_key _key * with nogil: * rc = c_ssh.ssh_pki_import_pubkey_base64( # <<<<<<<<<<<<<< @@ -3922,7 +4088,7 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject __pyx_v_rc = ssh_pki_import_pubkey_base64(__pyx_v_c_key, __pyx_v_key_type->_type, (&__pyx_v__key)); } - /* "ssh/key.pyx":181 + /* "ssh/key.pyx":183 * cdef SSHKey key * cdef c_ssh.ssh_key _key * with nogil: # <<<<<<<<<<<<<< @@ -3941,7 +4107,7 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject } } - /* "ssh/key.pyx":184 + /* "ssh/key.pyx":186 * rc = c_ssh.ssh_pki_import_pubkey_base64( * c_key, key_type._type, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -3951,20 +4117,20 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject __pyx_t_2 = ((__pyx_v_rc != SSH_OK) != 0); if (unlikely(__pyx_t_2)) { - /* "ssh/key.pyx":185 + /* "ssh/key.pyx":187 * c_key, key_type._type, &_key) * if rc != c_ssh.SSH_OK: * raise KeyImportError # <<<<<<<<<<<<<< * key = SSHKey.from_ptr(_key) * return key */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 185, __pyx_L1_error) + __PYX_ERR(0, 187, __pyx_L1_error) - /* "ssh/key.pyx":184 + /* "ssh/key.pyx":186 * rc = c_ssh.ssh_pki_import_pubkey_base64( * c_key, key_type._type, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -3973,19 +4139,19 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject */ } - /* "ssh/key.pyx":186 + /* "ssh/key.pyx":188 * if rc != c_ssh.SSH_OK: * raise KeyImportError * key = SSHKey.from_ptr(_key) # <<<<<<<<<<<<<< * return key * */ - __pyx_t_3 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_3 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)__pyx_t_3); __pyx_t_3 = 0; - /* "ssh/key.pyx":187 + /* "ssh/key.pyx":189 * raise KeyImportError * key = SSHKey.from_ptr(_key) * return key # <<<<<<<<<<<<<< @@ -3997,7 +4163,7 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject __pyx_r = ((PyObject *)__pyx_v_key); goto __pyx_L0; - /* "ssh/key.pyx":176 + /* "ssh/key.pyx":178 * * * def import_pubkey_base64(bytes b64_key, KeyType key_type): # <<<<<<<<<<<<<< @@ -4017,7 +4183,7 @@ static PyObject *__pyx_pf_3ssh_3key_6import_pubkey_base64(CYTHON_UNUSED PyObject return __pyx_r; } -/* "ssh/key.pyx":190 +/* "ssh/key.pyx":192 * * * def import_pubkey_file(filepath): # <<<<<<<<<<<<<< @@ -4056,19 +4222,19 @@ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_pubkey_file", 0); - /* "ssh/key.pyx":191 + /* "ssh/key.pyx":193 * * def import_pubkey_file(filepath): * cdef bytes b_filepath = to_bytes(filepath) # <<<<<<<<<<<<<< * cdef const_char *c_filepath = b_filepath * cdef int rc */ - __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_b_filepath = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/key.pyx":192 + /* "ssh/key.pyx":194 * def import_pubkey_file(filepath): * cdef bytes b_filepath = to_bytes(filepath) * cdef const_char *c_filepath = b_filepath # <<<<<<<<<<<<<< @@ -4077,12 +4243,12 @@ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject * */ if (unlikely(__pyx_v_b_filepath == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 192, __pyx_L1_error) + __PYX_ERR(0, 194, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_filepath); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_filepath); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error) __pyx_v_c_filepath = __pyx_t_2; - /* "ssh/key.pyx":196 + /* "ssh/key.pyx":198 * cdef SSHKey key * cdef c_ssh.ssh_key _key * with nogil: # <<<<<<<<<<<<<< @@ -4097,7 +4263,7 @@ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject * #endif /*try:*/ { - /* "ssh/key.pyx":197 + /* "ssh/key.pyx":199 * cdef c_ssh.ssh_key _key * with nogil: * rc = c_ssh.ssh_pki_import_pubkey_file( # <<<<<<<<<<<<<< @@ -4107,7 +4273,7 @@ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject * __pyx_v_rc = ssh_pki_import_pubkey_file(__pyx_v_c_filepath, (&__pyx_v__key)); } - /* "ssh/key.pyx":196 + /* "ssh/key.pyx":198 * cdef SSHKey key * cdef c_ssh.ssh_key _key * with nogil: # <<<<<<<<<<<<<< @@ -4126,7 +4292,7 @@ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject * } } - /* "ssh/key.pyx":199 + /* "ssh/key.pyx":201 * rc = c_ssh.ssh_pki_import_pubkey_file( * c_filepath, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -4136,20 +4302,20 @@ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject * __pyx_t_3 = ((__pyx_v_rc != SSH_OK) != 0); if (unlikely(__pyx_t_3)) { - /* "ssh/key.pyx":200 + /* "ssh/key.pyx":202 * c_filepath, &_key) * if rc != c_ssh.SSH_OK: * raise KeyImportError # <<<<<<<<<<<<<< * key = SSHKey.from_ptr(_key) * return key */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 200, __pyx_L1_error) + __PYX_ERR(0, 202, __pyx_L1_error) - /* "ssh/key.pyx":199 + /* "ssh/key.pyx":201 * rc = c_ssh.ssh_pki_import_pubkey_file( * c_filepath, &_key) * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< @@ -4158,28 +4324,31 @@ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject * */ } - /* "ssh/key.pyx":201 + /* "ssh/key.pyx":203 * if rc != c_ssh.SSH_OK: * raise KeyImportError * key = SSHKey.from_ptr(_key) # <<<<<<<<<<<<<< * return key + * */ - __pyx_t_1 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/key.pyx":202 + /* "ssh/key.pyx":204 * raise KeyImportError * key = SSHKey.from_ptr(_key) * return key # <<<<<<<<<<<<<< + * + * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_key)); __pyx_r = ((PyObject *)__pyx_v_key); goto __pyx_L0; - /* "ssh/key.pyx":190 + /* "ssh/key.pyx":192 * * * def import_pubkey_file(filepath): # <<<<<<<<<<<<<< @@ -4199,29 +4368,707 @@ static PyObject *__pyx_pf_3ssh_3key_8import_pubkey_file(CYTHON_UNUSED PyObject * __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_vtabstruct_3ssh_3key_SSHKey __pyx_vtable_3ssh_3key_SSHKey; -static PyObject *__pyx_tp_new_3ssh_3key_SSHKey(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_3ssh_3key_SSHKey *p; - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); +/* "ssh/key.pyx":207 + * + * + * def import_cert_base64(bytes b64_cert, KeyType key_type): # <<<<<<<<<<<<<< + * cdef const_char *c_key = b64_cert + * cdef int rc + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_3key_11import_cert_base64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_3ssh_3key_10import_cert_base64[] = "import_cert_base64(bytes b64_cert, KeyType key_type)"; +static PyMethodDef __pyx_mdef_3ssh_3key_11import_cert_base64 = {"import_cert_base64", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_3key_11import_cert_base64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_3key_10import_cert_base64}; +static PyObject *__pyx_pw_3ssh_3key_11import_cert_base64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_b64_cert = 0; + struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_key_type = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("import_cert_base64 (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b64_cert,&__pyx_n_s_key_type,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b64_cert)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key_type)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("import_cert_base64", 1, 2, 2, 1); __PYX_ERR(0, 207, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "import_cert_base64") < 0)) __PYX_ERR(0, 207, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_b64_cert = ((PyObject*)values[0]); + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)values[1]); } - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_3ssh_3key_SSHKey *)o); - p->__pyx_vtab = __pyx_vtabptr_3ssh_3key_SSHKey; - if (unlikely(__pyx_pw_3ssh_3key_6SSHKey_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; - return o; - bad: - Py_DECREF(o); o = 0; + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("import_cert_base64", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 207, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("ssh.key.import_cert_base64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b64_cert), (&PyBytes_Type), 1, "b64_cert", 1))) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_key_type), __pyx_ptype_3ssh_8keytypes_KeyType, 1, "key_type", 0))) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_r = __pyx_pf_3ssh_3key_10import_cert_base64(__pyx_self, __pyx_v_b64_cert, __pyx_v_key_type); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; } -static void __pyx_tp_dealloc_3ssh_3key_SSHKey(PyObject *o) { - #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { +static PyObject *__pyx_pf_3ssh_3key_10import_cert_base64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b64_cert, struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_key_type) { + const char *__pyx_v_c_key; + int __pyx_v_rc; + struct __pyx_obj_3ssh_3key_SSHKey *__pyx_v_key = 0; + ssh_key __pyx_v__key; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + const char *__pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_cert_base64", 0); + + /* "ssh/key.pyx":208 + * + * def import_cert_base64(bytes b64_cert, KeyType key_type): + * cdef const_char *c_key = b64_cert # <<<<<<<<<<<<<< + * cdef int rc + * cdef SSHKey key + */ + if (unlikely(__pyx_v_b64_cert == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 208, __pyx_L1_error) + } + __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_b64_cert); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_v_c_key = __pyx_t_1; + + /* "ssh/key.pyx":212 + * cdef SSHKey key + * cdef c_ssh.ssh_key _key + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh.ssh_pki_import_cert_base64( + * c_key, key_type._type, &_key) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh/key.pyx":213 + * cdef c_ssh.ssh_key _key + * with nogil: + * rc = c_ssh.ssh_pki_import_cert_base64( # <<<<<<<<<<<<<< + * c_key, key_type._type, &_key) + * if rc != c_ssh.SSH_OK: + */ + __pyx_v_rc = ssh_pki_import_cert_base64(__pyx_v_c_key, __pyx_v_key_type->_type, (&__pyx_v__key)); + } + + /* "ssh/key.pyx":212 + * cdef SSHKey key + * cdef c_ssh.ssh_key _key + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh.ssh_pki_import_cert_base64( + * c_key, key_type._type, &_key) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh/key.pyx":215 + * rc = c_ssh.ssh_pki_import_cert_base64( + * c_key, key_type._type, &_key) + * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< + * raise KeyImportError + * key = SSHKey.from_ptr(_key) + */ + __pyx_t_2 = ((__pyx_v_rc != SSH_OK) != 0); + if (unlikely(__pyx_t_2)) { + + /* "ssh/key.pyx":216 + * c_key, key_type._type, &_key) + * if rc != c_ssh.SSH_OK: + * raise KeyImportError # <<<<<<<<<<<<<< + * key = SSHKey.from_ptr(_key) + * return key + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(0, 216, __pyx_L1_error) + + /* "ssh/key.pyx":215 + * rc = c_ssh.ssh_pki_import_cert_base64( + * c_key, key_type._type, &_key) + * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< + * raise KeyImportError + * key = SSHKey.from_ptr(_key) + */ + } + + /* "ssh/key.pyx":217 + * if rc != c_ssh.SSH_OK: + * raise KeyImportError + * key = SSHKey.from_ptr(_key) # <<<<<<<<<<<<<< + * return key + * + */ + __pyx_t_3 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)__pyx_t_3); + __pyx_t_3 = 0; + + /* "ssh/key.pyx":218 + * raise KeyImportError + * key = SSHKey.from_ptr(_key) + * return key # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_key)); + __pyx_r = ((PyObject *)__pyx_v_key); + goto __pyx_L0; + + /* "ssh/key.pyx":207 + * + * + * def import_cert_base64(bytes b64_cert, KeyType key_type): # <<<<<<<<<<<<<< + * cdef const_char *c_key = b64_cert + * cdef int rc + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("ssh.key.import_cert_base64", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh/key.pyx":221 + * + * + * def import_cert_file(filepath): # <<<<<<<<<<<<<< + * cdef bytes b_filepath = to_bytes(filepath) + * cdef const_char *c_filepath = b_filepath + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_3key_13import_cert_file(PyObject *__pyx_self, PyObject *__pyx_v_filepath); /*proto*/ +static char __pyx_doc_3ssh_3key_12import_cert_file[] = "import_cert_file(filepath)"; +static PyMethodDef __pyx_mdef_3ssh_3key_13import_cert_file = {"import_cert_file", (PyCFunction)__pyx_pw_3ssh_3key_13import_cert_file, METH_O, __pyx_doc_3ssh_3key_12import_cert_file}; +static PyObject *__pyx_pw_3ssh_3key_13import_cert_file(PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("import_cert_file (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_3key_12import_cert_file(__pyx_self, ((PyObject *)__pyx_v_filepath)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3ssh_3key_12import_cert_file(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filepath) { + PyObject *__pyx_v_b_filepath = 0; + const char *__pyx_v_c_filepath; + int __pyx_v_rc; + struct __pyx_obj_3ssh_3key_SSHKey *__pyx_v_key = 0; + ssh_key __pyx_v__key; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + const char *__pyx_t_2; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("import_cert_file", 0); + + /* "ssh/key.pyx":222 + * + * def import_cert_file(filepath): + * cdef bytes b_filepath = to_bytes(filepath) # <<<<<<<<<<<<<< + * cdef const_char *c_filepath = b_filepath + * cdef int rc + */ + __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_filepath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_b_filepath = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/key.pyx":223 + * def import_cert_file(filepath): + * cdef bytes b_filepath = to_bytes(filepath) + * cdef const_char *c_filepath = b_filepath # <<<<<<<<<<<<<< + * cdef int rc + * cdef SSHKey key + */ + if (unlikely(__pyx_v_b_filepath == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(0, 223, __pyx_L1_error) + } + __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_b_filepath); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_v_c_filepath = __pyx_t_2; + + /* "ssh/key.pyx":227 + * cdef SSHKey key + * cdef c_ssh.ssh_key _key + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh.ssh_pki_import_cert_file( + * c_filepath, &_key) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh/key.pyx":228 + * cdef c_ssh.ssh_key _key + * with nogil: + * rc = c_ssh.ssh_pki_import_cert_file( # <<<<<<<<<<<<<< + * c_filepath, &_key) + * if rc != c_ssh.SSH_OK: + */ + __pyx_v_rc = ssh_pki_import_cert_file(__pyx_v_c_filepath, (&__pyx_v__key)); + } + + /* "ssh/key.pyx":227 + * cdef SSHKey key + * cdef c_ssh.ssh_key _key + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh.ssh_pki_import_cert_file( + * c_filepath, &_key) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } + } + + /* "ssh/key.pyx":230 + * rc = c_ssh.ssh_pki_import_cert_file( + * c_filepath, &_key) + * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< + * raise KeyImportError + * key = SSHKey.from_ptr(_key) + */ + __pyx_t_3 = ((__pyx_v_rc != SSH_OK) != 0); + if (unlikely(__pyx_t_3)) { + + /* "ssh/key.pyx":231 + * c_filepath, &_key) + * if rc != c_ssh.SSH_OK: + * raise KeyImportError # <<<<<<<<<<<<<< + * key = SSHKey.from_ptr(_key) + * return key + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 231, __pyx_L1_error) + + /* "ssh/key.pyx":230 + * rc = c_ssh.ssh_pki_import_cert_file( + * c_filepath, &_key) + * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< + * raise KeyImportError + * key = SSHKey.from_ptr(_key) + */ + } + + /* "ssh/key.pyx":232 + * if rc != c_ssh.SSH_OK: + * raise KeyImportError + * key = SSHKey.from_ptr(_key) # <<<<<<<<<<<<<< + * return key + * + */ + __pyx_t_1 = ((PyObject *)__pyx_f_3ssh_3key_6SSHKey_from_ptr(__pyx_v__key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/key.pyx":233 + * raise KeyImportError + * key = SSHKey.from_ptr(_key) + * return key # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((PyObject *)__pyx_v_key)); + __pyx_r = ((PyObject *)__pyx_v_key); + goto __pyx_L0; + + /* "ssh/key.pyx":221 + * + * + * def import_cert_file(filepath): # <<<<<<<<<<<<<< + * cdef bytes b_filepath = to_bytes(filepath) + * cdef const_char *c_filepath = b_filepath + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.key.import_cert_file", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_b_filepath); + __Pyx_XDECREF((PyObject *)__pyx_v_key); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh/key.pyx":236 + * + * + * def copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key): # <<<<<<<<<<<<<< + * if priv_key.is_private() is False: + * raise KeyImportError + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_3key_15copy_cert_to_privkey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_3ssh_3key_14copy_cert_to_privkey[] = "copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key)"; +static PyMethodDef __pyx_mdef_3ssh_3key_15copy_cert_to_privkey = {"copy_cert_to_privkey", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_3key_15copy_cert_to_privkey, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_3key_14copy_cert_to_privkey}; +static PyObject *__pyx_pw_3ssh_3key_15copy_cert_to_privkey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_3ssh_3key_SSHKey *__pyx_v_cert_key = 0; + struct __pyx_obj_3ssh_3key_SSHKey *__pyx_v_priv_key = 0; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("copy_cert_to_privkey (wrapper)", 0); + { + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cert_key,&__pyx_n_s_priv_key,0}; + PyObject* values[2] = {0,0}; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args; + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: + if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cert_key)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_priv_key)) != 0)) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("copy_cert_to_privkey", 1, 2, 2, 1); __PYX_ERR(0, 236, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_cert_to_privkey") < 0)) __PYX_ERR(0, 236, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + } + __pyx_v_cert_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)values[0]); + __pyx_v_priv_key = ((struct __pyx_obj_3ssh_3key_SSHKey *)values[1]); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("copy_cert_to_privkey", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 236, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("ssh.key.copy_cert_to_privkey", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cert_key), __pyx_ptype_3ssh_3key_SSHKey, 1, "cert_key", 0))) __PYX_ERR(0, 236, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_priv_key), __pyx_ptype_3ssh_3key_SSHKey, 1, "priv_key", 0))) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_r = __pyx_pf_3ssh_3key_14copy_cert_to_privkey(__pyx_self, __pyx_v_cert_key, __pyx_v_priv_key); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3ssh_3key_14copy_cert_to_privkey(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_3ssh_3key_SSHKey *__pyx_v_cert_key, struct __pyx_obj_3ssh_3key_SSHKey *__pyx_v_priv_key) { + ssh_key __pyx_v__priv_key; + ssh_key __pyx_v__cert_key; + int __pyx_v_rc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + ssh_key __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy_cert_to_privkey", 0); + + /* "ssh/key.pyx":237 + * + * def copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key): + * if priv_key.is_private() is False: # <<<<<<<<<<<<<< + * raise KeyImportError + * cdef c_ssh.ssh_key _priv_key = priv_key._key + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_priv_key), __pyx_n_s_is_private); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + } + } + __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = (__pyx_t_1 == Py_False); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = (__pyx_t_4 != 0); + if (unlikely(__pyx_t_5)) { + + /* "ssh/key.pyx":238 + * def copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key): + * if priv_key.is_private() is False: + * raise KeyImportError # <<<<<<<<<<<<<< + * cdef c_ssh.ssh_key _priv_key = priv_key._key + * cdef c_ssh.ssh_key _cert_key = cert_key._key + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 238, __pyx_L1_error) + + /* "ssh/key.pyx":237 + * + * def copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key): + * if priv_key.is_private() is False: # <<<<<<<<<<<<<< + * raise KeyImportError + * cdef c_ssh.ssh_key _priv_key = priv_key._key + */ + } + + /* "ssh/key.pyx":239 + * if priv_key.is_private() is False: + * raise KeyImportError + * cdef c_ssh.ssh_key _priv_key = priv_key._key # <<<<<<<<<<<<<< + * cdef c_ssh.ssh_key _cert_key = cert_key._key + * with nogil: + */ + __pyx_t_6 = __pyx_v_priv_key->_key; + __pyx_v__priv_key = __pyx_t_6; + + /* "ssh/key.pyx":240 + * raise KeyImportError + * cdef c_ssh.ssh_key _priv_key = priv_key._key + * cdef c_ssh.ssh_key _cert_key = cert_key._key # <<<<<<<<<<<<<< + * with nogil: + * rc = c_ssh.ssh_pki_copy_cert_to_privkey( + */ + __pyx_t_6 = __pyx_v_cert_key->_key; + __pyx_v__cert_key = __pyx_t_6; + + /* "ssh/key.pyx":241 + * cdef c_ssh.ssh_key _priv_key = priv_key._key + * cdef c_ssh.ssh_key _cert_key = cert_key._key + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh.ssh_pki_copy_cert_to_privkey( + * _cert_key, _priv_key) + */ + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { + + /* "ssh/key.pyx":242 + * cdef c_ssh.ssh_key _cert_key = cert_key._key + * with nogil: + * rc = c_ssh.ssh_pki_copy_cert_to_privkey( # <<<<<<<<<<<<<< + * _cert_key, _priv_key) + * if rc != c_ssh.SSH_OK: + */ + __pyx_v_rc = ssh_pki_copy_cert_to_privkey(__pyx_v__cert_key, __pyx_v__priv_key); + } + + /* "ssh/key.pyx":241 + * cdef c_ssh.ssh_key _priv_key = priv_key._key + * cdef c_ssh.ssh_key _cert_key = cert_key._key + * with nogil: # <<<<<<<<<<<<<< + * rc = c_ssh.ssh_pki_copy_cert_to_privkey( + * _cert_key, _priv_key) + */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L6; + } + __pyx_L6:; + } + } + + /* "ssh/key.pyx":244 + * rc = c_ssh.ssh_pki_copy_cert_to_privkey( + * _cert_key, _priv_key) + * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< + * raise KeyImportError + */ + __pyx_t_5 = ((__pyx_v_rc != SSH_OK) != 0); + if (unlikely(__pyx_t_5)) { + + /* "ssh/key.pyx":245 + * _cert_key, _priv_key) + * if rc != c_ssh.SSH_OK: + * raise KeyImportError # <<<<<<<<<<<<<< + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_KeyImportError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 245, __pyx_L1_error) + + /* "ssh/key.pyx":244 + * rc = c_ssh.ssh_pki_copy_cert_to_privkey( + * _cert_key, _priv_key) + * if rc != c_ssh.SSH_OK: # <<<<<<<<<<<<<< + * raise KeyImportError + */ + } + + /* "ssh/key.pyx":236 + * + * + * def copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key): # <<<<<<<<<<<<<< + * if priv_key.is_private() is False: + * raise KeyImportError + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("ssh.key.copy_cert_to_privkey", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} +static struct __pyx_vtabstruct_3ssh_3key_SSHKey __pyx_vtable_3ssh_3key_SSHKey; + +static PyObject *__pyx_tp_new_3ssh_3key_SSHKey(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_3ssh_3key_SSHKey *p; + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + p = ((struct __pyx_obj_3ssh_3key_SSHKey *)o); + p->__pyx_vtab = __pyx_vtabptr_3ssh_3key_SSHKey; + if (unlikely(__pyx_pw_3ssh_3key_6SSHKey_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_3ssh_3key_SSHKey(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif @@ -4393,6 +5240,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_SSHKey, __pyx_k_SSHKey, sizeof(__pyx_k_SSHKey), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0}, + {&__pyx_n_s_b64_cert, __pyx_k_b64_cert, sizeof(__pyx_k_b64_cert), 0, 0, 1, 1}, {&__pyx_n_s_b64_key, __pyx_k_b64_key, sizeof(__pyx_k_b64_key), 0, 0, 1, 1}, {&__pyx_n_s_b_filepath, __pyx_k_b_filepath, sizeof(__pyx_k_b_filepath), 0, 0, 1, 1}, {&__pyx_n_s_b_passphrase, __pyx_k_b_passphrase, sizeof(__pyx_k_b_passphrase), 0, 0, 1, 1}, @@ -4400,16 +5248,22 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_c_filepath, __pyx_k_c_filepath, sizeof(__pyx_k_c_filepath), 0, 0, 1, 1}, {&__pyx_n_s_c_key, __pyx_k_c_key, sizeof(__pyx_k_c_key), 0, 0, 1, 1}, {&__pyx_n_s_c_passphrase, __pyx_k_c_passphrase, sizeof(__pyx_k_c_passphrase), 0, 0, 1, 1}, + {&__pyx_n_s_cert_key, __pyx_k_cert_key, sizeof(__pyx_k_cert_key), 0, 0, 1, 1}, + {&__pyx_n_s_cert_key_2, __pyx_k_cert_key_2, sizeof(__pyx_k_cert_key_2), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_copy_cert_to_privkey, __pyx_k_copy_cert_to_privkey, sizeof(__pyx_k_copy_cert_to_privkey), 0, 0, 1, 1}, {&__pyx_n_s_exceptions, __pyx_k_exceptions, sizeof(__pyx_k_exceptions), 0, 0, 1, 1}, {&__pyx_n_s_filepath, __pyx_k_filepath, sizeof(__pyx_k_filepath), 0, 0, 1, 1}, {&__pyx_n_s_generate, __pyx_k_generate, sizeof(__pyx_k_generate), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_import_cert_base64, __pyx_k_import_cert_base64, sizeof(__pyx_k_import_cert_base64), 0, 0, 1, 1}, + {&__pyx_n_s_import_cert_file, __pyx_k_import_cert_file, sizeof(__pyx_k_import_cert_file), 0, 0, 1, 1}, {&__pyx_n_s_import_privkey_base64, __pyx_k_import_privkey_base64, sizeof(__pyx_k_import_privkey_base64), 0, 0, 1, 1}, {&__pyx_n_s_import_privkey_file, __pyx_k_import_privkey_file, sizeof(__pyx_k_import_privkey_file), 0, 0, 1, 1}, {&__pyx_n_s_import_pubkey_base64, __pyx_k_import_pubkey_base64, sizeof(__pyx_k_import_pubkey_base64), 0, 0, 1, 1}, {&__pyx_n_s_import_pubkey_file, __pyx_k_import_pubkey_file, sizeof(__pyx_k_import_pubkey_file), 0, 0, 1, 1}, + {&__pyx_n_s_is_private, __pyx_k_is_private, sizeof(__pyx_k_is_private), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_key_2, __pyx_k_key_2, sizeof(__pyx_k_key_2), 0, 0, 1, 1}, {&__pyx_n_s_key_type, __pyx_k_key_type, sizeof(__pyx_k_key_type), 0, 0, 1, 1}, @@ -4417,6 +5271,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_passphrase, __pyx_k_passphrase, sizeof(__pyx_k_passphrase), 0, 0, 1, 1}, + {&__pyx_n_s_priv_key, __pyx_k_priv_key, sizeof(__pyx_k_priv_key), 0, 0, 1, 1}, + {&__pyx_n_s_priv_key_2, __pyx_k_priv_key_2, sizeof(__pyx_k_priv_key_2), 0, 0, 1, 1}, {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1}, {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, @@ -4460,65 +5316,101 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "ssh/key.pyx":125 + /* "ssh/key.pyx":127 * * * def generate(KeyType key_type, int bits): # <<<<<<<<<<<<<< * cdef SSHKey key * cdef c_ssh.ssh_key _key */ - __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_key_type, __pyx_n_s_bits, __pyx_n_s_key, __pyx_n_s_key_2, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_key_type, __pyx_n_s_bits, __pyx_n_s_key, __pyx_n_s_key_2, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_generate, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_generate, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 127, __pyx_L1_error) - /* "ssh/key.pyx":137 + /* "ssh/key.pyx":139 * * * def import_privkey_base64(bytes b64_key, passphrase=b''): # <<<<<<<<<<<<<< * cdef const_char *c_key = b64_key * cdef bytes b_passphrase */ - __pyx_tuple__6 = PyTuple_Pack(8, __pyx_n_s_b64_key, __pyx_n_s_passphrase, __pyx_n_s_c_key, __pyx_n_s_b_passphrase, __pyx_n_s_c_passphrase, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(8, __pyx_n_s_b64_key, __pyx_n_s_passphrase, __pyx_n_s_c_key, __pyx_n_s_b_passphrase, __pyx_n_s_c_passphrase, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_privkey_base64, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_privkey_base64, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 139, __pyx_L1_error) - /* "ssh/key.pyx":156 + /* "ssh/key.pyx":158 * * * def import_privkey_file(filepath, passphrase=b''): # <<<<<<<<<<<<<< * cdef bytes b_passphrase * cdef bytes b_filepath = to_bytes(filepath) */ - __pyx_tuple__8 = PyTuple_Pack(9, __pyx_n_s_filepath, __pyx_n_s_passphrase, __pyx_n_s_b_passphrase, __pyx_n_s_b_filepath, __pyx_n_s_c_passphrase, __pyx_n_s_c_filepath, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(9, __pyx_n_s_filepath, __pyx_n_s_passphrase, __pyx_n_s_b_passphrase, __pyx_n_s_b_filepath, __pyx_n_s_c_passphrase, __pyx_n_s_c_filepath, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_privkey_file, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_privkey_file, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 158, __pyx_L1_error) - /* "ssh/key.pyx":176 + /* "ssh/key.pyx":178 * * * def import_pubkey_base64(bytes b64_key, KeyType key_type): # <<<<<<<<<<<<<< * cdef const_char *c_key = b64_key * cdef int rc */ - __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_b64_key, __pyx_n_s_key_type, __pyx_n_s_c_key, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_b64_key, __pyx_n_s_key_type, __pyx_n_s_c_key, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_pubkey_base64, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_pubkey_base64, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 178, __pyx_L1_error) - /* "ssh/key.pyx":190 + /* "ssh/key.pyx":192 * * * def import_pubkey_file(filepath): # <<<<<<<<<<<<<< * cdef bytes b_filepath = to_bytes(filepath) * cdef const_char *c_filepath = b_filepath */ - __pyx_tuple__12 = PyTuple_Pack(6, __pyx_n_s_filepath, __pyx_n_s_b_filepath, __pyx_n_s_c_filepath, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(6, __pyx_n_s_filepath, __pyx_n_s_b_filepath, __pyx_n_s_c_filepath, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_pubkey_file, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_pubkey_file, 192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 192, __pyx_L1_error) + + /* "ssh/key.pyx":207 + * + * + * def import_cert_base64(bytes b64_cert, KeyType key_type): # <<<<<<<<<<<<<< + * cdef const_char *c_key = b64_cert + * cdef int rc + */ + __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_b64_cert, __pyx_n_s_key_type, __pyx_n_s_c_key, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_cert_base64, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 207, __pyx_L1_error) + + /* "ssh/key.pyx":221 + * + * + * def import_cert_file(filepath): # <<<<<<<<<<<<<< + * cdef bytes b_filepath = to_bytes(filepath) + * cdef const_char *c_filepath = b_filepath + */ + __pyx_tuple__16 = PyTuple_Pack(6, __pyx_n_s_filepath, __pyx_n_s_b_filepath, __pyx_n_s_c_filepath, __pyx_n_s_rc, __pyx_n_s_key, __pyx_n_s_key_2); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_import_cert_file, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 221, __pyx_L1_error) + + /* "ssh/key.pyx":236 + * + * + * def copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key): # <<<<<<<<<<<<<< + * if priv_key.is_private() is False: + * raise KeyImportError + */ + __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_cert_key, __pyx_n_s_priv_key, __pyx_n_s_priv_key_2, __pyx_n_s_cert_key_2, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_key_pyx, __pyx_n_s_copy_cert_to_privkey, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -4616,6 +5508,20 @@ static int __Pyx_modinit_type_import_code(void) { if (!__pyx_ptype_3ssh_8keytypes_DSSCert01Key) __PYX_ERR(2, 40, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_RSACert01Key = __Pyx_ImportType(__pyx_t_1, "ssh.keytypes", "RSACert01Key", sizeof(struct __pyx_obj_3ssh_8keytypes_RSACert01Key), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_3ssh_8keytypes_RSACert01Key) __PYX_ERR(2, 44, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P256 = __Pyx_ImportType(__pyx_t_1, "ssh.keytypes", "ECDSA_P256", sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P256), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_3ssh_8keytypes_ECDSA_P256) __PYX_ERR(2, 48, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P384 = __Pyx_ImportType(__pyx_t_1, "ssh.keytypes", "ECDSA_P384", sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P384), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_3ssh_8keytypes_ECDSA_P384) __PYX_ERR(2, 52, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P521 = __Pyx_ImportType(__pyx_t_1, "ssh.keytypes", "ECDSA_P521", sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P521), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_3ssh_8keytypes_ECDSA_P521) __PYX_ERR(2, 56, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P256_CERT01 = __Pyx_ImportType(__pyx_t_1, "ssh.keytypes", "ECDSA_P256_CERT01", sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_3ssh_8keytypes_ECDSA_P256_CERT01) __PYX_ERR(2, 60, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P384_CERT01 = __Pyx_ImportType(__pyx_t_1, "ssh.keytypes", "ECDSA_P384_CERT01", sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_3ssh_8keytypes_ECDSA_P384_CERT01) __PYX_ERR(2, 64, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P521_CERT01 = __Pyx_ImportType(__pyx_t_1, "ssh.keytypes", "ECDSA_P521_CERT01", sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_3ssh_8keytypes_ECDSA_P521_CERT01) __PYX_ERR(2, 68, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ED25519_CERT01 = __Pyx_ImportType(__pyx_t_1, "ssh.keytypes", "ED25519_CERT01", sizeof(struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01), __Pyx_ImportType_CheckSize_Warn); + if (!__pyx_ptype_3ssh_8keytypes_ED25519_CERT01) __PYX_ERR(2, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -4896,64 +5802,100 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh/key.pyx":125 + /* "ssh/key.pyx":127 * * * def generate(KeyType key_type, int bits): # <<<<<<<<<<<<<< * cdef SSHKey key * cdef c_ssh.ssh_key _key */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_1generate, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_1generate, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_generate, __pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_generate, __pyx_t_2) < 0) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh/key.pyx":137 + /* "ssh/key.pyx":139 * * * def import_privkey_base64(bytes b64_key, passphrase=b''): # <<<<<<<<<<<<<< * cdef const_char *c_key = b64_key * cdef bytes b_passphrase */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_3import_privkey_base64, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_3import_privkey_base64, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_privkey_base64, __pyx_t_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_privkey_base64, __pyx_t_2) < 0) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh/key.pyx":156 + /* "ssh/key.pyx":158 * * * def import_privkey_file(filepath, passphrase=b''): # <<<<<<<<<<<<<< * cdef bytes b_passphrase * cdef bytes b_filepath = to_bytes(filepath) */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_5import_privkey_file, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_5import_privkey_file, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_privkey_file, __pyx_t_2) < 0) __PYX_ERR(0, 156, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_privkey_file, __pyx_t_2) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh/key.pyx":176 + /* "ssh/key.pyx":178 * * * def import_pubkey_base64(bytes b64_key, KeyType key_type): # <<<<<<<<<<<<<< * cdef const_char *c_key = b64_key * cdef int rc */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_7import_pubkey_base64, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_7import_pubkey_base64, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_pubkey_base64, __pyx_t_2) < 0) __PYX_ERR(0, 176, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_pubkey_base64, __pyx_t_2) < 0) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "ssh/key.pyx":190 + /* "ssh/key.pyx":192 * * * def import_pubkey_file(filepath): # <<<<<<<<<<<<<< * cdef bytes b_filepath = to_bytes(filepath) * cdef const_char *c_filepath = b_filepath */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_9import_pubkey_file, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_9import_pubkey_file, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_pubkey_file, __pyx_t_2) < 0) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh/key.pyx":207 + * + * + * def import_cert_base64(bytes b64_cert, KeyType key_type): # <<<<<<<<<<<<<< + * cdef const_char *c_key = b64_cert + * cdef int rc + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_11import_cert_base64, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_cert_base64, __pyx_t_2) < 0) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh/key.pyx":221 + * + * + * def import_cert_file(filepath): # <<<<<<<<<<<<<< + * cdef bytes b_filepath = to_bytes(filepath) + * cdef const_char *c_filepath = b_filepath + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_13import_cert_file, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_cert_file, __pyx_t_2) < 0) __PYX_ERR(0, 221, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "ssh/key.pyx":236 + * + * + * def copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key): # <<<<<<<<<<<<<< + * if priv_key.is_private() is False: + * raise KeyImportError + */ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3ssh_3key_15copy_cert_to_privkey, NULL, __pyx_n_s_ssh_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_pubkey_file, __pyx_t_2) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_cert_to_privkey, __pyx_t_2) < 0) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "ssh/key.pyx":1 @@ -5504,6 +6446,230 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg } #endif +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +#if 1 || PY_VERSION_HEX < 0x030600B1 +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { + return NULL; + } + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectCallNoArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, NULL, 0); + } +#endif +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) +#else + if (likely(PyCFunction_Check(func))) +#endif + { + if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { + return __Pyx_PyObject_CallMethO(func, NULL); + } + } + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); +} +#endif + +/* PyCFunctionFastCall */ +#if CYTHON_FAST_PYCCALL +static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { + PyCFunctionObject *func = (PyCFunctionObject*)func_obj; + PyCFunction meth = PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + int flags = PyCFunction_GET_FLAGS(func); + assert(PyCFunction_Check(func)); + assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); + assert(nargs >= 0); + assert(nargs == 0 || args != NULL); + /* _PyCFunction_FastCallDict() must not be called with an exception set, + because it may clear it (directly or indirectly) and so the + caller loses its exception */ + assert(!PyErr_Occurred()); + if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { + return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); + } else { + return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); + } +} +#endif + +/* PyObjectCallOneArg */ +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCall(func, &arg, 1); + } +#endif + if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); +#if CYTHON_FAST_PYCCALL + } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { + return __Pyx_PyCFunction_FastCall(func, &arg, 1); +#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_Pack(1, arg); + if (unlikely(!args)) return NULL; + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +#endif + /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { diff --git a/ssh/key.pyx b/ssh/key.pyx index 0fa9357..4bc2665 100644 --- a/ssh/key.pyx +++ b/ssh/key.pyx @@ -69,8 +69,9 @@ cdef class SSHKey: def key_type(self): cdef c_ssh.ssh_keytypes_e _type - with nogil: - _type = c_ssh.ssh_key_type(self._key) + if self._key is NULL: + return + _type = c_ssh.ssh_key_type(self._key) return from_keytype(_type) def ecdsa_name(self): @@ -200,3 +201,44 @@ def import_pubkey_file(filepath): raise KeyImportError key = SSHKey.from_ptr(_key) return key + + +def import_cert_base64(bytes b64_cert, KeyType key_type): + cdef const_char *c_key = b64_cert + cdef int rc + cdef SSHKey key + cdef c_ssh.ssh_key _key + with nogil: + rc = c_ssh.ssh_pki_import_cert_base64( + c_key, key_type._type, &_key) + if rc != c_ssh.SSH_OK: + raise KeyImportError + key = SSHKey.from_ptr(_key) + return key + + +def import_cert_file(filepath): + cdef bytes b_filepath = to_bytes(filepath) + cdef const_char *c_filepath = b_filepath + cdef int rc + cdef SSHKey key + cdef c_ssh.ssh_key _key + with nogil: + rc = c_ssh.ssh_pki_import_cert_file( + c_filepath, &_key) + if rc != c_ssh.SSH_OK: + raise KeyImportError + key = SSHKey.from_ptr(_key) + return key + + +def copy_cert_to_privkey(SSHKey cert_key, SSHKey priv_key): + if priv_key.is_private() is False: + raise KeyImportError + cdef c_ssh.ssh_key _priv_key = priv_key._key + cdef c_ssh.ssh_key _cert_key = cert_key._key + with nogil: + rc = c_ssh.ssh_pki_copy_cert_to_privkey( + _cert_key, _priv_key) + if rc != c_ssh.SSH_OK: + raise KeyImportError diff --git a/ssh/keytypes.c b/ssh/keytypes.c index 1c76f31..b08696a 100644 --- a/ssh/keytypes.c +++ b/ssh/keytypes.c @@ -818,8 +818,8 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { - "ssh/keytypes.pyx", "stringsource", + "ssh/keytypes.pyx", }; /* NoFastGil.proto */ #define __Pyx_PyGILState_Ensure PyGILState_Ensure @@ -842,6 +842,13 @@ struct __pyx_obj_3ssh_8keytypes_RSA1Key; struct __pyx_obj_3ssh_8keytypes_ECDSAKey; struct __pyx_obj_3ssh_8keytypes_DSSCert01Key; struct __pyx_obj_3ssh_8keytypes_RSACert01Key; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P256; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P384; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P521; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01; +struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01; +struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01; struct __pyx_obj_3ssh_8keytypes_UnknownKey; /* "ssh/keytypes.pxd":20 @@ -929,7 +936,91 @@ struct __pyx_obj_3ssh_8keytypes_RSACert01Key { }; -/* "ssh/keytypes.pyx":42 +/* "ssh/keytypes.pxd":48 + * + * + * cdef class ECDSA_P256(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P256 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "ssh/keytypes.pxd":52 + * + * + * cdef class ECDSA_P384(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P384 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "ssh/keytypes.pxd":56 + * + * + * cdef class ECDSA_P521(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P521 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "ssh/keytypes.pxd":60 + * + * + * cdef class ECDSA_P256_CERT01(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "ssh/keytypes.pxd":64 + * + * + * cdef class ECDSA_P384_CERT01(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "ssh/keytypes.pxd":68 + * + * + * cdef class ECDSA_P521_CERT01(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "ssh/keytypes.pxd":72 + * + * + * cdef class ED25519_CERT01(KeyType): # <<<<<<<<<<<<<< + * pass + * + */ +struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01 { + struct __pyx_obj_3ssh_8keytypes_KeyType __pyx_base; +}; + + +/* "ssh/keytypes.pyx":45 * * * cdef class UnknownKey(KeyType): # <<<<<<<<<<<<<< @@ -1012,6 +1103,16 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); + /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ @@ -1064,14 +1165,6 @@ static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObje /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); -/* PyErrExceptionMatches.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) -static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); -#else -#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) -#endif - /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; @@ -1108,14 +1201,39 @@ static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif -/* GetAttr.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); -/* GetAttr3.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* SetupReduce.proto */ +static int __Pyx_setup_reduce(PyObject* type_obj); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS @@ -1143,77 +1261,6 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif -/* GetModuleGlobalName.proto */ -#if CYTHON_USE_DICT_VERSIONS -#define __Pyx_GetModuleGlobalName(var, name) {\ - static PY_UINT64_T __pyx_dict_version = 0;\ - static PyObject *__pyx_dict_cached_value = NULL;\ - (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ - (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ - __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -#define __Pyx_GetModuleGlobalNameUncached(var, name) {\ - PY_UINT64_T __pyx_dict_version;\ - PyObject *__pyx_dict_cached_value;\ - (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ -} -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); -#else -#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) -#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); -#endif - -/* PyObjectCall2Args.proto */ -static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* RaiseArgTupleInvalid.proto */ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); - -/* RaiseDoubleKeywords.proto */ -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); - -/* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ - const char* function_name); - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* HasAttr.proto */ -static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); - -/* PyObject_GenericGetAttrNoDict.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr -#endif - -/* PyObject_GenericGetAttr.proto */ -#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 -static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); -#else -#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr -#endif - -/* PyObjectGetAttrStrNoError.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); - -/* SetupReduce.proto */ -static int __Pyx_setup_reduce(PyObject* type_obj); - /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) @@ -1243,18 +1290,15 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ssh_keytypes_e(enum ssh_keytypes_e value); +/* CIntFromPy.proto */ +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); + /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); -/* CIntFromPy.proto */ -static CYTHON_INLINE enum ssh_keytypes_e __Pyx_PyInt_As_enum__ssh_keytypes_e(PyObject *); - /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); -/* CIntFromPy.proto */ -static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *); - /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); @@ -1306,105 +1350,83 @@ static PyTypeObject *__pyx_ptype_3ssh_8keytypes_RSA1Key = 0; static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSAKey = 0; static PyTypeObject *__pyx_ptype_3ssh_8keytypes_DSSCert01Key = 0; static PyTypeObject *__pyx_ptype_3ssh_8keytypes_RSACert01Key = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P256 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P384 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P521 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P256_CERT01 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P384_CERT01 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ECDSA_P521_CERT01 = 0; +static PyTypeObject *__pyx_ptype_3ssh_8keytypes_ED25519_CERT01 = 0; static PyTypeObject *__pyx_ptype_3ssh_8keytypes_UnknownKey = 0; static struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_f_3ssh_8keytypes_from_keytype(enum ssh_keytypes_e); /*proto*/ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_KeyType__set_state(struct __pyx_obj_3ssh_8keytypes_KeyType *, PyObject *); /*proto*/ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_UnknownKey__set_state(struct __pyx_obj_3ssh_8keytypes_UnknownKey *, PyObject *); /*proto*/ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_DSSKey__set_state(struct __pyx_obj_3ssh_8keytypes_DSSKey *, PyObject *); /*proto*/ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_RSAKey__set_state(struct __pyx_obj_3ssh_8keytypes_RSAKey *, PyObject *); /*proto*/ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_RSA1Key__set_state(struct __pyx_obj_3ssh_8keytypes_RSA1Key *, PyObject *); /*proto*/ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_ECDSAKey__set_state(struct __pyx_obj_3ssh_8keytypes_ECDSAKey *, PyObject *); /*proto*/ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_DSSCert01Key__set_state(struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *, PyObject *); /*proto*/ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_RSACert01Key__set_state(struct __pyx_obj_3ssh_8keytypes_RSACert01Key *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "ssh.keytypes" extern int __pyx_module_is_main_ssh__keytypes; int __pyx_module_is_main_ssh__keytypes = 0; /* Implementation of 'ssh.keytypes' */ -static const char __pyx_k_new[] = "__new__"; +static PyObject *__pyx_builtin_TypeError; static const char __pyx_k_str[] = "__str__"; -static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_type[] = "_type"; static const char __pyx_k_DSSKey[] = "DSSKey"; static const char __pyx_k_RSAKey[] = "RSAKey"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; -static const char __pyx_k_update[] = "update"; static const char __pyx_k_KeyType[] = "KeyType"; static const char __pyx_k_RSA1Key[] = "RSA1Key"; static const char __pyx_k_ECDSAKey[] = "ECDSAKey"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_key_name[] = "key_name"; -static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_setstate[] = "__setstate__"; -static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_ECDSA_P256[] = "ECDSA_P256"; +static const char __pyx_k_ECDSA_P384[] = "ECDSA_P384"; +static const char __pyx_k_ECDSA_P521[] = "ECDSA_P521"; static const char __pyx_k_UnknownKey[] = "UnknownKey"; static const char __pyx_k_b_key_name[] = "b_key_name"; static const char __pyx_k_key_name_2[] = "_key_name"; -static const char __pyx_k_pyx_result[] = "__pyx_result"; -static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_DSSCert01Key[] = "DSSCert01Key"; static const char __pyx_k_RSACert01Key[] = "RSACert01Key"; -static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_ssh_keytypes[] = "ssh.keytypes"; -static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; -static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; +static const char __pyx_k_ED25519_CERT01[] = "ED25519_CERT01"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_ssh_keytypes_pyx[] = "ssh/keytypes.pyx"; +static const char __pyx_k_ECDSA_P256_CERT01[] = "ECDSA_P256_CERT01"; +static const char __pyx_k_ECDSA_P384_CERT01[] = "ECDSA_P384_CERT01"; +static const char __pyx_k_ECDSA_P521_CERT01[] = "ECDSA_P521_CERT01"; static const char __pyx_k_Unknown_keytype_s[] = "Unknown keytype %s"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_key_type_from_name[] = "key_type_from_name"; -static const char __pyx_k_pyx_unpickle_DSSKey[] = "__pyx_unpickle_DSSKey"; -static const char __pyx_k_pyx_unpickle_RSAKey[] = "__pyx_unpickle_RSAKey"; -static const char __pyx_k_pyx_unpickle_KeyType[] = "__pyx_unpickle_KeyType"; -static const char __pyx_k_pyx_unpickle_RSA1Key[] = "__pyx_unpickle_RSA1Key"; -static const char __pyx_k_pyx_unpickle_ECDSAKey[] = "__pyx_unpickle_ECDSAKey"; -static const char __pyx_k_pyx_unpickle_UnknownKey[] = "__pyx_unpickle_UnknownKey"; -static const char __pyx_k_pyx_unpickle_DSSCert01Key[] = "__pyx_unpickle_DSSCert01Key"; -static const char __pyx_k_pyx_unpickle_RSACert01Key[] = "__pyx_unpickle_RSACert01Key"; -static const char __pyx_k_Incompatible_checksums_s_vs_0x12[] = "Incompatible checksums (%s vs 0x12dfdbc = (_type))"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static PyObject *__pyx_n_s_DSSCert01Key; static PyObject *__pyx_n_s_DSSKey; static PyObject *__pyx_n_s_ECDSAKey; -static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x12; +static PyObject *__pyx_n_s_ECDSA_P256; +static PyObject *__pyx_n_s_ECDSA_P256_CERT01; +static PyObject *__pyx_n_s_ECDSA_P384; +static PyObject *__pyx_n_s_ECDSA_P384_CERT01; +static PyObject *__pyx_n_s_ECDSA_P521; +static PyObject *__pyx_n_s_ECDSA_P521_CERT01; +static PyObject *__pyx_n_s_ED25519_CERT01; static PyObject *__pyx_n_s_KeyType; -static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_RSA1Key; static PyObject *__pyx_n_s_RSACert01Key; static PyObject *__pyx_n_s_RSAKey; +static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_UnknownKey; static PyObject *__pyx_kp_s_Unknown_keytype_s; static PyObject *__pyx_n_s_b_key_name; static PyObject *__pyx_n_s_cline_in_traceback; -static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_getstate; -static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_key_name; static PyObject *__pyx_n_s_key_name_2; static PyObject *__pyx_n_s_key_type_from_name; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_name; -static PyObject *__pyx_n_s_new; -static PyObject *__pyx_n_s_pickle; -static PyObject *__pyx_n_s_pyx_PickleError; -static PyObject *__pyx_n_s_pyx_checksum; -static PyObject *__pyx_n_s_pyx_result; -static PyObject *__pyx_n_s_pyx_state; -static PyObject *__pyx_n_s_pyx_type; -static PyObject *__pyx_n_s_pyx_unpickle_DSSCert01Key; -static PyObject *__pyx_n_s_pyx_unpickle_DSSKey; -static PyObject *__pyx_n_s_pyx_unpickle_ECDSAKey; -static PyObject *__pyx_n_s_pyx_unpickle_KeyType; -static PyObject *__pyx_n_s_pyx_unpickle_RSA1Key; -static PyObject *__pyx_n_s_pyx_unpickle_RSACert01Key; -static PyObject *__pyx_n_s_pyx_unpickle_RSAKey; -static PyObject *__pyx_n_s_pyx_unpickle_UnknownKey; +static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; @@ -1413,38 +1435,44 @@ static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_ssh_keytypes; static PyObject *__pyx_kp_s_ssh_keytypes_pyx; static PyObject *__pyx_n_s_str; -static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_type; -static PyObject *__pyx_n_s_update; +static int __pyx_pf_3ssh_8keytypes_7KeyType___cinit__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_5value___get__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_2__repr__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_4__reduce_cython__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_6__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_2__str__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_4__repr__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static int __pyx_pf_3ssh_8keytypes_12RSACert01Key___cinit__(struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P256___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P256 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P256_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P256 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P384___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P384 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P384_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P384 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P521___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P521 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P521_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P521 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P256_CERT01___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P256_CERT01_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P384_CERT01___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P384_CERT01_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P521_CERT01___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P521_CERT01_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_14ED25519_CERT01___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01 *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3ssh_8keytypes_14ED25519_CERT01_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_3ssh_8keytypes_key_type_from_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key_name); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_2__pyx_unpickle_KeyType(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_4__pyx_unpickle_UnknownKey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_6__pyx_unpickle_DSSKey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_8__pyx_unpickle_RSAKey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_10__pyx_unpickle_RSA1Key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_12__pyx_unpickle_ECDSAKey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_14__pyx_unpickle_DSSCert01Key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_3ssh_8keytypes_16__pyx_unpickle_RSACert01Key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_3ssh_8keytypes_KeyType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_3ssh_8keytypes_DSSKey(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_3ssh_8keytypes_RSAKey(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -1452,29 +1480,101 @@ static PyObject *__pyx_tp_new_3ssh_8keytypes_RSA1Key(PyTypeObject *t, PyObject * static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSAKey(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_3ssh_8keytypes_DSSCert01Key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_3ssh_8keytypes_RSACert01Key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P256(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P384(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P521(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P256_CERT01(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P384_CERT01(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P521_CERT01(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_3ssh_8keytypes_ED25519_CERT01(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_3ssh_8keytypes_UnknownKey(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_int_19791292; static PyObject *__pyx_tuple_; +static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; +static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; +static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; +static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; +static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; +static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; +static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; +static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; -static PyObject *__pyx_codeobj__2; -static PyObject *__pyx_codeobj__4; -static PyObject *__pyx_codeobj__6; -static PyObject *__pyx_codeobj__8; -static PyObject *__pyx_codeobj__10; -static PyObject *__pyx_codeobj__12; -static PyObject *__pyx_codeobj__14; -static PyObject *__pyx_codeobj__16; -static PyObject *__pyx_codeobj__18; +static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; +static PyObject *__pyx_tuple__20; +static PyObject *__pyx_tuple__21; +static PyObject *__pyx_tuple__22; +static PyObject *__pyx_tuple__23; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; +static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__27; +static PyObject *__pyx_tuple__28; +static PyObject *__pyx_tuple__29; +static PyObject *__pyx_tuple__30; +static PyObject *__pyx_tuple__31; +static PyObject *__pyx_codeobj__32; /* Late includes */ -/* "ssh/keytypes.pyx":27 +/* "ssh/keytypes.pyx":26 + * cdef class KeyType: + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self._type = ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN + * + */ + +/* Python wrapper */ +static int __pyx_pw_3ssh_8keytypes_7KeyType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3ssh_8keytypes_7KeyType_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType___cinit__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_3ssh_8keytypes_7KeyType___cinit__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__", 0); + + /* "ssh/keytypes.pyx":27 + * + * def __cinit__(self): + * self._type = ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_v_self->_type = SSH_KEYTYPE_UNKNOWN; + + /* "ssh/keytypes.pyx":26 + * cdef class KeyType: + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self._type = ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN + * + */ + + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "ssh/keytypes.pyx":30 * * @property * def value(self): # <<<<<<<<<<<<<< @@ -1504,7 +1604,7 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_5value___get__(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "ssh/keytypes.pyx":28 + /* "ssh/keytypes.pyx":31 * @property * def value(self): * return self._type # <<<<<<<<<<<<<< @@ -1512,13 +1612,13 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_5value___get__(struct __pyx_ob * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh/keytypes.pyx":27 + /* "ssh/keytypes.pyx":30 * * @property * def value(self): # <<<<<<<<<<<<<< @@ -1537,7 +1637,7 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_5value___get__(struct __pyx_ob return __pyx_r; } -/* "ssh/keytypes.pyx":30 +/* "ssh/keytypes.pyx":33 * return self._type * * def __str__(self): # <<<<<<<<<<<<<< @@ -1546,19 +1646,19 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_5value___get__(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_1__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_1__str__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_3__str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_3__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType___str__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self)); + __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType_2__str__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self) { +static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_2__str__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self) { PyObject *__pyx_v__type = 0; const char *__pyx_v_c_type; PyObject *__pyx_r = NULL; @@ -1570,7 +1670,7 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "ssh/keytypes.pyx":33 + /* "ssh/keytypes.pyx":36 * cdef bytes _type * cdef const_char *c_type * with nogil: # <<<<<<<<<<<<<< @@ -1585,7 +1685,7 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_ #endif /*try:*/ { - /* "ssh/keytypes.pyx":34 + /* "ssh/keytypes.pyx":37 * cdef const_char *c_type * with nogil: * c_type = ssh_key_type_to_char(self._type) # <<<<<<<<<<<<<< @@ -1595,7 +1695,7 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_ __pyx_v_c_type = ssh_key_type_to_char(__pyx_v_self->_type); } - /* "ssh/keytypes.pyx":33 + /* "ssh/keytypes.pyx":36 * cdef bytes _type * cdef const_char *c_type * with nogil: # <<<<<<<<<<<<<< @@ -1614,19 +1714,19 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_ } } - /* "ssh/keytypes.pyx":35 + /* "ssh/keytypes.pyx":38 * with nogil: * c_type = ssh_key_type_to_char(self._type) * _type = c_type # <<<<<<<<<<<<<< * return to_str(_type) * */ - __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__type = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "ssh/keytypes.pyx":36 + /* "ssh/keytypes.pyx":39 * c_type = ssh_key_type_to_char(self._type) * _type = c_type * return to_str(_type) # <<<<<<<<<<<<<< @@ -1634,14 +1734,14 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_ * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v__type); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_5utils_to_str(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v__type); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(1, 39, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3ssh_5utils_to_str(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh/keytypes.pyx":30 + /* "ssh/keytypes.pyx":33 * return self._type * * def __str__(self): # <<<<<<<<<<<<<< @@ -1661,7 +1761,7 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_ return __pyx_r; } -/* "ssh/keytypes.pyx":38 +/* "ssh/keytypes.pyx":41 * return to_str(_type) * * def __repr__(self): # <<<<<<<<<<<<<< @@ -1670,19 +1770,19 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType___str__(struct __pyx_obj_3ssh_ */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_3__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_3__repr__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_5__repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_5__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType_2__repr__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self)); + __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType_4__repr__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_2__repr__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self) { +static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_4__repr__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -1693,7 +1793,7 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_2__repr__(struct __pyx_obj_3ss int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "ssh/keytypes.pyx":39 + /* "ssh/keytypes.pyx":42 * * def __repr__(self): * return self.__str__() # <<<<<<<<<<<<<< @@ -1701,7 +1801,7 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_2__repr__(struct __pyx_obj_3ss * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -1715,14 +1815,14 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_2__repr__(struct __pyx_obj_3ss } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 42, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "ssh/keytypes.pyx":38 + /* "ssh/keytypes.pyx":41 * return to_str(_type) * * def __repr__(self): # <<<<<<<<<<<<<< @@ -1745,262 +1845,83 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_2__repr__(struct __pyx_obj_3ss /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_7KeyType_4__reduce_cython__[] = "KeyType.__reduce_cython__(self)"; -static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_7KeyType_6__reduce_cython__[] = "KeyType.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType_4__reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self)); + __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType_6__reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_4__reduce_cython__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; +static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._type,) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_state = ((PyObject*)__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, 2, __pyx_L1_error) - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__dict = __pyx_t_2; - __pyx_t_2 = 0; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_3 = (__pyx_v__dict != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = False - */ - __pyx_v_use_setstate = 1; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.KeyType.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - goto __pyx_L3; - } - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = False # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, None), state - */ - /*else*/ { - __pyx_v_use_setstate = 0; - } - __pyx_L3:; +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_7KeyType_8__setstate_cython__[] = "KeyType.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType_8__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, None), state - * else: - */ - __pyx_t_4 = (__pyx_v_use_setstate != 0); - if (__pyx_t_4) { + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "(tree fragment)":13 - * use_setstate = False - * if use_setstate: - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_KeyType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, None), state - * else: - */ - } - - /* "(tree fragment)":15 - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, None), state - * else: - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, state) # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_KeyType__set_state(self, __pyx_state) - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_KeyType); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.KeyType.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, state) - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_KeyType__set_state(self, __pyx_state) - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_7KeyType_6__setstate_cython__[] = "KeyType.__setstate_cython__(self, __pyx_state)"; -static PyObject *__pyx_pw_3ssh_8keytypes_7KeyType_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_3ssh_8keytypes_7KeyType_6__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_6__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -2009,31 +1930,29 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_6__setstate_cython__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "(tree fragment)":17 - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_KeyType__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_8keytypes___pyx_unpickle_KeyType__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_KeyType, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_KeyType__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh.keytypes.KeyType.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -2041,8 +1960,8 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7KeyType_6__setstate_cython__(struct __ /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ @@ -2059,227 +1978,48 @@ static PyObject *__pyx_pw_3ssh_8keytypes_10UnknownKey_1__reduce_cython__(PyObjec return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; +static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._type,) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->__pyx_base._type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_state = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__dict = __pyx_t_2; - __pyx_t_2 = 0; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_3 = (__pyx_v__dict != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = False - */ - __pyx_v_use_setstate = 1; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - goto __pyx_L3; - } - - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = False # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, None), state - */ - /*else*/ { - __pyx_v_use_setstate = 0; - } - __pyx_L3:; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, None), state - * else: - */ - __pyx_t_4 = (__pyx_v_use_setstate != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":13 - * use_setstate = False - * if use_setstate: - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_UnknownKey); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, None), state - * else: - */ - } - - /* "(tree fragment)":15 - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, None), state - * else: - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, state) # <<<<<<<<<<<<<< + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_UnknownKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_UnknownKey); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("ssh.keytypes.UnknownKey.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, state) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_UnknownKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ @@ -2296,7 +2036,7 @@ static PyObject *__pyx_pw_3ssh_8keytypes_10UnknownKey_3__setstate_cython__(PyObj return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -2305,31 +2045,29 @@ static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey_2__setstate_cython__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "(tree fragment)":17 - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_UnknownKey__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_8keytypes___pyx_unpickle_UnknownKey__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_UnknownKey, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_UnknownKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh.keytypes.UnknownKey.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -2337,8 +2075,8 @@ static PyObject *__pyx_pf_3ssh_8keytypes_10UnknownKey_2__setstate_cython__(struc /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ @@ -2355,227 +2093,48 @@ static PyObject *__pyx_pw_3ssh_8keytypes_6DSSKey_1__reduce_cython__(PyObject *__ return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; +static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._type,) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->__pyx_base._type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_state = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__dict = __pyx_t_2; - __pyx_t_2 = 0; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_3 = (__pyx_v__dict != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = False - */ - __pyx_v_use_setstate = 1; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - goto __pyx_L3; - } - - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = False # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, None), state - */ - /*else*/ { - __pyx_v_use_setstate = 0; - } - __pyx_L3:; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, None), state - * else: - */ - __pyx_t_4 = (__pyx_v_use_setstate != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":13 - * use_setstate = False - * if use_setstate: - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_DSSKey); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, None), state - * else: - */ - } - - /* "(tree fragment)":15 - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, None), state - * else: - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, state) # <<<<<<<<<<<<<< + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_DSSKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_DSSKey); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("ssh.keytypes.DSSKey.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, state) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_DSSKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ @@ -2592,7 +2151,7 @@ static PyObject *__pyx_pw_3ssh_8keytypes_6DSSKey_3__setstate_cython__(PyObject * return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -2601,31 +2160,29 @@ static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey_2__setstate_cython__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "(tree fragment)":17 - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_DSSKey__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_8keytypes___pyx_unpickle_DSSKey__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_DSSKey, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_DSSKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh.keytypes.DSSKey.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -2633,8 +2190,8 @@ static PyObject *__pyx_pf_3ssh_8keytypes_6DSSKey_2__setstate_cython__(struct __p /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ @@ -2651,227 +2208,48 @@ static PyObject *__pyx_pw_3ssh_8keytypes_6RSAKey_1__reduce_cython__(PyObject *__ return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; +static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._type,) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->__pyx_base._type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_state = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__dict = __pyx_t_2; - __pyx_t_2 = 0; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_3 = (__pyx_v__dict != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = False - */ - __pyx_v_use_setstate = 1; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - goto __pyx_L3; - } - - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = False # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, None), state - */ - /*else*/ { - __pyx_v_use_setstate = 0; - } - __pyx_L3:; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, None), state - * else: - */ - __pyx_t_4 = (__pyx_v_use_setstate != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":13 - * use_setstate = False - * if use_setstate: - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_RSAKey); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, None), state - * else: - */ - } - - /* "(tree fragment)":15 - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, None), state - * else: - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, state) # <<<<<<<<<<<<<< + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_RSAKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_RSAKey); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("ssh.keytypes.RSAKey.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, state) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_RSAKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ @@ -2888,7 +2266,7 @@ static PyObject *__pyx_pw_3ssh_8keytypes_6RSAKey_3__setstate_cython__(PyObject * return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -2897,31 +2275,29 @@ static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey_2__setstate_cython__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "(tree fragment)":17 - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_RSAKey__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_8keytypes___pyx_unpickle_RSAKey__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_RSAKey, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_RSAKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh.keytypes.RSAKey.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -2929,8 +2305,8 @@ static PyObject *__pyx_pf_3ssh_8keytypes_6RSAKey_2__setstate_cython__(struct __p /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ @@ -2947,227 +2323,48 @@ static PyObject *__pyx_pw_3ssh_8keytypes_7RSA1Key_1__reduce_cython__(PyObject *_ return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; +static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._type,) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->__pyx_base._type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_state = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__dict = __pyx_t_2; - __pyx_t_2 = 0; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_3 = (__pyx_v__dict != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = False + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_v_use_setstate = 1; - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - goto __pyx_L3; - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.RSA1Key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = False # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, None), state - */ - /*else*/ { - __pyx_v_use_setstate = 0; - } - __pyx_L3:; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, None), state - * else: - */ - __pyx_t_4 = (__pyx_v_use_setstate != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":13 - * use_setstate = False - * if use_setstate: - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_RSA1Key); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, None), state - * else: - */ - } - - /* "(tree fragment)":15 - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, None), state - * else: - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, state) # <<<<<<<<<<<<<< - * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_RSA1Key__set_state(self, __pyx_state) - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_RSA1Key); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } - - /* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.RSA1Key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, state) - * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_RSA1Key__set_state(self, __pyx_state) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ @@ -3184,7 +2381,7 @@ static PyObject *__pyx_pw_3ssh_8keytypes_7RSA1Key_3__setstate_cython__(PyObject return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3193,31 +2390,29 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key_2__setstate_cython__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "(tree fragment)":17 - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_RSA1Key__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_8keytypes___pyx_unpickle_RSA1Key__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_RSA1Key, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_RSA1Key__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh.keytypes.RSA1Key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3225,8 +2420,8 @@ static PyObject *__pyx_pf_3ssh_8keytypes_7RSA1Key_2__setstate_cython__(struct __ /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ @@ -3243,227 +2438,48 @@ static PyObject *__pyx_pw_3ssh_8keytypes_8ECDSAKey_1__reduce_cython__(PyObject * return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; +static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._type,) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->__pyx_base._type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_state = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__dict = __pyx_t_2; - __pyx_t_2 = 0; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_3 = (__pyx_v__dict != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = False - */ - __pyx_v_use_setstate = 1; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - goto __pyx_L3; - } - - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = False # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, None), state - */ - /*else*/ { - __pyx_v_use_setstate = 0; - } - __pyx_L3:; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, None), state - * else: - */ - __pyx_t_4 = (__pyx_v_use_setstate != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":13 - * use_setstate = False - * if use_setstate: - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_ECDSAKey); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, None), state - * else: - */ - } - - /* "(tree fragment)":15 - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, None), state - * else: - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, state) # <<<<<<<<<<<<<< + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_ECDSAKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_ECDSAKey); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("ssh.keytypes.ECDSAKey.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, state) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_ECDSAKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ @@ -3480,7 +2496,7 @@ static PyObject *__pyx_pw_3ssh_8keytypes_8ECDSAKey_3__setstate_cython__(PyObject return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3489,31 +2505,29 @@ static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey_2__setstate_cython__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "(tree fragment)":17 - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_ECDSAKey__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_8keytypes___pyx_unpickle_ECDSAKey__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_ECDSAKey, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_ECDSAKey__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh.keytypes.ECDSAKey.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3521,8 +2535,8 @@ static PyObject *__pyx_pf_3ssh_8keytypes_8ECDSAKey_2__setstate_cython__(struct _ /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ @@ -3539,227 +2553,48 @@ static PyObject *__pyx_pw_3ssh_8keytypes_12DSSCert01Key_1__reduce_cython__(PyObj return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; +static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._type,) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->__pyx_base._type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_state = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__dict = __pyx_t_2; - __pyx_t_2 = 0; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_3 = (__pyx_v__dict != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = False - */ - __pyx_v_use_setstate = 1; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - goto __pyx_L3; - } - - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = False # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, None), state - */ - /*else*/ { - __pyx_v_use_setstate = 0; - } - __pyx_L3:; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, None), state - * else: - */ - __pyx_t_4 = (__pyx_v_use_setstate != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":13 - * use_setstate = False - * if use_setstate: - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_DSSCert01Key); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, None), state - * else: - */ - } - - /* "(tree fragment)":15 - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, None), state - * else: - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, state) # <<<<<<<<<<<<<< + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_DSSCert01Key__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_DSSCert01Key); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("ssh.keytypes.DSSCert01Key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, state) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_DSSCert01Key__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ @@ -3776,7 +2611,7 @@ static PyObject *__pyx_pw_3ssh_8keytypes_12DSSCert01Key_3__setstate_cython__(PyO return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3785,294 +2620,165 @@ static PyObject *__pyx_pf_3ssh_8keytypes_12DSSCert01Key_2__setstate_cython__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "(tree fragment)":17 - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_DSSCert01Key__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_8keytypes___pyx_unpickle_DSSCert01Key__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_DSSCert01Key, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_DSSCert01Key__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh.keytypes.DSSCert01Key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":1 - * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict +/* "ssh/keytypes.pyx":71 + * cdef class RSACert01Key(KeyType): + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self._type = ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01 + * */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_12RSACert01Key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_12RSACert01Key___reduce_cython__[] = "RSACert01Key.__reduce_cython__(self)"; -static PyObject *__pyx_pw_3ssh_8keytypes_12RSACert01Key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; +static int __pyx_pw_3ssh_8keytypes_12RSACert01Key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3ssh_8keytypes_12RSACert01Key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_3ssh_8keytypes_12RSACert01Key___reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_RSACert01Key *)__pyx_v_self)); + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} + if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_3ssh_8keytypes_12RSACert01Key___cinit__(((struct __pyx_obj_3ssh_8keytypes_RSACert01Key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key___reduce_cython__(struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self) { - PyObject *__pyx_v_state = 0; - PyObject *__pyx_v__dict = 0; - int __pyx_v_use_setstate; - PyObject *__pyx_r = NULL; +static int __pyx_pf_3ssh_8keytypes_12RSACert01Key___cinit__(struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self) { + int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__reduce_cython__", 0); - - /* "(tree fragment)":5 - * cdef object _dict - * cdef bint use_setstate - * state = (self._type,) # <<<<<<<<<<<<<< - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v_self->__pyx_base._type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_v_state = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_RefNannySetupContext("__cinit__", 0); - /* "(tree fragment)":6 - * cdef bint use_setstate - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< - * if _dict is not None: - * state += (_dict,) - */ - __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v__dict = __pyx_t_2; - __pyx_t_2 = 0; - - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - __pyx_t_3 = (__pyx_v__dict != Py_None); - __pyx_t_4 = (__pyx_t_3 != 0); - if (__pyx_t_4) { - - /* "(tree fragment)":8 - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: - * state += (_dict,) # <<<<<<<<<<<<<< - * use_setstate = True - * else: + /* "ssh/keytypes.pyx":72 + * + * def __cinit__(self): + * self._type = ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01 # <<<<<<<<<<<<<< + * + * */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v__dict); - __Pyx_GIVEREF(__pyx_v__dict); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict); - __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1)); - __pyx_t_1 = 0; + __pyx_v_self->__pyx_base._type = SSH_KEYTYPE_RSA_CERT01; - /* "(tree fragment)":9 - * if _dict is not None: - * state += (_dict,) - * use_setstate = True # <<<<<<<<<<<<<< - * else: - * use_setstate = False + /* "ssh/keytypes.pyx":71 + * cdef class RSACert01Key(KeyType): + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * self._type = ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01 + * */ - __pyx_v_use_setstate = 1; - /* "(tree fragment)":7 - * state = (self._type,) - * _dict = getattr(self, '__dict__', None) - * if _dict is not None: # <<<<<<<<<<<<<< - * state += (_dict,) - * use_setstate = True - */ - goto __pyx_L3; - } + /* function exit code */ + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "(tree fragment)":11 - * use_setstate = True - * else: - * use_setstate = False # <<<<<<<<<<<<<< - * if use_setstate: - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, None), state +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - /*else*/ { - __pyx_v_use_setstate = 0; - } - __pyx_L3:; - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, None), state - * else: - */ - __pyx_t_4 = (__pyx_v_use_setstate != 0); - if (__pyx_t_4) { +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_12RSACert01Key_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_12RSACert01Key_2__reduce_cython__[] = "RSACert01Key.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_12RSACert01Key_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_12RSACert01Key_2__reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_RSACert01Key *)__pyx_v_self)); - /* "(tree fragment)":13 - * use_setstate = False - * if use_setstate: - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, None), state # <<<<<<<<<<<<<< - * else: - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, state) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_RSACert01Key); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "(tree fragment)":12 - * else: - * use_setstate = False - * if use_setstate: # <<<<<<<<<<<<<< - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, None), state - * else: - */ - } +static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":15 - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, None), state - * else: - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, state) # <<<<<<<<<<<<<< + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_RSACert01Key__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_RSACert01Key); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); - __Pyx_INCREF(__pyx_int_19791292); - __Pyx_GIVEREF(__pyx_int_19791292); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_19791292); - __Pyx_INCREF(__pyx_v_state); - __Pyx_GIVEREF(__pyx_v_state); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); - __pyx_t_5 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< - * cdef tuple state - * cdef object _dict + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("ssh.keytypes.RSACert01Key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_state); - __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":16 - * else: - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, state) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_RSACert01Key__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_12RSACert01Key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_12RSACert01Key_2__setstate_cython__[] = "RSACert01Key.__setstate_cython__(self, __pyx_state)"; -static PyObject *__pyx_pw_3ssh_8keytypes_12RSACert01Key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pw_3ssh_8keytypes_12RSACert01Key_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_12RSACert01Key_4__setstate_cython__[] = "RSACert01Key.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_12RSACert01Key_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_3ssh_8keytypes_12RSACert01Key_2__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_RSACert01Key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_3ssh_8keytypes_12RSACert01Key_4__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_RSACert01Key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key_2__setstate_cython__(struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -4081,3688 +2787,2053 @@ static PyObject *__pyx_pf_3ssh_8keytypes_12RSACert01Key_2__setstate_cython__(str int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "(tree fragment)":17 - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): - * __pyx_unpickle_RSACert01Key__set_state(self, __pyx_state) # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_3ssh_8keytypes___pyx_unpickle_RSACert01Key__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":16 - * else: - * return __pyx_unpickle_RSACert01Key, (type(self), 0x12dfdbc, state) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< - * __pyx_unpickle_RSACert01Key__set_state(self, __pyx_state) + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("ssh.keytypes.RSACert01Key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "ssh/keytypes.pyx":70 - * - * - * cdef KeyType from_keytype(ssh_keytypes_e _type): # <<<<<<<<<<<<<< - * cdef KeyType key_type - * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ -static struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_f_3ssh_8keytypes_from_keytype(enum ssh_keytypes_e __pyx_v__type) { - struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_key_type = 0; - struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_r = NULL; +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P256_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_10ECDSA_P256___reduce_cython__[] = "ECDSA_P256.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P256_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_10ECDSA_P256___reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P256 *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P256___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P256 *__pyx_v_self) { + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("from_keytype", 0); - - /* "ssh/keytypes.pyx":72 - * cdef KeyType from_keytype(ssh_keytypes_e _type): - * cdef KeyType key_type - * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: # <<<<<<<<<<<<<< - * key_type = UnknownKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: - */ - switch (__pyx_v__type) { - case SSH_KEYTYPE_UNKNOWN: - - /* "ssh/keytypes.pyx":73 - * cdef KeyType key_type - * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: - * key_type = UnknownKey.__new__(KeyType) # <<<<<<<<<<<<<< - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: - * key_type = DSSKey.__new__(KeyType) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_UnknownKey), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3ssh_8keytypes_KeyType))))) __PYX_ERR(0, 73, __pyx_L1_error) - __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "ssh/keytypes.pyx":72 - * cdef KeyType from_keytype(ssh_keytypes_e _type): - * cdef KeyType key_type - * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: # <<<<<<<<<<<<<< - * key_type = UnknownKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: - */ - break; - case SSH_KEYTYPE_DSS: - - /* "ssh/keytypes.pyx":75 - * key_type = UnknownKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: - * key_type = DSSKey.__new__(KeyType) # <<<<<<<<<<<<<< - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: - * key_type = RSAKey.__new__(KeyType) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_DSSKey), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3ssh_8keytypes_KeyType))))) __PYX_ERR(0, 75, __pyx_L1_error) - __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "ssh/keytypes.pyx":74 - * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: - * key_type = UnknownKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: # <<<<<<<<<<<<<< - * key_type = DSSKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: - */ - break; - case SSH_KEYTYPE_RSA: - - /* "ssh/keytypes.pyx":77 - * key_type = DSSKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: - * key_type = RSAKey.__new__(KeyType) # <<<<<<<<<<<<<< - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: - * key_type = RSA1Key.__new__(KeyType) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_RSAKey), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3ssh_8keytypes_KeyType))))) __PYX_ERR(0, 77, __pyx_L1_error) - __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "ssh/keytypes.pyx":76 - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: - * key_type = DSSKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: # <<<<<<<<<<<<<< - * key_type = RSAKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: - */ - break; - case SSH_KEYTYPE_RSA1: - - /* "ssh/keytypes.pyx":79 - * key_type = RSAKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: - * key_type = RSA1Key.__new__(KeyType) # <<<<<<<<<<<<<< - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: - * key_type = ECDSAKey.__new__(KeyType) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_RSA1Key), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3ssh_8keytypes_KeyType))))) __PYX_ERR(0, 79, __pyx_L1_error) - __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "ssh/keytypes.pyx":78 - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: - * key_type = RSAKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: # <<<<<<<<<<<<<< - * key_type = RSA1Key.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: - */ - break; - case SSH_KEYTYPE_ECDSA: - - /* "ssh/keytypes.pyx":81 - * key_type = RSA1Key.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: - * key_type = ECDSAKey.__new__(KeyType) # <<<<<<<<<<<<<< - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: - * key_type = DSSCert01Key.__new__(KeyType) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_ECDSAKey), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3ssh_8keytypes_KeyType))))) __PYX_ERR(0, 81, __pyx_L1_error) - __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "ssh/keytypes.pyx":80 - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: - * key_type = RSA1Key.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: # <<<<<<<<<<<<<< - * key_type = ECDSAKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - break; - case SSH_KEYTYPE_DSS_CERT01: + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) - /* "ssh/keytypes.pyx":83 - * key_type = ECDSAKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: - * key_type = DSSCert01Key.__new__(KeyType) # <<<<<<<<<<<<<< - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: - * key_type = RSACert01Key.__new__(KeyType) + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_DSSCert01Key), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3ssh_8keytypes_KeyType))))) __PYX_ERR(0, 83, __pyx_L1_error) - __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); - __pyx_t_1 = 0; - /* "ssh/keytypes.pyx":82 - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: - * key_type = ECDSAKey.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: # <<<<<<<<<<<<<< - * key_type = DSSCert01Key.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: - */ - break; - case SSH_KEYTYPE_RSA_CERT01: + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P256.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "ssh/keytypes.pyx":85 - * key_type = DSSCert01Key.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: - * key_type = RSACert01Key.__new__(KeyType) # <<<<<<<<<<<<<< - * else: - * raise Exception("Unknown keytype %s", _type) +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_RSACert01Key), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType)); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3ssh_8keytypes_KeyType))))) __PYX_ERR(0, 85, __pyx_L1_error) - __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); - __pyx_t_1 = 0; - /* "ssh/keytypes.pyx":84 - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: - * key_type = DSSCert01Key.__new__(KeyType) - * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: # <<<<<<<<<<<<<< - * key_type = RSACert01Key.__new__(KeyType) - * else: - */ - break; - default: +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P256_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_10ECDSA_P256_2__setstate_cython__[] = "ECDSA_P256.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P256_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_10ECDSA_P256_2__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P256 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "ssh/keytypes.pyx":87 - * key_type = RSACert01Key.__new__(KeyType) - * else: - * raise Exception("Unknown keytype %s", _type) # <<<<<<<<<<<<<< - * key_type._type = _type - * return key_type - */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v__type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_kp_s_Unknown_keytype_s); - __Pyx_GIVEREF(__pyx_kp_s_Unknown_keytype_s); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Unknown_keytype_s); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __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, 87, __pyx_L1_error) - break; - } + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "ssh/keytypes.pyx":88 - * else: - * raise Exception("Unknown keytype %s", _type) - * key_type._type = _type # <<<<<<<<<<<<<< - * return key_type - * - */ - __pyx_v_key_type->_type = __pyx_v__type; +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P256_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P256 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); - /* "ssh/keytypes.pyx":89 - * raise Exception("Unknown keytype %s", _type) - * key_type._type = _type - * return key_type # <<<<<<<<<<<<<< - * - * + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_key_type)); - __pyx_r = __pyx_v_key_type; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "ssh/keytypes.pyx":70 - * - * - * cdef KeyType from_keytype(ssh_keytypes_e _type): # <<<<<<<<<<<<<< - * cdef KeyType key_type - * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("ssh.keytypes.from_keytype", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_key_type); - __Pyx_XGIVEREF((PyObject *)__pyx_r); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P256.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "ssh/keytypes.pyx":92 - * - * - * def key_type_from_name(key_name): # <<<<<<<<<<<<<< - * cdef ssh_keytypes_e _type - * cdef bytes b_key_name = to_bytes(key_name) +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_1key_type_from_name(PyObject *__pyx_self, PyObject *__pyx_v_key_name); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_key_type_from_name[] = "key_type_from_name(key_name)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_1key_type_from_name = {"key_type_from_name", (PyCFunction)__pyx_pw_3ssh_8keytypes_1key_type_from_name, METH_O, __pyx_doc_3ssh_8keytypes_key_type_from_name}; -static PyObject *__pyx_pw_3ssh_8keytypes_1key_type_from_name(PyObject *__pyx_self, PyObject *__pyx_v_key_name) { +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P384_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_10ECDSA_P384___reduce_cython__[] = "ECDSA_P384.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P384_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("key_type_from_name (wrapper)", 0); - __pyx_r = __pyx_pf_3ssh_8keytypes_key_type_from_name(__pyx_self, ((PyObject *)__pyx_v_key_name)); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_10ECDSA_P384___reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P384 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_key_type_from_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key_name) { - enum ssh_keytypes_e __pyx_v__type; - PyObject *__pyx_v_b_key_name = 0; - char __pyx_v__key_name; +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P384___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P384 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - char __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("key_type_from_name", 0); + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "ssh/keytypes.pyx":94 - * def key_type_from_name(key_name): - * cdef ssh_keytypes_e _type - * cdef bytes b_key_name = to_bytes(key_name) # <<<<<<<<<<<<<< - * cdef char _key_name = b_key_name - * with nogil: + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_key_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_b_key_name = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) - /* "ssh/keytypes.pyx":95 - * cdef ssh_keytypes_e _type - * cdef bytes b_key_name = to_bytes(key_name) - * cdef char _key_name = b_key_name # <<<<<<<<<<<<<< - * with nogil: - * _type = ssh_key_type_from_name(&_key_name) + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = __Pyx_PyInt_As_char(__pyx_v_b_key_name); if (unlikely((__pyx_t_2 == (char)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error) - __pyx_v__key_name = __pyx_t_2; - /* "ssh/keytypes.pyx":96 - * cdef bytes b_key_name = to_bytes(key_name) - * cdef char _key_name = b_key_name - * with nogil: # <<<<<<<<<<<<<< - * _type = ssh_key_type_from_name(&_key_name) - * return from_keytype(_type) - */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - Py_UNBLOCK_THREADS - __Pyx_FastGIL_Remember(); - #endif - /*try:*/ { + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P384.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "ssh/keytypes.pyx":97 - * cdef char _key_name = b_key_name - * with nogil: - * _type = ssh_key_type_from_name(&_key_name) # <<<<<<<<<<<<<< - * return from_keytype(_type) - * +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_v__type = ssh_key_type_from_name((&__pyx_v__key_name)); - } - /* "ssh/keytypes.pyx":96 - * cdef bytes b_key_name = to_bytes(key_name) - * cdef char _key_name = b_key_name - * with nogil: # <<<<<<<<<<<<<< - * _type = ssh_key_type_from_name(&_key_name) - * return from_keytype(_type) - */ - /*finally:*/ { - /*normal exit:*/{ - #ifdef WITH_THREAD - __Pyx_FastGIL_Forget(); - Py_BLOCK_THREADS - #endif - goto __pyx_L5; - } - __pyx_L5:; - } - } +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P384_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_10ECDSA_P384_2__setstate_cython__[] = "ECDSA_P384.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P384_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_10ECDSA_P384_2__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P384 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); - /* "ssh/keytypes.pyx":98 - * with nogil: - * _type = ssh_key_type_from_name(&_key_name) - * return from_keytype(_type) # <<<<<<<<<<<<<< - * - * + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P384_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P384 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_3ssh_8keytypes_from_keytype(__pyx_v__type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "ssh/keytypes.pyx":92 - * - * - * def key_type_from_name(key_name): # <<<<<<<<<<<<<< - * cdef ssh_keytypes_e _type - * cdef bytes b_key_name = to_bytes(key_name) + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("ssh.keytypes.key_type_from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P384.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_b_key_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 - * def __pyx_unpickle_KeyType(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_3__pyx_unpickle_KeyType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_2__pyx_unpickle_KeyType[] = "__pyx_unpickle_KeyType(__pyx_type, long __pyx_checksum, __pyx_state)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_3__pyx_unpickle_KeyType = {"__pyx_unpickle_KeyType", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_8keytypes_3__pyx_unpickle_KeyType, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_8keytypes_2__pyx_unpickle_KeyType}; -static PyObject *__pyx_pw_3ssh_8keytypes_3__pyx_unpickle_KeyType(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P521_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_10ECDSA_P521___reduce_cython__[] = "ECDSA_P521.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P521_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_KeyType (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_KeyType", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_KeyType", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_KeyType") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_KeyType", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_KeyType", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_3ssh_8keytypes_2__pyx_unpickle_KeyType(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_10ECDSA_P521___reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P521 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_2__pyx_unpickle_KeyType(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P521___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P521 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_KeyType", 0); - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x12dfdbc) != 0); - if (__pyx_t_1) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = KeyType.__new__(__pyx_type) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":6 - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = KeyType.__new__(__pyx_type) - * if __pyx_state is not None: - */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - } - - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = KeyType.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_KeyType__set_state( __pyx_result, __pyx_state) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_KeyType), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = KeyType.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_KeyType__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { - - /* "(tree fragment)":9 - * __pyx_result = KeyType.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_KeyType__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_KeyType__set_state(KeyType __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3ssh_8keytypes___pyx_unpickle_KeyType__set_state(((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = KeyType.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_KeyType__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - } + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_KeyType__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_KeyType__set_state(KeyType __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 - * def __pyx_unpickle_KeyType(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_KeyType", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P521.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":11 - * __pyx_unpickle_KeyType__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_KeyType__set_state(KeyType __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_KeyType__set_state(struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P521_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_10ECDSA_P521_2__setstate_cython__[] = "ECDSA_P521.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_10ECDSA_P521_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_10ECDSA_P521_2__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P521 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3ssh_8keytypes_10ECDSA_P521_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P521 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - enum ssh_keytypes_e __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_KeyType__set_state", 0); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_KeyType__set_state(KeyType __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = ((enum ssh_keytypes_e)__Pyx_PyInt_As_enum__ssh_keytypes_e(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_v___pyx_result->_type = __pyx_t_1; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_KeyType__set_state(KeyType __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = (__pyx_t_4 != 0); - __pyx_t_2 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_KeyType__set_state(KeyType __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":11 - * __pyx_unpickle_KeyType__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_KeyType__set_state(KeyType __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_KeyType__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P521.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 - * def __pyx_unpickle_UnknownKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_5__pyx_unpickle_UnknownKey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_4__pyx_unpickle_UnknownKey[] = "__pyx_unpickle_UnknownKey(__pyx_type, long __pyx_checksum, __pyx_state)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_5__pyx_unpickle_UnknownKey = {"__pyx_unpickle_UnknownKey", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_8keytypes_5__pyx_unpickle_UnknownKey, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_8keytypes_4__pyx_unpickle_UnknownKey}; -static PyObject *__pyx_pw_3ssh_8keytypes_5__pyx_unpickle_UnknownKey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P256_CERT01_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_17ECDSA_P256_CERT01___reduce_cython__[] = "ECDSA_P256_CERT01.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P256_CERT01_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_UnknownKey (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_UnknownKey", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_UnknownKey", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_UnknownKey") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_UnknownKey", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_UnknownKey", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_3ssh_8keytypes_4__pyx_unpickle_UnknownKey(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_17ECDSA_P256_CERT01___reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_4__pyx_unpickle_UnknownKey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P256_CERT01___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_UnknownKey", 0); - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x12dfdbc) != 0); - if (__pyx_t_1) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = UnknownKey.__new__(__pyx_type) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":6 - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = UnknownKey.__new__(__pyx_type) - * if __pyx_state is not None: - */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - } - - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = UnknownKey.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_UnknownKey__set_state( __pyx_result, __pyx_state) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_UnknownKey), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = UnknownKey.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_UnknownKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { - - /* "(tree fragment)":9 - * __pyx_result = UnknownKey.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_UnknownKey__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_UnknownKey__set_state(UnknownKey __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3ssh_8keytypes___pyx_unpickle_UnknownKey__set_state(((struct __pyx_obj_3ssh_8keytypes_UnknownKey *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = UnknownKey.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_UnknownKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - } + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_UnknownKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_UnknownKey__set_state(UnknownKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 - * def __pyx_unpickle_UnknownKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_UnknownKey", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P256_CERT01.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":11 - * __pyx_unpickle_UnknownKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_UnknownKey__set_state(UnknownKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_UnknownKey__set_state(struct __pyx_obj_3ssh_8keytypes_UnknownKey *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P256_CERT01_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_17ECDSA_P256_CERT01_2__setstate_cython__[] = "ECDSA_P256_CERT01.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P256_CERT01_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - enum ssh_keytypes_e __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_17ECDSA_P256_CERT01_2__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P256_CERT01_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_UnknownKey__set_state", 0); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_UnknownKey__set_state(UnknownKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = ((enum ssh_keytypes_e)__Pyx_PyInt_As_enum__ssh_keytypes_e(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_v___pyx_result->__pyx_base._type = __pyx_t_1; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_UnknownKey__set_state(UnknownKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = (__pyx_t_4 != 0); - __pyx_t_2 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_UnknownKey__set_state(UnknownKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":11 - * __pyx_unpickle_UnknownKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_UnknownKey__set_state(UnknownKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_UnknownKey__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P256_CERT01.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 - * def __pyx_unpickle_DSSKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_7__pyx_unpickle_DSSKey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_6__pyx_unpickle_DSSKey[] = "__pyx_unpickle_DSSKey(__pyx_type, long __pyx_checksum, __pyx_state)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_7__pyx_unpickle_DSSKey = {"__pyx_unpickle_DSSKey", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_8keytypes_7__pyx_unpickle_DSSKey, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_8keytypes_6__pyx_unpickle_DSSKey}; -static PyObject *__pyx_pw_3ssh_8keytypes_7__pyx_unpickle_DSSKey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P384_CERT01_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_17ECDSA_P384_CERT01___reduce_cython__[] = "ECDSA_P384_CERT01.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P384_CERT01_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_DSSKey (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DSSKey", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DSSKey", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_DSSKey") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DSSKey", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_DSSKey", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_3ssh_8keytypes_6__pyx_unpickle_DSSKey(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_17ECDSA_P384_CERT01___reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_6__pyx_unpickle_DSSKey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P384_CERT01___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_DSSKey", 0); - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x12dfdbc) != 0); - if (__pyx_t_1) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = DSSKey.__new__(__pyx_type) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":6 - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = DSSKey.__new__(__pyx_type) - * if __pyx_state is not None: - */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - } - - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = DSSKey.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_DSSKey__set_state( __pyx_result, __pyx_state) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_DSSKey), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = DSSKey.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_DSSKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { - - /* "(tree fragment)":9 - * __pyx_result = DSSKey.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_DSSKey__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_DSSKey__set_state(DSSKey __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3ssh_8keytypes___pyx_unpickle_DSSKey__set_state(((struct __pyx_obj_3ssh_8keytypes_DSSKey *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = DSSKey.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_DSSKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - } + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_DSSKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_DSSKey__set_state(DSSKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 - * def __pyx_unpickle_DSSKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_DSSKey", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P384_CERT01.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":11 - * __pyx_unpickle_DSSKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_DSSKey__set_state(DSSKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_DSSKey__set_state(struct __pyx_obj_3ssh_8keytypes_DSSKey *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P384_CERT01_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_17ECDSA_P384_CERT01_2__setstate_cython__[] = "ECDSA_P384_CERT01.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P384_CERT01_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_17ECDSA_P384_CERT01_2__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P384_CERT01_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - enum ssh_keytypes_e __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_DSSKey__set_state", 0); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_DSSKey__set_state(DSSKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = ((enum ssh_keytypes_e)__Pyx_PyInt_As_enum__ssh_keytypes_e(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_v___pyx_result->__pyx_base._type = __pyx_t_1; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_DSSKey__set_state(DSSKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = (__pyx_t_4 != 0); - __pyx_t_2 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_DSSKey__set_state(DSSKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":11 - * __pyx_unpickle_DSSKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_DSSKey__set_state(DSSKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_DSSKey__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P384_CERT01.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 - * def __pyx_unpickle_RSAKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_9__pyx_unpickle_RSAKey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_8__pyx_unpickle_RSAKey[] = "__pyx_unpickle_RSAKey(__pyx_type, long __pyx_checksum, __pyx_state)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_9__pyx_unpickle_RSAKey = {"__pyx_unpickle_RSAKey", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_8keytypes_9__pyx_unpickle_RSAKey, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_8keytypes_8__pyx_unpickle_RSAKey}; -static PyObject *__pyx_pw_3ssh_8keytypes_9__pyx_unpickle_RSAKey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P521_CERT01_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_17ECDSA_P521_CERT01___reduce_cython__[] = "ECDSA_P521_CERT01.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P521_CERT01_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_RSAKey (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSAKey", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSAKey", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_RSAKey") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSAKey", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSAKey", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_3ssh_8keytypes_8__pyx_unpickle_RSAKey(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_17ECDSA_P521_CERT01___reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_8__pyx_unpickle_RSAKey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P521_CERT01___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_RSAKey", 0); - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x12dfdbc) != 0); - if (__pyx_t_1) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSAKey.__new__(__pyx_type) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":6 - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = RSAKey.__new__(__pyx_type) - * if __pyx_state is not None: - */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - } - - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSAKey.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_RSAKey__set_state( __pyx_result, __pyx_state) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_RSAKey), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSAKey.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_RSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { - - /* "(tree fragment)":9 - * __pyx_result = RSAKey.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_RSAKey__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_RSAKey__set_state(RSAKey __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3ssh_8keytypes___pyx_unpickle_RSAKey__set_state(((struct __pyx_obj_3ssh_8keytypes_RSAKey *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSAKey.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_RSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - } + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_RSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_RSAKey__set_state(RSAKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 - * def __pyx_unpickle_RSAKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSAKey", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P521_CERT01.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":11 - * __pyx_unpickle_RSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_RSAKey__set_state(RSAKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_RSAKey__set_state(struct __pyx_obj_3ssh_8keytypes_RSAKey *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { +/* Python wrapper */ +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P521_CERT01_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_17ECDSA_P521_CERT01_2__setstate_cython__[] = "ECDSA_P521_CERT01.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_17ECDSA_P521_CERT01_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_17ECDSA_P521_CERT01_2__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_3ssh_8keytypes_17ECDSA_P521_CERT01_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - enum ssh_keytypes_e __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_RSAKey__set_state", 0); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_RSAKey__set_state(RSAKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = ((enum ssh_keytypes_e)__Pyx_PyInt_As_enum__ssh_keytypes_e(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_v___pyx_result->__pyx_base._type = __pyx_t_1; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_RSAKey__set_state(RSAKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = (__pyx_t_4 != 0); - __pyx_t_2 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_RSAKey__set_state(RSAKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) + __Pyx_RefNannySetupContext("__setstate_cython__", 0); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - } + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":11 - * __pyx_unpickle_RSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_RSAKey__set_state(RSAKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSAKey__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ECDSA_P521_CERT01.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 - * def __pyx_unpickle_RSA1Key(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_11__pyx_unpickle_RSA1Key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_10__pyx_unpickle_RSA1Key[] = "__pyx_unpickle_RSA1Key(__pyx_type, long __pyx_checksum, __pyx_state)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_11__pyx_unpickle_RSA1Key = {"__pyx_unpickle_RSA1Key", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_8keytypes_11__pyx_unpickle_RSA1Key, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_8keytypes_10__pyx_unpickle_RSA1Key}; -static PyObject *__pyx_pw_3ssh_8keytypes_11__pyx_unpickle_RSA1Key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +static PyObject *__pyx_pw_3ssh_8keytypes_14ED25519_CERT01_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_14ED25519_CERT01___reduce_cython__[] = "ED25519_CERT01.__reduce_cython__(self)"; +static PyObject *__pyx_pw_3ssh_8keytypes_14ED25519_CERT01_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_RSA1Key (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSA1Key", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSA1Key", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_RSA1Key") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSA1Key", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSA1Key", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_3ssh_8keytypes_10__pyx_unpickle_RSA1Key(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_14ED25519_CERT01___reduce_cython__(((struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01 *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_10__pyx_unpickle_RSA1Key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; +static PyObject *__pyx_pf_3ssh_8keytypes_14ED25519_CERT01___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01 *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_RSA1Key", 0); - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x12dfdbc) != 0); - if (__pyx_t_1) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSA1Key.__new__(__pyx_type) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 0); - /* "(tree fragment)":6 - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = RSA1Key.__new__(__pyx_type) - * if __pyx_state is not None: + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 2, __pyx_L1_error) - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - } - - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSA1Key.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_RSA1Key__set_state( __pyx_result, __pyx_state) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_RSA1Key), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSA1Key.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_RSA1Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { - - /* "(tree fragment)":9 - * __pyx_result = RSA1Key.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_RSA1Key__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_RSA1Key__set_state(RSA1Key __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3ssh_8keytypes___pyx_unpickle_RSA1Key__set_state(((struct __pyx_obj_3ssh_8keytypes_RSA1Key *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSA1Key.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_RSA1Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - } - - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_RSA1Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_RSA1Key__set_state(RSA1Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; - goto __pyx_L0; - - /* "(tree fragment)":1 - * def __pyx_unpickle_RSA1Key(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSA1Key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ED25519_CERT01.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":11 - * __pyx_unpickle_RSA1Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_RSA1Key__set_state(RSA1Key __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - */ - -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_RSA1Key__set_state(struct __pyx_obj_3ssh_8keytypes_RSA1Key *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - enum ssh_keytypes_e __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_RSA1Key__set_state", 0); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_RSA1Key__set_state(RSA1Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = ((enum ssh_keytypes_e)__Pyx_PyInt_As_enum__ssh_keytypes_e(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_v___pyx_result->__pyx_base._type = __pyx_t_1; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_RSA1Key__set_state(RSA1Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = (__pyx_t_4 != 0); - __pyx_t_2 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_RSA1Key__set_state(RSA1Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - } - - /* "(tree fragment)":11 - * __pyx_unpickle_RSA1Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_RSA1Key__set_state(RSA1Key __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - */ - - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSA1Key__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":1 - * def __pyx_unpickle_ECDSAKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_13__pyx_unpickle_ECDSAKey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_12__pyx_unpickle_ECDSAKey[] = "__pyx_unpickle_ECDSAKey(__pyx_type, long __pyx_checksum, __pyx_state)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_13__pyx_unpickle_ECDSAKey = {"__pyx_unpickle_ECDSAKey", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_8keytypes_13__pyx_unpickle_ECDSAKey, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_8keytypes_12__pyx_unpickle_ECDSAKey}; -static PyObject *__pyx_pw_3ssh_8keytypes_13__pyx_unpickle_ECDSAKey(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +static PyObject *__pyx_pw_3ssh_8keytypes_14ED25519_CERT01_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_14ED25519_CERT01_2__setstate_cython__[] = "ED25519_CERT01.__setstate_cython__(self, __pyx_state)"; +static PyObject *__pyx_pw_3ssh_8keytypes_14ED25519_CERT01_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_ECDSAKey (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ECDSAKey", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ECDSAKey", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_ECDSAKey") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ECDSAKey", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_ECDSAKey", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_3ssh_8keytypes_12__pyx_unpickle_ECDSAKey(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_14ED25519_CERT01_2__setstate_cython__(((struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_12__pyx_unpickle_ECDSAKey(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; +static PyObject *__pyx_pf_3ssh_8keytypes_14ED25519_CERT01_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_ECDSAKey", 0); + __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x12dfdbc) != 0); - if (__pyx_t_1) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = ECDSAKey.__new__(__pyx_type) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":6 - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = ECDSAKey.__new__(__pyx_type) - * if __pyx_state is not None: - */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) - - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - } - - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = ECDSAKey.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_ECDSAKey__set_state( __pyx_result, __pyx_state) - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_ECDSAKey), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = ECDSAKey.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_ECDSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { - - /* "(tree fragment)":9 - * __pyx_result = ECDSAKey.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_ECDSAKey__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_ECDSAKey__set_state(ECDSAKey __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3ssh_8keytypes___pyx_unpickle_ECDSAKey__set_state(((struct __pyx_obj_3ssh_8keytypes_ECDSAKey *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = ECDSAKey.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_ECDSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - } - - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_ECDSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_ECDSAKey__set_state(ECDSAKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 4, __pyx_L1_error) - /* "(tree fragment)":1 - * def __pyx_unpickle_ECDSAKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_ECDSAKey", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.ED25519_CERT01.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":11 - * __pyx_unpickle_ECDSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_ECDSAKey__set_state(ECDSAKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): +/* "ssh/keytypes.pyx":103 + * + * + * cdef KeyType from_keytype(ssh_keytypes_e _type): # <<<<<<<<<<<<<< + * cdef KeyType key_type + * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: */ -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_ECDSAKey__set_state(struct __pyx_obj_3ssh_8keytypes_ECDSAKey *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; +static struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_f_3ssh_8keytypes_from_keytype(enum ssh_keytypes_e __pyx_v__type) { + struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_v_key_type = 0; + struct __pyx_obj_3ssh_8keytypes_KeyType *__pyx_r = NULL; __Pyx_RefNannyDeclarations - enum ssh_keytypes_e __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_ECDSAKey__set_state", 0); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_ECDSAKey__set_state(ECDSAKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = ((enum ssh_keytypes_e)__Pyx_PyInt_As_enum__ssh_keytypes_e(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_v___pyx_result->__pyx_base._type = __pyx_t_1; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_ECDSAKey__set_state(ECDSAKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = (__pyx_t_4 != 0); - __pyx_t_2 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_ECDSAKey__set_state(ECDSAKey __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - } + __Pyx_RefNannySetupContext("from_keytype", 0); - /* "(tree fragment)":11 - * __pyx_unpickle_ECDSAKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_ECDSAKey__set_state(ECDSAKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + /* "ssh/keytypes.pyx":105 + * cdef KeyType from_keytype(ssh_keytypes_e _type): + * cdef KeyType key_type + * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: # <<<<<<<<<<<<<< + * key_type = UnknownKey.__new__(UnknownKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: */ + switch (__pyx_v__type) { + case SSH_KEYTYPE_UNKNOWN: - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_ECDSAKey__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "(tree fragment)":1 - * def __pyx_unpickle_DSSCert01Key(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + /* "ssh/keytypes.pyx":106 + * cdef KeyType key_type + * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: + * key_type = UnknownKey.__new__(UnknownKey) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: + * key_type = DSSKey.__new__(DSSKey) */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_UnknownKey(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_UnknownKey), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 106, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 106, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_15__pyx_unpickle_DSSCert01Key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_14__pyx_unpickle_DSSCert01Key[] = "__pyx_unpickle_DSSCert01Key(__pyx_type, long __pyx_checksum, __pyx_state)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_15__pyx_unpickle_DSSCert01Key = {"__pyx_unpickle_DSSCert01Key", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_8keytypes_15__pyx_unpickle_DSSCert01Key, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_8keytypes_14__pyx_unpickle_DSSCert01Key}; -static PyObject *__pyx_pw_3ssh_8keytypes_15__pyx_unpickle_DSSCert01Key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_DSSCert01Key (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DSSCert01Key", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DSSCert01Key", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_DSSCert01Key") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_DSSCert01Key", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_DSSCert01Key", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_3ssh_8keytypes_14__pyx_unpickle_DSSCert01Key(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + /* "ssh/keytypes.pyx":105 + * cdef KeyType from_keytype(ssh_keytypes_e _type): + * cdef KeyType key_type + * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: # <<<<<<<<<<<<<< + * key_type = UnknownKey.__new__(UnknownKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: + */ + break; + case SSH_KEYTYPE_DSS: - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "ssh/keytypes.pyx":108 + * key_type = UnknownKey.__new__(UnknownKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: + * key_type = DSSKey.__new__(DSSKey) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: + * key_type = RSAKey.__new__(RSAKey) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_DSSKey(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_DSSKey), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 108, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 108, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; -static PyObject *__pyx_pf_3ssh_8keytypes_14__pyx_unpickle_DSSCert01Key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_DSSCert01Key", 0); + /* "ssh/keytypes.pyx":107 + * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: + * key_type = UnknownKey.__new__(UnknownKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: # <<<<<<<<<<<<<< + * key_type = DSSKey.__new__(DSSKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: + */ + break; + case SSH_KEYTYPE_RSA: - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x12dfdbc) != 0); - if (__pyx_t_1) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = DSSCert01Key.__new__(__pyx_type) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* "ssh/keytypes.pyx":110 + * key_type = DSSKey.__new__(DSSKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: + * key_type = RSAKey.__new__(RSAKey) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: + * key_type = RSA1Key.__new__(RSA1Key) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_RSAKey(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_RSAKey), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 110, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 110, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; - /* "(tree fragment)":6 - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = DSSCert01Key.__new__(__pyx_type) - * if __pyx_state is not None: + /* "ssh/keytypes.pyx":109 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: + * key_type = DSSKey.__new__(DSSKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: # <<<<<<<<<<<<<< + * key_type = RSAKey.__new__(RSAKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) + break; + case SSH_KEYTYPE_RSA1: - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) + /* "ssh/keytypes.pyx":112 + * key_type = RSAKey.__new__(RSAKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: + * key_type = RSA1Key.__new__(RSA1Key) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: + * key_type = ECDSAKey.__new__(ECDSAKey) */ - } + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_RSA1Key(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_RSA1Key), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 112, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 112, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = DSSCert01Key.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_DSSCert01Key__set_state( __pyx_result, __pyx_state) + /* "ssh/keytypes.pyx":111 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: + * key_type = RSAKey.__new__(RSAKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: # <<<<<<<<<<<<<< + * key_type = RSA1Key.__new__(RSA1Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_DSSCert01Key), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = DSSCert01Key.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_DSSCert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { - - /* "(tree fragment)":9 - * __pyx_result = DSSCert01Key.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_DSSCert01Key__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_DSSCert01Key__set_state(DSSCert01Key __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3ssh_8keytypes___pyx_unpickle_DSSCert01Key__set_state(((struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = DSSCert01Key.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_DSSCert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result + break; + case SSH_KEYTYPE_ECDSA: + + /* "ssh/keytypes.pyx":114 + * key_type = RSA1Key.__new__(RSA1Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: + * key_type = ECDSAKey.__new__(ECDSAKey) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: + * key_type = DSSCert01Key.__new__(DSSCert01Key) */ - } + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_ECDSAKey(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_ECDSAKey), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 114, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_DSSCert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_DSSCert01Key__set_state(DSSCert01Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] + /* "ssh/keytypes.pyx":113 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: + * key_type = RSA1Key.__new__(RSA1Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: # <<<<<<<<<<<<<< + * key_type = ECDSAKey.__new__(ECDSAKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; - goto __pyx_L0; + break; + case SSH_KEYTYPE_DSS_CERT01: - /* "(tree fragment)":1 - * def __pyx_unpickle_DSSCert01Key(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + /* "ssh/keytypes.pyx":116 + * key_type = ECDSAKey.__new__(ECDSAKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: + * key_type = DSSCert01Key.__new__(DSSCert01Key) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: + * key_type = RSACert01Key.__new__(RSACert01Key) */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_DSSCert01Key(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_DSSCert01Key), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 116, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_DSSCert01Key", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "ssh/keytypes.pyx":115 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: + * key_type = ECDSAKey.__new__(ECDSAKey) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: # <<<<<<<<<<<<<< + * key_type = DSSCert01Key.__new__(DSSCert01Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: + */ + break; + case SSH_KEYTYPE_RSA_CERT01: -/* "(tree fragment)":11 - * __pyx_unpickle_DSSCert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_DSSCert01Key__set_state(DSSCert01Key __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + /* "ssh/keytypes.pyx":118 + * key_type = DSSCert01Key.__new__(DSSCert01Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: + * key_type = RSACert01Key.__new__(RSACert01Key) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256: + * key_type = ECDSA_P256.__new__(ECDSA_P256) */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_RSACert01Key(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_RSACert01Key), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 118, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 118, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_DSSCert01Key__set_state(struct __pyx_obj_3ssh_8keytypes_DSSCert01Key *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - enum ssh_keytypes_e __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_DSSCert01Key__set_state", 0); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_DSSCert01Key__set_state(DSSCert01Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = ((enum ssh_keytypes_e)__Pyx_PyInt_As_enum__ssh_keytypes_e(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_v___pyx_result->__pyx_base._type = __pyx_t_1; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_DSSCert01Key__set_state(DSSCert01Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = (__pyx_t_4 != 0); - __pyx_t_2 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_DSSCert01Key__set_state(DSSCert01Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) + /* "ssh/keytypes.pyx":117 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: + * key_type = DSSCert01Key.__new__(DSSCert01Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: # <<<<<<<<<<<<<< + * key_type = RSACert01Key.__new__(RSACert01Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256: + */ + break; + case SSH_KEYTYPE_ECDSA_P256: + + /* "ssh/keytypes.pyx":120 + * key_type = RSACert01Key.__new__(RSACert01Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256: + * key_type = ECDSA_P256.__new__(ECDSA_P256) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384: + * key_type = ECDSA_P384.__new__(ECDSA_P384) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_ECDSA_P256(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_ECDSA_P256), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 120, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/keytypes.pyx":119 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: + * key_type = RSACert01Key.__new__(RSACert01Key) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256: # <<<<<<<<<<<<<< + * key_type = ECDSA_P256.__new__(ECDSA_P256) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384: + */ + break; + case SSH_KEYTYPE_ECDSA_P384: + + /* "ssh/keytypes.pyx":122 + * key_type = ECDSA_P256.__new__(ECDSA_P256) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384: + * key_type = ECDSA_P384.__new__(ECDSA_P384) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521: + * key_type = ECDSA_P521.__new__(ECDSA_P521) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_ECDSA_P384(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_ECDSA_P384), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 122, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 122, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/keytypes.pyx":121 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256: + * key_type = ECDSA_P256.__new__(ECDSA_P256) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384: # <<<<<<<<<<<<<< + * key_type = ECDSA_P384.__new__(ECDSA_P384) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521: + */ + break; + case SSH_KEYTYPE_ECDSA_P521: + + /* "ssh/keytypes.pyx":124 + * key_type = ECDSA_P384.__new__(ECDSA_P384) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521: + * key_type = ECDSA_P521.__new__(ECDSA_P521) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256_CERT01: + * key_type = ECDSA_P256_CERT01.__new__(ECDSA_P256_CERT01) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_ECDSA_P521(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_ECDSA_P521), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 124, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/keytypes.pyx":123 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384: + * key_type = ECDSA_P384.__new__(ECDSA_P384) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521: # <<<<<<<<<<<<<< + * key_type = ECDSA_P521.__new__(ECDSA_P521) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256_CERT01: + */ + break; + case SSH_KEYTYPE_ECDSA_P256_CERT01: + + /* "ssh/keytypes.pyx":126 + * key_type = ECDSA_P521.__new__(ECDSA_P521) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256_CERT01: + * key_type = ECDSA_P256_CERT01.__new__(ECDSA_P256_CERT01) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384_CERT01: + * key_type = ECDSA_P384_CERT01.__new__(ECDSA_P384_CERT01) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_ECDSA_P256_CERT01(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_ECDSA_P256_CERT01), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 126, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/keytypes.pyx":125 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521: + * key_type = ECDSA_P521.__new__(ECDSA_P521) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256_CERT01: # <<<<<<<<<<<<<< + * key_type = ECDSA_P256_CERT01.__new__(ECDSA_P256_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384_CERT01: + */ + break; + case SSH_KEYTYPE_ECDSA_P384_CERT01: + + /* "ssh/keytypes.pyx":128 + * key_type = ECDSA_P256_CERT01.__new__(ECDSA_P256_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384_CERT01: + * key_type = ECDSA_P384_CERT01.__new__(ECDSA_P384_CERT01) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521_CERT01: + * key_type = ECDSA_P521_CERT01.__new__(ECDSA_P521_CERT01) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_ECDSA_P384_CERT01(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_ECDSA_P384_CERT01), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 128, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 128, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/keytypes.pyx":127 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256_CERT01: + * key_type = ECDSA_P256_CERT01.__new__(ECDSA_P256_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384_CERT01: # <<<<<<<<<<<<<< + * key_type = ECDSA_P384_CERT01.__new__(ECDSA_P384_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521_CERT01: + */ + break; + case SSH_KEYTYPE_ECDSA_P521_CERT01: + + /* "ssh/keytypes.pyx":130 + * key_type = ECDSA_P384_CERT01.__new__(ECDSA_P384_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521_CERT01: + * key_type = ECDSA_P521_CERT01.__new__(ECDSA_P521_CERT01) # <<<<<<<<<<<<<< + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ED25519_CERT01: + * key_type = ED25519_CERT01.__new__(ED25519_CERT01) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_ECDSA_P521_CERT01(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_ECDSA_P521_CERT01), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 130, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 130, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/keytypes.pyx":129 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384_CERT01: + * key_type = ECDSA_P384_CERT01.__new__(ECDSA_P384_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521_CERT01: # <<<<<<<<<<<<<< + * key_type = ECDSA_P521_CERT01.__new__(ECDSA_P521_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ED25519_CERT01: + */ + break; + case SSH_KEYTYPE_ED25519_CERT01: + + /* "ssh/keytypes.pyx":132 + * key_type = ECDSA_P521_CERT01.__new__(ECDSA_P521_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ED25519_CERT01: + * key_type = ED25519_CERT01.__new__(ED25519_CERT01) # <<<<<<<<<<<<<< + * else: + * raise Exception("Unknown keytype %s", _type) + */ + __pyx_t_1 = ((PyObject *)__pyx_tp_new_3ssh_8keytypes_ED25519_CERT01(((PyTypeObject *)__pyx_ptype_3ssh_8keytypes_ED25519_CERT01), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 132, __pyx_L1_error) + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_3ssh_8keytypes_KeyType)))) __PYX_ERR(1, 132, __pyx_L1_error) + __pyx_v_key_type = ((struct __pyx_obj_3ssh_8keytypes_KeyType *)__pyx_t_1); + __pyx_t_1 = 0; + + /* "ssh/keytypes.pyx":131 + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521_CERT01: + * key_type = ECDSA_P521_CERT01.__new__(ECDSA_P521_CERT01) + * elif _type == ssh_keytypes_e.SSH_KEYTYPE_ED25519_CERT01: # <<<<<<<<<<<<<< + * key_type = ED25519_CERT01.__new__(ED25519_CERT01) + * else: + */ + break; + default: + + /* "ssh/keytypes.pyx":134 + * key_type = ED25519_CERT01.__new__(ED25519_CERT01) + * else: + * raise Exception("Unknown keytype %s", _type) # <<<<<<<<<<<<<< + * key_type._type = _type + * return key_type */ + __pyx_t_1 = __Pyx_PyInt_From_enum__ssh_keytypes_e(__pyx_v__type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_kp_s_Unknown_keytype_s); + __Pyx_GIVEREF(__pyx_kp_s_Unknown_keytype_s); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Unknown_keytype_s); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 134, __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(1, 134, __pyx_L1_error) + break; } - /* "(tree fragment)":11 - * __pyx_unpickle_DSSCert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_DSSCert01Key__set_state(DSSCert01Key __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): + /* "ssh/keytypes.pyx":135 + * else: + * raise Exception("Unknown keytype %s", _type) + * key_type._type = _type # <<<<<<<<<<<<<< + * return key_type + * + */ + __pyx_v_key_type->_type = __pyx_v__type; + + /* "ssh/keytypes.pyx":136 + * raise Exception("Unknown keytype %s", _type) + * key_type._type = _type + * return key_type # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(((PyObject *)__pyx_r)); + __Pyx_INCREF(((PyObject *)__pyx_v_key_type)); + __pyx_r = __pyx_v_key_type; + goto __pyx_L0; + + /* "ssh/keytypes.pyx":103 + * + * + * cdef KeyType from_keytype(ssh_keytypes_e _type): # <<<<<<<<<<<<<< + * cdef KeyType key_type + * if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_DSSCert01Key__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("ssh.keytypes.from_keytype", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + __Pyx_XDECREF((PyObject *)__pyx_v_key_type); + __Pyx_XGIVEREF((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":1 - * def __pyx_unpickle_RSACert01Key(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result +/* "ssh/keytypes.pyx":139 + * + * + * def key_type_from_name(key_name): # <<<<<<<<<<<<<< + * cdef ssh_keytypes_e _type + * cdef bytes b_key_name = to_bytes(key_name) */ /* Python wrapper */ -static PyObject *__pyx_pw_3ssh_8keytypes_17__pyx_unpickle_RSACert01Key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_3ssh_8keytypes_16__pyx_unpickle_RSACert01Key[] = "__pyx_unpickle_RSACert01Key(__pyx_type, long __pyx_checksum, __pyx_state)"; -static PyMethodDef __pyx_mdef_3ssh_8keytypes_17__pyx_unpickle_RSACert01Key = {"__pyx_unpickle_RSACert01Key", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3ssh_8keytypes_17__pyx_unpickle_RSACert01Key, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3ssh_8keytypes_16__pyx_unpickle_RSACert01Key}; -static PyObject *__pyx_pw_3ssh_8keytypes_17__pyx_unpickle_RSACert01Key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v___pyx_type = 0; - long __pyx_v___pyx_checksum; - PyObject *__pyx_v___pyx_state = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +static PyObject *__pyx_pw_3ssh_8keytypes_1key_type_from_name(PyObject *__pyx_self, PyObject *__pyx_v_key_name); /*proto*/ +static char __pyx_doc_3ssh_8keytypes_key_type_from_name[] = "key_type_from_name(key_name)"; +static PyMethodDef __pyx_mdef_3ssh_8keytypes_1key_type_from_name = {"key_type_from_name", (PyCFunction)__pyx_pw_3ssh_8keytypes_1key_type_from_name, METH_O, __pyx_doc_3ssh_8keytypes_key_type_from_name}; +static PyObject *__pyx_pw_3ssh_8keytypes_1key_type_from_name(PyObject *__pyx_self, PyObject *__pyx_v_key_name) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pyx_unpickle_RSACert01Key (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSACert01Key", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSACert01Key", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_RSACert01Key") < 0)) __PYX_ERR(1, 1, __pyx_L3_error) - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v___pyx_type = values[0]; - __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_v___pyx_state = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RSACert01Key", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSACert01Key", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_3ssh_8keytypes_16__pyx_unpickle_RSACert01Key(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __Pyx_RefNannySetupContext("key_type_from_name (wrapper)", 0); + __pyx_r = __pyx_pf_3ssh_8keytypes_key_type_from_name(__pyx_self, ((PyObject *)__pyx_v_key_name)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_3ssh_8keytypes_16__pyx_unpickle_RSACert01Key(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_v___pyx_PickleError = 0; - PyObject *__pyx_v___pyx_result = 0; +static PyObject *__pyx_pf_3ssh_8keytypes_key_type_from_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key_name) { + enum ssh_keytypes_e __pyx_v__type; + PyObject *__pyx_v_b_key_name = 0; + char __pyx_v__key_name; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_1 = NULL; + char __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_RSACert01Key", 0); + __Pyx_RefNannySetupContext("key_type_from_name", 0); - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - */ - __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x12dfdbc) != 0); - if (__pyx_t_1) { - - /* "(tree fragment)":5 - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSACert01Key.__new__(__pyx_type) - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_PickleError); - __Pyx_GIVEREF(__pyx_n_s_PickleError); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); - __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_2); - __pyx_v___pyx_PickleError = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + /* "ssh/keytypes.pyx":141 + * def key_type_from_name(key_name): + * cdef ssh_keytypes_e _type + * cdef bytes b_key_name = to_bytes(key_name) # <<<<<<<<<<<<<< + * cdef char _key_name = b_key_name + * with nogil: + */ + __pyx_t_1 = __pyx_f_3ssh_5utils_to_bytes(__pyx_v_key_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_b_key_name = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "(tree fragment)":6 - * if __pyx_checksum != 0x12dfdbc: - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) # <<<<<<<<<<<<<< - * __pyx_result = RSACert01Key.__new__(__pyx_type) - * if __pyx_state is not None: + /* "ssh/keytypes.pyx":142 + * cdef ssh_keytypes_e _type + * cdef bytes b_key_name = to_bytes(key_name) + * cdef char _key_name = b_key_name # <<<<<<<<<<<<<< + * with nogil: + * _type = ssh_key_type_from_name(&_key_name) */ - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_v___pyx_PickleError); - __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(1, 6, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_char(__pyx_v_b_key_name); if (unlikely((__pyx_t_2 == (char)-1) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error) + __pyx_v__key_name = __pyx_t_2; - /* "(tree fragment)":4 - * cdef object __pyx_PickleError - * cdef object __pyx_result - * if __pyx_checksum != 0x12dfdbc: # <<<<<<<<<<<<<< - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) + /* "ssh/keytypes.pyx":143 + * cdef bytes b_key_name = to_bytes(key_name) + * cdef char _key_name = b_key_name + * with nogil: # <<<<<<<<<<<<<< + * _type = ssh_key_type_from_name(&_key_name) + * return from_keytype(_type) */ - } + { + #ifdef WITH_THREAD + PyThreadState *_save; + Py_UNBLOCK_THREADS + __Pyx_FastGIL_Remember(); + #endif + /*try:*/ { - /* "(tree fragment)":7 - * from pickle import PickleError as __pyx_PickleError - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSACert01Key.__new__(__pyx_type) # <<<<<<<<<<<<<< - * if __pyx_state is not None: - * __pyx_unpickle_RSACert01Key__set_state( __pyx_result, __pyx_state) + /* "ssh/keytypes.pyx":144 + * cdef char _key_name = b_key_name + * with nogil: + * _type = ssh_key_type_from_name(&_key_name) # <<<<<<<<<<<<<< + * return from_keytype(_type) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3ssh_8keytypes_RSACert01Key), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v___pyx_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSACert01Key.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_RSACert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - */ - __pyx_t_1 = (__pyx_v___pyx_state != Py_None); - __pyx_t_6 = (__pyx_t_1 != 0); - if (__pyx_t_6) { - - /* "(tree fragment)":9 - * __pyx_result = RSACert01Key.__new__(__pyx_type) - * if __pyx_state is not None: - * __pyx_unpickle_RSACert01Key__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< - * return __pyx_result - * cdef __pyx_unpickle_RSACert01Key__set_state(RSACert01Key __pyx_result, tuple __pyx_state): - */ - if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_3 = __pyx_f_3ssh_8keytypes___pyx_unpickle_RSACert01Key__set_state(((struct __pyx_obj_3ssh_8keytypes_RSACert01Key *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "(tree fragment)":8 - * raise __pyx_PickleError("Incompatible checksums (%s vs 0x12dfdbc = (_type))" % __pyx_checksum) - * __pyx_result = RSACert01Key.__new__(__pyx_type) - * if __pyx_state is not None: # <<<<<<<<<<<<<< - * __pyx_unpickle_RSACert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result + __pyx_v__type = ssh_key_type_from_name((&__pyx_v__key_name)); + } + + /* "ssh/keytypes.pyx":143 + * cdef bytes b_key_name = to_bytes(key_name) + * cdef char _key_name = b_key_name + * with nogil: # <<<<<<<<<<<<<< + * _type = ssh_key_type_from_name(&_key_name) + * return from_keytype(_type) */ + /*finally:*/ { + /*normal exit:*/{ + #ifdef WITH_THREAD + __Pyx_FastGIL_Forget(); + Py_BLOCK_THREADS + #endif + goto __pyx_L5; + } + __pyx_L5:; + } } - /* "(tree fragment)":10 - * if __pyx_state is not None: - * __pyx_unpickle_RSACert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result # <<<<<<<<<<<<<< - * cdef __pyx_unpickle_RSACert01Key__set_state(RSACert01Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] + /* "ssh/keytypes.pyx":145 + * with nogil: + * _type = ssh_key_type_from_name(&_key_name) + * return from_keytype(_type) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v___pyx_result); - __pyx_r = __pyx_v___pyx_result; + __pyx_t_1 = ((PyObject *)__pyx_f_3ssh_8keytypes_from_keytype(__pyx_v__type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "(tree fragment)":1 - * def __pyx_unpickle_RSACert01Key(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + /* "ssh/keytypes.pyx":139 + * + * + * def key_type_from_name(key_name): # <<<<<<<<<<<<<< + * cdef ssh_keytypes_e _type + * cdef bytes b_key_name = to_bytes(key_name) */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSACert01Key", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("ssh.keytypes.key_type_from_name", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v___pyx_PickleError); - __Pyx_XDECREF(__pyx_v___pyx_result); + __Pyx_XDECREF(__pyx_v_b_key_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "(tree fragment)":11 - * __pyx_unpickle_RSACert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_RSACert01Key__set_state(RSACert01Key __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - */ - -static PyObject *__pyx_f_3ssh_8keytypes___pyx_unpickle_RSACert01Key__set_state(struct __pyx_obj_3ssh_8keytypes_RSACert01Key *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - enum ssh_keytypes_e __pyx_t_1; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__pyx_unpickle_RSACert01Key__set_state", 0); - - /* "(tree fragment)":12 - * return __pyx_result - * cdef __pyx_unpickle_RSACert01Key__set_state(RSACert01Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] # <<<<<<<<<<<<<< - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 12, __pyx_L1_error) - } - __pyx_t_1 = ((enum ssh_keytypes_e)__Pyx_PyInt_As_enum__ssh_keytypes_e(PyTuple_GET_ITEM(__pyx_v___pyx_state, 0))); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error) - __pyx_v___pyx_result->__pyx_base._type = __pyx_t_1; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_RSACert01Key__set_state(RSACert01Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(1, 13, __pyx_L1_error) - } - __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_4 = ((__pyx_t_3 > 1) != 0); - if (__pyx_t_4) { - } else { - __pyx_t_2 = __pyx_t_4; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) - __pyx_t_5 = (__pyx_t_4 != 0); - __pyx_t_2 = __pyx_t_5; - __pyx_L4_bool_binop_done:; - if (__pyx_t_2) { - - /* "(tree fragment)":14 - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<< - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(__pyx_v___pyx_state == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(1, 14, __pyx_L1_error) - } - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - } - } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)) : __Pyx_PyObject_CallOneArg(__pyx_t_8, PyTuple_GET_ITEM(__pyx_v___pyx_state, 1)); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "(tree fragment)":13 - * cdef __pyx_unpickle_RSACert01Key__set_state(RSACert01Key __pyx_result, tuple __pyx_state): - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< - * __pyx_result.__dict__.update(__pyx_state[1]) - */ +static PyObject *__pyx_tp_new_3ssh_8keytypes_KeyType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_3ssh_8keytypes_7KeyType_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} - /* "(tree fragment)":11 - * __pyx_unpickle_RSACert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_RSACert01Key__set_state(RSACert01Key __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - */ +static void __pyx_tp_dealloc_3ssh_8keytypes_KeyType(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif + (*Py_TYPE(o)->tp_free)(o); +} - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("ssh.keytypes.__pyx_unpickle_RSACert01Key__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; +static PyObject *__pyx_getprop_3ssh_8keytypes_7KeyType_value(PyObject *o, CYTHON_UNUSED void *x) { + return __pyx_pw_3ssh_8keytypes_7KeyType_5value_1__get__(o); +} + +static PyMethodDef __pyx_methods_3ssh_8keytypes_KeyType[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_7KeyType_7__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_7KeyType_6__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_7KeyType_9__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_7KeyType_8__setstate_cython__}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_3ssh_8keytypes_KeyType[] = { + {(char *)"value", __pyx_getprop_3ssh_8keytypes_7KeyType_value, 0, (char *)0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_3ssh_8keytypes_KeyType = { + PyVarObject_HEAD_INIT(0, 0) + "ssh.keytypes.KeyType", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_KeyType), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_3ssh_8keytypes_KeyType, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_3ssh_8keytypes_KeyType, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3ssh_8keytypes_KeyType, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_3ssh_8keytypes_DSSKey(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_3ssh_8keytypes_DSSKey[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_6DSSKey_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_6DSSKey___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_6DSSKey_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_6DSSKey_2__setstate_cython__}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_3ssh_8keytypes_DSSKey = { + PyVarObject_HEAD_INIT(0, 0) + "ssh.keytypes.DSSKey", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_DSSKey), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_3ssh_8keytypes_DSSKey, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3ssh_8keytypes_DSSKey, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_3ssh_8keytypes_RSAKey(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); + if (unlikely(!o)) return 0; + return o; } -static PyObject *__pyx_tp_new_3ssh_8keytypes_KeyType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { - o = (*t->tp_alloc)(t, 0); - } else { - o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); - } +static PyMethodDef __pyx_methods_3ssh_8keytypes_RSAKey[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_6RSAKey_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_6RSAKey___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_6RSAKey_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_6RSAKey_2__setstate_cython__}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_3ssh_8keytypes_RSAKey = { + PyVarObject_HEAD_INIT(0, 0) + "ssh.keytypes.RSAKey", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_RSAKey), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_3ssh_8keytypes_RSAKey, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3ssh_8keytypes_RSAKey, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_3ssh_8keytypes_RSA1Key(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_3ssh_8keytypes_RSA1Key[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_7RSA1Key_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_7RSA1Key___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_7RSA1Key_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_7RSA1Key_2__setstate_cython__}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_3ssh_8keytypes_RSA1Key = { + PyVarObject_HEAD_INIT(0, 0) + "ssh.keytypes.RSA1Key", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_RSA1Key), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_3ssh_8keytypes_RSA1Key, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3ssh_8keytypes_RSA1Key, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSAKey(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_3ssh_8keytypes_ECDSAKey[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_8ECDSAKey_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_8ECDSAKey___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_8ECDSAKey_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_8ECDSAKey_2__setstate_cython__}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSAKey = { + PyVarObject_HEAD_INIT(0, 0) + "ssh.keytypes.ECDSAKey", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSAKey), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_3ssh_8keytypes_ECDSAKey, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3ssh_8keytypes_ECDSAKey, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_3ssh_8keytypes_DSSCert01Key(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); + if (unlikely(!o)) return 0; + return o; +} + +static PyMethodDef __pyx_methods_3ssh_8keytypes_DSSCert01Key[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_12DSSCert01Key_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_12DSSCert01Key___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_12DSSCert01Key_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_12DSSCert01Key_2__setstate_cython__}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_3ssh_8keytypes_DSSCert01Key = { + PyVarObject_HEAD_INIT(0, 0) + "ssh.keytypes.DSSCert01Key", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_DSSCert01Key), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_3ssh_8keytypes_DSSCert01Key, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3ssh_8keytypes_DSSCert01Key, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_3ssh_8keytypes_RSACert01Key(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); + if (unlikely(!o)) return 0; + if (unlikely(__pyx_pw_3ssh_8keytypes_12RSACert01Key_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static PyMethodDef __pyx_methods_3ssh_8keytypes_RSACert01Key[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_12RSACert01Key_3__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_12RSACert01Key_2__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_12RSACert01Key_5__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_12RSACert01Key_4__setstate_cython__}, + {0, 0, 0, 0} +}; + +static PyTypeObject __pyx_type_3ssh_8keytypes_RSACert01Key = { + PyVarObject_HEAD_INIT(0, 0) + "ssh.keytypes.RSACert01Key", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_RSACert01Key), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_3ssh_8keytypes_RSACert01Key, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_3ssh_8keytypes_RSACert01Key, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + 0, /*tp_finalize*/ + #endif + #if PY_VERSION_HEX >= 0x030800b1 + 0, /*tp_vectorcall*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 + 0, /*tp_print*/ + #endif +}; + +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P256(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); if (unlikely(!o)) return 0; return o; } -static void __pyx_tp_dealloc_3ssh_8keytypes_KeyType(PyObject *o) { - #if CYTHON_USE_TP_FINALIZE - if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { - if (PyObject_CallFinalizerFromDealloc(o)) return; - } - #endif - (*Py_TYPE(o)->tp_free)(o); -} - -static PyObject *__pyx_getprop_3ssh_8keytypes_7KeyType_value(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_3ssh_8keytypes_7KeyType_5value_1__get__(o); -} - -static PyMethodDef __pyx_methods_3ssh_8keytypes_KeyType[] = { - {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_7KeyType_5__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_7KeyType_4__reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_7KeyType_7__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_7KeyType_6__setstate_cython__}, +static PyMethodDef __pyx_methods_3ssh_8keytypes_ECDSA_P256[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_10ECDSA_P256_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_10ECDSA_P256___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_10ECDSA_P256_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_10ECDSA_P256_2__setstate_cython__}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_3ssh_8keytypes_KeyType[] = { - {(char *)"value", __pyx_getprop_3ssh_8keytypes_7KeyType_value, 0, (char *)0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_3ssh_8keytypes_KeyType = { +static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSA_P256 = { PyVarObject_HEAD_INIT(0, 0) - "ssh.keytypes.KeyType", /*tp_name*/ - sizeof(struct __pyx_obj_3ssh_8keytypes_KeyType), /*tp_basicsize*/ + "ssh.keytypes.ECDSA_P256", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P256), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 @@ -7779,13 +4850,21 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_KeyType = { #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif - __pyx_pw_3ssh_8keytypes_7KeyType_3__repr__, /*tp_repr*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ + #else + 0, /*tp_repr*/ + #endif 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pw_3ssh_8keytypes_7KeyType_1__str__, /*tp_str*/ + #if CYTHON_COMPILING_IN_PYPY + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ + #else + 0, /*tp_str*/ + #endif 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ @@ -7797,9 +4876,9 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_KeyType = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_3ssh_8keytypes_KeyType, /*tp_methods*/ + __pyx_methods_3ssh_8keytypes_ECDSA_P256, /*tp_methods*/ 0, /*tp_members*/ - __pyx_getsets_3ssh_8keytypes_KeyType, /*tp_getset*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ @@ -7807,7 +4886,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_KeyType = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_3ssh_8keytypes_KeyType, /*tp_new*/ + __pyx_tp_new_3ssh_8keytypes_ECDSA_P256, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -7828,22 +4907,22 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_KeyType = { #endif }; -static PyObject *__pyx_tp_new_3ssh_8keytypes_DSSKey(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P384(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); if (unlikely(!o)) return 0; return o; } -static PyMethodDef __pyx_methods_3ssh_8keytypes_DSSKey[] = { - {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_6DSSKey_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_6DSSKey___reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_6DSSKey_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_6DSSKey_2__setstate_cython__}, +static PyMethodDef __pyx_methods_3ssh_8keytypes_ECDSA_P384[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_10ECDSA_P384_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_10ECDSA_P384___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_10ECDSA_P384_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_10ECDSA_P384_2__setstate_cython__}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_3ssh_8keytypes_DSSKey = { +static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSA_P384 = { PyVarObject_HEAD_INIT(0, 0) - "ssh.keytypes.DSSKey", /*tp_name*/ - sizeof(struct __pyx_obj_3ssh_8keytypes_DSSKey), /*tp_basicsize*/ + "ssh.keytypes.ECDSA_P384", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P384), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 @@ -7861,7 +4940,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSKey = { 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_3__repr__, /*tp_repr*/ + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif @@ -7871,7 +4950,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSKey = { 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_1__str__, /*tp_str*/ + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ #else 0, /*tp_str*/ #endif @@ -7886,7 +4965,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSKey = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_3ssh_8keytypes_DSSKey, /*tp_methods*/ + __pyx_methods_3ssh_8keytypes_ECDSA_P384, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -7896,7 +4975,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSKey = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_3ssh_8keytypes_DSSKey, /*tp_new*/ + __pyx_tp_new_3ssh_8keytypes_ECDSA_P384, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -7917,22 +4996,22 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSKey = { #endif }; -static PyObject *__pyx_tp_new_3ssh_8keytypes_RSAKey(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P521(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); if (unlikely(!o)) return 0; return o; } -static PyMethodDef __pyx_methods_3ssh_8keytypes_RSAKey[] = { - {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_6RSAKey_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_6RSAKey___reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_6RSAKey_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_6RSAKey_2__setstate_cython__}, +static PyMethodDef __pyx_methods_3ssh_8keytypes_ECDSA_P521[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_10ECDSA_P521_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_10ECDSA_P521___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_10ECDSA_P521_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_10ECDSA_P521_2__setstate_cython__}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_3ssh_8keytypes_RSAKey = { +static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSA_P521 = { PyVarObject_HEAD_INIT(0, 0) - "ssh.keytypes.RSAKey", /*tp_name*/ - sizeof(struct __pyx_obj_3ssh_8keytypes_RSAKey), /*tp_basicsize*/ + "ssh.keytypes.ECDSA_P521", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P521), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 @@ -7950,7 +5029,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSAKey = { 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_3__repr__, /*tp_repr*/ + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif @@ -7960,7 +5039,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSAKey = { 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_1__str__, /*tp_str*/ + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ #else 0, /*tp_str*/ #endif @@ -7975,7 +5054,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSAKey = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_3ssh_8keytypes_RSAKey, /*tp_methods*/ + __pyx_methods_3ssh_8keytypes_ECDSA_P521, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -7985,7 +5064,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSAKey = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_3ssh_8keytypes_RSAKey, /*tp_new*/ + __pyx_tp_new_3ssh_8keytypes_ECDSA_P521, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8006,22 +5085,22 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSAKey = { #endif }; -static PyObject *__pyx_tp_new_3ssh_8keytypes_RSA1Key(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P256_CERT01(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); if (unlikely(!o)) return 0; return o; } -static PyMethodDef __pyx_methods_3ssh_8keytypes_RSA1Key[] = { - {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_7RSA1Key_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_7RSA1Key___reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_7RSA1Key_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_7RSA1Key_2__setstate_cython__}, +static PyMethodDef __pyx_methods_3ssh_8keytypes_ECDSA_P256_CERT01[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_17ECDSA_P256_CERT01_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_17ECDSA_P256_CERT01___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_17ECDSA_P256_CERT01_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_17ECDSA_P256_CERT01_2__setstate_cython__}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_3ssh_8keytypes_RSA1Key = { +static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01 = { PyVarObject_HEAD_INIT(0, 0) - "ssh.keytypes.RSA1Key", /*tp_name*/ - sizeof(struct __pyx_obj_3ssh_8keytypes_RSA1Key), /*tp_basicsize*/ + "ssh.keytypes.ECDSA_P256_CERT01", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P256_CERT01), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 @@ -8039,7 +5118,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSA1Key = { 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_3__repr__, /*tp_repr*/ + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif @@ -8049,7 +5128,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSA1Key = { 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_1__str__, /*tp_str*/ + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ #else 0, /*tp_str*/ #endif @@ -8064,7 +5143,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSA1Key = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_3ssh_8keytypes_RSA1Key, /*tp_methods*/ + __pyx_methods_3ssh_8keytypes_ECDSA_P256_CERT01, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8074,7 +5153,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSA1Key = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_3ssh_8keytypes_RSA1Key, /*tp_new*/ + __pyx_tp_new_3ssh_8keytypes_ECDSA_P256_CERT01, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8095,22 +5174,22 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSA1Key = { #endif }; -static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSAKey(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P384_CERT01(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); if (unlikely(!o)) return 0; return o; } -static PyMethodDef __pyx_methods_3ssh_8keytypes_ECDSAKey[] = { - {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_8ECDSAKey_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_8ECDSAKey___reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_8ECDSAKey_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_8ECDSAKey_2__setstate_cython__}, +static PyMethodDef __pyx_methods_3ssh_8keytypes_ECDSA_P384_CERT01[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_17ECDSA_P384_CERT01_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_17ECDSA_P384_CERT01___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_17ECDSA_P384_CERT01_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_17ECDSA_P384_CERT01_2__setstate_cython__}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSAKey = { +static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01 = { PyVarObject_HEAD_INIT(0, 0) - "ssh.keytypes.ECDSAKey", /*tp_name*/ - sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSAKey), /*tp_basicsize*/ + "ssh.keytypes.ECDSA_P384_CERT01", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P384_CERT01), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 @@ -8128,7 +5207,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSAKey = { 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_3__repr__, /*tp_repr*/ + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif @@ -8138,7 +5217,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSAKey = { 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_1__str__, /*tp_str*/ + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ #else 0, /*tp_str*/ #endif @@ -8153,7 +5232,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSAKey = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_3ssh_8keytypes_ECDSAKey, /*tp_methods*/ + __pyx_methods_3ssh_8keytypes_ECDSA_P384_CERT01, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8163,7 +5242,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSAKey = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_3ssh_8keytypes_ECDSAKey, /*tp_new*/ + __pyx_tp_new_3ssh_8keytypes_ECDSA_P384_CERT01, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8184,22 +5263,22 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSAKey = { #endif }; -static PyObject *__pyx_tp_new_3ssh_8keytypes_DSSCert01Key(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3ssh_8keytypes_ECDSA_P521_CERT01(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); if (unlikely(!o)) return 0; return o; } -static PyMethodDef __pyx_methods_3ssh_8keytypes_DSSCert01Key[] = { - {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_12DSSCert01Key_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_12DSSCert01Key___reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_12DSSCert01Key_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_12DSSCert01Key_2__setstate_cython__}, +static PyMethodDef __pyx_methods_3ssh_8keytypes_ECDSA_P521_CERT01[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_17ECDSA_P521_CERT01_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_17ECDSA_P521_CERT01___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_17ECDSA_P521_CERT01_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_17ECDSA_P521_CERT01_2__setstate_cython__}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_3ssh_8keytypes_DSSCert01Key = { +static PyTypeObject __pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01 = { PyVarObject_HEAD_INIT(0, 0) - "ssh.keytypes.DSSCert01Key", /*tp_name*/ - sizeof(struct __pyx_obj_3ssh_8keytypes_DSSCert01Key), /*tp_basicsize*/ + "ssh.keytypes.ECDSA_P521_CERT01", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_ECDSA_P521_CERT01), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 @@ -8217,7 +5296,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSCert01Key = { 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_3__repr__, /*tp_repr*/ + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif @@ -8227,7 +5306,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSCert01Key = { 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_1__str__, /*tp_str*/ + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ #else 0, /*tp_str*/ #endif @@ -8242,7 +5321,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSCert01Key = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_3ssh_8keytypes_DSSCert01Key, /*tp_methods*/ + __pyx_methods_3ssh_8keytypes_ECDSA_P521_CERT01, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8252,7 +5331,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSCert01Key = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_3ssh_8keytypes_DSSCert01Key, /*tp_new*/ + __pyx_tp_new_3ssh_8keytypes_ECDSA_P521_CERT01, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8273,22 +5352,22 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_DSSCert01Key = { #endif }; -static PyObject *__pyx_tp_new_3ssh_8keytypes_RSACert01Key(PyTypeObject *t, PyObject *a, PyObject *k) { +static PyObject *__pyx_tp_new_3ssh_8keytypes_ED25519_CERT01(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_3ssh_8keytypes_KeyType(t, a, k); if (unlikely(!o)) return 0; return o; } -static PyMethodDef __pyx_methods_3ssh_8keytypes_RSACert01Key[] = { - {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_12RSACert01Key_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_12RSACert01Key___reduce_cython__}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_12RSACert01Key_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_12RSACert01Key_2__setstate_cython__}, +static PyMethodDef __pyx_methods_3ssh_8keytypes_ED25519_CERT01[] = { + {"__reduce_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_14ED25519_CERT01_1__reduce_cython__, METH_NOARGS, __pyx_doc_3ssh_8keytypes_14ED25519_CERT01___reduce_cython__}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_3ssh_8keytypes_14ED25519_CERT01_3__setstate_cython__, METH_O, __pyx_doc_3ssh_8keytypes_14ED25519_CERT01_2__setstate_cython__}, {0, 0, 0, 0} }; -static PyTypeObject __pyx_type_3ssh_8keytypes_RSACert01Key = { +static PyTypeObject __pyx_type_3ssh_8keytypes_ED25519_CERT01 = { PyVarObject_HEAD_INIT(0, 0) - "ssh.keytypes.RSACert01Key", /*tp_name*/ - sizeof(struct __pyx_obj_3ssh_8keytypes_RSACert01Key), /*tp_basicsize*/ + "ssh.keytypes.ED25519_CERT01", /*tp_name*/ + sizeof(struct __pyx_obj_3ssh_8keytypes_ED25519_CERT01), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_3ssh_8keytypes_KeyType, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 @@ -8306,7 +5385,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSACert01Key = { 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_3__repr__, /*tp_repr*/ + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif @@ -8316,7 +5395,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSACert01Key = { 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_1__str__, /*tp_str*/ + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ #else 0, /*tp_str*/ #endif @@ -8331,7 +5410,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSACert01Key = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_3ssh_8keytypes_RSACert01Key, /*tp_methods*/ + __pyx_methods_3ssh_8keytypes_ED25519_CERT01, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -8341,7 +5420,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_RSACert01Key = { 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_3ssh_8keytypes_RSACert01Key, /*tp_new*/ + __pyx_tp_new_3ssh_8keytypes_ED25519_CERT01, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -8395,7 +5474,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_UnknownKey = { 0, /*tp_as_async*/ #endif #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_3__repr__, /*tp_repr*/ + __pyx_pw_3ssh_8keytypes_7KeyType_5__repr__, /*tp_repr*/ #else 0, /*tp_repr*/ #endif @@ -8405,7 +5484,7 @@ static PyTypeObject __pyx_type_3ssh_8keytypes_UnknownKey = { 0, /*tp_hash*/ 0, /*tp_call*/ #if CYTHON_COMPILING_IN_PYPY - __pyx_pw_3ssh_8keytypes_7KeyType_1__str__, /*tp_str*/ + __pyx_pw_3ssh_8keytypes_7KeyType_3__str__, /*tp_str*/ #else 0, /*tp_str*/ #endif @@ -8500,39 +5579,29 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_DSSCert01Key, __pyx_k_DSSCert01Key, sizeof(__pyx_k_DSSCert01Key), 0, 0, 1, 1}, {&__pyx_n_s_DSSKey, __pyx_k_DSSKey, sizeof(__pyx_k_DSSKey), 0, 0, 1, 1}, {&__pyx_n_s_ECDSAKey, __pyx_k_ECDSAKey, sizeof(__pyx_k_ECDSAKey), 0, 0, 1, 1}, - {&__pyx_kp_s_Incompatible_checksums_s_vs_0x12, __pyx_k_Incompatible_checksums_s_vs_0x12, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x12), 0, 0, 1, 0}, + {&__pyx_n_s_ECDSA_P256, __pyx_k_ECDSA_P256, sizeof(__pyx_k_ECDSA_P256), 0, 0, 1, 1}, + {&__pyx_n_s_ECDSA_P256_CERT01, __pyx_k_ECDSA_P256_CERT01, sizeof(__pyx_k_ECDSA_P256_CERT01), 0, 0, 1, 1}, + {&__pyx_n_s_ECDSA_P384, __pyx_k_ECDSA_P384, sizeof(__pyx_k_ECDSA_P384), 0, 0, 1, 1}, + {&__pyx_n_s_ECDSA_P384_CERT01, __pyx_k_ECDSA_P384_CERT01, sizeof(__pyx_k_ECDSA_P384_CERT01), 0, 0, 1, 1}, + {&__pyx_n_s_ECDSA_P521, __pyx_k_ECDSA_P521, sizeof(__pyx_k_ECDSA_P521), 0, 0, 1, 1}, + {&__pyx_n_s_ECDSA_P521_CERT01, __pyx_k_ECDSA_P521_CERT01, sizeof(__pyx_k_ECDSA_P521_CERT01), 0, 0, 1, 1}, + {&__pyx_n_s_ED25519_CERT01, __pyx_k_ED25519_CERT01, sizeof(__pyx_k_ED25519_CERT01), 0, 0, 1, 1}, {&__pyx_n_s_KeyType, __pyx_k_KeyType, sizeof(__pyx_k_KeyType), 0, 0, 1, 1}, - {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_RSA1Key, __pyx_k_RSA1Key, sizeof(__pyx_k_RSA1Key), 0, 0, 1, 1}, {&__pyx_n_s_RSACert01Key, __pyx_k_RSACert01Key, sizeof(__pyx_k_RSACert01Key), 0, 0, 1, 1}, {&__pyx_n_s_RSAKey, __pyx_k_RSAKey, sizeof(__pyx_k_RSAKey), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_UnknownKey, __pyx_k_UnknownKey, sizeof(__pyx_k_UnknownKey), 0, 0, 1, 1}, {&__pyx_kp_s_Unknown_keytype_s, __pyx_k_Unknown_keytype_s, sizeof(__pyx_k_Unknown_keytype_s), 0, 0, 1, 0}, {&__pyx_n_s_b_key_name, __pyx_k_b_key_name, sizeof(__pyx_k_b_key_name), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_key_name, __pyx_k_key_name, sizeof(__pyx_k_key_name), 0, 0, 1, 1}, {&__pyx_n_s_key_name_2, __pyx_k_key_name_2, sizeof(__pyx_k_key_name_2), 0, 0, 1, 1}, {&__pyx_n_s_key_type_from_name, __pyx_k_key_type_from_name, sizeof(__pyx_k_key_type_from_name), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, - {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_DSSCert01Key, __pyx_k_pyx_unpickle_DSSCert01Key, sizeof(__pyx_k_pyx_unpickle_DSSCert01Key), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_DSSKey, __pyx_k_pyx_unpickle_DSSKey, sizeof(__pyx_k_pyx_unpickle_DSSKey), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_ECDSAKey, __pyx_k_pyx_unpickle_ECDSAKey, sizeof(__pyx_k_pyx_unpickle_ECDSAKey), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_KeyType, __pyx_k_pyx_unpickle_KeyType, sizeof(__pyx_k_pyx_unpickle_KeyType), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_RSA1Key, __pyx_k_pyx_unpickle_RSA1Key, sizeof(__pyx_k_pyx_unpickle_RSA1Key), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_RSACert01Key, __pyx_k_pyx_unpickle_RSACert01Key, sizeof(__pyx_k_pyx_unpickle_RSACert01Key), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_RSAKey, __pyx_k_pyx_unpickle_RSAKey, sizeof(__pyx_k_pyx_unpickle_RSAKey), 0, 0, 1, 1}, - {&__pyx_n_s_pyx_unpickle_UnknownKey, __pyx_k_pyx_unpickle_UnknownKey, sizeof(__pyx_k_pyx_unpickle_UnknownKey), 0, 0, 1, 1}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, @@ -8541,69 +5610,317 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ssh_keytypes, __pyx_k_ssh_keytypes, sizeof(__pyx_k_ssh_keytypes), 0, 0, 1, 1}, {&__pyx_kp_s_ssh_keytypes_pyx, __pyx_k_ssh_keytypes_pyx, sizeof(__pyx_k_ssh_keytypes_pyx), 0, 0, 1, 0}, {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1}, - {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1}, - {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; + __pyx_L1_error:; + return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "ssh/keytypes.pyx":92 - * - * - * def key_type_from_name(key_name): # <<<<<<<<<<<<<< - * cdef ssh_keytypes_e _type - * cdef bytes b_key_name = to_bytes(key_name) + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple_ = PyTuple_Pack(4, __pyx_n_s_key_name, __pyx_n_s_type, __pyx_n_s_b_key_name, __pyx_n_s_key_name_2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_keytypes_pyx, __pyx_n_s_key_type_from_name, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 92, __pyx_L1_error) - /* "(tree fragment)":1 - * def __pyx_unpickle_KeyType(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ - __pyx_tuple__3 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_KeyType, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_tuple__5 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_UnknownKey, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_tuple__7 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DSSKey, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_RSAKey, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_tuple__11 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_RSA1Key, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ECDSAKey, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_DSSCert01Key, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_tuple__17 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__16); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_RSACert01Key, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 1, __pyx_L1_error) + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__18); + __Pyx_GIVEREF(__pyx_tuple__18); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__20); + __Pyx_GIVEREF(__pyx_tuple__20); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__21); + __Pyx_GIVEREF(__pyx_tuple__21); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__28); + __Pyx_GIVEREF(__pyx_tuple__28); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + + /* "(tree fragment)":4 + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") + * def __setstate_cython__(self, __pyx_state): + * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< + */ + __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 4, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + + /* "ssh/keytypes.pyx":139 + * + * + * def key_type_from_name(key_name): # <<<<<<<<<<<<<< + * cdef ssh_keytypes_e _type + * cdef bytes b_key_name = to_bytes(key_name) + */ + __pyx_tuple__31 = PyTuple_Pack(4, __pyx_n_s_key_name, __pyx_n_s_type, __pyx_n_s_b_key_name, __pyx_n_s_key_name_2); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 139, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_ssh_keytypes_pyx, __pyx_n_s_key_type_from_name, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8612,8 +5929,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_19791292 = PyInt_FromLong(19791292L); if (unlikely(!__pyx_int_19791292)) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; @@ -8650,7 +5966,7 @@ static int __Pyx_modinit_function_export_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ - if (__Pyx_ExportFunction("from_keytype", (void (*)(void))__pyx_f_3ssh_8keytypes_from_keytype, "struct __pyx_obj_3ssh_8keytypes_KeyType *(enum ssh_keytypes_e)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ExportFunction("from_keytype", (void (*)(void))__pyx_f_3ssh_8keytypes_from_keytype, "struct __pyx_obj_3ssh_8keytypes_KeyType *(enum ssh_keytypes_e)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -8665,92 +5981,169 @@ static int __Pyx_modinit_type_init_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_3ssh_8keytypes_KeyType) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_KeyType) < 0) __PYX_ERR(1, 24, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3ssh_8keytypes_KeyType.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_KeyType.tp_dictoffset && __pyx_type_3ssh_8keytypes_KeyType.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3ssh_8keytypes_KeyType.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KeyType, (PyObject *)&__pyx_type_3ssh_8keytypes_KeyType) < 0) __PYX_ERR(0, 24, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_KeyType) < 0) __PYX_ERR(0, 24, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KeyType, (PyObject *)&__pyx_type_3ssh_8keytypes_KeyType) < 0) __PYX_ERR(1, 24, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_KeyType) < 0) __PYX_ERR(1, 24, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_KeyType = &__pyx_type_3ssh_8keytypes_KeyType; __pyx_type_3ssh_8keytypes_DSSKey.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; - if (PyType_Ready(&__pyx_type_3ssh_8keytypes_DSSKey) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_DSSKey) < 0) __PYX_ERR(1, 49, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3ssh_8keytypes_DSSKey.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_DSSKey.tp_dictoffset && __pyx_type_3ssh_8keytypes_DSSKey.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3ssh_8keytypes_DSSKey.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DSSKey, (PyObject *)&__pyx_type_3ssh_8keytypes_DSSKey) < 0) __PYX_ERR(0, 46, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_DSSKey) < 0) __PYX_ERR(0, 46, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DSSKey, (PyObject *)&__pyx_type_3ssh_8keytypes_DSSKey) < 0) __PYX_ERR(1, 49, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_DSSKey) < 0) __PYX_ERR(1, 49, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_DSSKey = &__pyx_type_3ssh_8keytypes_DSSKey; __pyx_type_3ssh_8keytypes_RSAKey.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; - if (PyType_Ready(&__pyx_type_3ssh_8keytypes_RSAKey) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_RSAKey) < 0) __PYX_ERR(1, 53, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3ssh_8keytypes_RSAKey.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_RSAKey.tp_dictoffset && __pyx_type_3ssh_8keytypes_RSAKey.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3ssh_8keytypes_RSAKey.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RSAKey, (PyObject *)&__pyx_type_3ssh_8keytypes_RSAKey) < 0) __PYX_ERR(0, 50, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_RSAKey) < 0) __PYX_ERR(0, 50, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RSAKey, (PyObject *)&__pyx_type_3ssh_8keytypes_RSAKey) < 0) __PYX_ERR(1, 53, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_RSAKey) < 0) __PYX_ERR(1, 53, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_RSAKey = &__pyx_type_3ssh_8keytypes_RSAKey; __pyx_type_3ssh_8keytypes_RSA1Key.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; - if (PyType_Ready(&__pyx_type_3ssh_8keytypes_RSA1Key) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_RSA1Key) < 0) __PYX_ERR(1, 57, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3ssh_8keytypes_RSA1Key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_RSA1Key.tp_dictoffset && __pyx_type_3ssh_8keytypes_RSA1Key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3ssh_8keytypes_RSA1Key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RSA1Key, (PyObject *)&__pyx_type_3ssh_8keytypes_RSA1Key) < 0) __PYX_ERR(0, 54, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_RSA1Key) < 0) __PYX_ERR(0, 54, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RSA1Key, (PyObject *)&__pyx_type_3ssh_8keytypes_RSA1Key) < 0) __PYX_ERR(1, 57, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_RSA1Key) < 0) __PYX_ERR(1, 57, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_RSA1Key = &__pyx_type_3ssh_8keytypes_RSA1Key; __pyx_type_3ssh_8keytypes_ECDSAKey.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; - if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ECDSAKey) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ECDSAKey) < 0) __PYX_ERR(1, 61, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3ssh_8keytypes_ECDSAKey.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_ECDSAKey.tp_dictoffset && __pyx_type_3ssh_8keytypes_ECDSAKey.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3ssh_8keytypes_ECDSAKey.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ECDSAKey, (PyObject *)&__pyx_type_3ssh_8keytypes_ECDSAKey) < 0) __PYX_ERR(0, 58, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ECDSAKey) < 0) __PYX_ERR(0, 58, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ECDSAKey, (PyObject *)&__pyx_type_3ssh_8keytypes_ECDSAKey) < 0) __PYX_ERR(1, 61, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ECDSAKey) < 0) __PYX_ERR(1, 61, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_ECDSAKey = &__pyx_type_3ssh_8keytypes_ECDSAKey; __pyx_type_3ssh_8keytypes_DSSCert01Key.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; - if (PyType_Ready(&__pyx_type_3ssh_8keytypes_DSSCert01Key) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_DSSCert01Key) < 0) __PYX_ERR(1, 65, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3ssh_8keytypes_DSSCert01Key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_DSSCert01Key.tp_dictoffset && __pyx_type_3ssh_8keytypes_DSSCert01Key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3ssh_8keytypes_DSSCert01Key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DSSCert01Key, (PyObject *)&__pyx_type_3ssh_8keytypes_DSSCert01Key) < 0) __PYX_ERR(0, 62, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_DSSCert01Key) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DSSCert01Key, (PyObject *)&__pyx_type_3ssh_8keytypes_DSSCert01Key) < 0) __PYX_ERR(1, 65, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_DSSCert01Key) < 0) __PYX_ERR(1, 65, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_DSSCert01Key = &__pyx_type_3ssh_8keytypes_DSSCert01Key; __pyx_type_3ssh_8keytypes_RSACert01Key.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; - if (PyType_Ready(&__pyx_type_3ssh_8keytypes_RSACert01Key) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_RSACert01Key) < 0) __PYX_ERR(1, 69, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3ssh_8keytypes_RSACert01Key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_RSACert01Key.tp_dictoffset && __pyx_type_3ssh_8keytypes_RSACert01Key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3ssh_8keytypes_RSACert01Key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RSACert01Key, (PyObject *)&__pyx_type_3ssh_8keytypes_RSACert01Key) < 0) __PYX_ERR(0, 66, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_RSACert01Key) < 0) __PYX_ERR(0, 66, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RSACert01Key, (PyObject *)&__pyx_type_3ssh_8keytypes_RSACert01Key) < 0) __PYX_ERR(1, 69, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_RSACert01Key) < 0) __PYX_ERR(1, 69, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_RSACert01Key = &__pyx_type_3ssh_8keytypes_RSACert01Key; + __pyx_type_3ssh_8keytypes_ECDSA_P256.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ECDSA_P256) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_3ssh_8keytypes_ECDSA_P256.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_ECDSA_P256.tp_dictoffset && __pyx_type_3ssh_8keytypes_ECDSA_P256.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_3ssh_8keytypes_ECDSA_P256.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ECDSA_P256, (PyObject *)&__pyx_type_3ssh_8keytypes_ECDSA_P256) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ECDSA_P256) < 0) __PYX_ERR(1, 75, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P256 = &__pyx_type_3ssh_8keytypes_ECDSA_P256; + __pyx_type_3ssh_8keytypes_ECDSA_P384.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ECDSA_P384) < 0) __PYX_ERR(1, 79, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_3ssh_8keytypes_ECDSA_P384.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_ECDSA_P384.tp_dictoffset && __pyx_type_3ssh_8keytypes_ECDSA_P384.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_3ssh_8keytypes_ECDSA_P384.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ECDSA_P384, (PyObject *)&__pyx_type_3ssh_8keytypes_ECDSA_P384) < 0) __PYX_ERR(1, 79, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ECDSA_P384) < 0) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P384 = &__pyx_type_3ssh_8keytypes_ECDSA_P384; + __pyx_type_3ssh_8keytypes_ECDSA_P521.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ECDSA_P521) < 0) __PYX_ERR(1, 83, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_3ssh_8keytypes_ECDSA_P521.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_ECDSA_P521.tp_dictoffset && __pyx_type_3ssh_8keytypes_ECDSA_P521.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_3ssh_8keytypes_ECDSA_P521.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ECDSA_P521, (PyObject *)&__pyx_type_3ssh_8keytypes_ECDSA_P521) < 0) __PYX_ERR(1, 83, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ECDSA_P521) < 0) __PYX_ERR(1, 83, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P521 = &__pyx_type_3ssh_8keytypes_ECDSA_P521; + __pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01) < 0) __PYX_ERR(1, 87, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01.tp_dictoffset && __pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ECDSA_P256_CERT01, (PyObject *)&__pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01) < 0) __PYX_ERR(1, 87, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01) < 0) __PYX_ERR(1, 87, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P256_CERT01 = &__pyx_type_3ssh_8keytypes_ECDSA_P256_CERT01; + __pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01) < 0) __PYX_ERR(1, 91, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01.tp_dictoffset && __pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ECDSA_P384_CERT01, (PyObject *)&__pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01) < 0) __PYX_ERR(1, 91, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01) < 0) __PYX_ERR(1, 91, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P384_CERT01 = &__pyx_type_3ssh_8keytypes_ECDSA_P384_CERT01; + __pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01) < 0) __PYX_ERR(1, 95, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01.tp_dictoffset && __pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ECDSA_P521_CERT01, (PyObject *)&__pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01) < 0) __PYX_ERR(1, 95, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01) < 0) __PYX_ERR(1, 95, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ECDSA_P521_CERT01 = &__pyx_type_3ssh_8keytypes_ECDSA_P521_CERT01; + __pyx_type_3ssh_8keytypes_ED25519_CERT01.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_ED25519_CERT01) < 0) __PYX_ERR(1, 99, __pyx_L1_error) + #if PY_VERSION_HEX < 0x030800B1 + __pyx_type_3ssh_8keytypes_ED25519_CERT01.tp_print = 0; + #endif + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_ED25519_CERT01.tp_dictoffset && __pyx_type_3ssh_8keytypes_ED25519_CERT01.tp_getattro == PyObject_GenericGetAttr)) { + __pyx_type_3ssh_8keytypes_ED25519_CERT01.tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ED25519_CERT01, (PyObject *)&__pyx_type_3ssh_8keytypes_ED25519_CERT01) < 0) __PYX_ERR(1, 99, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_ED25519_CERT01) < 0) __PYX_ERR(1, 99, __pyx_L1_error) + __pyx_ptype_3ssh_8keytypes_ED25519_CERT01 = &__pyx_type_3ssh_8keytypes_ED25519_CERT01; __pyx_type_3ssh_8keytypes_UnknownKey.tp_base = __pyx_ptype_3ssh_8keytypes_KeyType; - if (PyType_Ready(&__pyx_type_3ssh_8keytypes_UnknownKey) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_3ssh_8keytypes_UnknownKey) < 0) __PYX_ERR(1, 45, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_3ssh_8keytypes_UnknownKey.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3ssh_8keytypes_UnknownKey.tp_dictoffset && __pyx_type_3ssh_8keytypes_UnknownKey.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_3ssh_8keytypes_UnknownKey.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnknownKey, (PyObject *)&__pyx_type_3ssh_8keytypes_UnknownKey) < 0) __PYX_ERR(0, 42, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_UnknownKey) < 0) __PYX_ERR(0, 42, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnknownKey, (PyObject *)&__pyx_type_3ssh_8keytypes_UnknownKey) < 0) __PYX_ERR(1, 45, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3ssh_8keytypes_UnknownKey) < 0) __PYX_ERR(1, 45, __pyx_L1_error) __pyx_ptype_3ssh_8keytypes_UnknownKey = &__pyx_type_3ssh_8keytypes_UnknownKey; __Pyx_RefNannyFinishContext(); return 0; @@ -8783,10 +6176,10 @@ static int __Pyx_modinit_function_import_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ - __pyx_t_1 = PyImport_ImportModule("ssh.utils"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule("ssh.utils"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_ImportFunction(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_3ssh_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - if (__Pyx_ImportFunction(__pyx_t_1, "to_str", (void (**)(void))&__pyx_f_3ssh_5utils_to_str, "PyObject *(char *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "to_bytes", (void (**)(void))&__pyx_f_3ssh_5utils_to_bytes, "PyObject *(PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_ImportFunction(__pyx_t_1, "to_str", (void (**)(void))&__pyx_f_3ssh_5utils_to_str, "PyObject *(char *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -8914,30 +6307,30 @@ if (!__Pyx_RefNanny) { } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_keytypes(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED - if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ @@ -8956,146 +6349,58 @@ if (!__Pyx_RefNanny) { #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_b); - __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_ssh__keytypes) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "ssh.keytypes")) { - if (unlikely(PyDict_SetItemString(modules, "ssh.keytypes", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(PyDict_SetItemString(modules, "ssh.keytypes", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); - if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error) + if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error) (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); - if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error) /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif - /* "ssh/keytypes.pyx":92 + /* "ssh/keytypes.pyx":139 * * * def key_type_from_name(key_name): # <<<<<<<<<<<<<< * cdef ssh_keytypes_e _type * cdef bytes b_key_name = to_bytes(key_name) */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_1key_type_from_name, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_key_type_from_name, __pyx_t_1) < 0) __PYX_ERR(0, 92, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":1 - * def __pyx_unpickle_KeyType(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_3__pyx_unpickle_KeyType, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_KeyType, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":11 - * __pyx_unpickle_KeyType__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_KeyType__set_state(KeyType __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_5__pyx_unpickle_UnknownKey, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_UnknownKey, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":1 - * def __pyx_unpickle_DSSKey(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_7__pyx_unpickle_DSSKey, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DSSKey, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":11 - * __pyx_unpickle_DSSKey__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_DSSKey__set_state(DSSKey __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_9__pyx_unpickle_RSAKey, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_RSAKey, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":1 - * def __pyx_unpickle_RSA1Key(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_11__pyx_unpickle_RSA1Key, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_RSA1Key, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":11 - * __pyx_unpickle_RSA1Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_RSA1Key__set_state(RSA1Key __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_13__pyx_unpickle_ECDSAKey, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ECDSAKey, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":1 - * def __pyx_unpickle_DSSCert01Key(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< - * cdef object __pyx_PickleError - * cdef object __pyx_result - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_15__pyx_unpickle_DSSCert01Key, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_DSSCert01Key, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "(tree fragment)":11 - * __pyx_unpickle_DSSCert01Key__set_state( __pyx_result, __pyx_state) - * return __pyx_result - * cdef __pyx_unpickle_DSSCert01Key__set_state(DSSCert01Key __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< - * __pyx_result._type = __pyx_state[0] - * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_17__pyx_unpickle_RSACert01Key, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3ssh_8keytypes_1key_type_from_name, NULL, __pyx_n_s_ssh_keytypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_RSACert01Key, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_key_type_from_name, __pyx_t_1) < 0) __PYX_ERR(1, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "ssh/keytypes.pyx":1 @@ -9103,9 +6408,9 @@ if (!__Pyx_RefNanny) { * # Copyright (C) 2018-2020 Panos Kittenis * # */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ @@ -9164,6 +6469,86 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject } #endif +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* RaiseArgTupleInvalid */ +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *more_or_less; + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); +} + +/* KeywordStringCheck */ +static int __Pyx_CheckKeywordStrings( + PyObject *kwdict, + const char* function_name, + int kw_allowed) +{ + PyObject* key = 0; + Py_ssize_t pos = 0; +#if CYTHON_COMPILING_IN_PYPY + if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) + goto invalid_keyword; + return 1; +#else + while (PyDict_Next(kwdict, &pos, &key, 0)) { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_Check(key))) + #endif + if (unlikely(!PyUnicode_Check(key))) + goto invalid_keyword_type; + } + if ((!kw_allowed) && unlikely(key)) + goto invalid_keyword; + return 1; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + return 0; +#endif +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif + return 0; +} + /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, @@ -9408,199 +6793,29 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec } #endif -/* PyErrExceptionMatches */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { - Py_ssize_t i, n; - n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 - for (i=0; icurexc_type; - if (exc_type == err) return 1; - if (unlikely(!exc_type)) return 0; - if (unlikely(PyTuple_Check(err))) - return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); - return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); -} -#endif - /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} -#endif - -/* GetAttr */ -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { -#if CYTHON_USE_TYPE_SLOTS -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - -/* GetAttr3 */ -static PyObject *__Pyx_GetAttr3Default(PyObject *d) { - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) - return NULL; - __Pyx_PyErr_Clear(); - Py_INCREF(d); - return d; -} -static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { - PyObject *r = __Pyx_GetAttr(o, n); - return (likely(r)) ? r : __Pyx_GetAttr3Default(d); -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* PyDictVersioning */ -#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; -} -static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { - PyObject **dictptr = NULL; - Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; - if (offset) { -#if CYTHON_COMPILING_IN_CPYTHON - dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); -#else - dictptr = _PyObject_GetDictPtr(obj); -#endif - } - return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; -} -static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { - PyObject *dict = Py_TYPE(obj)->tp_dict; - if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) - return 0; - return obj_dict_version == __Pyx_get_object_dict_version(obj); -} -#endif - -/* GetModuleGlobalName */ -#if CYTHON_USE_DICT_VERSIONS -static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) -#else -static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) -#endif -{ - PyObject *result; -#if !CYTHON_AVOID_BORROWED_REFS -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 - result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } else if (unlikely(PyErr_Occurred())) { - return NULL; - } -#else - result = PyDict_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } -#endif -#else - result = PyObject_GetItem(__pyx_d, name); - __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) - if (likely(result)) { - return __Pyx_NewRef(result); - } - PyErr_Clear(); -#endif - return __Pyx_GetBuiltinName(name); -} - -/* PyObjectCall2Args */ -static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { - PyObject *args, *result = NULL; - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(function)) { - PyObject *args[2] = {arg1, arg2}; - return __Pyx_PyFunction_FastCall(function, args, 2); - } - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(function)) { - PyObject *args[2] = {arg1, arg2}; - return __Pyx_PyCFunction_FastCall(function, args, 2); - } - #endif - args = PyTuple_New(2); - if (unlikely(!args)) goto done; - Py_INCREF(arg1); - PyTuple_SET_ITEM(args, 0, arg1); - Py_INCREF(arg2); - PyTuple_SET_ITEM(args, 1, arg2); - Py_INCREF(function); - result = __Pyx_PyObject_Call(function, args, NULL); - Py_DECREF(args); - Py_DECREF(function); -done: - return result; +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); } - -/* ExtTypeTest */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(__Pyx_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; } +#endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 @@ -9761,243 +6976,17 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } #endif -/* RaiseArgTupleInvalid */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseDoubleKeywords */ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%.200s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_MAJOR_VERSION < 3 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) { - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_MAJOR_VERSION < 3 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* HasAttr */ -static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { - PyObject *r; - if (unlikely(!__Pyx_PyBaseString_Check(n))) { - PyErr_SetString(PyExc_TypeError, - "hasattr(): attribute name must be string"); - return -1; - } - r = __Pyx_GetAttr(o, n); - if (unlikely(!r)) { - PyErr_Clear(); +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; - } else { - Py_DECREF(r); - return 1; } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; } /* PyObject_GenericGetAttrNoDict */ @@ -10050,6 +7039,31 @@ static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_nam } #endif +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; icurexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; + if (unlikely(PyTuple_Check(err))) + return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); +} +#endif + /* PyObjectGetAttrStrNoError */ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare @@ -10156,6 +7170,32 @@ static int __Pyx_setup_reduce(PyObject* type_obj) { return ret; } +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) { @@ -10416,51 +7456,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ssh_keytypes_e(enum ssh_ke return (target_type) value;\ } -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); -#endif - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); -#ifdef HAVE_LONG_LONG - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); -#endif - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - /* CIntFromPy */ -static CYTHON_INLINE enum ssh_keytypes_e __Pyx_PyInt_As_enum__ssh_keytypes_e(PyObject *x) { - const enum ssh_keytypes_e neg_one = (enum ssh_keytypes_e) ((enum ssh_keytypes_e) 0 - (enum ssh_keytypes_e) 1), const_zero = (enum ssh_keytypes_e) 0; +static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { + const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { - if (sizeof(enum ssh_keytypes_e) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, long, PyInt_AS_LONG(x)) + if (sizeof(char) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } - return (enum ssh_keytypes_e) val; + return (char) val; } } else #endif @@ -10469,32 +7478,32 @@ static CYTHON_INLINE enum ssh_keytypes_e __Pyx_PyInt_As_enum__ssh_keytypes_e(PyO #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (enum ssh_keytypes_e) 0; - case 1: __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, digit, digits[0]) + case 0: return (char) 0; + case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) case 2: - if (8 * sizeof(enum ssh_keytypes_e) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) >= 2 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) (((((enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0])); + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { + return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; case 3: - if (8 * sizeof(enum ssh_keytypes_e) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) >= 3 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) (((((((enum ssh_keytypes_e)digits[2]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0])); + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { + return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; case 4: - if (8 * sizeof(enum ssh_keytypes_e) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) >= 4 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) (((((((((enum ssh_keytypes_e)digits[3]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[2]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0])); + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { + return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); } } break; @@ -10508,86 +7517,86 @@ static CYTHON_INLINE enum ssh_keytypes_e __Pyx_PyInt_As_enum__ssh_keytypes_e(PyO { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) - return (enum ssh_keytypes_e) -1; + return (char) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif - if (sizeof(enum ssh_keytypes_e) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(enum ssh_keytypes_e, unsigned long, PyLong_AsUnsignedLong(x)) + if (sizeof(char) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(enum ssh_keytypes_e) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(enum ssh_keytypes_e, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) + } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { - case 0: return (enum ssh_keytypes_e) 0; - case -1: __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, digit, +digits[0]) + case 0: return (char) 0; + case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) case -2: - if (8 * sizeof(enum ssh_keytypes_e) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) - 1 > 2 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) (((enum ssh_keytypes_e)-1)*(((((enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0]))); + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 2: - if (8 * sizeof(enum ssh_keytypes_e) > 1 * PyLong_SHIFT) { + if (8 * sizeof(char) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) - 1 > 2 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) ((((((enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0]))); + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { + return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -3: - if (8 * sizeof(enum ssh_keytypes_e) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) - 1 > 3 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) (((enum ssh_keytypes_e)-1)*(((((((enum ssh_keytypes_e)digits[2]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0]))); + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 3: - if (8 * sizeof(enum ssh_keytypes_e) > 2 * PyLong_SHIFT) { + if (8 * sizeof(char) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) - 1 > 3 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) ((((((((enum ssh_keytypes_e)digits[2]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0]))); + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { + return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case -4: - if (8 * sizeof(enum ssh_keytypes_e) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) - 1 > 4 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) (((enum ssh_keytypes_e)-1)*(((((((((enum ssh_keytypes_e)digits[3]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[2]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0]))); + __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; case 4: - if (8 * sizeof(enum ssh_keytypes_e) > 3 * PyLong_SHIFT) { + if (8 * sizeof(char) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(enum ssh_keytypes_e, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(enum ssh_keytypes_e) - 1 > 4 * PyLong_SHIFT) { - return (enum ssh_keytypes_e) ((((((((((enum ssh_keytypes_e)digits[3]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[2]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[1]) << PyLong_SHIFT) | (enum ssh_keytypes_e)digits[0]))); + __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { + return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); } } break; } #endif - if (sizeof(enum ssh_keytypes_e) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(enum ssh_keytypes_e, long, PyLong_AsLong(x)) + if (sizeof(char) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG - } else if (sizeof(enum ssh_keytypes_e) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(enum ssh_keytypes_e, PY_LONG_LONG, PyLong_AsLongLong(x)) + } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } @@ -10596,7 +7605,7 @@ static CYTHON_INLINE enum ssh_keytypes_e __Pyx_PyInt_As_enum__ssh_keytypes_e(PyO PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else - enum ssh_keytypes_e val; + char val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { @@ -10616,24 +7625,55 @@ static CYTHON_INLINE enum ssh_keytypes_e __Pyx_PyInt_As_enum__ssh_keytypes_e(PyO return val; } #endif - return (enum ssh_keytypes_e) -1; + return (char) -1; } } else { - enum ssh_keytypes_e val; + char val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (enum ssh_keytypes_e) -1; - val = __Pyx_PyInt_As_enum__ssh_keytypes_e(tmp); + if (!tmp) return (char) -1; + val = __Pyx_PyInt_As_char(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, - "value too large to convert to enum ssh_keytypes_e"); - return (enum ssh_keytypes_e) -1; + "value too large to convert to char"); + return (char) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to enum ssh_keytypes_e"); - return (enum ssh_keytypes_e) -1; + "can't convert negative value to char"); + return (char) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); + } } /* CIntFromPy */ @@ -10825,195 +7865,6 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { return (long) -1; } -/* CIntFromPy */ -static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) { - const char neg_one = (char) ((char) 0 - (char) 1), const_zero = (char) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(char) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (char) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (char) 0; - case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0]) - case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) { - return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(char) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) { - return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(char) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) { - return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (char) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(char) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) -#endif - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (char) 0; - case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0]) - case -2: - if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(char) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(char) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { - return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(char) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) { - return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]))); - } - } - break; - } -#endif - if (sizeof(char) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x)) -#ifdef HAVE_LONG_LONG - } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x)) -#endif - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - char val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (char) -1; - } - } else { - char val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (char) -1; - val = __Pyx_PyInt_As_char(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to char"); - return (char) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to char"); - return (char) -1; -} - /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; diff --git a/ssh/keytypes.pxd b/ssh/keytypes.pxd index 2714d3e..33e8614 100644 --- a/ssh/keytypes.pxd +++ b/ssh/keytypes.pxd @@ -45,4 +45,32 @@ cdef class RSACert01Key(KeyType): pass +cdef class ECDSA_P256(KeyType): + pass + + +cdef class ECDSA_P384(KeyType): + pass + + +cdef class ECDSA_P521(KeyType): + pass + + +cdef class ECDSA_P256_CERT01(KeyType): + pass + + +cdef class ECDSA_P384_CERT01(KeyType): + pass + + +cdef class ECDSA_P521_CERT01(KeyType): + pass + + +cdef class ED25519_CERT01(KeyType): + pass + + cdef KeyType from_keytype(ssh_keytypes_e _type) diff --git a/ssh/keytypes.pyx b/ssh/keytypes.pyx index 5d6a59b..b50ea95 100644 --- a/ssh/keytypes.pyx +++ b/ssh/keytypes.pyx @@ -23,6 +23,9 @@ from c_ssh cimport ssh_keytypes_e, ssh_key_type_to_char, ssh_key_type_from_name cdef class KeyType: + def __cinit__(self): + self._type = ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN + @property def value(self): return self._type @@ -64,25 +67,69 @@ cdef class DSSCert01Key(KeyType): cdef class RSACert01Key(KeyType): + + def __cinit__(self): + self._type = ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01 + + +cdef class ECDSA_P256(KeyType): + pass + + +cdef class ECDSA_P384(KeyType): + pass + + +cdef class ECDSA_P521(KeyType): + pass + + +cdef class ECDSA_P256_CERT01(KeyType): + pass + + +cdef class ECDSA_P384_CERT01(KeyType): + pass + + +cdef class ECDSA_P521_CERT01(KeyType): + pass + + +cdef class ED25519_CERT01(KeyType): pass cdef KeyType from_keytype(ssh_keytypes_e _type): cdef KeyType key_type if _type == ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN: - key_type = UnknownKey.__new__(KeyType) + key_type = UnknownKey.__new__(UnknownKey) elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS: - key_type = DSSKey.__new__(KeyType) + key_type = DSSKey.__new__(DSSKey) elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA: - key_type = RSAKey.__new__(KeyType) + key_type = RSAKey.__new__(RSAKey) elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA1: - key_type = RSA1Key.__new__(KeyType) + key_type = RSA1Key.__new__(RSA1Key) elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA: - key_type = ECDSAKey.__new__(KeyType) + key_type = ECDSAKey.__new__(ECDSAKey) elif _type == ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01: - key_type = DSSCert01Key.__new__(KeyType) + key_type = DSSCert01Key.__new__(DSSCert01Key) elif _type == ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01: - key_type = RSACert01Key.__new__(KeyType) + key_type = RSACert01Key.__new__(RSACert01Key) + elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256: + key_type = ECDSA_P256.__new__(ECDSA_P256) + elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384: + key_type = ECDSA_P384.__new__(ECDSA_P384) + elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521: + key_type = ECDSA_P521.__new__(ECDSA_P521) + elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P256_CERT01: + key_type = ECDSA_P256_CERT01.__new__(ECDSA_P256_CERT01) + elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P384_CERT01: + key_type = ECDSA_P384_CERT01.__new__(ECDSA_P384_CERT01) + elif _type == ssh_keytypes_e.SSH_KEYTYPE_ECDSA_P521_CERT01: + key_type = ECDSA_P521_CERT01.__new__(ECDSA_P521_CERT01) + elif _type == ssh_keytypes_e.SSH_KEYTYPE_ED25519_CERT01: + key_type = ED25519_CERT01.__new__(ED25519_CERT01) else: raise Exception("Unknown keytype %s", _type) key_type._type = _type @@ -96,12 +143,3 @@ def key_type_from_name(key_name): with nogil: _type = ssh_key_type_from_name(&_key_name) return from_keytype(_type) - - -# UNKNOWN = KeyType.from_keytype(ssh_keytypes_e.SSH_KEYTYPE_UNKNOWN) -# DSS = KeyType.from_keytype(ssh_keytypes_e.SSH_KEYTYPE_DSS) -# RSA = KeyType.from_keytype(ssh_keytypes_e.SSH_KEYTYPE_RSA) -# RSA1 = KeyType.from_keytype(ssh_keytypes_e.SSH_KEYTYPE_RSA1) -# ECDSA = KeyType.from_keytype(ssh_keytypes_e.SSH_KEYTYPE_ECDSA) -# DSS_CERT01 = KeyType.from_keytype(ssh_keytypes_e.SSH_KEYTYPE_DSS_CERT01) -# RSA_CERT01 = KeyType.from_keytype(ssh_keytypes_e.SSH_KEYTYPE_RSA_CERT01) diff --git a/tests/base_case.py b/tests/base_case.py index ab7b40b..e0a9a91 100644 --- a/tests/base_case.py +++ b/tests/base_case.py @@ -1,5 +1,5 @@ # This file is part of ssh-python. -# Copyright (C) 2018 Panos Kittenis +# Copyright (C) 2018-2020 Panos Kittenis # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ import pwd import os import socket +import subprocess from sys import version_info from .embedded_server.openssh import OpenSSHServer @@ -28,14 +29,28 @@ PKEY_FILENAME = os.path.sep.join([os.path.dirname(__file__), 'unit_test_key']) PUB_FILE = "%s.pub" % (PKEY_FILENAME,) +USER_CERT_PRIV_KEY = os.path.sep.join([os.path.dirname(__file__), 'unit_test_cert_key']) +USER_CERT_PUB_KEY = os.path.sep.join([os.path.dirname(__file__), 'unit_test_cert_key.pub']) +USER_CERT_FILE = os.path.sep.join([os.path.dirname(__file__), 'unit_test_cert_key-cert.pub']) +CA_USER_KEY = os.path.sep.join([os.path.dirname(__file__), 'embedded_server', 'ca_user_key']) +USER = pwd.getpwuid(os.geteuid()).pw_name class SSHTestCase(unittest.TestCase): + @classmethod + def sign_cert(cls): + cmd = [ + 'ssh-keygen', '-s', CA_USER_KEY, '-n', USER, '-I', 'tests', USER_CERT_PUB_KEY, + ] + subprocess.check_call(cmd) + @classmethod def setUpClass(cls): _mask = int('0600') if version_info <= (2,) else 0o600 - os.chmod(PKEY_FILENAME, _mask) + for _file in [PKEY_FILENAME, USER_CERT_PRIV_KEY, CA_USER_KEY]: + os.chmod(_file, _mask) + cls.sign_cert() cls.server = OpenSSHServer() cls.server.start_server() @@ -51,7 +66,9 @@ def setUp(self): self.resp = u'me' self.user_key = PKEY_FILENAME self.user_pub_key = PUB_FILE - self.user = pwd.getpwuid(os.geteuid()).pw_name + self.user_ca_key = USER_CERT_PRIV_KEY + self.user_cert_file = USER_CERT_FILE + self.user = USER sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((self.host, self.port)) self.sock = sock diff --git a/tests/embedded_server/authorized_keys b/tests/embedded_server/authorized_keys index 7ecc3ff..41bc82d 100644 --- a/tests/embedded_server/authorized_keys +++ b/tests/embedded_server/authorized_keys @@ -1 +1,4 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEsAAs2ew1xYntiiBAb3oqs7UC2Qd2kQ/eF+6WqOjeTFjWGksybnFidV91MwLjHdPmioz/1SleZqSqcD0csBcUs6jqclDlJ2MX8ZjL0e8hFDYpepFPTkwB2D6e55DwK0GJefiHUda5fKaaCzMN69h/RoBYurV/Zxf4+kRUAt+A5RXBGe22BdMtKW30J9endU9qWP4QDWtFXxvOjWHuJc7M/MNP2qww4yBo4xcKTabr8TC9uL7RUh4hMWdiNZnlmwSICT6k9NkkcBbDEIW0SjEcUMRB/V0qQ/J5Jeb8Lea82wDDdcfKaOPmI8ST5WtjfqPkKd9sqVhsq0gcCKtFZv0r +@cert-authority * ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCphJViWy6xwUQngUeHU2AmHaHj/kkDSI4dHQLoWhYwEQ85CowwDaJ7NhZBr6bpA0OTYBgXcfkQw8ncH2k6HybfeT9KXLogTS/hKwZIz1NY5bvVBHSXI8uzSX5OlBujPUxk99kc1Vm3OA9fKB0iCdufgmdXo+3c3JBG5EqO4H21u8zxwfHmVpigkERGxMYkOMWEjAF7i7kptG9d0Gtijw8GWYUmO7R2xkBWsLaZY3llOdCCH6EDYerfHdUOnkwvm0yhy4UqSt8Cu6XoErhdH4l+uF4Pbz+rWgmQ7GQlpSCgZqrIAyyQyTQOn+heFkGr407lFl+PkClXHK5NgZ90EgXSA+dRNl9Qjw3BO5tUN9jWALEURfT4CQemtSe+1JNMbxsA7+byW1YeLbVZknBMieRhMoerXRvG9ENglkYeFzKeKKAj0pS5FzzegXP4QxK+XAkX1Mw3GTRGkrpwrd8b6FVWf/yFzCFkm//rCQiQ933om57Q3QQriJtABfBH0L9bg2s= +@cert-authority * ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQClYv7851Sl96qxb2VV8rbhqhpSmLD+VUvKjj4aMjFgunw8HA9BOUu5kuPLo7LWzZN1brTv0JB9xbcCvmNdzhHKEBsP4F3xp20vCz2EKivjGIJkFiPyn/xAZvlfA0rvoXyzwCekiFJqhrEsSpiHDk4jL9CImStcOhm/ZLXTjZL2aa+A2DSE4JFAXvpvuTbw68JSujCPWsNNyqydQNXpWkHoqI/Lo/dtXX1jYoD4zmwEqN++VwNIdANazQpABBkcVQfwVtcHvYptA9Pq4HhrTPA59Pv63yPb7/fL7F2CfKCW+sb+yRGY6U81vXVG+jRMhrcPTY6SIXqW43P0qhGW6NWswn1k5sLvpYHdRTyDdC1uwBVVQJ9kO/QP4SnXklfMVzuFIxt5BhM4dXwlPDuJcJG1rXUfXIAWtZJd/LCcyp+xKsJxgjTIitDevNRxzfkRkijryzUgfZHh27557ztoubl3NuLKf+cWcdLzBkeGpNNHCE+tqVueuBqiUqPttE6LSx0= + diff --git a/tests/embedded_server/ca_host_key b/tests/embedded_server/ca_host_key new file mode 100644 index 0000000..769abf0 --- /dev/null +++ b/tests/embedded_server/ca_host_key @@ -0,0 +1,40 @@ +-----BEGIN PRIVATE KEY----- +MIIG/gIBADANBgkqhkiG9w0BAQEFAASCBugwggbkAgEAAoIBgQCphJViWy6xwUQn +gUeHU2AmHaHj/kkDSI4dHQLoWhYwEQ85CowwDaJ7NhZBr6bpA0OTYBgXcfkQw8nc +H2k6HybfeT9KXLogTS/hKwZIz1NY5bvVBHSXI8uzSX5OlBujPUxk99kc1Vm3OA9f +KB0iCdufgmdXo+3c3JBG5EqO4H21u8zxwfHmVpigkERGxMYkOMWEjAF7i7kptG9d +0Gtijw8GWYUmO7R2xkBWsLaZY3llOdCCH6EDYerfHdUOnkwvm0yhy4UqSt8Cu6Xo +ErhdH4l+uF4Pbz+rWgmQ7GQlpSCgZqrIAyyQyTQOn+heFkGr407lFl+PkClXHK5N +gZ90EgXSA+dRNl9Qjw3BO5tUN9jWALEURfT4CQemtSe+1JNMbxsA7+byW1YeLbVZ +knBMieRhMoerXRvG9ENglkYeFzKeKKAj0pS5FzzegXP4QxK+XAkX1Mw3GTRGkrpw +rd8b6FVWf/yFzCFkm//rCQiQ933om57Q3QQriJtABfBH0L9bg2sCAwEAAQKCAYEA +i3Ld0INh7igmgLkAtnoH5lMKEhvkxCazgY+UDL/O8MuX0jyzBfSxbNoZhP+SNqzQ +sjOinebMFNZ6//F3BrEJsVx0jB+rnVbhxEE4cjzbO44A7kM0BgEUWPBkTw/XjHmo +loasu+NmYipjusus64tgd982VAouajmnFipGizJxN0a+WUJKVEl4VN1YzT6iILnz +Ag6KSa+vKnecBXimXfWBTp/lwIXs9qgv1SCZlaUXAAaHWAPc2IN8Sv6nfdcKpT8C +fDE9du146QvFlfvzxvyz5c5OwIlKHc/6+LSOcp+OJTE+8mrXqkYJGLuD8pdPVYQm +NfpzHm7LKUNwS2v+lS9hviEwIGkZo4ZepFB4ij9wllngBY4j9jGPlakwUu0D9Vyf +r+pHUrKfRVi8xqyZT9S20Z+3KkTqAVeblPWCxBGvyAl2JU/sY2LelfZo+P89uKqU +12+uEha5WIyCgMyBuYS0LUgzkBLfQAsBj1RLcqvG3WLV1sSXL6q2U5OvdC3tTevB +AoHBANjwpGuxibDk/UnKbVtOxJbpUJkM8BiZnV8NuPXvi/qHjfwrTK/UnRwC5ZCZ +eetm5vWCxClspVewidR3HWa1kxTVcgSO2J3PlAgpKR8phdkFO68+heLExYamYUgu +IYP3C0Kygcj9HLWueJtecq/ogUNYmJKCcI381iTbt2iqth/35nbe8l7Xa+XBfvhS +ytVohlO3QZX/ubtosgNEwuxGDQj9YxEejt5t0f8CHVETvN+xzbWjnIpn3+KJLKRy +DdHs3QKBwQDICiB8wImZFNnrDGpycng78P34CUrxaEmCN1/SiN2GJ5LYVS++K2Pc +I/9a0x4TSGvDNCNt4RE8ebwWcTe0U8rEw99kUKNlI4ZvpVJvv0vH8IabGC3p0gBf +OlGhoIYOqvDzkL58P48IbP43wfOGJqenkGx8SXWEGUnYTzSEoFJHv3RHE9b86q0b +cm3NyyxBWPM9DBQ2e594ouVNKeLo6HT3j5ZW5ypFjWhCnIoyENabPAHWTYKUnu/f +W7NN1W+5aOcCgcABQSsCQG2Wa0yXr6cAPy1d3g2MRQniaokBcrfeHDuIAF6u1aVE +4wrhjZa8RlbxKJAvXUk7IBi4sBmr8+BkpqoqFa3qHtVb3EZz4aEOQBQ5FBGrSsZF +cHPf+nhXjYS+GaCkCxo7ClOvLUofQ+WP5N1SgWGofz6dY5ftcKPX5BzXhHx9tX5b +VA2Yr4zHbNslbsxQEaA8eNUfI1TcNfqWmTUcFzMKd03GNYZgXifDP0T5WjLhWQff +uQgPbFGoxcwUqbUCgcBomYsFULRinJmao8Jhl+OxDEHw2gMbGnodohD0COc1CCpr +/pdZbFzqNtSGzJAUazEWQIQqJ58YrVshrRAAtjP4EagVT2kxMJNSe/MQRco9gVMR +dGJFuq7BHMCksEiJEO+vnMdONvn24O9Jfpx1UG8oWoevscXGTmbjuf7vPtnndIA7 +zm8Djz73dC1gh9XbUcTW7iL/nkL0FNGsOLPTMAJBlQ564KOk/N1Av5Qvu8hMIeOg +CKW4SyeI9u1aTLoADI8CgcEA0zy4laBzjAlN6Uc7RTTiqd259R7vqlc95wPkLDS0 +jg+mfpNHyNdtAhHnFnKVYgu4qqshcjX4BwW1m15/lHZ3VTY71U0TYHGeD1F2WY7R +ptMFo8iiUrY1qAS79dFutY5MGHD9htw11j52GgBz0dAB1Z9MtXblS+3QeS0m79g8 +srLhNUQPKrl61h2aT2nv2mROYZJ5lkDcByGcwSpXAAUXrJ7WQtcaQ5awq/Uqwfac +niIHADTER1prOuXylm1pWZdk +-----END PRIVATE KEY----- diff --git a/tests/embedded_server/ca_host_key-cert.pub b/tests/embedded_server/ca_host_key-cert.pub new file mode 100644 index 0000000..988c386 --- /dev/null +++ b/tests/embedded_server/ca_host_key-cert.pub @@ -0,0 +1 @@ +ssh-rsa-cert-v01@openssh.com AAAAHHNzaC1yc2EtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgu84sipb+xoLb4xY/PnjXE6HGJlJKz+VdqW+Z9oMFMv4AAAADAQABAAABgQCphJViWy6xwUQngUeHU2AmHaHj/kkDSI4dHQLoWhYwEQ85CowwDaJ7NhZBr6bpA0OTYBgXcfkQw8ncH2k6HybfeT9KXLogTS/hKwZIz1NY5bvVBHSXI8uzSX5OlBujPUxk99kc1Vm3OA9fKB0iCdufgmdXo+3c3JBG5EqO4H21u8zxwfHmVpigkERGxMYkOMWEjAF7i7kptG9d0Gtijw8GWYUmO7R2xkBWsLaZY3llOdCCH6EDYerfHdUOnkwvm0yhy4UqSt8Cu6XoErhdH4l+uF4Pbz+rWgmQ7GQlpSCgZqrIAyyQyTQOn+heFkGr407lFl+PkClXHK5NgZ90EgXSA+dRNl9Qjw3BO5tUN9jWALEURfT4CQemtSe+1JNMbxsA7+byW1YeLbVZknBMieRhMoerXRvG9ENglkYeFzKeKKAj0pS5FzzegXP4QxK+XAkX1Mw3GTRGkrpwrd8b6FVWf/yFzCFkm//rCQiQ933om57Q3QQriJtABfBH0L9bg2sAAAAAAAAAAAAAAAIAAAAMdGVzdF9jYV9ob3N0AAAAAAAAAAAAAAAA//////////8AAAAAAAAAAAAAAAAAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQCphJViWy6xwUQngUeHU2AmHaHj/kkDSI4dHQLoWhYwEQ85CowwDaJ7NhZBr6bpA0OTYBgXcfkQw8ncH2k6HybfeT9KXLogTS/hKwZIz1NY5bvVBHSXI8uzSX5OlBujPUxk99kc1Vm3OA9fKB0iCdufgmdXo+3c3JBG5EqO4H21u8zxwfHmVpigkERGxMYkOMWEjAF7i7kptG9d0Gtijw8GWYUmO7R2xkBWsLaZY3llOdCCH6EDYerfHdUOnkwvm0yhy4UqSt8Cu6XoErhdH4l+uF4Pbz+rWgmQ7GQlpSCgZqrIAyyQyTQOn+heFkGr407lFl+PkClXHK5NgZ90EgXSA+dRNl9Qjw3BO5tUN9jWALEURfT4CQemtSe+1JNMbxsA7+byW1YeLbVZknBMieRhMoerXRvG9ENglkYeFzKeKKAj0pS5FzzegXP4QxK+XAkX1Mw3GTRGkrpwrd8b6FVWf/yFzCFkm//rCQiQ933om57Q3QQriJtABfBH0L9bg2sAAAGUAAAADHJzYS1zaGEyLTI1NgAAAYBv+fXgU7e+0OW/mBZbG6jlMtEALbF2IxjRe2KbmRMb5V7XVqVHVt1qAsl+aNtGntARVRMLnOn8Nasoquy3N+7voaMrQAADpAx+Ig3o8cNR1Ym86TUX7cuUTaSkWm7gOrfUILzIwJnyTJAV74NUac1LGXHL1w3EiLtkga5I+dsAm7Ba+8XohkK350D2lwjq8msvPsrPdT5IHoTG6XWO4QCJBYiu4FTV8Xye2XjFP60pH0F3RkrIFk9l3ftyJPm/2ptWgWJOM9TJimTcSy3bnt6DjLfUZJmePIXyyETEhBGQkRXyZ6VrJHd+biFdEz1X87BEVQcYoBBL5glnWgPAqsKzI70Z9pmS9SX7qA795Xp6zMJq0Ov/H7mUvZSvhnIip6NF9z4KOAy7mmF9dZR8UABE4upZpT2k0xIO+x+aJChkg8EwYX3z4v4VC+dzCIfUGEIfbrvYnQOh/VvG6A04lnALaJ/iRleXjmrbW2EJCDlOtZMTHqmvc2KLzponpJHyyeM= zefrer@kirin diff --git a/tests/embedded_server/ca_host_key.pub b/tests/embedded_server/ca_host_key.pub new file mode 100644 index 0000000..1e9e0f8 --- /dev/null +++ b/tests/embedded_server/ca_host_key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCphJViWy6xwUQngUeHU2AmHaHj/kkDSI4dHQLoWhYwEQ85CowwDaJ7NhZBr6bpA0OTYBgXcfkQw8ncH2k6HybfeT9KXLogTS/hKwZIz1NY5bvVBHSXI8uzSX5OlBujPUxk99kc1Vm3OA9fKB0iCdufgmdXo+3c3JBG5EqO4H21u8zxwfHmVpigkERGxMYkOMWEjAF7i7kptG9d0Gtijw8GWYUmO7R2xkBWsLaZY3llOdCCH6EDYerfHdUOnkwvm0yhy4UqSt8Cu6XoErhdH4l+uF4Pbz+rWgmQ7GQlpSCgZqrIAyyQyTQOn+heFkGr407lFl+PkClXHK5NgZ90EgXSA+dRNl9Qjw3BO5tUN9jWALEURfT4CQemtSe+1JNMbxsA7+byW1YeLbVZknBMieRhMoerXRvG9ENglkYeFzKeKKAj0pS5FzzegXP4QxK+XAkX1Mw3GTRGkrpwrd8b6FVWf/yFzCFkm//rCQiQ933om57Q3QQriJtABfBH0L9bg2s= zefrer@kirin diff --git a/tests/embedded_server/ca_user_key b/tests/embedded_server/ca_user_key new file mode 100644 index 0000000..de150ca --- /dev/null +++ b/tests/embedded_server/ca_user_key @@ -0,0 +1,40 @@ +-----BEGIN PRIVATE KEY----- +MIIG/AIBADANBgkqhkiG9w0BAQEFAASCBuYwggbiAgEAAoIBgQClYv7851Sl96qx +b2VV8rbhqhpSmLD+VUvKjj4aMjFgunw8HA9BOUu5kuPLo7LWzZN1brTv0JB9xbcC +vmNdzhHKEBsP4F3xp20vCz2EKivjGIJkFiPyn/xAZvlfA0rvoXyzwCekiFJqhrEs +SpiHDk4jL9CImStcOhm/ZLXTjZL2aa+A2DSE4JFAXvpvuTbw68JSujCPWsNNyqyd +QNXpWkHoqI/Lo/dtXX1jYoD4zmwEqN++VwNIdANazQpABBkcVQfwVtcHvYptA9Pq +4HhrTPA59Pv63yPb7/fL7F2CfKCW+sb+yRGY6U81vXVG+jRMhrcPTY6SIXqW43P0 +qhGW6NWswn1k5sLvpYHdRTyDdC1uwBVVQJ9kO/QP4SnXklfMVzuFIxt5BhM4dXwl +PDuJcJG1rXUfXIAWtZJd/LCcyp+xKsJxgjTIitDevNRxzfkRkijryzUgfZHh2755 +7ztoubl3NuLKf+cWcdLzBkeGpNNHCE+tqVueuBqiUqPttE6LSx0CAwEAAQKCAYBc +yU2FVcOH2YtKQNT5g1JXCLf73u5twizjVypASCiru/Q3RQbJ8PsrAd4LQav0FyHD +oHiiksB9z479WxMkbZhNZPvJzHboPKZk3kmE/KPipL2CqWlBlcBP4XXGeHJyPodX +0VZsWI7kdOyxjKhGHSB5XToBaO2KsI4Bct8P8T2iQWjVQHc2lUbodmDKjX7la196 +Sjs0MhegbTSqhNV+NcUEYo1KEpOeJ/VQ7NKuxCCV/KiKgQa2f1/icWZuw93Sp2EF +f22BQlcepJKaq0SnGKFXvZm5FvTmmViQtUYk28DaAgO5L4th6ejHoCXAqVp857kj +ral7DOehdATybohX5+bK62GQxwFiehBGnFh0Z1uOOe6SHaxsDhPCi46DTbViXP64 +7X1jIXxXE+6dfvMrbGFoirbclBrMskZK98kZnWZ6GDtDQkowOtgP2ZEjWBUnKPeI +gegfhH0CFTGGpLw7MjJS+xk8ht5bXp0Gflawve0RPPJm9cs2DOrJDIEKQNczjYEC +gcEA2xeP5YRp7JLG/TzQU9+z/BAGhMZyqqBBCOL8DLf1oit5/aFAdN6gQ9YCrrw9 +5BFDj687MVwmF6YWMOPivd7hv/SWJchsHSWs4I2VAuAqo8hU4Ri5IoDZjRpllh0p +IB8HVTt+hwdnGF6/mO3Pm6GxBlJ2iLSeDMgiFFPLrjT8uh+p+y3O32Kydb/T4u2v +nGxRzNKJ21rQQwxVQ0CegYlF6j9ljyKJTR5/4dZDUV05syC1zmcs2Kz3qX6ickE6 +4c8nAoHBAME/XkzkEco4HaTMNhyR8F/9kXzjH0Yn1o13u0pO/QTU4vvlnOIqsUYP +roXd9+yQs88ckCR1U0h16dzQsOtrGo/E538AzYKLgourLxKD26bybUO49Dm/j5bV +WlIxuV3jTv5biasmx8379ejlz6wVo7bYqMI/q+Rn2QYp+t5GUXqBek3L8wnfpnfL +FmoMrUdDe21xiPLVd9O13/8MnZJsg45u04PGV4hJzANn9Z73oQwl9dzAKZESQq4G +9RHT/Fk+GwKBwCoZR/QxUm078vKcKefD94C6z5XZ0BTLQFPl0crb2l4z/nfm8UzD +roX6bH+I+leFnbbRVA1zCHrI1kDEuUAEwNoytFtEPMoJAEQR0I1B58+a4fxy1Lg1 +jBgZ92U16z4Z2D3fdbuah4veQPCw2ZCtLCfr1o0EL86C8lF3nI637cwR44a5UaQJ +AgOwPZXAWFs1US6LUiQNOjF4ADYxB4QajY2qauhrGXjxIF+T3VGYGUs7QNQNbUeh +TOGLzMkpkZfsRwKBwBnBt3DqKRDZ3+GaMlAmh3JT2rNZlk6Ees1KOxVRZ9ngAgzu +8rUWWaBr8Kf5CNVoB/8/4FprpNkQlkYPLrWCBf1Jkk1ULxAKRjEVdOWz22/p+fQ/ +z5Vu2dWRxEMWS42fAWVXkAbW2WS0A3eyQba+/54cTInvcJq12LBAoiZEGxIH9eQu +ncsgGxD2aZti6ymHbgkNS+KJ3znBkQRuiwX8HqC6VsjGg94vb9i4X317peR3nsh4 +eFHUrDyDwuBIb+b5JwKBwERnucizMWzGZvNyTYmkO54u8lJPdGTEevzn7gjBc14x +yYAR+Uu1+eeSw295jFpvAi5Nr8dwtQqboRUc/69dLYCR73uxCw4PDKJ0bpmfPAJU +ythKjZ2b8KS7gxndUvl18C9l2jBHqnQvhB/pz4EDwyWsTXmiA15YtuPgandYhJMu ++NmCtMMMeXC690Igw6yhs+s3pUjWW+fKn+fdkx5uH+5gvYd+c5iJEWGdPogIXlCx +vP43QJnRZlNs4a4d41ifvA== +-----END PRIVATE KEY----- diff --git a/tests/embedded_server/ca_user_key.pub b/tests/embedded_server/ca_user_key.pub new file mode 100644 index 0000000..e63433f --- /dev/null +++ b/tests/embedded_server/ca_user_key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQClYv7851Sl96qxb2VV8rbhqhpSmLD+VUvKjj4aMjFgunw8HA9BOUu5kuPLo7LWzZN1brTv0JB9xbcCvmNdzhHKEBsP4F3xp20vCz2EKivjGIJkFiPyn/xAZvlfA0rvoXyzwCekiFJqhrEsSpiHDk4jL9CImStcOhm/ZLXTjZL2aa+A2DSE4JFAXvpvuTbw68JSujCPWsNNyqydQNXpWkHoqI/Lo/dtXX1jYoD4zmwEqN++VwNIdANazQpABBkcVQfwVtcHvYptA9Pq4HhrTPA59Pv63yPb7/fL7F2CfKCW+sb+yRGY6U81vXVG+jRMhrcPTY6SIXqW43P0qhGW6NWswn1k5sLvpYHdRTyDdC1uwBVVQJ9kO/QP4SnXklfMVzuFIxt5BhM4dXwlPDuJcJG1rXUfXIAWtZJd/LCcyp+xKsJxgjTIitDevNRxzfkRkijryzUgfZHh27557ztoubl3NuLKf+cWcdLzBkeGpNNHCE+tqVueuBqiUqPttE6LSx0= zefrer@kirin diff --git a/tests/embedded_server/openssh.py b/tests/embedded_server/openssh.py index c3f2854..23aeec7 100644 --- a/tests/embedded_server/openssh.py +++ b/tests/embedded_server/openssh.py @@ -16,6 +16,9 @@ import os import socket +import pwd +import random +import string from subprocess import Popen from time import sleep from sys import version_info @@ -25,10 +28,12 @@ DIR_NAME = os.path.dirname(__file__) PDIR_NAME = os.path.dirname(DIR_NAME) PPDIR_NAME = os.path.dirname(PDIR_NAME) -SERVER_KEY = os.path.abspath(os.path.sep.join([DIR_NAME, 'rsa.key'])) +SERVER_KEY = os.path.abspath(os.path.sep.join([DIR_NAME, 'ca_host_key'])) SSHD_CONFIG_TMPL = os.path.abspath(os.path.sep.join( [DIR_NAME, 'sshd_config.tmpl'])) SSHD_CONFIG = os.path.abspath(os.path.sep.join([DIR_NAME, 'sshd_config'])) +PRINCIPALS_TMPL = os.path.abspath(os.path.sep.join([DIR_NAME, 'principals.tmpl'])) +PRINCIPALS = os.path.abspath(os.path.sep.join([DIR_NAME, 'principals'])) class OpenSSHServer(object): @@ -37,6 +42,8 @@ def __init__(self, port=2222): self.port = port self.server_proc = None self._fix_masks() + self.random_server = ''.join(random.choice(string.ascii_lowercase + string.digits) + for _ in range(8)) self.make_config() def _fix_masks(self): @@ -47,12 +54,19 @@ def _fix_masks(self): os.chmod(_dir, dir_mask) def make_config(self): + user = pwd.getpwuid(os.geteuid()).pw_name with open(SSHD_CONFIG_TMPL) as fh: tmpl = fh.read() template = Template(tmpl) with open(SSHD_CONFIG, 'w') as fh: fh.write(template.render(parent_dir=os.path.abspath(DIR_NAME))) fh.write(os.linesep) + with open(PRINCIPALS_TMPL) as fh: + _princ_tmpl = fh.read() + princ_tmpl = Template(_princ_tmpl) + with open(PRINCIPALS, 'w') as fh: + fh.write(princ_tmpl.render(user=user)) + fh.write(os.linesep) def start_server(self): cmd = ['/usr/sbin/sshd', '-D', '-p', str(self.port), @@ -75,3 +89,4 @@ def stop(self): def __del__(self): self.stop() os.unlink(SSHD_CONFIG) + os.unlink(PRINCIPALS) diff --git a/tests/embedded_server/principals.tmpl b/tests/embedded_server/principals.tmpl new file mode 100644 index 0000000..846c4f2 --- /dev/null +++ b/tests/embedded_server/principals.tmpl @@ -0,0 +1 @@ +{{user}} diff --git a/tests/embedded_server/sshd_config.tmpl b/tests/embedded_server/sshd_config.tmpl index eaf40ab..b636d2c 100644 --- a/tests/embedded_server/sshd_config.tmpl +++ b/tests/embedded_server/sshd_config.tmpl @@ -3,7 +3,12 @@ UsePAM no HostbasedAuthentication no IgnoreUserKnownHosts yes ListenAddress 127.0.0.1 +HostKey {{parent_dir}}/ca_host_key +HostCertificate {{parent_dir}}/ca_host_key-cert.pub +TrustedUserCAKeys {{parent_dir}}/ca_user_key.pub +AuthorizedPrincipalsFile {{parent_dir}}/principals AcceptEnv LANG LC_* Subsystem sftp internal-sftp AuthorizedKeysFile {{parent_dir}}/authorized_keys +PidFile {{parent_dir}}/{{random_server}}.pid diff --git a/tests/test_session.py b/tests/test_session.py index 27435f0..e7d1ed9 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -17,11 +17,14 @@ import unittest import socket import os +import base64 from select import select from ssh.session import Session, SSH_AUTH_AGAIN, SSH_READ_PENDING, SSH_WRITE_PENDING from ssh.channel import Channel -from ssh.key import SSHKey, import_pubkey_file, import_privkey_file +from ssh.key import SSHKey, import_pubkey_file, import_privkey_file, import_cert_file, \ + import_cert_base64, copy_cert_to_privkey +from ssh.keytypes import RSACert01Key from ssh import options from ssh.exceptions import KeyImportError, InvalidAPIUse, \ AuthenticationDenied @@ -117,6 +120,33 @@ def test_key_auth(self): self.assertEqual( self.session.userauth_publickey(pkey), 0) + def test_cert_auth(self): + self.assertEqual(self.session.connect(), 0) + cert_key = import_cert_file(self.user_cert_file) + self.assertIsInstance(cert_key, SSHKey) + key_type = cert_key.key_type() + self.assertIsInstance(key_type, RSACert01Key) + cert_priv_key = import_privkey_file(self.user_ca_key) + copy_cert_to_privkey(cert_key, cert_priv_key) + self.assertEqual(self.session.userauth_try_publickey(cert_key), 0) + self.assertEqual(self.session.userauth_publickey(cert_priv_key), 0) + chan = self.session.channel_new() + self.assertIsInstance(chan, Channel) + + def test_cert_imports(self): + self.assertRaises(KeyImportError, import_cert_file, self.user_key) + priv_key = SSHKey() + cert_key = import_cert_file(self.user_cert_file) + self.assertRaises(KeyImportError, copy_cert_to_privkey, cert_key, priv_key) + with open(self.user_cert_file, 'rb') as fh: + cert_key_data = base64.b64encode(fh.read()) + # cert_key_data = fh.read() + rsa_cert = RSACert01Key() + self.assertIsNotNone(rsa_cert.value) + # Failing + # cert_key_b64 = import_cert_base64(cert_key_data, rsa_cert) + # self.assertIsInstance(cert_key_b64.key_type(), RSACert01Key) + def test_open_channel(self): self._auth() chan = self.session.channel_new() diff --git a/tests/unit_test_cert_key b/tests/unit_test_cert_key new file mode 100644 index 0000000..49c521c --- /dev/null +++ b/tests/unit_test_cert_key @@ -0,0 +1,40 @@ +-----BEGIN PRIVATE KEY----- +MIIG/AIBADANBgkqhkiG9w0BAQEFAASCBuYwggbiAgEAAoIBgQCzmJ3mpB2ZnQfN +hJ7qfSMmBWGVADgkRwME8oIcJW6Szpk8jkt+p8QjjKC0RJYjwh2zy4mXKe8yYS2q +BaobDFt1/tyoBnBVcyZc2Fu7kM/JRLYVhbIuiiL60o+28bPY0To77ZpHbvZOjQSb +PdSwxex5JyG9Q0NbryrVWoXZtQU4xYEk3sy1vj3J5GD4/kHK2uxno3xNVbtc/+4b +YVcDHPqRhA6YQdjMWXV2hr5GJUcm5kZVqtbtXBeAVpb/CwTmypGmxAStqk5AzXoI +K2fSlG5QzMOci0DqyK51V3kg6j78Or9JIZ7laLZiPI1U/kDxfMNiGljgnTjqRKTc +UaClkBglfqSXzkaSGKkvCARzhM9EKprvsOtrS7NUGS3wPkS1I3RmmDppscdKZjv6 +bpcz6bbbgb9DUK4Ygh+5mOeFcXqFKdwSAkbcRbhOeBEVbuwqNyRGt8gbHcOiejJd +9VOu1TWdLTYEho9je97qZu4UZvqYBNAl4ly+fnMciXcrs3JrMAUCAwEAAQKCAYBv +whLQSWQaCTunylVRudk7ebHFlMNa382jMH2ColByjpmQs0OLZz6ImKQQSXXcfpkZ +HxlZtcChaxONb8Tw2/m2LYiGDqusoOFIeWJsD6sdpeJg9jdw+ojV6F2CDFpMG7bP +QAX3WbdwHhS1vf4ympeStKUsL0UlMpXG+nO8jAbZ0x2QIgzlM6MjlTg6+Y1bfGwL ++hIJ1cWoE6LJ6wLIbyoFj1W9rYwJbcnIngSdhekG7djqykrAncQKGtgPkX3VWEvL +gcNmRedVxBZ9yuNQUl3lJn80eLHT+cvA1F2Oo7GBN+hst8B9ctENPPxDwCcuj7aZ +hw/L2PDJAH+mi2XYecudGLy6BlddWZ8Cd2YEFuJCX2n/kEBbkK5OhW/DmYTP8tMz +JOEFYxGReFpXUistD1GYSr4xMcAi7fJCW0ZOk9MgtUcrKGR7MRt9n1TYLsqilRTj +58H+/Ny53GyW+nGMAw3TDPzBHhzcdYmR7V2NKhFEDSGRLCyd+HwYs9Ub3GuheEEC +gcEA4KfjGFx8sJ+zdMnzeoLT/Id3aVcezGL2TD5b1NMziv1/WQOUo06NjY7umKT7 +UcTfx4YQHafutfStjm4itkHyQwcqOZ6rIz45m7LBNcrceNciIOzc8i5LuDW5qu9S +9nQvIfqqrFwUwSy6Ip9BxWX1GjflaXhC5djC591e0ZsBGvJ2jJqUSa3Nf0qGSKpB +6cVdnXD99/J+oTw5P37aifWzYcmo+vKxzEfHk+SbBjez6lHLCsBSZ5hSVTr7XIQ9 +VpedAoHBAMynUWDRV7XyUNCQHOGhjVNged4PK7gBNZOfbuh5a9sKSwULcG6mba38 +HUGGXLHXazkR8nF5ddTwnC09fjykwuYeLbR6syaIZu/7rs/Rb5Dsn2Tt6fcxmxZv +ZebdbGTIotmTJxh+KtSXE9eOPDblFpawUXifjQDII45XtWKVd/fBAgLNgTXxgJSh +fj+U+kp9Z6Rjg9ovGbmJKNe2G+YCNeZNMUaGSBzLReGLgU2Wa/CP+FLTnQan5QlY +EF6MQJsxiQKBwFfC/kJMDyHooXBkXEtlxG6IdSufrxZlKpaKXdF8WExZz1/0uCI7 +06yTQ7455TwCTvFg+/a53dUTKqHTgJf2ly98IxCzXWO9MUATysq63voOAPUf0wiA +8W+a/Vc7ewtwQ+FgTUBcEHeOg4B2+nik5eVCJMrZAjlMPofZwOrdRMdEJO+0i21l +CjxJ3r+QU4OBaJrSw0QTZUiTgEG/ypvOci8nWm3+VVraR6sMyUrag9xr64fdrdNu +e+tzyTJRLq0fOQKBwD/tpEYSHsv/Pa9o1RzGUldRM8BiDM4V0p6ilwqXo1FxDa4t +vJlT8779mkX1qs8C88OID6vSvTQfVSnso5pd/WPU2YIfMgc/ZKhifmD8k1U6FTB6 +ATPukvuXIMXVNR7mbbh5dyT3hHmUF+alz7l2JnA787cyX+F2o2S7kTWSaz9BU1d8 +yngHUJsdN0q1RtouAkofq/hj7i0+4zs+78gRuLSQOGxHVg9okBO8eE+8RUuILZHx ++IMzvyAEGljuht/zwQKBwCmaeZFIjU0dWIwAhpgn4lFUv8g21IO/UGOpValb/PwC +Tm3qfjvWsFwGGSdkbTzEpujxkBOEGE74lcOB+KvHFrJYAmN5FQga9MDpm06YnnYY +SuRxdWLUA5hl07IpIUbM6UbljBf1KTXrNqiZ510DecG9nwLvSFUjusFvOO9cuQOa +lK2VOnY/EyeTliLViiCIZc6vDuL/AErDwE9VQ/SVB97DBxfH+PmKsQtK6sYt1FnS +5ktKCvrdoVH/G/1yz78Tog== +-----END PRIVATE KEY----- diff --git a/tests/unit_test_cert_key.pub b/tests/unit_test_cert_key.pub new file mode 100644 index 0000000..ac403bd --- /dev/null +++ b/tests/unit_test_cert_key.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzmJ3mpB2ZnQfNhJ7qfSMmBWGVADgkRwME8oIcJW6Szpk8jkt+p8QjjKC0RJYjwh2zy4mXKe8yYS2qBaobDFt1/tyoBnBVcyZc2Fu7kM/JRLYVhbIuiiL60o+28bPY0To77ZpHbvZOjQSbPdSwxex5JyG9Q0NbryrVWoXZtQU4xYEk3sy1vj3J5GD4/kHK2uxno3xNVbtc/+4bYVcDHPqRhA6YQdjMWXV2hr5GJUcm5kZVqtbtXBeAVpb/CwTmypGmxAStqk5AzXoIK2fSlG5QzMOci0DqyK51V3kg6j78Or9JIZ7laLZiPI1U/kDxfMNiGljgnTjqRKTcUaClkBglfqSXzkaSGKkvCARzhM9EKprvsOtrS7NUGS3wPkS1I3RmmDppscdKZjv6bpcz6bbbgb9DUK4Ygh+5mOeFcXqFKdwSAkbcRbhOeBEVbuwqNyRGt8gbHcOiejJd9VOu1TWdLTYEho9je97qZu4UZvqYBNAl4ly+fnMciXcrs3JrMAU= zefrer@kirin