1 /* #ident "@(#)mglueP.h 1.2 96/01/18 SMI" */
4 * This header contains the private mechglue definitions.
6 * Copyright (c) 1995, by Sun Microsystems, Inc.
10 #ifndef _GSS_MECHGLUEP_H
11 #define _GSS_MECHGLUEP_H
16 * Array of context IDs typed by mechanism OID
18 typedef struct gss_union_ctx_id_t {
20 gss_ctx_id_t internal_ctx_id;
21 } gss_union_ctx_id_desc, *gss_union_ctx_id_t;
24 * Structure for holding list of mechanism-specific name types
26 typedef struct gss_mech_spec_name_t {
29 struct gss_mech_spec_name_t *next, *prev;
30 } gss_mech_spec_name_desc, *gss_mech_spec_name;
33 * Credential auxiliary info, used in the credential structure
35 typedef struct gss_union_cred_auxinfo {
41 } gss_union_cred_auxinfo;
44 * Set of Credentials typed on mechanism OID
46 typedef struct gss_union_cred_t {
49 gss_cred_id_t * cred_array;
50 gss_union_cred_auxinfo auxinfo;
51 } gss_union_cred_desc, *gss_union_cred_t;
53 /********************************************************/
54 /* The Mechanism Dispatch Table -- a mechanism needs to */
55 /* define one of these and provide a function to return */
56 /* it to initialize the GSSAPI library */
59 * This is the definition of the mechs_array struct, which is used to
60 * define the mechs array table. This table is used to indirectly
61 * access mechanism specific versions of the gssapi routines through
62 * the routines in the glue module (gssd_mech_glue.c)
64 * This contants all of the functions defined in gssapi.h except for
65 * gss_release_buffer() and gss_release_oid_set(), which I am
66 * assuming, for now, to be equal across mechanisms.
69 typedef struct gss_config {
70 gss_OID_desc mech_type;
72 OM_uint32 (*gss_acquire_cred)
74 #ifdef USE_MECH_CONTEXT
77 OM_uint32*, /* minor_status */
78 gss_name_t, /* desired_name */
79 OM_uint32, /* time_req */
80 gss_OID_set, /* desired_mechs */
82 gss_cred_id_t*, /* output_cred_handle */
83 gss_OID_set*, /* actual_mechs */
84 OM_uint32* /* time_rec */
86 OM_uint32 (*gss_release_cred)
88 #ifdef USE_MECH_CONTEXT
91 OM_uint32*, /* minor_status */
92 gss_cred_id_t* /* cred_handle */
94 OM_uint32 (*gss_init_sec_context)
96 #ifdef USE_MECH_CONTEXT
99 OM_uint32*, /* minor_status */
100 gss_cred_id_t, /* claimant_cred_handle */
101 gss_ctx_id_t*, /* context_handle */
102 gss_name_t, /* target_name */
103 gss_OID, /* mech_type */
104 OM_uint32, /* req_flags */
105 OM_uint32, /* time_req */
106 gss_channel_bindings_t, /* input_chan_bindings */
107 gss_buffer_t, /* input_token */
108 gss_OID*, /* actual_mech_type */
109 gss_buffer_t, /* output_token */
110 OM_uint32*, /* ret_flags */
111 OM_uint32* /* time_rec */
113 OM_uint32 (*gss_accept_sec_context)
115 #ifdef USE_MECH_CONTEXT
118 OM_uint32*, /* minor_status */
119 gss_ctx_id_t*, /* context_handle */
120 gss_cred_id_t, /* verifier_cred_handle */
121 gss_buffer_t, /* input_token_buffer */
122 gss_channel_bindings_t, /* input_chan_bindings */
123 gss_name_t*, /* src_name */
124 gss_OID*, /* mech_type */
125 gss_buffer_t, /* output_token */
126 OM_uint32*, /* ret_flags */
127 OM_uint32*, /* time_rec */
128 gss_cred_id_t* /* delegated_cred_handle */
130 OM_uint32 (*gss_process_context_token)
132 #ifdef USE_MECH_CONTEXT
135 OM_uint32*, /* minor_status */
136 gss_ctx_id_t, /* context_handle */
137 gss_buffer_t /* token_buffer */
139 OM_uint32 (*gss_delete_sec_context)
141 #ifdef USE_MECH_CONTEXT
144 OM_uint32*, /* minor_status */
145 gss_ctx_id_t*, /* context_handle */
146 gss_buffer_t /* output_token */
148 OM_uint32 (*gss_context_time)
150 #ifdef USE_MECH_CONTEXT
153 OM_uint32*, /* minor_status */
154 gss_ctx_id_t, /* context_handle */
155 OM_uint32* /* time_rec */
157 OM_uint32 (*gss_sign)
159 #ifdef USE_MECH_CONTEXT
162 OM_uint32*, /* minor_status */
163 gss_ctx_id_t, /* context_handle */
165 gss_buffer_t, /* message_buffer */
166 gss_buffer_t /* message_token */
168 OM_uint32 (*gss_verify)
170 #ifdef USE_MECH_CONTEXT
173 OM_uint32*, /* minor_status */
174 gss_ctx_id_t, /* context_handle */
175 gss_buffer_t, /* message_buffer */
176 gss_buffer_t, /* token_buffer */
179 OM_uint32 (*gss_seal)
181 #ifdef USE_MECH_CONTEXT
184 OM_uint32*, /* minor_status */
185 gss_ctx_id_t, /* context_handle */
186 int, /* conf_req_flag */
188 gss_buffer_t, /* input_message_buffer */
189 int*, /* conf_state */
190 gss_buffer_t /* output_message_buffer */
192 OM_uint32 (*gss_unseal)
194 #ifdef USE_MECH_CONTEXT
197 OM_uint32*, /* minor_status */
198 gss_ctx_id_t, /* context_handle */
199 gss_buffer_t, /* input_message_buffer */
200 gss_buffer_t, /* output_message_buffer */
201 int*, /* conf_state */
204 OM_uint32 (*gss_display_status)
206 #ifdef USE_MECH_CONTEXT
209 OM_uint32*, /* minor_status */
210 OM_uint32, /* status_value */
211 int, /* status_type */
212 gss_OID, /* mech_type */
213 OM_uint32*, /* message_context */
214 gss_buffer_t /* status_string */
216 OM_uint32 (*gss_indicate_mechs)
218 #ifdef USE_MECH_CONTEXT
221 OM_uint32*, /* minor_status */
222 gss_OID_set* /* mech_set */
224 OM_uint32 (*gss_compare_name)
226 #ifdef USE_MECH_CONTEXT
229 OM_uint32*, /* minor_status */
230 gss_name_t, /* name1 */
231 gss_name_t, /* name2 */
232 int* /* name_equal */
234 OM_uint32 (*gss_display_name)
236 #ifdef USE_MECH_CONTEXT
239 OM_uint32*, /* minor_status */
240 gss_name_t, /* input_name */
241 gss_buffer_t, /* output_name_buffer */
242 gss_OID* /* output_name_type */
244 OM_uint32 (*gss_import_name)
246 #ifdef USE_MECH_CONTEXT
249 OM_uint32*, /* minor_status */
250 gss_buffer_t, /* input_name_buffer */
251 gss_OID, /* input_name_type */
252 gss_name_t* /* output_name */
254 OM_uint32 (*gss_release_name)
256 #ifdef USE_MECH_CONTEXT
259 OM_uint32*, /* minor_status */
260 gss_name_t* /* input_name */
262 OM_uint32 (*gss_inquire_cred)
264 #ifdef USE_MECH_CONTEXT
267 OM_uint32 *, /* minor_status */
268 gss_cred_id_t, /* cred_handle */
269 gss_name_t *, /* name */
270 OM_uint32 *, /* lifetime */
271 int *, /* cred_usage */
272 gss_OID_set * /* mechanisms */
274 OM_uint32 (*gss_add_cred)
276 #ifdef USE_MECH_CONTEXT
279 OM_uint32 *, /* minor_status */
280 gss_cred_id_t, /* input_cred_handle */
281 gss_name_t, /* desired_name */
282 gss_OID, /* desired_mech */
283 gss_cred_usage_t, /* cred_usage */
284 OM_uint32, /* initiator_time_req */
285 OM_uint32, /* acceptor_time_req */
286 gss_cred_id_t *, /* output_cred_handle */
287 gss_OID_set *, /* actual_mechs */
288 OM_uint32 *, /* initiator_time_rec */
289 OM_uint32 * /* acceptor_time_rec */
291 OM_uint32 (*gss_export_sec_context)
293 #ifdef USE_MECH_CONTEXT
296 OM_uint32 *, /* minor_status */
297 gss_ctx_id_t *, /* context_handle */
298 gss_buffer_t /* interprocess_token */
300 OM_uint32 (*gss_import_sec_context)
302 #ifdef USE_MECH_CONTEXT
303 void *, /* context */
305 OM_uint32 *, /* minor_status */
306 gss_buffer_t, /* interprocess_token */
307 gss_ctx_id_t * /* context_handle */
309 OM_uint32 (*gss_inquire_cred_by_mech)
311 #ifdef USE_MECH_CONTEXT
312 void *, /* context */
314 OM_uint32 *, /* minor_status */
315 gss_cred_id_t, /* cred_handle */
316 gss_OID, /* mech_type */
317 gss_name_t *, /* name */
318 OM_uint32 *, /* initiator_lifetime */
319 OM_uint32 *, /* acceptor_lifetime */
320 gss_cred_usage_t * /* cred_usage */
322 OM_uint32 (*gss_inquire_names_for_mech)
324 #ifdef USE_MECH_CONTEXT
325 void *, /* context */
327 OM_uint32 *, /* minor_status */
328 gss_OID, /* mechanism */
329 gss_OID_set * /* name_types */
331 OM_uint32 (*gss_inquire_context)
333 #ifdef USE_MECH_CONTEXT
334 void *, /* context */
336 OM_uint32 *, /* minor_status */
337 gss_ctx_id_t, /* context_handle */
338 gss_name_t *, /* src_name */
339 gss_name_t *, /* targ_name */
340 OM_uint32 *, /* lifetime_rec */
341 gss_OID *, /* mech_type */
342 OM_uint32 *, /* ctx_flags */
343 int *, /* locally_initiated */
346 OM_uint32 (*gss_internal_release_oid)
348 #ifdef USE_MECH_CONTEXT
349 void *, /* context */
351 OM_uint32 *, /* minor_status */
354 OM_uint32 (*gss_wrap_size_limit)
356 #ifdef USE_MECH_CONTEXT
357 void *, /* context */
359 OM_uint32 *, /* minor_status */
360 gss_ctx_id_t, /* context_handle */
361 int, /* conf_req_flag */
362 gss_qop_t, /* qop_req */
363 OM_uint32, /* req_output_size */
364 OM_uint32 * /* max_input_size */
366 OM_uint32 (*pname_to_uid)
368 #ifdef USE_MECH_CONTEXT
369 void *, /* context */
372 gss_OID, /* name type */
373 gss_OID, /* mech type */
376 OM_uint32 (*gss_duplicate_name)
378 #ifdef USE_MECH_CONTEXT
379 void *, /* context */
381 OM_uint32 *, /* minor_status */
382 const gss_name_t, /* input_name */
383 gss_name_t * /* dest_name */
385 OM_uint32 (*gss_set_allowable_enctypes)
387 #ifdef USE_MECH_CONTEXT
388 void *, /* context */
390 OM_uint32 *, /* minor_status */
391 gss_cred_id_t, /* cred_handle */
392 OM_uint32, /* num_ktypes */
395 OM_uint32 (*gss_verify_mic)
397 #ifdef USE_MECH_CONTEXT
400 OM_uint32*, /* minor_status */
401 gss_ctx_id_t, /* context_handle */
402 gss_buffer_t, /* message_buffer */
403 gss_buffer_t, /* token_buffer */
410 * Generic GSSAPI names. A name can either be a generic name, or a
411 * mechanism specific name....
413 typedef struct gss_union_name_t {
414 gss_mechanism gss_mech;
416 gss_buffer_t external_name;
418 * These last two fields are only filled in for mechanism
422 gss_name_t mech_name;
423 } gss_union_name_desc, *gss_union_name_t;
425 /********************************************************/
426 /* Internal mechglue routines */
428 gss_mechanism __gss_get_mechanism (gss_OID);
429 OM_uint32 __gss_get_mech_type (gss_OID, gss_buffer_t);
430 OM_uint32 __gss_import_internal_name (OM_uint32 *, gss_OID, gss_union_name_t,
432 OM_uint32 __gss_display_internal_name (OM_uint32 *, gss_OID, gss_name_t,
433 gss_buffer_t, gss_OID *);
434 OM_uint32 __gss_release_internal_name (OM_uint32 *, gss_OID, gss_name_t *);
436 OM_uint32 __gss_convert_name_to_union_name
437 (OM_uint32 *, /* minor_status */
438 gss_mechanism, /* mech */
439 gss_name_t, /* internal_name */
440 gss_name_t * /* external_name */
442 gss_cred_id_t __gss_get_mechanism_cred
443 (gss_union_cred_t, /* union_cred */
444 gss_OID /* mech_type */
447 OM_uint32 generic_gss_release_oid
448 (OM_uint32 *, /* minor_status */
452 OM_uint32 mech_gss_release_oid
453 (OM_uint32 *, /* minor_status */
455 gss_mechanism /* gss_mech */
458 OM_uint32 generic_gss_copy_oid
459 (OM_uint32 *, /* minor_status */
461 gss_OID * /* new_oid */
464 OM_uint32 generic_gss_create_empty_oid_set
465 (OM_uint32 *, /* minor_status */
466 gss_OID_set * /* oid_set */
469 OM_uint32 generic_gss_add_oid_set_member
470 (OM_uint32 *, /* minor_status */
471 gss_OID, /* member_oid */
472 gss_OID_set * /* oid_set */
475 OM_uint32 generic_gss_test_oid_set_member
476 (OM_uint32 *, /* minor_status */
477 gss_OID, /* member */
478 gss_OID_set, /* set */
482 OM_uint32 generic_gss_oid_to_str
483 (OM_uint32 *, /* minor_status */
485 gss_buffer_t /* oid_str */
488 OM_uint32 generic_gss_str_to_oid
489 (OM_uint32 *, /* minor_status */
490 gss_buffer_t, /* oid_str */
495 gss_OID gss_find_mechanism_from_name_type (gss_OID); /* name_type */
497 OM_uint32 gss_add_mech_name_type
498 (OM_uint32 *, /* minor_status */
499 gss_OID, /* name_type */
503 #endif /* _GSS_MECHGLUEP_H */