18 HOST_OK, HOST_NEW, HOST_CHANGED, HOST_REVOKED, HOST_FOUND
22 MRK_ERROR, MRK_NONE, MRK_REVOKE, MRK_CA
25 struct hostkey_entry {
34 struct hostkey_entry *entries;
38 struct hostkeys *init_hostkeys(
void);
39 void load_hostkeys(
struct hostkeys *,
const char *,
41 void load_hostkeys_file(
struct hostkeys *,
const char *,
42 const char *, FILE *, u_int note);
43 void free_hostkeys(
struct hostkeys *);
45 HostStatus check_key_in_hostkeys(
struct hostkeys *,
struct sshkey *,
46 const struct hostkey_entry **);
47 int lookup_key_in_hostkeys_by_type(
struct hostkeys *,
int,
int,
48 const struct hostkey_entry **);
49 int lookup_marker_in_hostkeys(
struct hostkeys *,
int);
51 int hostfile_read_key(
char **, u_int *,
struct sshkey *);
52 int add_host_to_hostfile(
const char *,
const char *,
53 const struct sshkey *,
int);
55 int hostfile_replace_entries(
const char *filename,
56 const char *host,
const char *ip,
struct sshkey **keys,
size_t nkeys,
57 int store_hash,
int quiet,
int hash_alg);
59 #define HASH_MAGIC "|1|"
60 #define HASH_DELIM '|'
62 #define CA_MARKER "@cert-authority"
63 #define REVOKE_MARKER "@revoked"
65 char *host_hash(
const char *,
const char *, u_int);
72 #define HKF_WANT_MATCH (1)
73 #define HKF_WANT_PARSE_KEY (1<<1)
75 #define HKF_STATUS_OK 0
76 #define HKF_STATUS_INVALID 1
77 #define HKF_STATUS_COMMENT 2
78 #define HKF_STATUS_MATCHED 3
80 #define HKF_MATCH_HOST (1)
81 #define HKF_MATCH_IP (1<<1)
82 #define HKF_MATCH_HOST_HASHED (1<<2)
83 #define HKF_MATCH_IP_HASHED (1<<3)
91 struct hostkey_foreach_line {
111 typedef int hostkeys_foreach_fn(
struct hostkey_foreach_line *l,
void *ctx);
114 int hostkeys_foreach(
const char *path,
115 hostkeys_foreach_fn *callback,
void *ctx,
116 const char *host,
const char *ip, u_int options, u_int note);
117 int hostkeys_foreach_file(
const char *path, FILE *f,
118 hostkeys_foreach_fn *callback,
void *ctx,
119 const char *host,
const char *ip, u_int options, u_int note);
121 void hostfile_create_user_ssh_dir(
const char *,
int);