1
/* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC */
3
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4
* unrestricted use provided that this legend is included on all tape
5
* media and as a part of the software program in whole or part. Users
6
* may copy or modify Sun RPC without charge, but are not authorized
7
* to license or distribute it to anyone else except as part of a product or
8
* program developed by the user.
10
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
12
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14
* Sun RPC is provided with no support and without any obligation on the
15
* part of Sun Microsystems, Inc. to assist in its use, correction,
16
* modification or enhancement.
18
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20
* OR ANY PART THEREOF.
22
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
23
* or profits or other special, indirect and consequential damages, even if
24
* Sun has been advised of the possibility of such damages.
26
* Sun Microsystems, Inc.
28
* Mountain View, California 94043
30
/* @(#)svc_auth.h 1.6 86/07/16 SMI */
33
* svc_auth.h, Service side of rpc authentication.
35
* Copyright (C) 1984, Sun Microsystems, Inc.
39
* Interface to server-side authentication flavors.
42
#ifndef GSSRPC_SVC_AUTH_H
43
#define GSSRPC_SVC_AUTH_H
45
#include <gssapi/gssapi.h>
51
typedef struct SVCAUTH {
53
int (*svc_ah_wrap)(struct SVCAUTH *, XDR *, xdrproc_t,
55
int (*svc_ah_unwrap)(struct SVCAUTH *, XDR *, xdrproc_t,
57
int (*svc_ah_destroy)(struct SVCAUTH *);
59
void * svc_ah_private;
64
extern SVCAUTH svc_auth_none;
66
extern struct svc_auth_ops svc_auth_none_ops;
67
extern struct svc_auth_ops svc_auth_gssapi_ops;
68
extern struct svc_auth_ops svc_auth_gss_ops;
71
* Server side authenticator
73
/* RENAMED: should be _authenticate. */
74
extern enum auth_stat gssrpc__authenticate(struct svc_req *rqst,
75
struct rpc_msg *msg, bool_t *no_dispatch);
77
#define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \
78
((*((auth)->svc_ah_ops->svc_ah_wrap))(auth, xdrs, xfunc, xwhere))
79
#define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \
80
((*((auth)->svc_ah_ops->svc_ah_unwrap))(auth, xdrs, xfunc, xwhere))
81
#define SVCAUTH_DESTROY(auth) \
82
((*((auth)->svc_ah_ops->svc_ah_destroy))(auth))
84
/* no authentication */
85
/* RENAMED: should be _svcauth_none. */
86
enum auth_stat gssrpc__svcauth_none(struct svc_req *,
87
struct rpc_msg *, bool_t *);
88
/* unix style (uid, gids) */
89
/* RENAMED: shoudl be _svcauth_unix. */
90
enum auth_stat gssrpc__svcauth_unix(struct svc_req *,
91
struct rpc_msg *, bool_t *);
92
/* short hand unix style */
93
/* RENAMED: should be _svcauth_short. */
94
enum auth_stat gssrpc__svcauth_short(struct svc_req *,
95
struct rpc_msg *, bool_t *);
97
/* RENAMED: should be _svcauth_gssapi. */
98
enum auth_stat gssrpc__svcauth_gssapi(struct svc_req *,
99
struct rpc_msg *, bool_t *);
101
enum auth_stat gssrpc__svcauth_gss(struct svc_req *,
102
struct rpc_msg *, bool_t *);
104
#endif /* defined(GSSRPC__IMPL) */
107
* Approved way of getting principal of caller
109
char *svcauth_gss_get_principal(SVCAUTH *auth);
111
* Approved way of setting server principal
113
bool_t svcauth_gss_set_svc_name(gss_name_t name);
117
#endif /* !defined(GSSRPC_SVC_AUTH_H) */