1 /* $NetBSD: skey.h,v 1.8 2000/07/28 16:35:11 thorpej Exp $ */
7 * Neil M. Haller <nmh@thumper.bellcore.com>
8 * Philip R. Karn <karn@chicago.qualcomm.com>
9 * John S. Walden <jsw@thumper.bellcore.com>
12 * Scott Chasin <chasin@crimelab.com>
13 * Todd C. Miller <Todd.Miller@courtesan.com>
18 /* Server-side data structure for reading keys file during login */
26 long recstart
; /* needed so reread of buffer is efficient */
29 /* Client-side structure for scanning data stream for challenge */
36 /* Maximum sequence number we allow */
38 #define SKEY_MAX_SEQ 10000
41 /* Minimum secret password length (rfc2289) */
42 #ifndef SKEY_MIN_PW_LEN
43 #define SKEY_MIN_PW_LEN 10
46 /* Max secret password length (rfc2289 says 63 but allows more) */
47 #ifndef SKEY_MAX_PW_LEN
48 #define SKEY_MAX_PW_LEN 255
51 /* Max length of an S/Key seed (rfc2289) */
52 #ifndef SKEY_MAX_SEED_LEN
53 #define SKEY_MAX_SEED_LEN 16
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)
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"
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 *);
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 *);
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 *);