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
38 * auth_des.h, Protocol for DES style authentication for RPC
53 * There are two kinds of "names": fullnames and nicknames
55 enum authdes_namekind
{
61 * A fullname contains the network name of the client,
62 * a conversation key and the window
64 struct authdes_fullname
{
65 char *name
; /* network name of client, up to MAXNETNAMELEN */
66 des_block key
; /* conversation key */
67 uint32_t window
; /* associated window */
75 enum authdes_namekind adc_namekind
;
76 struct authdes_fullname adc_fullname
;
77 uint32_t adc_nickname
;
81 * A des authentication verifier
85 struct timeval adv_ctime
; /* clear time */
86 des_block adv_xtime
; /* crypt time */
92 * des authentication verifier: client variety
94 * adv_timestamp is the current time.
95 * adv_winverf is the credential window + 1.
96 * Both are encrypted using the conversation key.
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
103 * des authentication verifier: server variety
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.
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
114 * Map a des credential into a unix cred.
116 * authdes_getucred(adc, uid, gid, grouplen, groups)
117 * struct authdes_cred *adc;
126 extern int kauthdes_getucred(const struct authdes_cred
*, cred_t
*);
129 extern int authdes_getucred(const struct authdes_cred
*,
130 uid_t
*, gid_t
*, short *, gid_t
*);
132 extern int authdes_getucred();
138 extern int getpublickey(const char *, char *);
139 extern int getsecretkey(const char *, char *, const char *);
141 extern int getpublickey();
142 extern int getsecretkey();
149 extern int authdes_create(char *, uint_t
, struct netbuf
*,
150 struct knetconfig
*, des_block
*, int, AUTH
**);
151 extern bool_t
xdr_authdes_cred(XDR
*, struct authdes_cred
*);
152 extern bool_t
xdr_authdes_verf(XDR
*, struct authdes_verf
*);
153 extern int rtime(struct knetconfig
*, struct netbuf
*, int,
154 struct timeval
*, struct timeval
*);
155 extern enum clnt_stat
kgetnetname(char *);
156 extern enum auth_stat
_svcauth_des(struct svc_req
*, struct rpc_msg
*);
158 extern int authdes_create();
159 extern bool_t
xdr_authdes_cred();
160 extern bool_t
xdr_authdes_verf();
162 extern enum clnt_stat
kgetnetname();
163 extern enum auth_stat
_svcauth_des();
166 extern kmutex_t authdes_ops_lock
;
174 #endif /* _RPC_AUTH_DES_H */