mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Public key auth no longer need to be blocking (libssh 0.6)
This commit is contained in:
parent
05de59d106
commit
864124f4c0
@ -47,18 +47,6 @@ static void register_input_stream_event(struct tmate_ssh_client *client)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __ssh_userauth_autopubkey(ssh_session session, const char *passphrase)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* For some reason, auth doesn't work in blocking mode :( */
|
|
||||||
ssh_set_blocking(session, 1);
|
|
||||||
ret = ssh_userauth_autopubkey(session, passphrase);
|
|
||||||
ssh_set_blocking(session, 0);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void consume_channel(struct tmate_ssh_client *client)
|
static void consume_channel(struct tmate_ssh_client *client)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
@ -134,7 +122,7 @@ static void on_session_event(struct tmate_ssh_client *client)
|
|||||||
/* TODO Authenticate server */
|
/* TODO Authenticate server */
|
||||||
|
|
||||||
case SSH_AUTH:
|
case SSH_AUTH:
|
||||||
switch (__ssh_userauth_autopubkey(session, NULL)) {
|
switch (ssh_userauth_autopubkey(session, NULL)) {
|
||||||
case SSH_AUTH_AGAIN:
|
case SSH_AUTH_AGAIN:
|
||||||
return;
|
return;
|
||||||
case SSH_AUTH_PARTIAL:
|
case SSH_AUTH_PARTIAL:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user