summaryrefslogtreecommitdiff
path: root/auth-rh-rsa.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 /auth-rh-rsa.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 'auth-rh-rsa.c')
-rw-r--r--auth-rh-rsa.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c
index 2e20396e..057335ba 100644
--- a/auth-rh-rsa.c
+++ b/auth-rh-rsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-rh-rsa.c,v 1.44 2014/07/15 15:54:14 millert Exp $ */
+/* $OpenBSD: auth-rh-rsa.c,v 1.45 2016/03/07 19:02:43 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -42,8 +42,8 @@
extern ServerOptions options;
int
-auth_rhosts_rsa_key_allowed(struct passwd *pw, char *cuser, char *chost,
- Key *client_host_key)
+auth_rhosts_rsa_key_allowed(struct passwd *pw, const char *cuser,
+ const char *chost, Key *client_host_key)
{
HostStatus host_status;
@@ -68,7 +68,8 @@ auth_rhosts_rsa_key_allowed(struct passwd *pw, char *cuser, char *chost,
int
auth_rhosts_rsa(Authctxt *authctxt, char *cuser, Key *client_host_key)
{
- char *chost;
+ struct ssh *ssh = active_state; /* XXX */
+ const char *chost;
struct passwd *pw = authctxt->pw;
debug("Trying rhosts with RSA host authentication for client user %.100s",
@@ -78,7 +79,7 @@ auth_rhosts_rsa(Authctxt *authctxt, char *cuser, Key *client_host_key)
client_host_key->rsa == NULL)
return 0;
- chost = (char *)get_canonical_hostname(options.use_dns);
+ chost = auth_get_canonical_hostname(ssh, options.use_dns);
debug("Rhosts RSA authentication: canonical host %.900s", chost);
if (!PRIVSEP(auth_rhosts_rsa_key_allowed(pw, cuser, chost, client_host_key))) {