Deleted Added
full compact
opie.h (60572) opie.h (92914)
1/* opie.h: Data structures and values for the OPIE authentication
2 system that a program might need.
3
4%%% portions-copyright-cmetz-96
1/* opie.h: Data structures and values for the OPIE authentication
2 system that a program might need.
3
4%%% portions-copyright-cmetz-96
5Portions of this software are Copyright 1996-1998 by Craig Metz, All Rights
5Portions of this software are Copyright 1996-1999 by Craig Metz, All Rights
6Reserved. The Inner Net License Version 2 applies to these portions of
7the software.
8You should have received a copy of the license with this software. If
9you didn't get a copy, you may request one from <license@inner.net>.
10
11Portions of this software are Copyright 1995 by Randall Atkinson and Dan
12McDonald, All Rights Reserved. All Rights under this copyright are assigned
13to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and
14License Agreement applies to this software.
15
16 History:
17
6Reserved. The Inner Net License Version 2 applies to these portions of
7the software.
8You should have received a copy of the license with this software. If
9you didn't get a copy, you may request one from <license@inner.net>.
10
11Portions of this software are Copyright 1995 by Randall Atkinson and Dan
12McDonald, All Rights Reserved. All Rights under this copyright are assigned
13to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and
14License Agreement applies to this software.
15
16 History:
17
18 Modified by cmetz for OPIE 2.4. Added sequence number limits. Added
19 struct opie_otpkey and made many functions use it. Added
20 opiestrncpy(). Include header with libmissing prototypes.
18 Modified by cmetz for OPIE 2.32. Added symbolic flag names for
19 opiepasswd(). Added __opieparsechallenge() prototype.
20 Modified by cmetz for OPIE 2.31. Removed active attack protection.
21 Modified by cmetz for OPIE 2.3. Renamed PTR to VOIDPTR. Added
22 re-init key and extension file fields to struct opie. Added
23 opie_ prefix on struct opie members. Added opie_flags field
24 and definitions. Added more prototypes. Changed opiehash()
25 prototype.
26 Modified by cmetz for OPIE 2.22. Define __P correctly if this file
27 is included in a third-party program.
28 Modified by cmetz for OPIE 2.2. Re-did prototypes. Added FUNCTION
29 definition et al. Multiple-include protection. Added struct
30 utsname fake. Got rid of gethostname() cruft. Moved UINT4
31 here. Provide for *seek whence values. Move MDx context here
32 and unify. Re-did prototypes.
33 Modified at NRL for OPIE 2.0.
34 Written at Bellcore for the S/Key Version 1 software distribution
35 (skey.h).
36
21 Modified by cmetz for OPIE 2.32. Added symbolic flag names for
22 opiepasswd(). Added __opieparsechallenge() prototype.
23 Modified by cmetz for OPIE 2.31. Removed active attack protection.
24 Modified by cmetz for OPIE 2.3. Renamed PTR to VOIDPTR. Added
25 re-init key and extension file fields to struct opie. Added
26 opie_ prefix on struct opie members. Added opie_flags field
27 and definitions. Added more prototypes. Changed opiehash()
28 prototype.
29 Modified by cmetz for OPIE 2.22. Define __P correctly if this file
30 is included in a third-party program.
31 Modified by cmetz for OPIE 2.2. Re-did prototypes. Added FUNCTION
32 definition et al. Multiple-include protection. Added struct
33 utsname fake. Got rid of gethostname() cruft. Moved UINT4
34 here. Provide for *seek whence values. Move MDx context here
35 and unify. Re-did prototypes.
36 Modified at NRL for OPIE 2.0.
37 Written at Bellcore for the S/Key Version 1 software distribution
38 (skey.h).
39
37$FreeBSD: head/contrib/opie/opie.h 60572 2000-05-15 04:20:54Z kris $
40$FreeBSD: head/contrib/opie/opie.h 92914 2002-03-21 23:42:52Z markm $
38*/
39#ifndef _OPIE_H
40#define _OPIE_H 1
41
42struct opie {
43 int opie_flags;
44 char opie_buf[256];
45 char *opie_principal;
46 int opie_n;
47 char *opie_seed;
48 char *opie_val;
49 long opie_recstart;
50};
51
52#define __OPIE_FLAGS_RW 1
53#define __OPIE_FLAGS_READ 2
54
55/* Minimum length of a secret password */
41*/
42#ifndef _OPIE_H
43#define _OPIE_H 1
44
45struct opie {
46 int opie_flags;
47 char opie_buf[256];
48 char *opie_principal;
49 int opie_n;
50 char *opie_seed;
51 char *opie_val;
52 long opie_recstart;
53};
54
55#define __OPIE_FLAGS_RW 1
56#define __OPIE_FLAGS_READ 2
57
58/* Minimum length of a secret password */
59#ifndef OPIE_SECRET_MIN
56#define OPIE_SECRET_MIN 10
60#define OPIE_SECRET_MIN 10
61#endif /* OPIE_SECRET_MIN */
57
58/* Maximum length of a secret password */
59#define OPIE_SECRET_MAX 127
60
61/* Minimum length of a seed */
62#define OPIE_SEED_MIN 5
63
64/* Maximum length of a seed */

--- 6 unchanged lines hidden (view full) ---

71#define OPIE_CHALLENGE_MAX (4+OPIE_HASHNAME_MAX+1+4+1+OPIE_SEED_MAX)
72
73/* Maximum length of a response that we allow */
74#define OPIE_RESPONSE_MAX (9+1+19+1+9+OPIE_SEED_MAX+1+19+1+19+1+19)
75
76/* Maximum length of a principal (read: user name) */
77#define OPIE_PRINCIPAL_MAX 32
78
62
63/* Maximum length of a secret password */
64#define OPIE_SECRET_MAX 127
65
66/* Minimum length of a seed */
67#define OPIE_SEED_MIN 5
68
69/* Maximum length of a seed */

--- 6 unchanged lines hidden (view full) ---

76#define OPIE_CHALLENGE_MAX (4+OPIE_HASHNAME_MAX+1+4+1+OPIE_SEED_MAX)
77
78/* Maximum length of a response that we allow */
79#define OPIE_RESPONSE_MAX (9+1+19+1+9+OPIE_SEED_MAX+1+19+1+19+1+19)
80
81/* Maximum length of a principal (read: user name) */
82#define OPIE_PRINCIPAL_MAX 32
83
79#include <sys/cdefs.h>
84/* Maximum sequence number */
85#ifndef OPIE_SEQUENCE_MAX
86#define OPIE_SEQUENCE_MAX 9999
87#endif /* OPIE_SEQUENCE_MAX */
80
88
89/* Restricted sequence number */
90#ifndef OPIE_SEQUENCE_RESTRICT
91#define OPIE_SEQUENCE_RESTRICT 9
92#endif /* OPIE_SEQUENCE_RESTRICT */
93
94#define UINT4 u_int32_t
95
96struct opie_otpkey {
97 UINT4 words[2];
98};
99
100#ifndef SEEK_SET
101#define SEEK_SET 0
102#endif /* SEEK_SET */
103
104#ifndef SEEK_END
105#define SEEK_END 2
106#endif /* SEEK_END */
107
81__BEGIN_DECLS
82int opieaccessfile __P((char *));
83int rdnets __P((long));
84int isaddr __P((register char *));
85int opiealways __P((char *));
108__BEGIN_DECLS
109int opieaccessfile __P((char *));
110int rdnets __P((long));
111int isaddr __P((register char *));
112int opiealways __P((char *));
86char *opieatob8 __P((char *,char *));
113char *opieatob8 __P((struct opie_otpkey *, char *));
87void opiebackspace __P((char *));
114void opiebackspace __P((char *));
88char *opiebtoa8 __P((char *,char *));
89char *opiebtoe __P((char *,char *));
90char *opiebtoh __P((char *,char *));
91int opieetob __P((char *,char *));
115char *opiebtoa8 __P((char *, struct opie_otpkey *));
116char *opiebtoe __P((char *, struct opie_otpkey *));
117char *opiebtoh __P((char *, struct opie_otpkey *));
118int opieetob __P((struct opie_otpkey *, char *));
92int opiechallenge __P((struct opie *,char *,char *));
93int opiegenerator __P((char *,char *,char *));
94int opiegetsequence __P((struct opie *));
119int opiechallenge __P((struct opie *,char *,char *));
120int opiegenerator __P((char *,char *,char *));
121int opiegetsequence __P((struct opie *));
95void opiehash __P((void *, unsigned));
122void opiehash __P((struct opie_otpkey *, unsigned));
96int opiehtoi __P((register char));
123int opiehtoi __P((register char));
97int opiekeycrunch __P((int, char *, char *, char *));
124int opiekeycrunch __P((int, struct opie_otpkey *, char *, char *));
98int opielock __P((char *));
99int opieunlock __P((void));
100void opieunlockaeh __P((void));
101void opiedisableaeh __P((void));
102int opielookup __P((struct opie *,char *));
103int opiepasscheck __P((char *));
104void opierandomchallenge __P((char *));
105char * opieskipspace __P((register char *));

--- 10 unchanged lines hidden (view full) ---

116
117#if _OPIE
118#define VOIDPTR void *
119#define VOIDRET void
120#define NOARGS void
121#define FUNCTION(arglist, args) (args)
122#define AND ,
123#define FUNCTION_NOARGS ()
125int opielock __P((char *));
126int opieunlock __P((void));
127void opieunlockaeh __P((void));
128void opiedisableaeh __P((void));
129int opielookup __P((struct opie *,char *));
130int opiepasscheck __P((char *));
131void opierandomchallenge __P((char *));
132char * opieskipspace __P((register char *));

--- 10 unchanged lines hidden (view full) ---

143
144#if _OPIE
145#define VOIDPTR void *
146#define VOIDRET void
147#define NOARGS void
148#define FUNCTION(arglist, args) (args)
149#define AND ,
150#define FUNCTION_NOARGS ()
124#define UINT4 u_int32_t
125
126__BEGIN_DECLS
127struct utmp;
128int __opiegetutmpentry __P((char *, struct utmp *));
129#ifdef EOF
130FILE *__opieopen __P((char *, int, int));
131#endif /* EOF */
132int __opiereadrec __P((struct opie *));
133int __opiewriterec __P((struct opie *));
134int __opieparsechallenge __P((char *buffer, int *algorithm, int *sequence, char **seed, int *exts));
135__END_DECLS
151
152__BEGIN_DECLS
153struct utmp;
154int __opiegetutmpentry __P((char *, struct utmp *));
155#ifdef EOF
156FILE *__opieopen __P((char *, int, int));
157#endif /* EOF */
158int __opiereadrec __P((struct opie *));
159int __opiewriterec __P((struct opie *));
160int __opieparsechallenge __P((char *buffer, int *algorithm, int *sequence, char **seed, int *exts));
161__END_DECLS
162
163#define opiestrncpy(dst, src, n) \
164 do { \
165 strncpy(dst, src, n-1); \
166 dst[n-1] = 0; \
167 } while(0)
168
169/* #include "missing.h" */
136#endif /* _OPIE */
137
138#define OPIEPASSWD_CONSOLE 1
139#define OPIEPASSWD_FORCE 2
140
141#endif /* _OPIE_H */
170#endif /* _OPIE */
171
172#define OPIEPASSWD_CONSOLE 1
173#define OPIEPASSWD_FORCE 2
174
175#endif /* _OPIE_H */