xref: /netbsd-src/lib/libskey/skey.h (revision 76dfffe33547c37f8bdd446e3e4ab0f3c16cea4b)
1 /*	$NetBSD: skey.h,v 1.3 1996/09/19 19:39:45 thorpej Exp $	*/
2 
3 /*
4  * S/KEY v1.1b (skey.h)
5  *
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>
10  *
11  * Modifications:
12  *          Scott Chasin <chasin@crimelab.com>
13  *
14  * Main client header
15  */
16 
17 #if	defined(__TURBOC__) || defined(__STDC__) || defined(LATTICE)
18 #define	ANSIPROTO	1
19 #endif
20 
21 #ifndef	__ARGS
22 #ifdef	ANSIPROTO
23 #define	__ARGS(x)	x
24 #else
25 #define	__ARGS(x)	()
26 #endif
27 #endif
28 
29 #ifdef SOLARIS
30 #define setpriority(x,y,z)      z
31 #endif
32 
33 /* Server-side data structure for reading keys file during login */
34 struct skey
35 {
36   FILE *keyfile;
37   char buf[256];
38   char *logname;
39   int n;
40   char *seed;
41   char *val;
42   long recstart;		/* needed so reread of buffer is efficient */
43 
44 
45 };
46 
47 /* Client-side structure for scanning data stream for challenge */
48 struct mc
49 {
50   char buf[256];
51   int skip;
52   int cnt;
53 };
54 
55 void f __ARGS ((char *x));
56 int keycrunch __ARGS ((char *result, char *seed, char *passwd));
57 char *btoe __ARGS ((char *engout, char *c));
58 char *put8 __ARGS ((char *out, char *s));
59 int etob __ARGS ((char *out, char *e));
60 void rip __ARGS ((char *buf));
61 int skeychallenge __ARGS ((struct skey * mp, char *name, char *ss));
62 int skeylookup __ARGS ((struct skey * mp, char *name));
63 int skeyverify __ARGS ((struct skey * mp, char *response));
64 void sevenbit __ARGS ((char *s));
65 void backspace __ARGS ((char *s));
66 char *skipspace __ARGS ((char *s));
67 char *readpass __ARGS ((char *buf, int n));
68 char *readskey __ARGS ((char *buf, int n));
69 int skey_authenticate __ARGS ((char *));
70 int skey_passcheck __ARGS ((char *, char *));
71 char *skey_keyinfo __ARGS ((char *));
72 int skey_haskey __ARGS ((char *));
73 int getskeyprompt __ARGS ((struct skey *, char *, char *));
74 int atob8 __ARGS((char *, char *));
75 int btoa8 __ARGS((char *, char *));
76 int htoi __ARGS((char));
77 
78