summaryrefslogtreecommitdiffstats
path: root/auth2-hostbased.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-01-27 10:05:28 +0000
committerDamien Miller <djm@mindrot.org>2021-01-27 21:10:57 +1100
commit39be3dc209f28f9c1ebfeba42adde8963b01e1cd (patch)
treed40c854a19626434deaf3b6e1706517ae234827f /auth2-hostbased.c
parent4ca6a1fac328477c642329676d6469dba59019a3 (diff)
upstream: make ssh->kex->session_id a sshbuf instead of u_char*/size_t
and use that instead of global variables containing copies of it. feedback/ok markus@ OpenBSD-Commit-ID: a4b1b1ca4afd2e37cb9f64f737b30a6a7f96af68
Diffstat (limited to 'auth2-hostbased.c')
-rw-r--r--auth2-hostbased.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index 3bc799c4..002e7e4e 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-hostbased.c,v 1.45 2021/01/26 05:32:21 dtucker Exp $ */
+/* $OpenBSD: auth2-hostbased.c,v 1.46 2021/01/27 10:05:28 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -35,6 +35,7 @@
#include "xmalloc.h"
#include "ssh2.h"
#include "packet.h"
+#include "kex.h"
#include "sshbuf.h"
#include "log.h"
#include "misc.h"
@@ -54,8 +55,6 @@
/* import */
extern ServerOptions options;
-extern u_char *session_id2;
-extern u_int session_id2_len;
static int
userauth_hostbased(struct ssh *ssh)
@@ -129,7 +128,7 @@ userauth_hostbased(struct ssh *ssh)
if ((b = sshbuf_new()) == NULL)
fatal_f("sshbuf_new failed");
/* 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_cstring(b, authctxt->user)) != 0 ||
(r = sshbuf_put_cstring(b, authctxt->service)) != 0 ||