summaryrefslogtreecommitdiff
path: root/auth2-hostbased.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2016-03-07 19:02:43 +0000
committerDamien Miller <djm@mindrot.org>2016-03-08 06:20:35 +1100
commit95767262caa6692eff1e1565be1f5cb297949a89 (patch)
tree1055360a328d0998dabb966f2e1002389f8c6c41 /auth2-hostbased.c
parentaf0bb38ffd1f2c4f9f43b0029be2efe922815255 (diff)
upstream commit
refactor canohost.c: move functions that cache results closer to the places that use them (authn and session code). After this, no state is cached in canohost.c feedback and ok markus@ Upstream-ID: 5f2e4df88d4803fc8ec59ec53629105e23ce625e
Diffstat (limited to 'auth2-hostbased.c')
-rw-r--r--auth2-hostbased.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index e2327cf77..1b3c3b202 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth2-hostbased.c,v 1.25 2015/05/04 06:10:48 djm Exp $ */ 1/* $OpenBSD: auth2-hostbased.c,v 1.26 2016/03/07 19:02:43 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -160,6 +160,7 @@ int
160hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost, 160hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost,
161 Key *key) 161 Key *key)
162{ 162{
163 struct ssh *ssh = active_state; /* XXX */
163 const char *resolvedname, *ipaddr, *lookup, *reason; 164 const char *resolvedname, *ipaddr, *lookup, *reason;
164 HostStatus host_status; 165 HostStatus host_status;
165 int len; 166 int len;
@@ -168,8 +169,8 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost,
168 if (auth_key_is_revoked(key)) 169 if (auth_key_is_revoked(key))
169 return 0; 170 return 0;
170 171
171 resolvedname = get_canonical_hostname(options.use_dns); 172 resolvedname = auth_get_canonical_hostname(ssh, options.use_dns);
172 ipaddr = get_remote_ipaddr(); 173 ipaddr = ssh_remote_ipaddr(ssh);
173 174
174 debug2("%s: chost %s resolvedname %s ipaddr %s", __func__, 175 debug2("%s: chost %s resolvedname %s ipaddr %s", __func__,
175 chost, resolvedname, ipaddr); 176 chost, resolvedname, ipaddr);