Path: blob/main/crypto/krb5/src/include/gssrpc/svc_auth.h
34907 views
/* @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC */1/*2* Copyright (c) 2010, Oracle America, Inc.3*4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions are met:8*9* * Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* * Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in14* the documentation and/or other materials provided with the15* distribution.16*17* * Neither the name of the "Oracle America, Inc." nor the names of18* its contributors may be used to endorse or promote products19* derived from this software without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS22* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED23* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A24* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT25* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,26* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED27* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR28* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF29* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING30* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS31* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.32*/33/* @(#)svc_auth.h 1.6 86/07/16 SMI */3435/*36* svc_auth.h, Service side of rpc authentication.37*/3839/*40* Interface to server-side authentication flavors.41*/4243#ifndef GSSRPC_SVC_AUTH_H44#define GSSRPC_SVC_AUTH_H4546#include <gssapi/gssapi.h>4748GSSRPC__BEGIN_DECLS4950struct svc_req;5152typedef struct SVCAUTH {53struct svc_auth_ops {54int (*svc_ah_wrap)(struct SVCAUTH *, XDR *, xdrproc_t,55caddr_t);56int (*svc_ah_unwrap)(struct SVCAUTH *, XDR *, xdrproc_t,57caddr_t);58int (*svc_ah_destroy)(struct SVCAUTH *);59} *svc_ah_ops;60void * svc_ah_private;61} SVCAUTH;6263#ifdef GSSRPC__IMPL6465extern SVCAUTH svc_auth_none;6667extern struct svc_auth_ops svc_auth_none_ops;68extern struct svc_auth_ops svc_auth_gssapi_ops;69extern struct svc_auth_ops svc_auth_gss_ops;7071/*72* Server side authenticator73*/74/* RENAMED: should be _authenticate. */75extern enum auth_stat gssrpc__authenticate(struct svc_req *rqst,76struct rpc_msg *msg, bool_t *no_dispatch);7778#define SVCAUTH_WRAP(auth, xdrs, xfunc, xwhere) \79((*((auth)->svc_ah_ops->svc_ah_wrap))(auth, xdrs, xfunc, xwhere))80#define SVCAUTH_UNWRAP(auth, xdrs, xfunc, xwhere) \81((*((auth)->svc_ah_ops->svc_ah_unwrap))(auth, xdrs, xfunc, xwhere))82#define SVCAUTH_DESTROY(auth) \83((*((auth)->svc_ah_ops->svc_ah_destroy))(auth))8485/* no authentication */86/* RENAMED: should be _svcauth_none. */87enum auth_stat gssrpc__svcauth_none(struct svc_req *,88struct rpc_msg *, bool_t *);89/* unix style (uid, gids) */90/* RENAMED: should be _svcauth_unix. */91enum auth_stat gssrpc__svcauth_unix(struct svc_req *,92struct rpc_msg *, bool_t *);93/* short hand unix style */94/* RENAMED: should be _svcauth_short. */95enum auth_stat gssrpc__svcauth_short(struct svc_req *,96struct rpc_msg *, bool_t *);97/* GSS-API style */98/* RENAMED: should be _svcauth_gssapi. */99enum auth_stat gssrpc__svcauth_gssapi(struct svc_req *,100struct rpc_msg *, bool_t *);101/* RPCSEC_GSS */102enum auth_stat gssrpc__svcauth_gss(struct svc_req *,103struct rpc_msg *, bool_t *);104105#endif /* defined(GSSRPC__IMPL) */106107/*108* Approved way of getting principal of caller109*/110char *svcauth_gss_get_principal(SVCAUTH *auth);111/*112* Approved way of setting server principal113*/114bool_t svcauth_gss_set_svc_name(gss_name_t name);115116GSSRPC__END_DECLS117118#endif /* !defined(GSSRPC_SVC_AUTH_H) */119120121