Path: blob/main/sys/rpc/rpcsec_gss/rpcsec_gss_int.h
39536 views
/*1rpcsec_gss.h23SPDX-License-Identifier: BSD-3-Clause45Copyright (c) 2000 The Regents of the University of Michigan.6All rights reserved.78Copyright (c) 2000 Dug Song <[email protected]>.9All rights reserved, all wrongs reversed.1011Redistribution and use in source and binary forms, with or without12modification, are permitted provided that the following conditions13are met:14151. Redistributions of source code must retain the above copyright16notice, this list of conditions and the following disclaimer.172. Redistributions in binary form must reproduce the above copyright18notice, this list of conditions and the following disclaimer in the19documentation and/or other materials provided with the distribution.203. Neither the name of the University nor the names of its21contributors may be used to endorse or promote products derived22from this software without specific prior written permission.2324THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED25WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF26MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE27DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE28FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR29CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF30SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR31BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF32LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING33NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS34SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3536$Id: auth_gss.h,v 1.12 2001/04/30 19:44:47 andros Exp $37*/3839#ifndef _RPCSEC_GSS_INT_H40#define _RPCSEC_GSS_INT_H4142#include <kgssapi/gssapi_impl.h>4344/* RPCSEC_GSS control procedures. */45typedef enum {46RPCSEC_GSS_DATA = 0,47RPCSEC_GSS_INIT = 1,48RPCSEC_GSS_CONTINUE_INIT = 2,49RPCSEC_GSS_DESTROY = 350} rpc_gss_proc_t;5152#define RPCSEC_GSS_VERSION 15354/* Credentials. */55struct rpc_gss_cred {56u_int gc_version; /* version */57rpc_gss_proc_t gc_proc; /* control procedure */58u_int gc_seq; /* sequence number */59rpc_gss_service_t gc_svc; /* service */60gss_buffer_desc gc_handle; /* handle to server-side context */61};6263/* Context creation response. */64struct rpc_gss_init_res {65gss_buffer_desc gr_handle; /* handle to server-side context */66u_int gr_major; /* major status */67u_int gr_minor; /* minor status */68u_int gr_win; /* sequence window */69gss_buffer_desc gr_token; /* token */70};7172/* Maximum sequence number value. */73#define MAXSEQ 0x800000007475enum krb_imp {76KRBIMP_UNKNOWN,77KRBIMP_HEIMDALV1,78KRBIMP_MIT79};8081/* Prototypes. */82__BEGIN_DECLS8384bool_t xdr_rpc_gss_cred(XDR *xdrs, struct rpc_gss_cred *p);85bool_t xdr_rpc_gss_init_res(XDR *xdrs, struct rpc_gss_init_res *p);86bool_t xdr_rpc_gss_wrap_data(struct mbuf **argsp,87gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_service_t svc,88u_int seq);89bool_t xdr_rpc_gss_unwrap_data(struct mbuf **resultsp,90gss_ctx_id_t ctx, gss_qop_t qop, rpc_gss_service_t svc, u_int seq);91const char *_rpc_gss_num_to_qop(const char *mech, u_int num);92void _rpc_gss_set_error(int rpc_gss_error, int system_error);9394void rpc_gss_log_debug(const char *fmt, ...);95void rpc_gss_log_status(const char *m, gss_OID mech, OM_uint32 major,96OM_uint32 minor);9798__END_DECLS99100#endif /* !_RPCSEC_GSS_INT_H */101102103