summaryrefslogtreecommitdiff
path: root/hostfile.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-12-01 12:21:51 +1100
committerDamien Miller <djm@mindrot.org>2010-12-01 12:21:51 +1100
commitd925dcd8a5d1a3070061006788352bed93260582 (patch)
tree12f78195086ff506d0f4e4c39098d675cdae0ee9 /hostfile.h
parent03c0e533de56a1fc55ec1885d35c3197fdefbf94 (diff)
- djm@cvs.openbsd.org 2010/11/29 23:45:51
[auth.c hostfile.c hostfile.h ssh.c ssh_config.5 sshconnect.c] [sshconnect.h sshconnect2.c] automatically order the hostkeys requested by the client based on which hostkeys are already recorded in known_hosts. This avoids hostkey warnings when connecting to servers with new ECDSA keys that are preferred by default; with markus@
Diffstat (limited to 'hostfile.h')
-rw-r--r--hostfile.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/hostfile.h b/hostfile.h
index 1d460c1a9..d84d422ff 100644
--- a/hostfile.h
+++ b/hostfile.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: hostfile.h,v 1.18 2010/03/04 10:36:03 djm Exp $ */ 1/* $OpenBSD: hostfile.h,v 1.19 2010/11/29 23:45:51 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -18,12 +18,30 @@ typedef enum {
18 HOST_OK, HOST_NEW, HOST_CHANGED, HOST_REVOKED, HOST_FOUND 18 HOST_OK, HOST_NEW, HOST_CHANGED, HOST_REVOKED, HOST_FOUND
19} HostStatus; 19} HostStatus;
20 20
21typedef enum {
22 MRK_ERROR, MRK_NONE, MRK_REVOKE, MRK_CA
23} HostkeyMarker;
24
25struct hostkey_entry {
26 char *host;
27 char *file;
28 u_long line;
29 Key *key;
30 HostkeyMarker marker;
31};
32struct hostkeys;
33
34struct hostkeys *init_hostkeys(void);
35void load_hostkeys(struct hostkeys *, const char *, const char *);
36void free_hostkeys(struct hostkeys *);
37
38HostStatus check_key_in_hostkeys(struct hostkeys *, Key *,
39 const struct hostkey_entry **);
40int lookup_key_in_hostkeys_by_type(struct hostkeys *, int,
41 const struct hostkey_entry **);
42
21int hostfile_read_key(char **, u_int *, Key *); 43int hostfile_read_key(char **, u_int *, Key *);
22HostStatus check_host_in_hostfile(const char *, const char *, 44int add_host_to_hostfile(const char *, const char *, const Key *, int);
23 const Key *, Key *, int *);
24int add_host_to_hostfile(const char *, const char *, const Key *, int);
25int lookup_key_in_hostfile_by_type(const char *, const char *,
26 int, Key *, int *);
27 45
28#define HASH_MAGIC "|1|" 46#define HASH_MAGIC "|1|"
29#define HASH_DELIM '|' 47#define HASH_DELIM '|'