diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-12-21 00:36:51 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-12-21 00:52:28 +0100 |
commit | b4c7cd1185c5dc0593d47eafcc1a34fda569dd1d (patch) | |
tree | efcf7641caaa015124a7b5cfd6622a0791ed0c32 /auth.c | |
parent | upstream: Print client kem key with correct length. (diff) | |
download | openssh-b4c7cd1185c5dc0593d47eafcc1a34fda569dd1d.tar.xz openssh-b4c7cd1185c5dc0593d47eafcc1a34fda569dd1d.zip |
upstream: 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@
OpenBSD-Commit-ID: 6ff6db13ec9ee4edfa658b2c38baad0f505d8c20
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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. * @@ -468,7 +468,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 && @@ -482,7 +482,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); |