Sync usage with man page.
[netbsd-mini2440.git] / lib / libskey / skey.h
blob31ec68e1a746e3011770e0a3df7fdfc471ef8e00
1 /* $NetBSD: skey.h,v 1.8 2000/07/28 16:35:11 thorpej Exp $ */
3 /*
4 * S/KEY v1.1b (skey.h)
6 * Authors:
7 * Neil M. Haller <nmh@thumper.bellcore.com>
8 * Philip R. Karn <karn@chicago.qualcomm.com>
9 * John S. Walden <jsw@thumper.bellcore.com>
11 * Modifications:
12 * Scott Chasin <chasin@crimelab.com>
13 * Todd C. Miller <Todd.Miller@courtesan.com>
15 * Main client header
18 /* Server-side data structure for reading keys file during login */
19 struct skey {
20 FILE *keyfile;
21 char buf[256];
22 char *logname;
23 int n;
24 char *seed;
25 char *val;
26 long recstart; /* needed so reread of buffer is efficient */
29 /* Client-side structure for scanning data stream for challenge */
30 struct mc {
31 char buf[256];
32 int skip;
33 int cnt;
36 /* Maximum sequence number we allow */
37 #ifndef SKEY_MAX_SEQ
38 #define SKEY_MAX_SEQ 10000
39 #endif
41 /* Minimum secret password length (rfc2289) */
42 #ifndef SKEY_MIN_PW_LEN
43 #define SKEY_MIN_PW_LEN 10
44 #endif
46 /* Max secret password length (rfc2289 says 63 but allows more) */
47 #ifndef SKEY_MAX_PW_LEN
48 #define SKEY_MAX_PW_LEN 255
49 #endif
51 /* Max length of an S/Key seed (rfc2289) */
52 #ifndef SKEY_MAX_SEED_LEN
53 #define SKEY_MAX_SEED_LEN 16
54 #endif
56 /* Max length of S/Key challenge (otp-???? 9999 seed) */
57 #ifndef SKEY_MAX_CHALLENGE
58 #define SKEY_MAX_CHALLENGE (11 + SKEY_MAX_HASHNAME_LEN + SKEY_MAX_SEED_LEN)
59 #endif
61 /* Max length of hash algorithm name (md4/md5/sha1/rmd160) */
62 #define SKEY_MAX_HASHNAME_LEN 6
64 /* Size of a binary key (not NULL-terminated) */
65 #define SKEY_BINKEY_SIZE 8
67 /* Location of random file for bogus challenges */
68 #define _SKEY_RAND_FILE_PATH_ "/var/db/host.random"
70 /* Prototypes */
71 void f(char *);
72 int keycrunch(char *, const char *, const char *);
73 char *btoe(char *, const char *);
74 char *put8(char *, const char *);
75 int etob(char *, const char *);
76 void rip(char *);
77 int skeychallenge(struct skey *, const char *, char *, size_t);
78 int skeylookup(struct skey *, const char *);
79 int skeyverify(struct skey *, char *);
80 void sevenbit(char *);
81 void backspace(char *);
82 const char *skipspace(const char *);
83 char *readpass(char *, int);
84 char *readskey(char *, int);
85 int skey_authenticate(const char *);
86 int skey_passcheck(const char *, char *);
87 const char *skey_keyinfo(const char *);
88 int skey_haskey(const char *);
89 int getskeyprompt(struct skey *, char *, char *);
90 int atob8(char *, const char *);
91 int btoa8(char *, const char *);
92 int htoi(int);
93 const char *skey_get_algorithm(void);
94 const char *skey_set_algorithm(const char *);
95 int skeygetnext(struct skey *);
96 int skeyzero(struct skey *, char *);