blob: 346bcd9ba54cb429f6d50613450868bce3a7fd04 [file] [log] [blame]
Ben Lindstrom31ca54a2001-02-09 02:11:24 +00001/* $OpenBSD: hostfile.h,v 1.7 2001/02/08 19:30:51 itojun Exp $ */
Ben Lindstrom36579d32001-01-29 07:39:26 +00002
Damien Millere4340be2000-09-16 13:29:08 +11003/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
5 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 * All rights reserved
7 *
8 * As far as I am concerned, the code I have written for this software
9 * can be used freely for any purpose. Any derived versions of this
10 * software must be clearly marked as such, and if the derived work is
11 * incompatible with the protocol description in the RFC file, it must be
12 * called by a name other than "ssh" or "Secure Shell".
13 */
Damien Miller450a7a12000-03-26 13:04:51 +100014#ifndef HOSTFILE_H
15#define HOSTFILE_H
16
Ben Lindstrom31ca54a2001-02-09 02:11:24 +000017int
18auth_rsa_read_key(char **cpp, u_int *bitsp, BIGNUM * e, BIGNUM * n);
19
Damien Miller450a7a12000-03-26 13:04:51 +100020/*
21 * Checks whether the given host is already in the list of our known hosts.
22 * Returns HOST_OK if the host is known and has the specified key, HOST_NEW
23 * if the host is not known, and HOST_CHANGED if the host is known but used
24 * to have a different host key. The host must be in all lowercase.
25 */
26typedef enum {
27 HOST_OK, HOST_NEW, HOST_CHANGED
28} HostStatus;
Ben Lindstrom46c16222000-12-22 01:43:59 +000029
Damien Miller4af51302000-04-16 11:18:38 +100030HostStatus
Ben Lindstrom46c16222000-12-22 01:43:59 +000031check_host_in_hostfile(const char *filename, const char *host, Key *key,
32 Key *found, int *line);
Damien Miller450a7a12000-03-26 13:04:51 +100033
34/*
35 * Appends an entry to the host file. Returns false if the entry could not
36 * be appended.
37 */
38int add_host_to_hostfile(const char *filename, const char *host, Key *key);
39
40#endif