207 |
mateuszvis |
1 |
/*!\file rpc/auth_des.h
|
|
|
2 |
* RPC authentication.
|
|
|
3 |
*/
|
|
|
4 |
|
|
|
5 |
/* @(#)auth_des.h 2.2 88/07/29 4.0 RPCSRC; from 1.3 88/02/08 SMI */
|
|
|
6 |
/*
|
|
|
7 |
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
|
|
8 |
* unrestricted use provided that this legend is included on all tape
|
|
|
9 |
* media and as a part of the software program in whole or part. Users
|
|
|
10 |
* may copy or modify Sun RPC without charge, but are not authorized
|
|
|
11 |
* to license or distribute it to anyone else except as part of a product or
|
|
|
12 |
* program developed by the user.
|
|
|
13 |
*
|
|
|
14 |
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
|
|
15 |
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
|
|
16 |
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
|
|
17 |
*
|
|
|
18 |
* Sun RPC is provided with no support and without any obligation on the
|
|
|
19 |
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
|
|
20 |
* modification or enhancement.
|
|
|
21 |
*
|
|
|
22 |
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
|
|
23 |
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
|
|
24 |
* OR ANY PART THEREOF.
|
|
|
25 |
*
|
|
|
26 |
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
|
|
27 |
* or profits or other special, indirect and consequential damages, even if
|
|
|
28 |
* Sun has been advised of the possibility of such damages.
|
|
|
29 |
*
|
|
|
30 |
* Sun Microsystems, Inc.
|
|
|
31 |
* 2550 Garcia Avenue
|
|
|
32 |
* Mountain View, California 94043
|
|
|
33 |
*/
|
|
|
34 |
|
|
|
35 |
/*
|
|
|
36 |
* Copyright (c) 1988 by Sun Microsystems, Inc.
|
|
|
37 |
*/
|
|
|
38 |
|
|
|
39 |
/*
|
|
|
40 |
* auth_des.h, Protocol for DES style authentication for RPC
|
|
|
41 |
*/
|
|
|
42 |
|
|
|
43 |
#ifndef __AUTH_DES_H
|
|
|
44 |
#define __AUTH_DES_H
|
|
|
45 |
|
|
|
46 |
/*
|
|
|
47 |
* There are two kinds of "names": fullnames and nicknames
|
|
|
48 |
*/
|
|
|
49 |
enum authdes_namekind {
|
|
|
50 |
ADN_FULLNAME,
|
|
|
51 |
ADN_NICKNAME
|
|
|
52 |
};
|
|
|
53 |
|
|
|
54 |
/*
|
|
|
55 |
* A fullname contains the network name of the client,
|
|
|
56 |
* a conversation key and the window
|
|
|
57 |
*/
|
|
|
58 |
struct authdes_fullname {
|
|
|
59 |
char *name; /* network name of client, up to MAXNETNAMELEN */
|
|
|
60 |
des_block key; /* conversation key */
|
|
|
61 |
u_long window; /* associated window */
|
|
|
62 |
};
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
/*
|
|
|
66 |
* A credential
|
|
|
67 |
*/
|
|
|
68 |
struct authdes_cred {
|
|
|
69 |
enum authdes_namekind adc_namekind;
|
|
|
70 |
struct authdes_fullname adc_fullname;
|
|
|
71 |
u_long adc_nickname;
|
|
|
72 |
};
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
/*
|
|
|
77 |
* A des authentication verifier
|
|
|
78 |
*/
|
|
|
79 |
struct authdes_verf {
|
|
|
80 |
union {
|
|
|
81 |
struct timeval adv_ctime; /* clear time */
|
|
|
82 |
des_block adv_xtime; /* crypt time */
|
|
|
83 |
} adv_time_u;
|
|
|
84 |
u_long adv_int_u;
|
|
|
85 |
};
|
|
|
86 |
|
|
|
87 |
/*
|
|
|
88 |
* des authentication verifier: client variety
|
|
|
89 |
*
|
|
|
90 |
* adv_timestamp is the current time.
|
|
|
91 |
* adv_winverf is the credential window + 1.
|
|
|
92 |
* Both are encrypted using the conversation key.
|
|
|
93 |
*/
|
|
|
94 |
#define adv_timestamp adv_time_u.adv_ctime
|
|
|
95 |
#define adv_xtimestamp adv_time_u.adv_xtime
|
|
|
96 |
#define adv_winverf adv_int_u
|
|
|
97 |
|
|
|
98 |
/*
|
|
|
99 |
* des authentication verifier: server variety
|
|
|
100 |
*
|
|
|
101 |
* adv_timeverf is the client's timestamp + client's window
|
|
|
102 |
* adv_nickname is the server's nickname for the client.
|
|
|
103 |
* adv_timeverf is encrypted using the conversation key.
|
|
|
104 |
*/
|
|
|
105 |
#define adv_timeverf adv_time_u.adv_ctime
|
|
|
106 |
#define adv_xtimeverf adv_time_u.adv_xtime
|
|
|
107 |
#define adv_nickname adv_int_u
|
|
|
108 |
|
|
|
109 |
#endif /* !__AUTH_DES_H */
|