Skip to content

Commit 33607b2

Browse files
committed
Add callback enum for c_ssh.
Add callback function typedef for keyboard interactive authentication. Add `ctypedef`s for keyboard interactive authentication. Fix keyboard interactive authentication function def in c_ssh. Internally hide that `libssh2_userauth_keyboard_interactive` takes a callback function and not a string...
1 parent d2bbea7 commit 33607b2

12 files changed

+2836
-1605
lines changed

ssh2/agent.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/c_ssh2.pxd

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ cdef extern from "libssh2.h" nogil:
3939
LIBSSH2_HOSTKEY_TYPE_UNKNOWN
4040
LIBSSH2_HOSTKEY_TYPE_RSA
4141
LIBSSH2_HOSTKEY_TYPE_DSS
42+
enum:
43+
LIBSSH2_CALLBACK_IGNORE
44+
LIBSSH2_CALLBACK_DEBUG
45+
LIBSSH2_CALLBACK_DISCONNECT
46+
LIBSSH2_CALLBACK_MACERROR
47+
LIBSSH2_CALLBACK_X11
48+
LIBSSH2_CALLBACK_RECV
49+
LIBSSH2_CALLBACK_SEND
4250
IF EMBEDDED_LIB:
4351
enum:
4452
LIBSSH2_HOSTKEY_HASH_SHA256
@@ -58,6 +66,7 @@ cdef extern from "libssh2.h" nogil:
5866
LIBSSH2_FLAG_SIGPIPE
5967
LIBSSH2_FLAG_COMPRESS
6068

69+
# ctypedef LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC "LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC"
6170
# ctypedef libssh2_uint64_t libssh2_struct_stat_size
6271
ctypedef struct libssh2_struct_stat:
6372
dev_t st_dev
@@ -73,6 +82,13 @@ cdef extern from "libssh2.h" nogil:
7382
time_t st_atime
7483
time_t st_mtime
7584
time_t st_ctime
85+
ctypedef struct LIBSSH2_USERAUTH_KBDINT_PROMPT:
86+
char *text
87+
unsigned int length
88+
unsigned char echo
89+
ctypedef struct LIBSSH2_USERAUTH_KBDINT_RESPONSE:
90+
char *text
91+
unsigned int length
7692
ctypedef struct LIBSSH2_SESSION:
7793
pass
7894
ctypedef struct LIBSSH2_CHANNEL:
@@ -157,7 +173,7 @@ cdef extern from "libssh2.h" nogil:
157173
(void *))
158174
int libssh2_userauth_keyboard_interactive(LIBSSH2_SESSION *session,
159175
const char *username,
160-
const char *password)
176+
(void *))
161177
int libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session,
162178
const char *username,
163179
unsigned int username_len,

ssh2/channel.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/knownhost.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/listener.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ssh2/publickey.c

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)