diff options
author | djm@openbsd.org <djm@openbsd.org> | 2021-01-27 11:05:28 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2021-01-27 11:10:57 +0100 |
commit | 39be3dc209f28f9c1ebfeba42adde8963b01e1cd (patch) | |
tree | d40c854a19626434deaf3b6e1706517ae234827f /auth2-pubkey.c | |
parent | upstream: remove global variable used to stash compat flags and use the (diff) | |
download | openssh-39be3dc209f28f9c1ebfeba42adde8963b01e1cd.tar.xz openssh-39be3dc209f28f9c1ebfeba42adde8963b01e1cd.zip |
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-pubkey.c')
-rw-r--r-- | auth2-pubkey.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c index 5a24af891..411d2d885 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-pubkey.c,v 1.105 2021/01/26 00:49:30 djm Exp $ */ +/* $OpenBSD: auth2-pubkey.c,v 1.106 2021/01/27 10:05:28 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * @@ -47,6 +47,7 @@ #include "ssh.h" #include "ssh2.h" #include "packet.h" +#include "kex.h" #include "sshbuf.h" #include "log.h" #include "misc.h" @@ -72,8 +73,6 @@ /* import */ extern ServerOptions options; -extern u_char *session_id2; -extern u_int session_id2_len; static char * format_key(const struct sshkey *key) @@ -175,11 +174,11 @@ userauth_pubkey(struct ssh *ssh) if ((b = sshbuf_new()) == NULL) fatal_f("sshbuf_new failed"); if (ssh->compat & SSH_OLD_SESSIONID) { - if ((r = sshbuf_put(b, session_id2, session_id2_len)) != 0) + if ((r = sshbuf_putb(b, ssh->kex->session_id)) != 0) fatal_fr(r, "put old session id"); } else { - if ((r = sshbuf_put_string(b, session_id2, - session_id2_len)) != 0) + if ((r = sshbuf_put_stringb(b, + ssh->kex->session_id)) != 0) fatal_fr(r, "put session id"); } if (!authctxt->valid || authctxt->user == NULL) { |