Skip to content

Commit cac5352

Browse files
author
Pan
committed
Added auth definition file.
1 parent 3782a46 commit cac5352

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

ssh/c_auth.pxd

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
# cimport c_callbacks
18+
19+
from c_ssh cimport uint32_t
20+
21+
cdef extern from "libssh/include/auth.h" nogil:
22+
struct ssh_kbdint_struct:
23+
uint32_t nprompts
24+
uint32_t nanswers
25+
char *name
26+
char *instruction
27+
char **prompts
28+
unsigned char *echo
29+
char **answers
30+
ctypedef ssh_kbdint_struct *ssh_kbdint
31+
ssh_kbdint ssh_kbdint_new();
32+
void ssh_kbdint_clean(ssh_kbdint kbd)
33+
void ssh_kbdint_free(ssh_kbdint kbd)
34+
enum ssh_auth_state_e:
35+
SSH_AUTH_STATE_NONE
36+
SSH_AUTH_STATE_PARTIAL
37+
SSH_AUTH_STATE_SUCCESS
38+
SSH_AUTH_STATE_FAILED
39+
SSH_AUTH_STATE_ERROR
40+
SSH_AUTH_STATE_INFO
41+
SSH_AUTH_STATE_PK_OK
42+
SSH_AUTH_STATE_KBDINT_SENT
43+
SSH_AUTH_STATE_GSSAPI_REQUEST_SENT
44+
SSH_AUTH_STATE_GSSAPI_TOKEN
45+
SSH_AUTH_STATE_GSSAPI_MIC_SENT
46+
enum ssh_auth_service_state_e:
47+
SSH_AUTH_SERVICE_NONE
48+
SSH_AUTH_SERVICE_SENT
49+
SSH_AUTH_SERVICE_ACCEPTED
50+
SSH_AUTH_SERVICE_DENIED
51+
SSH_AUTH_SERVICE_USER_SENT

ssh/ssh.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717

1818
cimport c_ssh
1919
cimport c_agent
20+
cimport c_auth

0 commit comments

Comments
 (0)