ReactOS  0.4.13-dev-249-gcba1a2f
auth_des.h
Go to the documentation of this file.
1 /* @(#)auth_des.h 2.2 88/07/29 4.0 RPCSRC; from 1.3 88/02/08 SMI */
2 /* $FreeBSD: src/include/rpc/auth_des.h,v 1.3 2002/03/23 17:24:55 imp Exp $ */
3 /*
4  * Copyright (c) 2009, Sun Microsystems, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  * - Redistributions of source code must retain the above copyright notice,
10  * this list of conditions and the following disclaimer.
11  * - Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  * - Neither the name of Sun Microsystems, Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  * from: @(#)auth_des.h 2.2 88/07/29 4.0 RPCSRC
31  * from: @(#)auth_des.h 1.14 94/04/25 SMI
32  */
33 
34 /*
35  * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
36  */
37 
38 /*
39  * auth_des.h, Protocol for DES style authentication for RPC
40  */
41 
42 #ifndef _TI_AUTH_DES_
43 #define _TI_AUTH_DES_
44 
45 #include <rpc/auth.h>
46 
47 /*
48  * There are two kinds of "names": fullnames and nicknames
49  */
53 };
54 
55 /*
56  * A fullname contains the network name of the client,
57  * a conversation key and the window
58  */
60  char *name; /* network name of client, up to MAXNETNAMELEN */
61  union des_block key; /* conversation key */
62  /* u_long window; */
63  u_int32_t window; /* associated window */
64 };
65 
66 
67 /*
68  * A credential
69  */
70 struct authdes_cred {
73  /*u_long adc_nickname;*/
75 };
76 
77 
78 
79 /*
80  * A des authentication verifier
81  */
82 struct authdes_verf {
83  union {
84  struct timeval adv_ctime; /* clear time */
85  des_block adv_xtime; /* crypt time */
86  } adv_time_u;
87  //u_long adv_int_u;
89 };
90 
91 /*
92  * des authentication verifier: client variety
93  *
94  * adv_timestamp is the current time.
95  * adv_winverf is the credential window + 1.
96  * Both are encrypted using the conversation key.
97  */
98 #define adv_timestamp adv_time_u.adv_ctime
99 #define adv_xtimestamp adv_time_u.adv_xtime
100 #define adv_winverf adv_int_u
101 
102 /*
103  * des authentication verifier: server variety
104  *
105  * adv_timeverf is the client's timestamp + client's window
106  * adv_nickname is the server's nickname for the client.
107  * adv_timeverf is encrypted using the conversation key.
108  */
109 #define adv_timeverf adv_time_u.adv_ctime
110 #define adv_xtimeverf adv_time_u.adv_xtime
111 #define adv_nickname adv_int_u
112 
113 /*
114  * Map a des credential into a unix cred.
115  *
116  */
118 extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * );
120 
122 extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *);
123 extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *);
124 #ifndef __REACTOS__
125 extern int rtime(dev_t, struct netbuf *, int, struct timeval *,
126  struct timeval *);
127 #else
128 extern int rtime(struct sockaddr_in *, struct timeval *, struct timeval *);
129 #endif
130 extern void kgetnetname(char *);
131 extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *);
133 
134 #endif /* ndef _TI_AUTH_DES_ */
u_int32_t window
Definition: auth_des.h:63
int32_t bool_t
Definition: types.h:101
des_block adv_xtime
Definition: auth_des.h:85
struct authdes_fullname adc_fullname
Definition: auth_des.h:72
long uid_t
Definition: various.h:8
Definition: xdr.h:103
void kgetnetname(char *)
u_int32_t adc_nickname
Definition: auth_des.h:74
UINT gid_t
Definition: types.h:89
auth_stat
Definition: auth.h:144
#define __END_DECLS
Definition: wintirpc.h:63
enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *)
Definition: svc_auth_des.c:106
__BEGIN_DECLS int authdes_getucred(struct authdes_cred *, uid_t *, gid_t *, int *, gid_t *)
struct timeval adv_ctime
Definition: auth_des.h:84
u_int32_t adv_int_u
Definition: auth_des.h:88
unsigned int u_int32_t
Definition: rosdhcp.h:35
enum authdes_namekind adc_namekind
Definition: auth_des.h:71
union authdes_verf::@180 adv_time_u
__kernel_dev_t dev_t
Definition: linux.h:197
Definition: svc.h:132
__END_DECLS __BEGIN_DECLS bool_t xdr_authdes_cred(XDR *, struct authdes_cred *)
Definition: authdes_prot.c:46
authdes_namekind
Definition: auth_des.h:50
Definition: types.h:144
bool_t xdr_authdes_verf(XDR *, struct authdes_verf *)
Definition: authdes_prot.c:74
#define __BEGIN_DECLS
Definition: wintirpc.h:62
int rtime(dev_t, struct netbuf *, int, struct timeval *, struct timeval *)
Definition: path.c:42