1 /*
2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
5
6 /*
7 * This header contains the private mechglue definitions.
8 */
9
10 #ifndef _MECHGLUEP_H
11 #define _MECHGLUEP_H
12
13 #pragma ident "@(#)mechglueP.h 1.42 04/09/08 SMI"
14
15 #include <sys/types.h>
16 #include <gssapi/gssapi.h>
17 #include <gssapi/gssapi_ext.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #ifdef _KERNEL
24 #define memcmp(a, b, l) bcmp((a), (b), (l))
25 #endif
26 /*
27 * derived types for passing context and credential handles
28 * between gssd and kernel
29 */
30 typedef unsigned int gssd_ctx_id_t;
31 typedef unsigned int gssd_cred_id_t;
32 /*
33 * Array of context IDs typed by mechanism OID
344 OM_uint32 *, /* minor_status */
345 gss_OID * /* OID */
346 /* */);
347 OM_uint32 (*gss_wrap_size_limit)
348 (
349 void *, /* context */
350 OM_uint32 *, /* minor_status */
351 const gss_ctx_id_t, /* context_handle */
352 int, /* conf_req_flag */
353 gss_qop_t, /* qop_req */
354 OM_uint32, /* req_output_size */
355 OM_uint32 * /* max_input_size */
356 /* */);
357 OM_uint32 (*pname_to_uid)
358 (
359 void *, /* context */
360 OM_uint32 *, /* minor_status */
361 const gss_name_t, /* pname */
362 uid_t * /* uid */
363 /* */);
364 OM_uint32 (*gss_export_name)
365 (
366 void *, /* context */
367 OM_uint32 *, /* minor_status */
368 const gss_name_t, /* input_name */
369 gss_buffer_t /* exported_name */
370 /* */);
371 #endif /* ! _KERNEL */
372 /* EXPORT DELETE START */
373 /* CRYPT DELETE START */
374 /*
375 * This block comment is Sun Proprietary: Need-To-Know.
376 * What we are doing is leaving the seal and unseal entry points
377 * in an obvious place before sign and unsign for the Domestic customer
378 * of the Solaris Source Product. The Domestic customer of the Solaris Source
379 * Product will have to deal with the problem of creating exportable libgss
380 * binaries.
381 * In the binary product that Sun builds, these entry points are elsewhere,
382 * and bracketed with special comments so that the CRYPT_SRC and EXPORT_SRC
383 * targets delete them.
422 const gss_ctx_id_t, /* context_handle */
423 int, /* qop_req */
424 const gss_buffer_t, /* message_buffer */
425 gss_buffer_t /* message_token */
426 #ifdef _KERNEL
427 /* */, OM_uint32
428 #endif
429 /* */);
430 OM_uint32 (*gss_verify)
431 (
432 void *, /* context */
433 OM_uint32 *, /* minor_status */
434 const gss_ctx_id_t, /* context_handle */
435 const gss_buffer_t, /* message_buffer */
436 const gss_buffer_t, /* token_buffer */
437 int * /* qop_state */
438 #ifdef _KERNEL
439 /* */, OM_uint32
440 #endif
441 /* */);
442 } *gss_mechanism;
443
444 /*
445 * In the user space we use a wrapper structure to encompass the
446 * mechanism entry points. The wrapper contain the mechanism
447 * entry points and other data which is only relevant to the gss-api
448 * layer. In the kernel we use only the gss_config strucutre because
449 * the kernal does not cantain any of the extra gss-api specific data.
450 */
451 #ifndef _KERNEL
452 typedef struct gss_mech_config {
453 char * kmodName; /* kernel module name */
454 char * uLibName; /* user library name */
455 char * mechNameStr; /* mechanism string name */
456 gss_OID mech_type; /* mechanism oid */
457 gss_mechanism mech; /* mechanism initialization struct */
458 struct gss_mech_config *next; /* next element in the list */
459 } *gss_mech_info;
460 #endif
461
462 #ifndef _KERNEL
463 /*
464 * Internal mechglue routines
465 */
466
467 gss_mechanism __gss_get_mechanism(const gss_OID);
468 char * __gss_get_kmodName(const gss_OID);
469 OM_uint32 __gss_import_internal_name(OM_uint32 *, const gss_OID,
470 gss_union_name_t, gss_name_t *);
471 OM_uint32 __gss_export_internal_name(OM_uint32 *, const gss_OID,
472 const gss_name_t, gss_buffer_t);
473 OM_uint32 __gss_display_internal_name(OM_uint32 *, const gss_OID,
474 const gss_name_t, gss_buffer_t, gss_OID *);
475 OM_uint32 __gss_release_internal_name(OM_uint32 *, const gss_OID,
476 gss_name_t *);
477
478 OM_uint32 __gss_convert_name_to_union_name(
479 OM_uint32 *, /* minor_status */
480 gss_mechanism, /* mech */
481 gss_name_t, /* internal_name */
482 gss_name_t * /* external_name */
483 );
484
485 gss_cred_id_t __gss_get_mechanism_cred(
486 const gss_union_cred_t, /* union_cred */
487 const gss_OID /* mech_type */
488 );
|
1 /*
2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
5
6 /*
7 * This header contains the private mechglue definitions.
8 */
9
10 #ifndef _MECHGLUEP_H
11 #define _MECHGLUEP_H
12
13 #pragma ident "@(#)mechglueP.h 1.41 04/04/06 SMI"
14
15 #include <sys/types.h>
16 #include <gssapi/gssapi.h>
17 #include <gssapi/gssapi_ext.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #ifdef _KERNEL
24 #define memcmp(a, b, l) bcmp((a), (b), (l))
25 #endif
26 /*
27 * derived types for passing context and credential handles
28 * between gssd and kernel
29 */
30 typedef unsigned int gssd_ctx_id_t;
31 typedef unsigned int gssd_cred_id_t;
32 /*
33 * Array of context IDs typed by mechanism OID
344 OM_uint32 *, /* minor_status */
345 gss_OID * /* OID */
346 /* */);
347 OM_uint32 (*gss_wrap_size_limit)
348 (
349 void *, /* context */
350 OM_uint32 *, /* minor_status */
351 const gss_ctx_id_t, /* context_handle */
352 int, /* conf_req_flag */
353 gss_qop_t, /* qop_req */
354 OM_uint32, /* req_output_size */
355 OM_uint32 * /* max_input_size */
356 /* */);
357 OM_uint32 (*pname_to_uid)
358 (
359 void *, /* context */
360 OM_uint32 *, /* minor_status */
361 const gss_name_t, /* pname */
362 uid_t * /* uid */
363 /* */);
364 OM_uint32 (*__gss_userok)
365 (
366 void *, /* context */
367 OM_uint32 *, /* minor_status */
368 const gss_name_t, /* pname */
369 const char *, /* local user */
370 int * /* user ok? */
371 /* */);
372 OM_uint32 (*gss_export_name)
373 (
374 void *, /* context */
375 OM_uint32 *, /* minor_status */
376 const gss_name_t, /* input_name */
377 gss_buffer_t /* exported_name */
378 /* */);
379 #endif /* ! _KERNEL */
380 /* EXPORT DELETE START */
381 /* CRYPT DELETE START */
382 /*
383 * This block comment is Sun Proprietary: Need-To-Know.
384 * What we are doing is leaving the seal and unseal entry points
385 * in an obvious place before sign and unsign for the Domestic customer
386 * of the Solaris Source Product. The Domestic customer of the Solaris Source
387 * Product will have to deal with the problem of creating exportable libgss
388 * binaries.
389 * In the binary product that Sun builds, these entry points are elsewhere,
390 * and bracketed with special comments so that the CRYPT_SRC and EXPORT_SRC
391 * targets delete them.
430 const gss_ctx_id_t, /* context_handle */
431 int, /* qop_req */
432 const gss_buffer_t, /* message_buffer */
433 gss_buffer_t /* message_token */
434 #ifdef _KERNEL
435 /* */, OM_uint32
436 #endif
437 /* */);
438 OM_uint32 (*gss_verify)
439 (
440 void *, /* context */
441 OM_uint32 *, /* minor_status */
442 const gss_ctx_id_t, /* context_handle */
443 const gss_buffer_t, /* message_buffer */
444 const gss_buffer_t, /* token_buffer */
445 int * /* qop_state */
446 #ifdef _KERNEL
447 /* */, OM_uint32
448 #endif
449 /* */);
450 #ifndef _KERNEL
451 OM_uint32 (*gss_store_cred)
452 (
453 void *, /* context */
454 OM_uint32 *, /* minor_status */
455 const gss_cred_id_t, /* input_cred */
456 gss_cred_usage_t, /* cred_usage */
457 const gss_OID, /* desired_mech */
458 OM_uint32, /* overwrite_cred */
459 OM_uint32, /* default_cred */
460 gss_OID_set *, /* elements_stored */
461 gss_cred_usage_t * /* cred_usage_stored */
462 /* */);
463 #endif
464 } *gss_mechanism;
465
466 /*
467 * In the user space we use a wrapper structure to encompass the
468 * mechanism entry points. The wrapper contain the mechanism
469 * entry points and other data which is only relevant to the gss-api
470 * layer. In the kernel we use only the gss_config strucutre because
471 * the kernal does not cantain any of the extra gss-api specific data.
472 */
473 #ifndef _KERNEL
474 typedef struct gss_mech_config {
475 char *kmodName; /* kernel module name */
476 char *uLibName; /* user library name */
477 char *mechNameStr; /* mechanism string name */
478 char *optionStr; /* optional mech parameters */
479 gss_OID mech_type; /* mechanism oid */
480 gss_mechanism mech; /* mechanism initialization struct */
481 struct gss_mech_config *next; /* next element in the list */
482 } *gss_mech_info;
483 #endif
484
485 #ifndef _KERNEL
486 /*
487 * Internal mechglue routines
488 */
489
490 gss_mechanism __gss_get_mechanism(const gss_OID);
491 char *__gss_get_kmodName(const gss_OID);
492 char *__gss_get_modOptions(const gss_OID);
493 OM_uint32 __gss_import_internal_name(OM_uint32 *, const gss_OID,
494 gss_union_name_t, gss_name_t *);
495 OM_uint32 __gss_export_internal_name(OM_uint32 *, const gss_OID,
496 const gss_name_t, gss_buffer_t);
497 OM_uint32 __gss_display_internal_name(OM_uint32 *, const gss_OID,
498 const gss_name_t, gss_buffer_t, gss_OID *);
499 OM_uint32 __gss_release_internal_name(OM_uint32 *, const gss_OID,
500 gss_name_t *);
501
502 OM_uint32 __gss_convert_name_to_union_name(
503 OM_uint32 *, /* minor_status */
504 gss_mechanism, /* mech */
505 gss_name_t, /* internal_name */
506 gss_name_t * /* external_name */
507 );
508
509 gss_cred_id_t __gss_get_mechanism_cred(
510 const gss_union_cred_t, /* union_cred */
511 const gss_OID /* mech_type */
512 );
|