Damien Miller | 1aed65e | 2010-03-04 21:53:35 +1100 | [diff] [blame] | 1 | /* $OpenBSD: hostfile.h,v 1.18 2010/03/04 10:36:03 djm Exp $ */ |
Ben Lindstrom | 36579d3 | 2001-01-29 07:39:26 +0000 | [diff] [blame] | 2 | |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 3 | /* |
| 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 Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 14 | #ifndef HOSTFILE_H |
| 15 | #define HOSTFILE_H |
| 16 | |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 17 | typedef enum { |
Damien Miller | 1aed65e | 2010-03-04 21:53:35 +1100 | [diff] [blame] | 18 | HOST_OK, HOST_NEW, HOST_CHANGED, HOST_REVOKED, HOST_FOUND |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 19 | } HostStatus; |
Ben Lindstrom | 46c1622 | 2000-12-22 01:43:59 +0000 | [diff] [blame] | 20 | |
Damien Miller | 5b2aea9 | 2001-12-21 12:47:09 +1100 | [diff] [blame] | 21 | int hostfile_read_key(char **, u_int *, Key *); |
Ben Lindstrom | 93576d9 | 2002-12-23 02:06:19 +0000 | [diff] [blame] | 22 | HostStatus check_host_in_hostfile(const char *, const char *, |
Damien Miller | f58b58c | 2003-11-17 21:18:23 +1100 | [diff] [blame] | 23 | const Key *, Key *, int *); |
Damien Miller | e177615 | 2005-03-01 21:47:37 +1100 | [diff] [blame] | 24 | int add_host_to_hostfile(const char *, const char *, const Key *, int); |
Ben Lindstrom | 93576d9 | 2002-12-23 02:06:19 +0000 | [diff] [blame] | 25 | int lookup_key_in_hostfile_by_type(const char *, const char *, |
| 26 | int, Key *, int *); |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 27 | |
Damien Miller | e177615 | 2005-03-01 21:47:37 +1100 | [diff] [blame] | 28 | #define HASH_MAGIC "|1|" |
| 29 | #define HASH_DELIM '|' |
| 30 | |
Damien Miller | 0a80ca1 | 2010-02-27 07:55:05 +1100 | [diff] [blame] | 31 | #define CA_MARKER "@cert-authority" |
Damien Miller | 1aed65e | 2010-03-04 21:53:35 +1100 | [diff] [blame] | 32 | #define REVOKE_MARKER "@revoked" |
Damien Miller | 0a80ca1 | 2010-02-27 07:55:05 +1100 | [diff] [blame] | 33 | |
Damien Miller | e177615 | 2005-03-01 21:47:37 +1100 | [diff] [blame] | 34 | char *host_hash(const char *, const char *, u_int); |
| 35 | |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 36 | #endif |