version 1.45, 2021/01/26 05:32:21 |
version 1.46, 2021/01/27 10:05:28 |
|
|
#include "xmalloc.h" |
#include "xmalloc.h" |
#include "ssh2.h" |
#include "ssh2.h" |
#include "packet.h" |
#include "packet.h" |
|
#include "kex.h" |
#include "sshbuf.h" |
#include "sshbuf.h" |
#include "log.h" |
#include "log.h" |
#include "misc.h" |
#include "misc.h" |
|
|
|
|
/* import */ |
/* import */ |
extern ServerOptions options; |
extern ServerOptions options; |
extern u_char *session_id2; |
|
extern u_int session_id2_len; |
|
|
|
static int |
static int |
userauth_hostbased(struct ssh *ssh) |
userauth_hostbased(struct ssh *ssh) |
|
|
if ((b = sshbuf_new()) == NULL) |
if ((b = sshbuf_new()) == NULL) |
fatal_f("sshbuf_new failed"); |
fatal_f("sshbuf_new failed"); |
/* reconstruct packet */ |
/* reconstruct packet */ |
if ((r = sshbuf_put_string(b, session_id2, session_id2_len)) != 0 || |
if ((r = sshbuf_put_stringb(b, ssh->kex->session_id)) != 0 || |
(r = sshbuf_put_u8(b, SSH2_MSG_USERAUTH_REQUEST)) != 0 || |
(r = sshbuf_put_u8(b, SSH2_MSG_USERAUTH_REQUEST)) != 0 || |
(r = sshbuf_put_cstring(b, authctxt->user)) != 0 || |
(r = sshbuf_put_cstring(b, authctxt->user)) != 0 || |
(r = sshbuf_put_cstring(b, authctxt->service)) != 0 || |
(r = sshbuf_put_cstring(b, authctxt->service)) != 0 || |