xref: /freebsd/include/rpc/auth.h (revision 5a1d1441)
18360efbdSAlfred Perlstein /*	$NetBSD: auth.h,v 1.15 2000/06/02 22:57:55 fvdl Exp $	*/
28360efbdSAlfred Perlstein 
32e322d37SHiroki Sato /*-
42321c474SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
52321c474SPedro F. Giffuni  *
62e322d37SHiroki Sato  * Copyright (c) 2009, Sun Microsystems, Inc.
72e322d37SHiroki Sato  * All rights reserved.
8dba7a33eSGarrett Wollman  *
92e322d37SHiroki Sato  * Redistribution and use in source and binary forms, with or without
102e322d37SHiroki Sato  * modification, are permitted provided that the following conditions are met:
112e322d37SHiroki Sato  * - Redistributions of source code must retain the above copyright notice,
122e322d37SHiroki Sato  *   this list of conditions and the following disclaimer.
132e322d37SHiroki Sato  * - Redistributions in binary form must reproduce the above copyright notice,
142e322d37SHiroki Sato  *   this list of conditions and the following disclaimer in the documentation
152e322d37SHiroki Sato  *   and/or other materials provided with the distribution.
162e322d37SHiroki Sato  * - Neither the name of Sun Microsystems, Inc. nor the names of its
172e322d37SHiroki Sato  *   contributors may be used to endorse or promote products derived
182e322d37SHiroki Sato  *   from this software without specific prior written permission.
19dba7a33eSGarrett Wollman  *
202e322d37SHiroki Sato  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
212e322d37SHiroki Sato  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
222e322d37SHiroki Sato  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
232e322d37SHiroki Sato  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
242e322d37SHiroki Sato  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
252e322d37SHiroki Sato  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
262e322d37SHiroki Sato  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
272e322d37SHiroki Sato  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
282e322d37SHiroki Sato  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
292e322d37SHiroki Sato  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
302e322d37SHiroki Sato  * POSSIBILITY OF SUCH DAMAGE.
31dba7a33eSGarrett Wollman  */
32dba7a33eSGarrett Wollman 
33dba7a33eSGarrett Wollman /*
34dba7a33eSGarrett Wollman  * auth.h, Authentication interface.
35dba7a33eSGarrett Wollman  *
36dba7a33eSGarrett Wollman  * Copyright (C) 1984, Sun Microsystems, Inc.
37dba7a33eSGarrett Wollman  *
38dba7a33eSGarrett Wollman  * The data structures are completely opaque to the client.  The client
399d5abbddSJens Schweikhardt  * is required to pass an AUTH * to routines that create rpc
40dba7a33eSGarrett Wollman  * "sessions".
41dba7a33eSGarrett Wollman  */
42dba7a33eSGarrett Wollman 
4386b9a9ccSGarrett Wollman #ifndef _RPC_AUTH_H
4486b9a9ccSGarrett Wollman #define _RPC_AUTH_H
458360efbdSAlfred Perlstein #include <rpc/xdr.h>
468360efbdSAlfred Perlstein #include <rpc/clnt_stat.h>
4786b9a9ccSGarrett Wollman #include <sys/cdefs.h>
48f26dae2bSBill Paul #include <sys/socket.h>
49dba7a33eSGarrett Wollman 
50dba7a33eSGarrett Wollman #define MAX_AUTH_BYTES	400
51dba7a33eSGarrett Wollman #define MAXNETNAMELEN	255	/* maximum length of network user's name */
52dba7a33eSGarrett Wollman 
53dba7a33eSGarrett Wollman /*
548360efbdSAlfred Perlstein  *  Client side authentication/security data
558360efbdSAlfred Perlstein  */
568360efbdSAlfred Perlstein 
578360efbdSAlfred Perlstein typedef struct sec_data {
588360efbdSAlfred Perlstein 	u_int	secmod;		/* security mode number e.g. in nfssec.conf */
598360efbdSAlfred Perlstein 	u_int	rpcflavor;	/* rpc flavors:AUTH_UNIX,AUTH_DES,RPCSEC_GSS */
608360efbdSAlfred Perlstein 	int	flags;		/* AUTH_F_xxx flags */
618360efbdSAlfred Perlstein 	caddr_t data;		/* opaque data per flavor */
628360efbdSAlfred Perlstein } sec_data_t;
638360efbdSAlfred Perlstein 
648360efbdSAlfred Perlstein #ifdef _SYSCALL32_IMPL
658360efbdSAlfred Perlstein struct sec_data32 {
668360efbdSAlfred Perlstein 	uint32_t secmod;	/* security mode number e.g. in nfssec.conf */
678360efbdSAlfred Perlstein 	uint32_t rpcflavor;	/* rpc flavors:AUTH_UNIX,AUTH_DES,RPCSEC_GSS */
688360efbdSAlfred Perlstein 	int32_t flags;		/* AUTH_F_xxx flags */
698360efbdSAlfred Perlstein 	caddr32_t data;		/* opaque data per flavor */
708360efbdSAlfred Perlstein };
718360efbdSAlfred Perlstein #endif /* _SYSCALL32_IMPL */
728360efbdSAlfred Perlstein 
738360efbdSAlfred Perlstein /*
748360efbdSAlfred Perlstein  * AUTH_DES flavor specific data from sec_data opaque data field.
758360efbdSAlfred Perlstein  * AUTH_KERB has the same structure.
768360efbdSAlfred Perlstein  */
778360efbdSAlfred Perlstein typedef struct des_clnt_data {
788360efbdSAlfred Perlstein 	struct netbuf	syncaddr;	/* time sync addr */
798360efbdSAlfred Perlstein 	struct knetconfig *knconf;	/* knetconfig info that associated */
808360efbdSAlfred Perlstein 					/* with the syncaddr. */
818360efbdSAlfred Perlstein 	char		*netname;	/* server's netname */
828360efbdSAlfred Perlstein 	int		netnamelen;	/* server's netname len */
838360efbdSAlfred Perlstein } dh_k4_clntdata_t;
848360efbdSAlfred Perlstein 
858360efbdSAlfred Perlstein #ifdef _SYSCALL32_IMPL
868360efbdSAlfred Perlstein struct des_clnt_data32 {
878360efbdSAlfred Perlstein 	struct netbuf32 syncaddr;	/* time sync addr */
888360efbdSAlfred Perlstein 	caddr32_t knconf;		/* knetconfig info that associated */
898360efbdSAlfred Perlstein 					/* with the syncaddr. */
908360efbdSAlfred Perlstein 	caddr32_t netname;		/* server's netname */
918360efbdSAlfred Perlstein 	int32_t netnamelen;		/* server's netname len */
928360efbdSAlfred Perlstein };
938360efbdSAlfred Perlstein #endif /* _SYSCALL32_IMPL */
948360efbdSAlfred Perlstein 
958360efbdSAlfred Perlstein #ifdef KERBEROS
968360efbdSAlfred Perlstein /*
978360efbdSAlfred Perlstein  * flavor specific data to hold the data for AUTH_DES/AUTH_KERB(v4)
988360efbdSAlfred Perlstein  * in sec_data->data opaque field.
998360efbdSAlfred Perlstein  */
1008360efbdSAlfred Perlstein typedef struct krb4_svc_data {
1018360efbdSAlfred Perlstein 	int		window;		/* window option value */
1028360efbdSAlfred Perlstein } krb4_svcdata_t;
1038360efbdSAlfred Perlstein 
1048360efbdSAlfred Perlstein typedef struct krb4_svc_data	des_svcdata_t;
1058360efbdSAlfred Perlstein #endif /* KERBEROS */
1068360efbdSAlfred Perlstein 
1078360efbdSAlfred Perlstein /*
1088360efbdSAlfred Perlstein  * authentication/security specific flags
1098360efbdSAlfred Perlstein  */
1108360efbdSAlfred Perlstein #define AUTH_F_RPCTIMESYNC	0x001	/* use RPC to do time sync */
1118360efbdSAlfred Perlstein #define AUTH_F_TRYNONE		0x002	/* allow fall back to AUTH_NONE */
1128360efbdSAlfred Perlstein 
1138360efbdSAlfred Perlstein 
1148360efbdSAlfred Perlstein /*
115dba7a33eSGarrett Wollman  * Status returned from authentication check
116dba7a33eSGarrett Wollman  */
117dba7a33eSGarrett Wollman enum auth_stat {
118dba7a33eSGarrett Wollman 	AUTH_OK=0,
119dba7a33eSGarrett Wollman 	/*
120dba7a33eSGarrett Wollman 	 * failed at remote end
121dba7a33eSGarrett Wollman 	 */
122dba7a33eSGarrett Wollman 	AUTH_BADCRED=1,			/* bogus credentials (seal broken) */
123dba7a33eSGarrett Wollman 	AUTH_REJECTEDCRED=2,		/* client should begin new session */
124dba7a33eSGarrett Wollman 	AUTH_BADVERF=3,			/* bogus verifier (seal broken) */
125dba7a33eSGarrett Wollman 	AUTH_REJECTEDVERF=4,		/* verifier expired or was replayed */
126dba7a33eSGarrett Wollman 	AUTH_TOOWEAK=5,			/* rejected due to security reasons */
127dba7a33eSGarrett Wollman 	/*
128dba7a33eSGarrett Wollman 	 * failed locally
129dba7a33eSGarrett Wollman 	*/
130dba7a33eSGarrett Wollman 	AUTH_INVALIDRESP=6,		/* bogus response verifier */
1318f55a568SDoug Rabson 	AUTH_FAILED=7,			/* some unknown reason */
1328360efbdSAlfred Perlstein #ifdef KERBEROS
1338360efbdSAlfred Perlstein 	/*
1348360efbdSAlfred Perlstein 	 * kerberos errors
1358360efbdSAlfred Perlstein 	 */
136f91b492aSAlfred Perlstein 	,
1378360efbdSAlfred Perlstein 	AUTH_KERB_GENERIC = 8,		/* kerberos generic error */
1388360efbdSAlfred Perlstein 	AUTH_TIMEEXPIRE = 9,		/* time of credential expired */
1398360efbdSAlfred Perlstein 	AUTH_TKT_FILE = 10,		/* something wrong with ticket file */
1408360efbdSAlfred Perlstein 	AUTH_DECODE = 11,			/* can't decode authenticator */
1418f55a568SDoug Rabson 	AUTH_NET_ADDR = 12,		/* wrong net address in ticket */
1428360efbdSAlfred Perlstein #endif /* KERBEROS */
1438f55a568SDoug Rabson 	/*
1448f55a568SDoug Rabson 	 * RPCSEC_GSS errors
1458f55a568SDoug Rabson 	 */
1468f55a568SDoug Rabson 	RPCSEC_GSS_CREDPROBLEM = 13,
1478f55a568SDoug Rabson 	RPCSEC_GSS_CTXPROBLEM = 14,
1488f55a568SDoug Rabson 	RPCSEC_GSS_NODISPATCH = 0x8000000
149dba7a33eSGarrett Wollman };
150dba7a33eSGarrett Wollman 
151dba7a33eSGarrett Wollman union des_block {
152dba7a33eSGarrett Wollman 	struct {
1538360efbdSAlfred Perlstein 		uint32_t high;
1548360efbdSAlfred Perlstein 		uint32_t low;
155dba7a33eSGarrett Wollman 	} key;
156dba7a33eSGarrett Wollman 	char c[8];
157dba7a33eSGarrett Wollman };
158dba7a33eSGarrett Wollman typedef union des_block des_block;
15986b9a9ccSGarrett Wollman __BEGIN_DECLS
1608360efbdSAlfred Perlstein extern bool_t xdr_des_block(XDR *, des_block *);
16186b9a9ccSGarrett Wollman __END_DECLS
162dba7a33eSGarrett Wollman 
163dba7a33eSGarrett Wollman /*
164dba7a33eSGarrett Wollman  * Authentication info.  Opaque to client.
165dba7a33eSGarrett Wollman  */
166dba7a33eSGarrett Wollman struct opaque_auth {
167dba7a33eSGarrett Wollman 	enum_t	oa_flavor;		/* flavor of auth */
168dba7a33eSGarrett Wollman 	caddr_t	oa_base;		/* address of more auth stuff */
169dba7a33eSGarrett Wollman 	u_int	oa_length;		/* not to exceed MAX_AUTH_BYTES */
170dba7a33eSGarrett Wollman };
171dba7a33eSGarrett Wollman 
172dba7a33eSGarrett Wollman 
173dba7a33eSGarrett Wollman /*
174dba7a33eSGarrett Wollman  * Auth handle, interface to client side authenticators.
175dba7a33eSGarrett Wollman  */
1768360efbdSAlfred Perlstein typedef struct __auth {
177dba7a33eSGarrett Wollman 	struct	opaque_auth	ah_cred;
178dba7a33eSGarrett Wollman 	struct	opaque_auth	ah_verf;
179dba7a33eSGarrett Wollman 	union	des_block	ah_key;
180dba7a33eSGarrett Wollman 	struct auth_ops {
1818360efbdSAlfred Perlstein 		void	(*ah_nextverf) (struct __auth *);
18270de0abfSPeter Wemm 		/* nextverf & serialize */
1838360efbdSAlfred Perlstein 		int	(*ah_marshal) (struct __auth *, XDR *);
18470de0abfSPeter Wemm 		/* validate verifier */
1858360efbdSAlfred Perlstein 		int	(*ah_validate) (struct __auth *,
1868360efbdSAlfred Perlstein 			    struct opaque_auth *);
18770de0abfSPeter Wemm 		/* refresh credentials */
1888360efbdSAlfred Perlstein 		int	(*ah_refresh) (struct __auth *, void *);
18970de0abfSPeter Wemm 		/* destroy this structure */
1908360efbdSAlfred Perlstein 		void	(*ah_destroy) (struct __auth *);
191dba7a33eSGarrett Wollman 	} *ah_ops;
192f91b492aSAlfred Perlstein 	void *ah_private;
193dba7a33eSGarrett Wollman } AUTH;
194dba7a33eSGarrett Wollman 
195dba7a33eSGarrett Wollman 
196dba7a33eSGarrett Wollman /*
197dba7a33eSGarrett Wollman  * Authentication ops.
198dba7a33eSGarrett Wollman  * The ops and the auth handle provide the interface to the authenticators.
199dba7a33eSGarrett Wollman  *
200dba7a33eSGarrett Wollman  * AUTH	*auth;
201dba7a33eSGarrett Wollman  * XDR	*xdrs;
202dba7a33eSGarrett Wollman  * struct opaque_auth verf;
203dba7a33eSGarrett Wollman  */
204dba7a33eSGarrett Wollman #define AUTH_NEXTVERF(auth)		\
205dba7a33eSGarrett Wollman 		((*((auth)->ah_ops->ah_nextverf))(auth))
206dba7a33eSGarrett Wollman #define auth_nextverf(auth)		\
207dba7a33eSGarrett Wollman 		((*((auth)->ah_ops->ah_nextverf))(auth))
208dba7a33eSGarrett Wollman 
209dba7a33eSGarrett Wollman #define AUTH_MARSHALL(auth, xdrs)	\
210dba7a33eSGarrett Wollman 		((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
211dba7a33eSGarrett Wollman #define auth_marshall(auth, xdrs)	\
212dba7a33eSGarrett Wollman 		((*((auth)->ah_ops->ah_marshal))(auth, xdrs))
213dba7a33eSGarrett Wollman 
214dba7a33eSGarrett Wollman #define AUTH_VALIDATE(auth, verfp)	\
215dba7a33eSGarrett Wollman 		((*((auth)->ah_ops->ah_validate))((auth), verfp))
216dba7a33eSGarrett Wollman #define auth_validate(auth, verfp)	\
217dba7a33eSGarrett Wollman 		((*((auth)->ah_ops->ah_validate))((auth), verfp))
218dba7a33eSGarrett Wollman 
2198360efbdSAlfred Perlstein #define AUTH_REFRESH(auth, msg)		\
2208360efbdSAlfred Perlstein 		((*((auth)->ah_ops->ah_refresh))(auth, msg))
2218360efbdSAlfred Perlstein #define auth_refresh(auth, msg)		\
2228360efbdSAlfred Perlstein 		((*((auth)->ah_ops->ah_refresh))(auth, msg))
223dba7a33eSGarrett Wollman 
224dba7a33eSGarrett Wollman #define AUTH_DESTROY(auth)		\
225dba7a33eSGarrett Wollman 		((*((auth)->ah_ops->ah_destroy))(auth))
226dba7a33eSGarrett Wollman #define auth_destroy(auth)		\
227dba7a33eSGarrett Wollman 		((*((auth)->ah_ops->ah_destroy))(auth))
228dba7a33eSGarrett Wollman 
229dba7a33eSGarrett Wollman 
2308360efbdSAlfred Perlstein __BEGIN_DECLS
231dba7a33eSGarrett Wollman extern struct opaque_auth _null_auth;
2328360efbdSAlfred Perlstein __END_DECLS
233dba7a33eSGarrett Wollman 
234dba7a33eSGarrett Wollman /*
235dba7a33eSGarrett Wollman  * These are the various implementations of client side authenticators.
236dba7a33eSGarrett Wollman  */
237dba7a33eSGarrett Wollman 
238dba7a33eSGarrett Wollman /*
2398360efbdSAlfred Perlstein  * System style authentication
240dba7a33eSGarrett Wollman  * AUTH *authunix_create(machname, uid, gid, len, aup_gids)
241dba7a33eSGarrett Wollman  *	char *machname;
2420d1040e5SPedro F. Giffuni  *	u_int uid;
2430d1040e5SPedro F. Giffuni  *	u_int gid;
244dba7a33eSGarrett Wollman  *	int len;
2450d1040e5SPedro F. Giffuni  *	u_int *aup_gids;
246dba7a33eSGarrett Wollman  */
24786b9a9ccSGarrett Wollman __BEGIN_DECLS
2480d1040e5SPedro F. Giffuni extern AUTH *authunix_create(char *, u_int, u_int, int, u_int *);
2498360efbdSAlfred Perlstein extern AUTH *authunix_create_default(void);	/* takes no parameters */
2508360efbdSAlfred Perlstein extern AUTH *authnone_create(void);		/* takes no parameters */
25186b9a9ccSGarrett Wollman __END_DECLS
252f26dae2bSBill Paul /*
253f26dae2bSBill Paul  * DES style authentication
2548360efbdSAlfred Perlstein  * AUTH *authsecdes_create(servername, window, timehost, ckey)
255f26dae2bSBill Paul  * 	char *servername;		- network name of server
256f26dae2bSBill Paul  *	u_int window;			- time to live
2578360efbdSAlfred Perlstein  * 	const char *timehost;			- optional hostname to sync with
258f26dae2bSBill Paul  * 	des_block *ckey;		- optional conversation key to use
259f26dae2bSBill Paul  */
260f26dae2bSBill Paul __BEGIN_DECLS
2618360efbdSAlfred Perlstein extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
2628360efbdSAlfred Perlstein extern AUTH *authdes_seccreate (const char *, const u_int, const  char *,
2638360efbdSAlfred Perlstein     const  des_block *);
264f26dae2bSBill Paul __END_DECLS
265f26dae2bSBill Paul 
2668360efbdSAlfred Perlstein __BEGIN_DECLS
2678d630135SAlfred Perlstein extern bool_t xdr_opaque_auth		(XDR *, struct opaque_auth *);
2688360efbdSAlfred Perlstein __END_DECLS
2698360efbdSAlfred Perlstein 
2708360efbdSAlfred Perlstein #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
2718360efbdSAlfred Perlstein #define authsys_create_default() authunix_create_default()
2728360efbdSAlfred Perlstein 
273f26dae2bSBill Paul /*
274f26dae2bSBill Paul  * Netname manipulation routines.
275f26dae2bSBill Paul  */
276f26dae2bSBill Paul __BEGIN_DECLS
277a2e41a58SJohn Baldwin extern int getnetname(char [MAXNETNAMELEN + 1]);
278a2e41a58SJohn Baldwin extern int host2netname(char [MAXNETNAMELEN + 1], const char *, const char *);
279a2e41a58SJohn Baldwin extern int user2netname(char [MAXNETNAMELEN + 1], const uid_t, const char *);
280a2e41a58SJohn Baldwin extern int netname2user(char [MAXNETNAMELEN + 1], uid_t *, gid_t *, int *,
281a2e41a58SJohn Baldwin     gid_t *);
282a2e41a58SJohn Baldwin extern int netname2host(char [MAXNETNAMELEN + 1], char *, const int);
2838360efbdSAlfred Perlstein extern void passwd2des ( char *, char * );
284f26dae2bSBill Paul __END_DECLS
285f26dae2bSBill Paul 
286f26dae2bSBill Paul /*
2878360efbdSAlfred Perlstein  *
2888360efbdSAlfred Perlstein  * These routines interface to the keyserv daemon
2898360efbdSAlfred Perlstein  *
290f26dae2bSBill Paul  */
291f26dae2bSBill Paul __BEGIN_DECLS
2928360efbdSAlfred Perlstein extern int key_decryptsession(const char *, des_block *);
2938360efbdSAlfred Perlstein extern int key_encryptsession(const char *, des_block *);
2948360efbdSAlfred Perlstein extern int key_gendes(des_block *);
2958360efbdSAlfred Perlstein extern int key_setsecret(const char *);
2968360efbdSAlfred Perlstein extern int key_secretkey_is_set(void);
2978360efbdSAlfred Perlstein __END_DECLS
2988360efbdSAlfred Perlstein 
2998d630135SAlfred Perlstein /*
3008d630135SAlfred Perlstein  * Publickey routines.
3018d630135SAlfred Perlstein  */
3028d630135SAlfred Perlstein __BEGIN_DECLS
3038d630135SAlfred Perlstein extern int getpublickey (const char *, char *);
3040411773bSDaniel Eischen extern int getpublicandprivatekey (const char *, char *);
3058d630135SAlfred Perlstein extern int getsecretkey (char *, char *, char *);
3068d630135SAlfred Perlstein __END_DECLS
3078d630135SAlfred Perlstein 
3088360efbdSAlfred Perlstein #ifdef KERBEROS
3098360efbdSAlfred Perlstein /*
3108360efbdSAlfred Perlstein  * Kerberos style authentication
3118360efbdSAlfred Perlstein  * AUTH *authkerb_seccreate(service, srv_inst, realm, window, timehost, status)
3128360efbdSAlfred Perlstein  *	const char *service;			- service name
3138360efbdSAlfred Perlstein  *	const char *srv_inst;			- server instance
3148360efbdSAlfred Perlstein  *	const char *realm;			- server realm
3158360efbdSAlfred Perlstein  *	const u_int window;			- time to live
3168360efbdSAlfred Perlstein  *	const char *timehost;			- optional hostname to sync with
3178360efbdSAlfred Perlstein  *	int *status;				- kerberos status returned
3188360efbdSAlfred Perlstein  */
3198360efbdSAlfred Perlstein __BEGIN_DECLS
3208360efbdSAlfred Perlstein extern AUTH	*authkerb_seccreate(const char *, const char *, const  char *,
3218360efbdSAlfred Perlstein 		    const u_int, const char *, int *);
322f26dae2bSBill Paul __END_DECLS
323f26dae2bSBill Paul 
324f26dae2bSBill Paul /*
3258360efbdSAlfred Perlstein  * Map a kerberos credential into a unix cred.
3268360efbdSAlfred Perlstein  *
3278360efbdSAlfred Perlstein  *	authkerb_getucred(rqst, uid, gid, grouplen, groups)
3288360efbdSAlfred Perlstein  *	const struct svc_req *rqst;		- request pointer
3298360efbdSAlfred Perlstein  *	uid_t *uid;
3308360efbdSAlfred Perlstein  *	gid_t *gid;
3318360efbdSAlfred Perlstein  *	short *grouplen;
3328360efbdSAlfred Perlstein  *	int *groups;
3338360efbdSAlfred Perlstein  *
334f26dae2bSBill Paul  */
335f26dae2bSBill Paul __BEGIN_DECLS
3368360efbdSAlfred Perlstein extern int	authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
3378360efbdSAlfred Perlstein 		    short *, int * */);
338f26dae2bSBill Paul __END_DECLS
3398360efbdSAlfred Perlstein #endif /* KERBEROS */
340f26dae2bSBill Paul 
3418360efbdSAlfred Perlstein __BEGIN_DECLS
3428360efbdSAlfred Perlstein struct svc_req;
3438360efbdSAlfred Perlstein struct rpc_msg;
3448d630135SAlfred Perlstein enum auth_stat _svcauth_null (struct svc_req *, struct rpc_msg *);
3458d630135SAlfred Perlstein enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
3468d630135SAlfred Perlstein enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
3478360efbdSAlfred Perlstein __END_DECLS
348f26dae2bSBill Paul 
349dba7a33eSGarrett Wollman #define AUTH_NONE	0		/* no authentication */
350dba7a33eSGarrett Wollman #define	AUTH_NULL	0		/* backward compatibility */
3518360efbdSAlfred Perlstein #define	AUTH_SYS	1		/* unix style (uid, gids) */
3528360efbdSAlfred Perlstein #define AUTH_UNIX	AUTH_SYS
353dba7a33eSGarrett Wollman #define	AUTH_SHORT	2		/* short hand unix style */
3548360efbdSAlfred Perlstein #define AUTH_DH		3		/* for Diffie-Hellman mechanism */
3558360efbdSAlfred Perlstein #define AUTH_DES	AUTH_DH		/* for backward compatibility */
3568360efbdSAlfred Perlstein #define AUTH_KERB	4		/* kerberos style */
3578f55a568SDoug Rabson #define RPCSEC_GSS	6		/* RPCSEC_GSS */
3588f55a568SDoug Rabson 
3598f55a568SDoug Rabson /*
3608f55a568SDoug Rabson  * Pseudo auth flavors for RPCSEC_GSS.
3618f55a568SDoug Rabson  */
3628f55a568SDoug Rabson #define	RPCSEC_GSS_KRB5		390003
3638f55a568SDoug Rabson #define	RPCSEC_GSS_KRB5I	390004
3648f55a568SDoug Rabson #define	RPCSEC_GSS_KRB5P	390005
36586b9a9ccSGarrett Wollman 
36686b9a9ccSGarrett Wollman #endif /* !_RPC_AUTH_H */
367