mirror of
https://github.com/libssh2/libssh2.git
synced 2025-08-07 08:02:56 +03:00
Add callback-based API for publickey auth.
Signed-off-by: Simon Josefsson <simon@josefsson.org>
This commit is contained in:
committed by
Simon Josefsson
parent
0a3b350012
commit
58abc7e30b
@@ -178,6 +178,11 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE
|
||||
unsigned int length;
|
||||
} LIBSSH2_USERAUTH_KBDINT_RESPONSE;
|
||||
|
||||
/* 'publickey' authentication callback */
|
||||
#define LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC(name) \
|
||||
int name(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, \
|
||||
const unsigned char *data, size_t data_len, void **abstract)
|
||||
|
||||
/* 'keyboard-interactive' authentication callback */
|
||||
#define LIBSSH2_USERAUTH_KBDINT_RESPONSE_FUNC(name_) \
|
||||
void name_(const char* name, int name_len, const char* instruction, \
|
||||
@@ -436,6 +441,14 @@ libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session,
|
||||
strlen(username), (publickey), \
|
||||
(privatekey), (passphrase))
|
||||
|
||||
LIBSSH2_API int
|
||||
libssh2_userauth_publickey(LIBSSH2_SESSION *session,
|
||||
const char *username,
|
||||
const unsigned char *pubkeydata,
|
||||
size_t pubkeydata_len,
|
||||
LIBSSH2_USERAUTH_PUBLICKEY_SIGN_FUNC((*sign_callback)),
|
||||
void **abstract);
|
||||
|
||||
LIBSSH2_API int
|
||||
libssh2_userauth_hostbased_fromfile_ex(LIBSSH2_SESSION *session,
|
||||
const char *username,
|
||||
|
Reference in New Issue
Block a user