4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
26 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
29 * Portions of this source code were derived from Berkeley
30 * 4.3 BSD under license from the Regents of the University of
34 #ifndef _RPC_AUTH_DES_H
35 #define _RPC_AUTH_DES_H
37 #pragma ident "%Z%%M% %I% %E% SMI"
40 * auth_des.h, Protocol for DES style authentication for RPC
55 * There are two kinds of "names": fullnames and nicknames
57 enum authdes_namekind
{
63 * A fullname contains the network name of the client,
64 * a conversation key and the window
66 struct authdes_fullname
{
67 char *name
; /* network name of client, up to MAXNETNAMELEN */
68 des_block key
; /* conversation key */
69 uint32_t window
; /* associated window */
77 enum authdes_namekind adc_namekind
;
78 struct authdes_fullname adc_fullname
;
79 uint32_t adc_nickname
;
83 * A des authentication verifier
87 struct timeval adv_ctime
; /* clear time */
88 des_block adv_xtime
; /* crypt time */
94 * des authentication verifier: client variety
96 * adv_timestamp is the current time.
97 * adv_winverf is the credential window + 1.
98 * Both are encrypted using the conversation key.
100 #define adv_timestamp adv_time_u.adv_ctime
101 #define adv_xtimestamp adv_time_u.adv_xtime
102 #define adv_winverf adv_int_u
105 * des authentication verifier: server variety
107 * adv_timeverf is the client's timestamp + client's window
108 * adv_nickname is the server's nickname for the client.
109 * adv_timeverf is encrypted using the conversation key.
111 #define adv_timeverf adv_time_u.adv_ctime
112 #define adv_xtimeverf adv_time_u.adv_xtime
113 #define adv_nickname adv_int_u
116 * Map a des credential into a unix cred.
118 * authdes_getucred(adc, uid, gid, grouplen, groups)
119 * struct authdes_cred *adc;
128 extern int kauthdes_getucred(const struct authdes_cred
*, cred_t
*);
131 extern int authdes_getucred(const struct authdes_cred
*,
132 uid_t
*, gid_t
*, short *, gid_t
*);
134 extern int authdes_getucred();
140 extern int getpublickey(const char *, char *);
141 extern int getsecretkey(const char *, char *, const char *);
143 extern int getpublickey();
144 extern int getsecretkey();
151 extern int authdes_create(char *, uint_t
, struct netbuf
*,
152 struct knetconfig
*, des_block
*, int, AUTH
**);
153 extern bool_t
xdr_authdes_cred(XDR
*, struct authdes_cred
*);
154 extern bool_t
xdr_authdes_verf(XDR
*, struct authdes_verf
*);
155 extern int rtime(struct knetconfig
*, struct netbuf
*, int,
156 struct timeval
*, struct timeval
*);
157 extern enum clnt_stat
kgetnetname(char *);
158 extern enum auth_stat
_svcauth_des(struct svc_req
*, struct rpc_msg
*);
160 extern int authdes_create();
161 extern bool_t
xdr_authdes_cred();
162 extern bool_t
xdr_authdes_verf();
164 extern enum clnt_stat
kgetnetname();
165 extern enum auth_stat
_svcauth_des();
168 extern kmutex_t authdes_ops_lock
;
176 #endif /* _RPC_AUTH_DES_H */