Deleted Added
full compact
opie.h (23540) opie.h (29967)
1/* opie.h: Data structures and values for the OPIE authentication
2 system that a program might need.
3
1/* opie.h: Data structures and values for the OPIE authentication
2 system that a program might need.
3
4%%% portions-copyright-cmetz
5Portions of this software are Copyright 1996 by Craig Metz, All Rights
4%%% portions-copyright-cmetz-96
5Portions of this software are Copyright 1996-1997 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.31. Removed active attack protection.
18 Modified by cmetz for OPIE 2.3. Renamed PTR to VOIDPTR. Added
19 re-init key and extension file fields to struct opie. Added
20 opie_ prefix on struct opie members. Added opie_flags field
21 and definitions. Added more prototypes. Changed opiehash()
22 prototype.
23 Modified by cmetz for OPIE 2.22. Define __P correctly if this file
24 is included in a third-party program.
25 Modified by cmetz for OPIE 2.2. Re-did prototypes. Added FUNCTION
26 definition et al. Multiple-include protection. Added struct
27 utsname fake. Got rid of gethostname() cruft. Moved UINT4
28 here. Provide for *seek whence values. Move MDx context here
29 and unify. Re-did prototypes.
30 Modified at NRL for OPIE 2.0.
31 Written at Bellcore for the S/Key Version 1 software distribution
32 (skey.h).
33*/
34#ifndef _OPIE_H
19 Modified by cmetz for OPIE 2.3. Renamed PTR to VOIDPTR. Added
20 re-init key and extension file fields to struct opie. Added
21 opie_ prefix on struct opie members. Added opie_flags field
22 and definitions. Added more prototypes. Changed opiehash()
23 prototype.
24 Modified by cmetz for OPIE 2.22. Define __P correctly if this file
25 is included in a third-party program.
26 Modified by cmetz for OPIE 2.2. Re-did prototypes. Added FUNCTION
27 definition et al. Multiple-include protection. Added struct
28 utsname fake. Got rid of gethostname() cruft. Moved UINT4
29 here. Provide for *seek whence values. Move MDx context here
30 and unify. Re-did prototypes.
31 Modified at NRL for OPIE 2.0.
32 Written at Bellcore for the S/Key Version 1 software distribution
33 (skey.h).
34*/
35#ifndef _OPIE_H
35#define _OPIE_H
36#define _OPIE_H 1
36
37struct opie {
38 int opie_flags;
39 char opie_buf[256];
40 char *opie_principal;
41 int opie_n;
42 char *opie_seed;
43 char *opie_val;
44 long opie_recstart;
37
38struct opie {
39 int opie_flags;
40 char opie_buf[256];
41 char *opie_principal;
42 int opie_n;
43 char *opie_seed;
44 char *opie_val;
45 long opie_recstart;
45 char opie_extbuf[129]; /* > OPIE_PRINCIPAL_MAX + 1 + 16 + 2 + 1 */
46 long opie_extrecstart;
47 char *opie_reinitkey;
48};
49
50#define __OPIE_FLAGS_RW 1
51#define __OPIE_FLAGS_READ 2
52
53/* Minimum length of a secret password */
54#define OPIE_SECRET_MIN 10
55

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

66#define OPIE_CHALLENGE_MAX (7+1+4+1+OPIE_SEED_MAX)
67
68/* Maximum length of a response that we allow */
69#define OPIE_RESPONSE_MAX (9+1+19+1+9+OPIE_SEED_MAX+1+19+1+19+1+19)
70
71/* Maximum length of a principal (read: user name) */
72#define OPIE_PRINCIPAL_MAX 32
73
46};
47
48#define __OPIE_FLAGS_RW 1
49#define __OPIE_FLAGS_READ 2
50
51/* Minimum length of a secret password */
52#define OPIE_SECRET_MIN 10
53

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

64#define OPIE_CHALLENGE_MAX (7+1+4+1+OPIE_SEED_MAX)
65
66/* Maximum length of a response that we allow */
67#define OPIE_RESPONSE_MAX (9+1+19+1+9+OPIE_SEED_MAX+1+19+1+19+1+19)
68
69/* Maximum length of a principal (read: user name) */
70#define OPIE_PRINCIPAL_MAX 32
71
74struct opiemdx_ctx {
75 u_int32_t state[4];
76 u_int32_t count[2];
77 unsigned char buffer[64];
78};
72#include <sys/cdefs.h>
79
80__BEGIN_DECLS
81int opieaccessfile __P((char *));
82int rdnets __P((long));
83int isaddr __P((register char *));
84int opiealways __P((char *));
85char *opieatob8 __P((char *,char *));
86void opiebackspace __P((char *));

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

96int opiekeycrunch __P((int, char *, char *, char *));
97int opielock __P((char *));
98int opielookup __P((struct opie *,char *));
99int opiepasscheck __P((char *));
100void opierandomchallenge __P((char *));
101char * opieskipspace __P((register char *));
102void opiestripcrlf __P((char *));
103int opieverify __P((struct opie *,char *));
73
74__BEGIN_DECLS
75int opieaccessfile __P((char *));
76int rdnets __P((long));
77int isaddr __P((register char *));
78int opiealways __P((char *));
79char *opieatob8 __P((char *,char *));
80void opiebackspace __P((char *));

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

90int opiekeycrunch __P((int, char *, char *, char *));
91int opielock __P((char *));
92int opielookup __P((struct opie *,char *));
93int opiepasscheck __P((char *));
94void opierandomchallenge __P((char *));
95char * opieskipspace __P((register char *));
96void opiestripcrlf __P((char *));
97int opieverify __P((struct opie *,char *));
104int opiepasswd __P((struct opie *, int, char *, int, char *, char *));
98int opiepasswd __P((struct opie *, int, char *, int, char *, char *));
105char *opiereadpass __P((char *, int, int));
106int opielogin __P((char *line, char *name, char *host));
107__END_DECLS
108
99char *opiereadpass __P((char *, int, int));
100int opielogin __P((char *line, char *name, char *host));
101__END_DECLS
102
109#if _OPIE /* internal glue support */
103#if _OPIE
104#define VOIDPTR void *
105#define VOIDRET void
106#define NOARGS void
107#define FUNCTION(arglist, args) (args)
108#define AND ,
109#define FUNCTION_NOARGS ()
110#define UINT4 u_int32_t
110
111
111#define VOIDPTR void *
112#define VOIDRET void
113#define NOARGS void
114#define FUNCTION(arglist, args) (args)
115#define AND ,
116#define FUNCTION_NOARGS ()
117#define UINT4 u_int32_t
118
119__BEGIN_DECLS
120struct utmp;
112__BEGIN_DECLS
113struct utmp;
121int __opiegetutmpentry __P((char *, struct utmp *));
122int __opiereadrec __P((struct opie *));
123int __opiewriterec __P((struct opie *));
124
114int __opiegetutmpentry __P((char *, struct utmp *));
125#ifdef EOF
126FILE *__opieopen __P((char *, int, int));
115#ifdef EOF
116FILE *__opieopen __P((char *, int, int));
127#endif
128
129__END_DECLS
130
117#endif /* EOF */
118int __opiereadrec __P((struct opie *));
119int __opiewriterec __P((struct opie *));
131#endif /* _OPIE */
120#endif /* _OPIE */
132
121__END_DECLS
133#endif /* _OPIE_H */
122#endif /* _OPIE_H */