summaryrefslogtreecommitdiff
path: root/auth2-hostbased.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-01-19 21:43:56 +0000
committerDamien Miller <djm@mindrot.org>2019-01-20 09:45:18 +1100
commit04c091fc199f17dacf8921df0a06634b454e2722 (patch)
tree76b75b5cf39f940bfc418fa7fe6e9ae3dc5c2569 /auth2-hostbased.c
parentec00f918b8ad90295044266c433340a8adc93452 (diff)
upstream: remove last references to active_state
with & ok markus@ OpenBSD-Commit-ID: 78619a50ea7e4ca2f3b54d4658b3227277490ba2
Diffstat (limited to 'auth2-hostbased.c')
-rw-r--r--auth2-hostbased.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index e28a48fb3..0c40fad4e 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-hostbased.c,v 1.39 2019/01/19 21:31:32 djm Exp $ */ 1/* $OpenBSD: auth2-hostbased.c,v 1.40 2019/01/19 21:43:56 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -51,8 +51,6 @@
51#include "ssherr.h" 51#include "ssherr.h"
52#include "match.h" 52#include "match.h"
53 53
54extern struct ssh *active_state; /* XXX */
55
56/* import */ 54/* import */
57extern ServerOptions options; 55extern ServerOptions options;
58extern u_char *session_id2; 56extern u_char *session_id2;
@@ -149,7 +147,8 @@ userauth_hostbased(struct ssh *ssh)
149 147
150 /* test for allowed key and correct signature */ 148 /* test for allowed key and correct signature */
151 authenticated = 0; 149 authenticated = 0;
152 if (PRIVSEP(hostbased_key_allowed(authctxt->pw, cuser, chost, key)) && 150 if (PRIVSEP(hostbased_key_allowed(ssh, authctxt->pw, cuser,
151 chost, key)) &&
153 PRIVSEP(sshkey_verify(key, sig, slen, 152 PRIVSEP(sshkey_verify(key, sig, slen,
154 sshbuf_ptr(b), sshbuf_len(b), pkalg, ssh->compat)) == 0) 153 sshbuf_ptr(b), sshbuf_len(b), pkalg, ssh->compat)) == 0)
155 authenticated = 1; 154 authenticated = 1;
@@ -169,10 +168,9 @@ done:
169 168
170/* return 1 if given hostkey is allowed */ 169/* return 1 if given hostkey is allowed */
171int 170int
172hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, 171hostbased_key_allowed(struct ssh *ssh, struct passwd *pw,
173 struct sshkey *key) 172 const char *cuser, char *chost, struct sshkey *key)
174{ 173{
175 struct ssh *ssh = active_state; /* XXX */
176 const char *resolvedname, *ipaddr, *lookup, *reason; 174 const char *resolvedname, *ipaddr, *lookup, *reason;
177 HostStatus host_status; 175 HostStatus host_status;
178 int len; 176 int len;