Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:04

0001 /* @(#)svc_auth.h   2.1 88/07/29 4.0 RPCSRC */
0002 /*
0003  * Copyright (c) 2010, Oracle America, Inc.
0004  *
0005  * All rights reserved.
0006  *
0007  * Redistribution and use in source and binary forms, with or without
0008  * modification, are permitted provided that the following conditions are met:
0009  *
0010  *     * Redistributions of source code must retain the above copyright
0011  *       notice, this list of conditions and the following disclaimer.
0012  *
0013  *     * Redistributions in binary form must reproduce the above copyright
0014  *       notice, this list of conditions and the following disclaimer in
0015  *       the documentation and/or other materials provided with the
0016  *       distribution.
0017  *
0018  *     * Neither the name of the "Oracle America, Inc." nor the names of
0019  *       its contributors may be used to endorse or promote products
0020  *       derived from this software without specific prior written permission.
0021  *
0022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
0023  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
0024  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
0025  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0026  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0027  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
0028  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
0029  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
0030  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0031  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0032  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0033  */
0034 /*      @(#)svc_auth.h 1.6 86/07/16 SMI      */
0035 
0036 /*
0037  * svc_auth.h, Service side of rpc authentication.
0038  */
0039 
0040 /*
0041  * Interface to server-side authentication flavors.
0042  */
0043 
0044 #ifndef GSSRPC_SVC_AUTH_H
0045 #define GSSRPC_SVC_AUTH_H
0046 
0047 #include <gssapi/gssapi.h>
0048 
0049 GSSRPC__BEGIN_DECLS
0050 
0051 struct svc_req;
0052 
0053 typedef struct SVCAUTH {
0054     struct svc_auth_ops {
0055         int (*svc_ah_wrap)(struct SVCAUTH *, XDR *, xdrproc_t,
0056                        caddr_t);
0057         int (*svc_ah_unwrap)(struct SVCAUTH *, XDR *, xdrproc_t,
0058                      caddr_t);
0059         int (*svc_ah_destroy)(struct SVCAUTH *);
0060     } *svc_ah_ops;
0061     void * svc_ah_private;
0062 } SVCAUTH;
0063 
0064 #ifdef GSSRPC__IMPL
0065 
0066 extern SVCAUTH svc_auth_none;
0067 
0068 extern struct svc_auth_ops svc_auth_none_ops;
0069 extern struct svc_auth_ops svc_auth_gssapi_ops;
0070 extern struct svc_auth_ops svc_auth_gss_ops;
0071 
0072 /*
0073  * Server side authenticator
0074  */
0075 /* RENAMED: should be _authenticate. */
0076 extern enum auth_stat gssrpc__authenticate(struct svc_req *rqst,
0077     struct rpc_msg *msg, bool_t *no_dispatch);
0078 
0079 #define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \
0080      ((*((auth)->svc_ah_ops->svc_ah_wrap))(auth, xdrs, xfunc, xwhere))
0081 #define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \
0082      ((*((auth)->svc_ah_ops->svc_ah_unwrap))(auth, xdrs, xfunc, xwhere))
0083 #define SVCAUTH_DESTROY(auth) \
0084      ((*((auth)->svc_ah_ops->svc_ah_destroy))(auth))
0085 
0086 /* no authentication */
0087 /* RENAMED: should be _svcauth_none. */
0088 enum auth_stat gssrpc__svcauth_none(struct svc_req *,
0089     struct rpc_msg *, bool_t *);
0090 /* unix style (uid, gids) */
0091 /* RENAMED: should be _svcauth_unix. */
0092 enum auth_stat gssrpc__svcauth_unix(struct svc_req *,
0093     struct rpc_msg *, bool_t *);
0094 /* short hand unix style */
0095 /* RENAMED: should be _svcauth_short. */
0096 enum auth_stat gssrpc__svcauth_short(struct svc_req *,
0097     struct rpc_msg *, bool_t *);
0098 /* GSS-API style */
0099 /* RENAMED: should be _svcauth_gssapi. */
0100 enum auth_stat gssrpc__svcauth_gssapi(struct svc_req *,
0101     struct rpc_msg *, bool_t *);
0102 /* RPCSEC_GSS */
0103 enum auth_stat gssrpc__svcauth_gss(struct svc_req *,
0104     struct rpc_msg *, bool_t *);
0105 
0106 #endif /* defined(GSSRPC__IMPL) */
0107 
0108 /*
0109  * Approved way of getting principal of caller
0110  */
0111 char *svcauth_gss_get_principal(SVCAUTH *auth);
0112 /*
0113  * Approved way of setting server principal
0114  */
0115 bool_t svcauth_gss_set_svc_name(gss_name_t name);
0116 
0117 GSSRPC__END_DECLS
0118 
0119 #endif /* !defined(GSSRPC_SVC_AUTH_H) */