1 /* lib/gssapi/mechglue/mglueP.h */
4 * Copyright (c) 1995, by Sun Microsystems, Inc.
8 /* This header contains the private mechglue definitions. */
10 #ifndef _GSS_MECHGLUEP_H
11 #define _GSS_MECHGLUEP_H
15 #include "gssapiP_generic.h"
17 #define g_OID_copy(o1, o2) \
19 memcpy((o1)->elements, (o2)->elements, (o2)->length); \
20 (o1)->length = (o2)->length; \
24 * Array of context IDs typed by mechanism OID
26 typedef struct gss_ctx_id_struct {
27 struct gss_ctx_id_struct *loopback;
29 gss_ctx_id_t internal_ctx_id;
30 } gss_union_ctx_id_desc, *gss_union_ctx_id_t;
33 * Generic GSSAPI names. A name can either be a generic name, or a
34 * mechanism specific name....
36 typedef struct gss_name_struct {
37 struct gss_name_struct *loopback;
39 gss_buffer_t external_name;
41 * These last two fields are only filled in for mechanism
46 } gss_union_name_desc, *gss_union_name_t;
49 * Structure for holding list of mechanism-specific name types
51 typedef struct gss_mech_spec_name_t {
54 struct gss_mech_spec_name_t *next, *prev;
55 } gss_mech_spec_name_desc, *gss_mech_spec_name;
58 * Set of Credentials typed on mechanism OID
60 typedef struct gss_cred_id_struct {
61 struct gss_cred_id_struct *loopback;
64 gss_cred_id_t *cred_array;
65 } gss_union_cred_desc, *gss_union_cred_t;
67 typedef OM_uint32 (KRB5_CALLCONV *gss_acquire_cred_with_password_sfct)(
68 OM_uint32 *, /* minor_status */
69 const gss_name_t, /* desired_name */
70 const gss_buffer_t, /* password */
71 OM_uint32, /* time_req */
72 const gss_OID_set, /* desired_mechs */
74 gss_cred_id_t *, /* output_cred_handle */
75 gss_OID_set *, /* actual_mechs */
76 OM_uint32 * /* time_rec */
80 * Rudimentary pointer validation macro to check whether the
81 * "loopback" field of an opaque struct points back to itself. This
82 * field also catches some programming errors where an opaque pointer
83 * is passed to a function expecting the address of the opaque
86 #define GSSINT_CHK_LOOP(p) (!((p) != NULL && (p)->loopback == (p)))
88 /********************************************************/
89 /* The Mechanism Dispatch Table -- a mechanism needs to */
90 /* define one of these and provide a function to return */
91 /* it to initialize the GSSAPI library */
92 int gssint_mechglue_initialize_library(void);
94 OM_uint32 gssint_get_mech_type_oid(gss_OID OID, gss_buffer_t token);
97 * This is the definition of the mechs_array struct, which is used to
98 * define the mechs array table. This table is used to indirectly
99 * access mechanism specific versions of the gssapi routines through
100 * the routines in the glue module (gssd_mech_glue.c)
102 * This contants all of the functions defined in gssapi.h except for
103 * gss_release_buffer() and gss_release_oid_set(), which I am
104 * assuming, for now, to be equal across mechanisms.
107 typedef struct gss_config {
108 gss_OID_desc mech_type;
110 OM_uint32 (KRB5_CALLCONV *gss_acquire_cred)
112 OM_uint32*, /* minor_status */
113 gss_name_t, /* desired_name */
114 OM_uint32, /* time_req */
115 gss_OID_set, /* desired_mechs */
116 int, /* cred_usage */
117 gss_cred_id_t*, /* output_cred_handle */
118 gss_OID_set*, /* actual_mechs */
119 OM_uint32* /* time_rec */
121 OM_uint32 (KRB5_CALLCONV *gss_release_cred)
123 OM_uint32*, /* minor_status */
124 gss_cred_id_t* /* cred_handle */
126 OM_uint32 (KRB5_CALLCONV *gss_init_sec_context)
128 OM_uint32*, /* minor_status */
129 gss_cred_id_t, /* claimant_cred_handle */
130 gss_ctx_id_t*, /* context_handle */
131 gss_name_t, /* target_name */
132 gss_OID, /* mech_type */
133 OM_uint32, /* req_flags */
134 OM_uint32, /* time_req */
135 gss_channel_bindings_t, /* input_chan_bindings */
136 gss_buffer_t, /* input_token */
137 gss_OID*, /* actual_mech_type */
138 gss_buffer_t, /* output_token */
139 OM_uint32*, /* ret_flags */
140 OM_uint32* /* time_rec */
142 OM_uint32 (KRB5_CALLCONV *gss_accept_sec_context)
144 OM_uint32*, /* minor_status */
145 gss_ctx_id_t*, /* context_handle */
146 gss_cred_id_t, /* verifier_cred_handle */
147 gss_buffer_t, /* input_token_buffer */
148 gss_channel_bindings_t, /* input_chan_bindings */
149 gss_name_t*, /* src_name */
150 gss_OID*, /* mech_type */
151 gss_buffer_t, /* output_token */
152 OM_uint32*, /* ret_flags */
153 OM_uint32*, /* time_rec */
154 gss_cred_id_t* /* delegated_cred_handle */
156 OM_uint32 (KRB5_CALLCONV *gss_process_context_token)
158 OM_uint32*, /* minor_status */
159 gss_ctx_id_t, /* context_handle */
160 gss_buffer_t /* token_buffer */
162 OM_uint32 (KRB5_CALLCONV *gss_delete_sec_context)
164 OM_uint32*, /* minor_status */
165 gss_ctx_id_t*, /* context_handle */
166 gss_buffer_t /* output_token */
168 OM_uint32 (KRB5_CALLCONV *gss_context_time)
170 OM_uint32*, /* minor_status */
171 gss_ctx_id_t, /* context_handle */
172 OM_uint32* /* time_rec */
174 OM_uint32 (KRB5_CALLCONV *gss_get_mic)
176 OM_uint32*, /* minor_status */
177 gss_ctx_id_t, /* context_handle */
178 gss_qop_t, /* qop_req */
179 gss_buffer_t, /* message_buffer */
180 gss_buffer_t /* message_token */
182 OM_uint32 (KRB5_CALLCONV *gss_verify_mic)
184 OM_uint32*, /* minor_status */
185 gss_ctx_id_t, /* context_handle */
186 gss_buffer_t, /* message_buffer */
187 gss_buffer_t, /* token_buffer */
188 gss_qop_t* /* qop_state */
190 OM_uint32 (KRB5_CALLCONV *gss_wrap)
192 OM_uint32*, /* minor_status */
193 gss_ctx_id_t, /* context_handle */
194 int, /* conf_req_flag */
195 gss_qop_t, /* qop_req */
196 gss_buffer_t, /* input_message_buffer */
197 int*, /* conf_state */
198 gss_buffer_t /* output_message_buffer */
200 OM_uint32 (KRB5_CALLCONV *gss_unwrap)
202 OM_uint32*, /* minor_status */
203 gss_ctx_id_t, /* context_handle */
204 gss_buffer_t, /* input_message_buffer */
205 gss_buffer_t, /* output_message_buffer */
206 int*, /* conf_state */
207 gss_qop_t* /* qop_state */
209 OM_uint32 (KRB5_CALLCONV *gss_display_status)
211 OM_uint32*, /* minor_status */
212 OM_uint32, /* status_value */
213 int, /* status_type */
214 gss_OID, /* mech_type */
215 OM_uint32*, /* message_context */
216 gss_buffer_t /* status_string */
218 OM_uint32 (KRB5_CALLCONV *gss_indicate_mechs)
220 OM_uint32*, /* minor_status */
221 gss_OID_set* /* mech_set */
223 OM_uint32 (KRB5_CALLCONV *gss_compare_name)
225 OM_uint32*, /* minor_status */
226 gss_name_t, /* name1 */
227 gss_name_t, /* name2 */
228 int* /* name_equal */
230 OM_uint32 (KRB5_CALLCONV *gss_display_name)
232 OM_uint32*, /* minor_status */
233 gss_name_t, /* input_name */
234 gss_buffer_t, /* output_name_buffer */
235 gss_OID* /* output_name_type */
237 OM_uint32 (KRB5_CALLCONV *gss_import_name)
239 OM_uint32*, /* minor_status */
240 gss_buffer_t, /* input_name_buffer */
241 gss_OID, /* input_name_type */
242 gss_name_t* /* output_name */
244 OM_uint32 (KRB5_CALLCONV *gss_release_name)
246 OM_uint32*, /* minor_status */
247 gss_name_t* /* input_name */
249 OM_uint32 (KRB5_CALLCONV *gss_inquire_cred)
251 OM_uint32 *, /* minor_status */
252 gss_cred_id_t, /* cred_handle */
253 gss_name_t *, /* name */
254 OM_uint32 *, /* lifetime */
255 int *, /* cred_usage */
256 gss_OID_set * /* mechanisms */
258 OM_uint32 (KRB5_CALLCONV *gss_add_cred)
260 OM_uint32 *, /* minor_status */
261 gss_cred_id_t, /* input_cred_handle */
262 gss_name_t, /* desired_name */
263 gss_OID, /* desired_mech */
264 gss_cred_usage_t, /* cred_usage */
265 OM_uint32, /* initiator_time_req */
266 OM_uint32, /* acceptor_time_req */
267 gss_cred_id_t *, /* output_cred_handle */
268 gss_OID_set *, /* actual_mechs */
269 OM_uint32 *, /* initiator_time_rec */
270 OM_uint32 * /* acceptor_time_rec */
272 OM_uint32 (KRB5_CALLCONV *gss_export_sec_context)
274 OM_uint32 *, /* minor_status */
275 gss_ctx_id_t *, /* context_handle */
276 gss_buffer_t /* interprocess_token */
278 OM_uint32 (KRB5_CALLCONV *gss_import_sec_context)
280 OM_uint32 *, /* minor_status */
281 gss_buffer_t, /* interprocess_token */
282 gss_ctx_id_t * /* context_handle */
284 OM_uint32 (KRB5_CALLCONV *gss_inquire_cred_by_mech)
286 OM_uint32 *, /* minor_status */
287 gss_cred_id_t, /* cred_handle */
288 gss_OID, /* mech_type */
289 gss_name_t *, /* name */
290 OM_uint32 *, /* initiator_lifetime */
291 OM_uint32 *, /* acceptor_lifetime */
292 gss_cred_usage_t * /* cred_usage */
294 OM_uint32 (KRB5_CALLCONV *gss_inquire_names_for_mech)
296 OM_uint32 *, /* minor_status */
297 gss_OID, /* mechanism */
298 gss_OID_set * /* name_types */
300 OM_uint32 (KRB5_CALLCONV *gss_inquire_context)
302 OM_uint32 *, /* minor_status */
303 gss_ctx_id_t, /* context_handle */
304 gss_name_t *, /* src_name */
305 gss_name_t *, /* targ_name */
306 OM_uint32 *, /* lifetime_rec */
307 gss_OID *, /* mech_type */
308 OM_uint32 *, /* ctx_flags */
309 int *, /* locally_initiated */
312 OM_uint32 (KRB5_CALLCONV *gss_internal_release_oid)
314 OM_uint32 *, /* minor_status */
317 OM_uint32 (KRB5_CALLCONV *gss_wrap_size_limit)
319 OM_uint32 *, /* minor_status */
320 gss_ctx_id_t, /* context_handle */
321 int, /* conf_req_flag */
322 gss_qop_t, /* qop_req */
323 OM_uint32, /* req_output_size */
324 OM_uint32 * /* max_input_size */
326 OM_uint32 (* KRB5_CALLCONV gss_localname)
328 OM_uint32 *, /* minor */
329 const gss_name_t, /* name */
330 gss_const_OID, /* mech_type */
331 gss_buffer_t /* localname */
333 OM_uint32 (KRB5_CALLCONV *gssspi_authorize_localname)
335 OM_uint32 *, /* minor_status */
336 const gss_name_t, /* pname */
337 gss_const_buffer_t, /* local user */
338 gss_const_OID /* local nametype */
340 OM_uint32 (KRB5_CALLCONV *gss_export_name)
342 OM_uint32 *, /* minor_status */
343 const gss_name_t, /* input_name */
344 gss_buffer_t /* exported_name */
346 OM_uint32 (KRB5_CALLCONV *gss_duplicate_name)
348 OM_uint32*, /* minor_status */
349 const gss_name_t, /* input_name */
350 gss_name_t * /* output_name */
352 OM_uint32 (KRB5_CALLCONV *gss_store_cred)
354 OM_uint32 *, /* minor_status */
355 const gss_cred_id_t, /* input_cred */
356 gss_cred_usage_t, /* cred_usage */
357 const gss_OID, /* desired_mech */
358 OM_uint32, /* overwrite_cred */
359 OM_uint32, /* default_cred */
360 gss_OID_set *, /* elements_stored */
361 gss_cred_usage_t * /* cred_usage_stored */
367 OM_uint32 (KRB5_CALLCONV *gss_inquire_sec_context_by_oid)
369 OM_uint32 *, /* minor_status */
370 const gss_ctx_id_t, /* context_handle */
371 const gss_OID, /* OID */
372 gss_buffer_set_t * /* data_set */
374 OM_uint32 (KRB5_CALLCONV *gss_inquire_cred_by_oid)
376 OM_uint32 *, /* minor_status */
377 const gss_cred_id_t, /* cred_handle */
378 const gss_OID, /* OID */
379 gss_buffer_set_t * /* data_set */
381 OM_uint32 (KRB5_CALLCONV *gss_set_sec_context_option)
383 OM_uint32 *, /* minor_status */
384 gss_ctx_id_t *, /* context_handle */
385 const gss_OID, /* OID */
386 const gss_buffer_t /* value */
388 OM_uint32 (KRB5_CALLCONV *gssspi_set_cred_option)
390 OM_uint32 *, /* minor_status */
391 gss_cred_id_t *, /* cred_handle */
392 const gss_OID, /* OID */
393 const gss_buffer_t /* value */
395 OM_uint32 (KRB5_CALLCONV *gssspi_mech_invoke)
397 OM_uint32*, /* minor_status */
398 const gss_OID, /* mech OID */
399 const gss_OID, /* OID */
400 gss_buffer_t /* value */
403 /* AEAD extensions */
404 OM_uint32 (KRB5_CALLCONV *gss_wrap_aead)
406 OM_uint32 *, /* minor_status */
407 gss_ctx_id_t, /* context_handle */
408 int, /* conf_req_flag */
409 gss_qop_t, /* qop_req */
410 gss_buffer_t, /* input_assoc_buffer */
411 gss_buffer_t, /* input_payload_buffer */
412 int *, /* conf_state */
413 gss_buffer_t /* output_message_buffer */
416 OM_uint32 (KRB5_CALLCONV *gss_unwrap_aead)
418 OM_uint32 *, /* minor_status */
419 gss_ctx_id_t, /* context_handle */
420 gss_buffer_t, /* input_message_buffer */
421 gss_buffer_t, /* input_assoc_buffer */
422 gss_buffer_t, /* output_payload_buffer */
423 int *, /* conf_state */
424 gss_qop_t * /* qop_state */
427 /* SSPI extensions */
428 OM_uint32 (KRB5_CALLCONV *gss_wrap_iov)
430 OM_uint32 *, /* minor_status */
431 gss_ctx_id_t, /* context_handle */
432 int, /* conf_req_flag */
433 gss_qop_t, /* qop_req */
434 int *, /* conf_state */
435 gss_iov_buffer_desc *, /* iov */
439 OM_uint32 (KRB5_CALLCONV *gss_unwrap_iov)
441 OM_uint32 *, /* minor_status */
442 gss_ctx_id_t, /* context_handle */
443 int *, /* conf_state */
444 gss_qop_t *, /* qop_state */
445 gss_iov_buffer_desc *, /* iov */
449 OM_uint32 (KRB5_CALLCONV *gss_wrap_iov_length)
451 OM_uint32 *, /* minor_status */
452 gss_ctx_id_t, /* context_handle */
453 int, /* conf_req_flag*/
454 gss_qop_t, /* qop_req */
455 int *, /* conf_state */
456 gss_iov_buffer_desc *, /* iov */
460 OM_uint32 (KRB5_CALLCONV *gss_complete_auth_token)
462 OM_uint32*, /* minor_status */
463 const gss_ctx_id_t, /* context_handle */
464 gss_buffer_t /* input_message_buffer */
469 OM_uint32 (KRB5_CALLCONV *gss_acquire_cred_impersonate_name)
471 OM_uint32 *, /* minor_status */
472 const gss_cred_id_t, /* impersonator_cred_handle */
473 const gss_name_t, /* desired_name */
474 OM_uint32, /* time_req */
475 const gss_OID_set, /* desired_mechs */
476 gss_cred_usage_t, /* cred_usage */
477 gss_cred_id_t *, /* output_cred_handle */
478 gss_OID_set *, /* actual_mechs */
479 OM_uint32 * /* time_rec */
482 OM_uint32 (KRB5_CALLCONV *gss_add_cred_impersonate_name)
484 OM_uint32 *, /* minor_status */
485 gss_cred_id_t, /* input_cred_handle */
486 const gss_cred_id_t, /* impersonator_cred_handle */
487 const gss_name_t, /* desired_name */
488 const gss_OID, /* desired_mech */
489 gss_cred_usage_t, /* cred_usage */
490 OM_uint32, /* initiator_time_req */
491 OM_uint32, /* acceptor_time_req */
492 gss_cred_id_t *, /* output_cred_handle */
493 gss_OID_set *, /* actual_mechs */
494 OM_uint32 *, /* initiator_time_rec */
495 OM_uint32 * /* acceptor_time_rec */
498 OM_uint32 (KRB5_CALLCONV *gss_display_name_ext)
500 OM_uint32 *, /* minor_status */
501 gss_name_t, /* name */
502 gss_OID, /* display_as_name_type */
503 gss_buffer_t /* display_name */
506 OM_uint32 (KRB5_CALLCONV *gss_inquire_name)
508 OM_uint32 *, /* minor_status */
509 gss_name_t, /* name */
510 int *, /* name_is_MN */
511 gss_OID *, /* MN_mech */
512 gss_buffer_set_t * /* attrs */
515 OM_uint32 (KRB5_CALLCONV *gss_get_name_attribute)
517 OM_uint32 *, /* minor_status */
518 gss_name_t, /* name */
519 gss_buffer_t, /* attr */
520 int *, /* authenticated */
521 int *, /* complete */
522 gss_buffer_t, /* value */
523 gss_buffer_t, /* display_value */
527 OM_uint32 (KRB5_CALLCONV *gss_set_name_attribute)
529 OM_uint32 *, /* minor_status */
530 gss_name_t, /* name */
532 gss_buffer_t, /* attr */
533 gss_buffer_t /* value */
536 OM_uint32 (KRB5_CALLCONV *gss_delete_name_attribute)
538 OM_uint32 *, /* minor_status */
539 gss_name_t, /* name */
540 gss_buffer_t /* attr */
543 OM_uint32 (KRB5_CALLCONV *gss_export_name_composite)
545 OM_uint32 *, /* minor_status */
546 gss_name_t, /* name */
547 gss_buffer_t /* exp_composite_name */
550 OM_uint32 (KRB5_CALLCONV *gss_map_name_to_any)
552 OM_uint32 *, /* minor_status */
553 gss_name_t, /* name */
554 int, /* authenticated */
555 gss_buffer_t, /* type_id */
556 gss_any_t * /* output */
559 OM_uint32 (KRB5_CALLCONV *gss_release_any_name_mapping)
561 OM_uint32 *, /* minor_status */
562 gss_name_t, /* name */
563 gss_buffer_t, /* type_id */
564 gss_any_t * /* input */
567 OM_uint32 (KRB5_CALLCONV *gss_pseudo_random)
569 OM_uint32 *, /* minor_status */
570 gss_ctx_id_t, /* context */
572 const gss_buffer_t, /* prf_in */
573 ssize_t, /* desired_output_len */
574 gss_buffer_t /* prf_out */
577 OM_uint32 (KRB5_CALLCONV *gss_set_neg_mechs)
579 OM_uint32 *, /* minor_status */
580 gss_cred_id_t, /* cred_handle */
581 const gss_OID_set /* mech_set */
584 OM_uint32 (KRB5_CALLCONV *gss_inquire_saslname_for_mech)
586 OM_uint32 *, /* minor_status */
587 const gss_OID, /* desired_mech */
588 gss_buffer_t, /* sasl_mech_name */
589 gss_buffer_t, /* mech_name */
590 gss_buffer_t /* mech_description */
593 OM_uint32 (KRB5_CALLCONV *gss_inquire_mech_for_saslname)
595 OM_uint32 *, /* minor_status */
596 const gss_buffer_t, /* sasl_mech_name */
597 gss_OID * /* mech_type */
600 OM_uint32 (KRB5_CALLCONV *gss_inquire_attrs_for_mech)
602 OM_uint32 *, /* minor_status */
603 gss_const_OID, /* mech */
604 gss_OID_set *, /* mech_attrs */
605 gss_OID_set * /* known_mech_attrs */
610 /* This structure MUST NOT be used by any code outside libgss */
611 typedef struct gss_config_ext {
612 gss_acquire_cred_with_password_sfct gssspi_acquire_cred_with_password;
613 } *gss_mechanism_ext;
616 * In the user space we use a wrapper structure to encompass the
617 * mechanism entry points. The wrapper contain the mechanism
618 * entry points and other data which is only relevant to the gss-api
619 * layer. In the kernel we use only the gss_config strucutre because
620 * the kernal does not cantain any of the extra gss-api specific data.
622 typedef struct gss_mech_config {
623 char *kmodName; /* kernel module name */
624 char *uLibName; /* user library name */
625 char *mechNameStr; /* mechanism string name */
626 char *optionStr; /* optional mech parameters */
627 void *dl_handle; /* RTLD object handle for the mech */
628 gss_OID mech_type; /* mechanism oid */
629 gss_mechanism mech; /* mechanism initialization struct */
630 gss_mechanism_ext mech_ext; /* extensions */
631 int priority; /* mechanism preference order */
632 int freeMech; /* free mech table */
633 struct gss_mech_config *next; /* next element in the list */
636 /********************************************************/
637 /* Internal mechglue routines */
640 int gssint_mechglue_init(void);
641 void gssint_mechglue_fini(void);
644 gss_mechanism gssint_get_mechanism (gss_const_OID);
645 gss_mechanism_ext gssint_get_mechanism_ext(const gss_OID);
646 OM_uint32 gssint_get_mech_type (gss_OID, gss_buffer_t);
647 char *gssint_get_kmodName(const gss_OID);
648 char *gssint_get_modOptions(const gss_OID);
649 OM_uint32 gssint_import_internal_name (OM_uint32 *, gss_OID, gss_union_name_t,
651 OM_uint32 gssint_export_internal_name(OM_uint32 *, const gss_OID,
652 const gss_name_t, gss_buffer_t);
653 OM_uint32 gssint_display_internal_name (OM_uint32 *, gss_OID, gss_name_t,
654 gss_buffer_t, gss_OID *);
655 OM_uint32 gssint_release_internal_name (OM_uint32 *, gss_OID, gss_name_t *);
656 OM_uint32 gssint_delete_internal_sec_context (OM_uint32 *, gss_OID,
657 gss_ctx_id_t *, gss_buffer_t);
658 #ifdef _GSS_STATIC_LINK
659 int gssint_register_mechinfo(gss_mech_info template);
662 OM_uint32 gssint_convert_name_to_union_name
663 (OM_uint32 *, /* minor_status */
664 gss_mechanism, /* mech */
665 gss_name_t, /* internal_name */
666 gss_name_t * /* external_name */
668 gss_cred_id_t gssint_get_mechanism_cred
669 (gss_union_cred_t, /* union_cred */
670 gss_OID /* mech_type */
673 OM_uint32 gssint_create_copy_buffer(
674 const gss_buffer_t, /* src buffer */
675 gss_buffer_t *, /* destination buffer */
676 int /* NULL terminate buffer ? */
679 OM_uint32 gssint_copy_oid_set(
680 OM_uint32 *, /* minor_status */
681 const gss_OID_set_desc * const, /* oid set */
682 gss_OID_set * /* new oid set */
685 gss_OID gss_find_mechanism_from_name_type (gss_OID); /* name_type */
687 OM_uint32 gss_add_mech_name_type
688 (OM_uint32 *, /* minor_status */
689 gss_OID, /* name_type */
694 * Sun extensions to GSS-API v2
699 const char *mech, /* mechanism string name */
700 gss_OID *oid /* mechanism oid */
705 const gss_OID oid /* mechanism oid */
709 gssint_get_mechanisms(
710 char *mechArray[], /* array to populate with mechs */
711 int arrayLen /* length of passed in array */
715 gssint_get_der_length(
716 unsigned char **, /* buf */
717 unsigned int, /* buf_len */
718 unsigned int * /* bytes */
722 gssint_der_length_size(unsigned int /* len */);
725 gssint_put_der_length(
726 unsigned int, /* length */
727 unsigned char **, /* buf */
728 unsigned int /* max_len */
732 gssint_wrap_aead (gss_mechanism, /* mech */
733 OM_uint32 *, /* minor_status */
734 gss_union_ctx_id_t, /* ctx */
735 int, /* conf_req_flag */
736 gss_qop_t, /* qop_req_flag */
737 gss_buffer_t, /* input_assoc_buffer */
738 gss_buffer_t, /* input_payload_buffer */
739 int *, /* conf_state */
740 gss_buffer_t); /* output_message_buffer */
742 gssint_unwrap_aead (gss_mechanism, /* mech */
743 OM_uint32 *, /* minor_status */
744 gss_union_ctx_id_t, /* ctx */
745 gss_buffer_t, /* input_message_buffer */
746 gss_buffer_t, /* input_assoc_buffer */
747 gss_buffer_t, /* output_payload_buffer */
748 int *, /* conf_state */
749 gss_qop_t *); /* qop_state */
752 /* Use this to map an error code that was returned from a mech
753 operation; the mech will be asked to produce the associated error
756 Remember that if the minor status code cannot be returned to the
757 caller (e.g., if it's stuffed in an automatic variable and then
758 ignored), then we don't care about producing a mapping. */
759 #define map_error(MINORP, MECH) \
760 (*(MINORP) = gssint_mecherrmap_map(*(MINORP), &(MECH)->mech_type))
761 #define map_error_oid(MINORP, MECHOID) \
762 (*(MINORP) = gssint_mecherrmap_map(*(MINORP), (MECHOID)))
764 /* Use this to map an errno value or com_err error code being
765 generated within the mechglue code (e.g., by calling generic oid
766 ops). Any errno or com_err values produced by mech operations
767 should be processed with map_error. This means they'll be stored
768 separately even if the mech uses com_err, because we can't assume
769 that it will use com_err. */
770 #define map_errcode(MINORP) \
771 (*(MINORP) = gssint_mecherrmap_map_errcode(*(MINORP)))
773 #endif /* _GSS_MECHGLUEP_H */