summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/auth.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2020-12-20 23:36:51 +0000
committerdjm <djm@openbsd.org>2020-12-20 23:36:51 +0000
commit4ac03e1d5c428c2c9ece98da213c4cba80bf5196 (patch)
treefbed8c49ca683002cca45beca328ebb0997bf1af /usr.bin/ssh/auth.c
parentUse regress framework for setup and shorten target names. (diff)
downloadwireguard-openbsd-4ac03e1d5c428c2c9ece98da213c4cba80bf5196.tar.xz
wireguard-openbsd-4ac03e1d5c428c2c9ece98da213c4cba80bf5196.zip
load_hostkeys()/hostkeys_foreach() variants for FILE*
Add load_hostkeys_file() and hostkeys_foreach_file() that accept a FILE* argument instead of opening the file directly. Original load_hostkeys() and hostkeys_foreach() are implemented using these new interfaces. Add a u_int note field to the hostkey_entry and hostkey_foreach_line structs that is passed directly from the load_hostkeys() and hostkeys_foreach() call. This is a lightweight way to annotate results between different invocations of load_hostkeys(). ok markus@
Diffstat (limited to 'usr.bin/ssh/auth.c')
-rw-r--r--usr.bin/ssh/auth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/auth.c b/usr.bin/ssh/auth.c
index 886ec7dca26..c4c23407ea3 100644
--- a/usr.bin/ssh/auth.c
+++ b/usr.bin/ssh/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.149 2020/10/18 11:32:01 djm Exp $ */
+/* $OpenBSD: auth.c,v 1.150 2020/12/20 23:36:51 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -378,7 +378,7 @@ check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host,
const struct hostkey_entry *found;
hostkeys = init_hostkeys();
- load_hostkeys(hostkeys, host, sysfile);
+ load_hostkeys(hostkeys, host, sysfile, 0);
if (userfile != NULL) {
user_hostfile = tilde_expand_filename(userfile, pw->pw_uid);
if (options.strict_modes &&
@@ -392,7 +392,7 @@ check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host,
user_hostfile);
} else {
temporarily_use_uid(pw);
- load_hostkeys(hostkeys, host, user_hostfile);
+ load_hostkeys(hostkeys, host, user_hostfile, 0);
restore_uid();
}
free(user_hostfile);