File indexing completed on 2025-01-18 10:13:01
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 _TIRPC_AUTH_GSS_H
0038 #define _TIRPC_AUTH_GSS_H
0039
0040 #include <rpc/clnt.h>
0041 #include <gssapi/gssapi.h>
0042
0043
0044 typedef enum {
0045 RPCSEC_GSS_DATA = 0,
0046 RPCSEC_GSS_INIT = 1,
0047 RPCSEC_GSS_CONTINUE_INIT = 2,
0048 RPCSEC_GSS_DESTROY = 3
0049 } rpc_gss_proc_t;
0050
0051
0052 typedef enum {
0053 RPCSEC_GSS_SVC_NONE = 1,
0054 RPCSEC_GSS_SVC_INTEGRITY = 2,
0055 RPCSEC_GSS_SVC_PRIVACY = 3
0056 } rpc_gss_svc_t;
0057
0058 #define RPCSEC_GSS_VERSION 1
0059
0060
0061 struct rpc_gss_sec {
0062 gss_OID mech;
0063 gss_qop_t qop;
0064 rpc_gss_svc_t svc;
0065 gss_cred_id_t cred;
0066 u_int req_flags;
0067 };
0068
0069
0070 struct authgss_private_data {
0071 gss_ctx_id_t pd_ctx;
0072 gss_buffer_desc pd_ctx_hndl;
0073 u_int pd_seq_win;
0074 };
0075
0076
0077 extern gss_OID_desc krb5oid;
0078 extern gss_OID_desc spkm3oid;
0079
0080
0081 struct rpc_gss_cred {
0082 u_int gc_v;
0083 rpc_gss_proc_t gc_proc;
0084 u_int gc_seq;
0085 rpc_gss_svc_t gc_svc;
0086 gss_buffer_desc gc_ctx;
0087 };
0088
0089
0090 struct rpc_gss_init_res {
0091 gss_buffer_desc gr_ctx;
0092 u_int gr_major;
0093 u_int gr_minor;
0094 u_int gr_win;
0095 gss_buffer_desc gr_token;
0096 };
0097
0098
0099 #define MAXSEQ 0x80000000
0100
0101
0102 #ifdef __cplusplus
0103 extern "C" {
0104 #endif
0105 bool_t xdr_rpc_gss_cred (XDR *xdrs, struct rpc_gss_cred *p);
0106 bool_t xdr_rpc_gss_init_args (XDR *xdrs, gss_buffer_desc *p);
0107 bool_t xdr_rpc_gss_init_res (XDR *xdrs, struct rpc_gss_init_res *p);
0108 bool_t xdr_rpc_gss_data (XDR *xdrs, xdrproc_t xdr_func,
0109 caddr_t xdr_ptr, gss_ctx_id_t ctx,
0110 gss_qop_t qop, rpc_gss_svc_t svc,
0111 u_int seq);
0112
0113 AUTH *authgss_create (CLIENT *, gss_name_t, struct rpc_gss_sec *);
0114 AUTH *authgss_create_default (CLIENT *, char *, struct rpc_gss_sec *);
0115 bool_t authgss_service (AUTH *auth, int svc);
0116 bool_t authgss_get_private_data (AUTH *auth, struct authgss_private_data *);
0117 bool_t authgss_free_private_data (struct authgss_private_data *);
0118
0119 void gss_log_debug (const char *fmt, ...);
0120 void gss_log_status (char *m, OM_uint32 major, OM_uint32 minor);
0121 void gss_log_hexdump (const u_char *buf, int len, int offset);
0122
0123 bool_t is_authgss_client (CLIENT *);
0124
0125 #ifdef __cplusplus
0126 }
0127 #endif
0128
0129 #endif