File indexing completed on 2025-01-18 10:01:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifndef GSSRPC_AUTH_GSS_H
0038 #define GSSRPC_AUTH_GSS_H
0039
0040 #include <gssrpc/rpc.h>
0041 #include <gssrpc/clnt.h>
0042 #ifdef HAVE_HEIMDAL
0043 #include <gssapi.h>
0044 #else
0045 #include <gssapi/gssapi.h>
0046 #endif
0047
0048 GSSRPC__BEGIN_DECLS
0049
0050
0051 typedef enum {
0052 RPCSEC_GSS_DATA = 0,
0053 RPCSEC_GSS_INIT = 1,
0054 RPCSEC_GSS_CONTINUE_INIT = 2,
0055 RPCSEC_GSS_DESTROY = 3
0056 } rpc_gss_proc_t;
0057
0058
0059 typedef enum {
0060 RPCSEC_GSS_SVC_NONE = 1,
0061 RPCSEC_GSS_SVC_INTEGRITY = 2,
0062 RPCSEC_GSS_SVC_PRIVACY = 3
0063 } rpc_gss_svc_t;
0064
0065 #define RPCSEC_GSS_VERSION 1
0066
0067
0068 struct rpc_gss_sec {
0069 gss_OID mech;
0070 gss_qop_t qop;
0071 rpc_gss_svc_t svc;
0072 gss_cred_id_t cred;
0073 uint32_t req_flags;
0074 };
0075
0076
0077 struct authgss_private_data {
0078 gss_ctx_id_t pd_ctx;
0079 gss_buffer_desc pd_ctx_hndl;
0080 uint32_t pd_seq_win;
0081 };
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100 struct rpc_gss_cred {
0101 u_int gc_v;
0102 rpc_gss_proc_t gc_proc;
0103 uint32_t gc_seq;
0104 rpc_gss_svc_t gc_svc;
0105 gss_buffer_desc gc_ctx;
0106 };
0107
0108
0109 struct rpc_gss_init_res {
0110 gss_buffer_desc gr_ctx;
0111 uint32_t gr_major;
0112 uint32_t gr_minor;
0113 uint32_t gr_win;
0114 gss_buffer_desc gr_token;
0115 };
0116
0117
0118 #define MAXSEQ 0x80000000
0119
0120
0121 bool_t xdr_rpc_gss_buf (XDR *xdrs, gss_buffer_t, u_int maxsize);
0122 bool_t xdr_rpc_gss_cred (XDR *xdrs, struct rpc_gss_cred *p);
0123 bool_t xdr_rpc_gss_init_args (XDR *xdrs, gss_buffer_desc *p);
0124 bool_t xdr_rpc_gss_init_res (XDR *xdrs, struct rpc_gss_init_res *p);
0125 bool_t xdr_rpc_gss_data (XDR *xdrs, xdrproc_t xdr_func,
0126 caddr_t xdr_ptr, gss_ctx_id_t ctx,
0127 gss_qop_t qop, rpc_gss_svc_t svc,
0128 uint32_t seq);
0129 bool_t xdr_rpc_gss_wrap_data (XDR *xdrs, xdrproc_t xdr_func, caddr_t
0130 xdr_ptr, gss_ctx_id_t ctx, gss_qop_t qop,
0131 rpc_gss_svc_t svc, uint32_t seq);
0132 bool_t xdr_rpc_gss_unwrap_data (XDR *xdrs, xdrproc_t xdr_func, caddr_t
0133 xdr_ptr, gss_ctx_id_t ctx, gss_qop_t qop,
0134 rpc_gss_svc_t svc, uint32_t seq);
0135
0136 AUTH *authgss_create (CLIENT *, gss_name_t, struct rpc_gss_sec *);
0137 AUTH *authgss_create_default (CLIENT *, char *, struct rpc_gss_sec *);
0138 bool_t authgss_service (AUTH *auth, int svc);
0139 bool_t authgss_get_private_data (AUTH *auth, struct authgss_private_data *);
0140
0141 #ifdef GSSRPC__IMPL
0142 void log_debug (const char *fmt, ...);
0143 void log_status (char *m, OM_uint32 major, OM_uint32 minor);
0144 void log_hexdump (const u_char *buf, int len, int offset);
0145 #endif
0146
0147 GSSRPC__END_DECLS
0148 #endif