|
| 1 | +# This file is part of ssh-python. |
| 2 | +# Copyright (C) 2018 Panos Kittenis |
| 3 | +# |
| 4 | +# This library is free software; you can redistribute it and/or |
| 5 | +# modify it under the terms of the GNU Lesser General Public |
| 6 | +# License as published by the Free Software Foundation, version 2.1. |
| 7 | +# |
| 8 | +# This library is distributed in the hope that it will be useful, |
| 9 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | +# Lesser General Public License for more details. |
| 12 | +# |
| 13 | +# You should have received a copy of the GNU Lesser General Public |
| 14 | +# License along with this library; if not, write to the Free Software |
| 15 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130 |
| 16 | + |
| 17 | +from c_ssh cimport ssh_session, ssh_string, ssh_message, uint32_t, ssh_keytypes_e |
| 18 | +from c_keys cimport ssh_private_key_struct, ssh_public_key_struct |
| 19 | + |
| 20 | +cdef extern from "libssh/include/legacy.h" nogil: |
| 21 | + ctypedef ssh_private_key_struct* ssh_private_key |
| 22 | + ctypedef ssh_public_key_struct* ssh_public_key |
| 23 | + int ssh_auth_list(ssh_session session) |
| 24 | + int ssh_userauth_offer_pubkey(ssh_session session, const char *username, |
| 25 | + int type, ssh_string publickey) |
| 26 | + int ssh_userauth_pubkey(ssh_session session, const char *username, |
| 27 | + ssh_string publickey, ssh_private_key privatekey) |
| 28 | + # IF not _WIN32: |
| 29 | + int ssh_userauth_agent_pubkey(ssh_session session, const char *username, |
| 30 | + ssh_public_key publickey) |
| 31 | + int ssh_userauth_autopubkey(ssh_session session, const char *passphrase) |
| 32 | + int ssh_userauth_privatekey_file(ssh_session session, const char *username, |
| 33 | + const char *filename, const char *passphrase) |
| 34 | + void privatekey_free(ssh_private_key prv) |
| 35 | + ssh_private_key privatekey_from_file(ssh_session session, const char *filename, |
| 36 | + int type, const char *passphrase) |
| 37 | + void publickey_free(ssh_public_key key) |
| 38 | + int ssh_publickey_to_file(ssh_session session, const char *file, |
| 39 | + ssh_string pubkey, int type) |
| 40 | + ssh_string publickey_from_file(ssh_session session, const char *filename, |
| 41 | + int *type) |
| 42 | + ssh_public_key publickey_from_privatekey(ssh_private_key prv) |
| 43 | + ssh_string publickey_to_string(ssh_public_key key) |
| 44 | + int ssh_try_publickey_from_file(ssh_session session, const char *keyfile, |
| 45 | + ssh_string *publickey, int *type) |
| 46 | + ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey) |
| 47 | + ssh_string ssh_get_pubkey(ssh_session session) |
| 48 | + ssh_message ssh_message_retrieve(ssh_session session, uint32_t packettype) |
| 49 | + ssh_public_key ssh_message_auth_publickey(ssh_message msg) |
0 commit comments