Annotation of src/usr.bin/ssh/hostfile.h, Revision 1.19
1.19 ! djm 1: /* $OpenBSD: hostfile.h,v 1.18 2010/03/04 10:36:03 djm Exp $ */
1.6 niklas 2:
1.3 deraadt 3: /*
1.4 markus 4: * Author: Tatu Ylonen <ylo@cs.hut.fi>
5: * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6: * All rights reserved
1.3 deraadt 7: *
1.4 markus 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".
1.3 deraadt 13: */
1.1 markus 14: #ifndef HOSTFILE_H
15: #define HOSTFILE_H
1.7 itojun 16:
1.1 markus 17: typedef enum {
1.18 djm 18: HOST_OK, HOST_NEW, HOST_CHANGED, HOST_REVOKED, HOST_FOUND
1.1 markus 19: } HostStatus;
1.5 markus 20:
1.19 ! djm 21: typedef enum {
! 22: MRK_ERROR, MRK_NONE, MRK_REVOKE, MRK_CA
! 23: } HostkeyMarker;
! 24:
! 25: struct hostkey_entry {
! 26: char *host;
! 27: char *file;
! 28: u_long line;
! 29: Key *key;
! 30: HostkeyMarker marker;
! 31: };
! 32: struct hostkeys;
! 33:
! 34: struct hostkeys *init_hostkeys(void);
! 35: void load_hostkeys(struct hostkeys *, const char *, const char *);
! 36: void free_hostkeys(struct hostkeys *);
! 37:
! 38: HostStatus check_key_in_hostkeys(struct hostkeys *, Key *,
! 39: const struct hostkey_entry **);
! 40: int lookup_key_in_hostkeys_by_type(struct hostkeys *, int,
! 41: const struct hostkey_entry **);
! 42:
1.10 jakob 43: int hostfile_read_key(char **, u_int *, Key *);
1.19 ! djm 44: int add_host_to_hostfile(const char *, const char *, const Key *, int);
1.15 djm 45:
46: #define HASH_MAGIC "|1|"
47: #define HASH_DELIM '|'
1.17 djm 48:
49: #define CA_MARKER "@cert-authority"
1.18 djm 50: #define REVOKE_MARKER "@revoked"
1.15 djm 51:
52: char *host_hash(const char *, const char *, u_int);
1.1 markus 53:
54: #endif