#ifndef _GSS_MECHGLUEP_H
#define _GSS_MECHGLUEP_H
#include "autoconf.h"
#include "mechglue.h"
#include "gssapiP_generic.h"
#define g_OID_copy(o1, o2) \
do { \
memcpy((o1)->elements, (o2)->elements, (o2)->length); \
(o1)->length = (o2)->length; \
} while (0)
typedef struct gss_union_ctx_id_struct {
struct gss_union_ctx_id_struct *loopback;
gss_OID mech_type;
gss_ctx_id_t internal_ctx_id;
} gss_union_ctx_id_desc, *gss_union_ctx_id_t;
typedef struct gss_name_struct {
struct gss_name_struct *loopback;
gss_OID name_type;
gss_buffer_t external_name;
gss_OID mech_type;
gss_name_t mech_name;
} gss_union_name_desc, *gss_union_name_t;
typedef struct gss_mech_spec_name_t {
gss_OID name_type;
gss_OID mech;
struct gss_mech_spec_name_t *next, *prev;
} gss_mech_spec_name_desc, *gss_mech_spec_name;
typedef struct gss_cred_id_struct {
struct gss_cred_id_struct *loopback;
int count;
gss_OID mechs_array;
gss_cred_id_t *cred_array;
} gss_union_cred_desc, *gss_union_cred_t;
#define GSSINT_CHK_LOOP(p) (!((p) != NULL && (p)->loopback == (p)))
int gssint_mechglue_initialize_library(void);
typedef struct gss_config {
gss_OID_desc mech_type;
void * context;
OM_uint32 (KRB5_CALLCONV *gss_acquire_cred)
(
OM_uint32*,
gss_name_t,
OM_uint32,
gss_OID_set,
int,
gss_cred_id_t*,
gss_OID_set*,
OM_uint32*
);
OM_uint32 (KRB5_CALLCONV *gss_release_cred)
(
OM_uint32*,
gss_cred_id_t*
);
OM_uint32 (KRB5_CALLCONV *gss_init_sec_context)
(
OM_uint32*,
gss_cred_id_t,
gss_ctx_id_t*,
gss_name_t,
gss_OID,
OM_uint32,
OM_uint32,
gss_channel_bindings_t,
gss_buffer_t,
gss_OID*,
gss_buffer_t,
OM_uint32*,
OM_uint32*
);
OM_uint32 (KRB5_CALLCONV *gss_accept_sec_context)
(
OM_uint32*,
gss_ctx_id_t*,
gss_cred_id_t,
gss_buffer_t,
gss_channel_bindings_t,
gss_name_t*,
gss_OID*,
gss_buffer_t,
OM_uint32*,
OM_uint32*,
gss_cred_id_t*
);
OM_uint32 (KRB5_CALLCONV *gss_process_context_token)
(
OM_uint32*,
gss_ctx_id_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_delete_sec_context)
(
OM_uint32*,
gss_ctx_id_t*,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_context_time)
(
OM_uint32*,
gss_ctx_id_t,
OM_uint32*
);
OM_uint32 (KRB5_CALLCONV *gss_get_mic)
(
OM_uint32*,
gss_ctx_id_t,
gss_qop_t,
gss_buffer_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_verify_mic)
(
OM_uint32*,
gss_ctx_id_t,
gss_buffer_t,
gss_buffer_t,
gss_qop_t*
);
OM_uint32 (KRB5_CALLCONV *gss_wrap)
(
OM_uint32*,
gss_ctx_id_t,
int,
gss_qop_t,
gss_buffer_t,
int*,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_unwrap)
(
OM_uint32*,
gss_ctx_id_t,
gss_buffer_t,
gss_buffer_t,
int*,
gss_qop_t*
);
OM_uint32 (KRB5_CALLCONV *gss_display_status)
(
OM_uint32*,
OM_uint32,
int,
gss_OID,
OM_uint32*,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_indicate_mechs)
(
OM_uint32*,
gss_OID_set*
);
OM_uint32 (KRB5_CALLCONV *gss_compare_name)
(
OM_uint32*,
gss_name_t,
gss_name_t,
int*
);
OM_uint32 (KRB5_CALLCONV *gss_display_name)
(
OM_uint32*,
gss_name_t,
gss_buffer_t,
gss_OID*
);
OM_uint32 (KRB5_CALLCONV *gss_import_name)
(
OM_uint32*,
gss_buffer_t,
gss_OID,
gss_name_t*
);
OM_uint32 (KRB5_CALLCONV *gss_release_name)
(
OM_uint32*,
gss_name_t*
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_cred)
(
OM_uint32 *,
gss_cred_id_t,
gss_name_t *,
OM_uint32 *,
int *,
gss_OID_set *
);
OM_uint32 (KRB5_CALLCONV *gss_add_cred)
(
OM_uint32 *,
gss_cred_id_t,
gss_name_t,
gss_OID,
gss_cred_usage_t,
OM_uint32,
OM_uint32,
gss_cred_id_t *,
gss_OID_set *,
OM_uint32 *,
OM_uint32 *
);
OM_uint32 (KRB5_CALLCONV *gss_export_sec_context)
(
OM_uint32 *,
gss_ctx_id_t *,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_import_sec_context)
(
OM_uint32 *,
gss_buffer_t,
gss_ctx_id_t *
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_cred_by_mech)
(
OM_uint32 *,
gss_cred_id_t,
gss_OID,
gss_name_t *,
OM_uint32 *,
OM_uint32 *,
gss_cred_usage_t *
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_names_for_mech)
(
OM_uint32 *,
gss_OID,
gss_OID_set *
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_context)
(
OM_uint32 *,
gss_ctx_id_t,
gss_name_t *,
gss_name_t *,
OM_uint32 *,
gss_OID *,
OM_uint32 *,
int *,
int *
);
OM_uint32 (KRB5_CALLCONV *gss_internal_release_oid)
(
OM_uint32 *,
gss_OID *
);
OM_uint32 (KRB5_CALLCONV *gss_wrap_size_limit)
(
OM_uint32 *,
gss_ctx_id_t,
int,
gss_qop_t,
OM_uint32,
OM_uint32 *
);
OM_uint32 (KRB5_CALLCONV *gss_localname)
(
OM_uint32 *,
const gss_name_t,
gss_const_OID,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gssspi_authorize_localname)
(
OM_uint32 *,
const gss_name_t,
gss_const_buffer_t,
gss_const_OID
);
OM_uint32 (KRB5_CALLCONV *gss_export_name)
(
OM_uint32 *,
const gss_name_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_duplicate_name)
(
OM_uint32*,
const gss_name_t,
gss_name_t *
);
OM_uint32 (KRB5_CALLCONV *gss_store_cred)
(
OM_uint32 *,
const gss_cred_id_t,
gss_cred_usage_t,
const gss_OID,
OM_uint32,
OM_uint32,
gss_OID_set *,
gss_cred_usage_t *
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_sec_context_by_oid)
(
OM_uint32 *,
const gss_ctx_id_t,
const gss_OID,
gss_buffer_set_t *
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_cred_by_oid)
(
OM_uint32 *,
const gss_cred_id_t,
const gss_OID,
gss_buffer_set_t *
);
OM_uint32 (KRB5_CALLCONV *gss_set_sec_context_option)
(
OM_uint32 *,
gss_ctx_id_t *,
const gss_OID,
const gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gssspi_set_cred_option)
(
OM_uint32 *,
gss_cred_id_t *,
const gss_OID,
const gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gssspi_mech_invoke)
(
OM_uint32*,
const gss_OID,
const gss_OID,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_wrap_aead)
(
OM_uint32 *,
gss_ctx_id_t,
int,
gss_qop_t,
gss_buffer_t,
gss_buffer_t,
int *,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_unwrap_aead)
(
OM_uint32 *,
gss_ctx_id_t,
gss_buffer_t,
gss_buffer_t,
gss_buffer_t,
int *,
gss_qop_t *
);
OM_uint32 (KRB5_CALLCONV *gss_wrap_iov)
(
OM_uint32 *,
gss_ctx_id_t,
int,
gss_qop_t,
int *,
gss_iov_buffer_desc *,
int
);
OM_uint32 (KRB5_CALLCONV *gss_unwrap_iov)
(
OM_uint32 *,
gss_ctx_id_t,
int *,
gss_qop_t *,
gss_iov_buffer_desc *,
int
);
OM_uint32 (KRB5_CALLCONV *gss_wrap_iov_length)
(
OM_uint32 *,
gss_ctx_id_t,
int,
gss_qop_t,
int *,
gss_iov_buffer_desc *,
int
);
OM_uint32 (KRB5_CALLCONV *gss_complete_auth_token)
(
OM_uint32*,
const gss_ctx_id_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_acquire_cred_impersonate_name)
(
OM_uint32 *,
const gss_cred_id_t,
const gss_name_t,
OM_uint32,
const gss_OID_set,
gss_cred_usage_t,
gss_cred_id_t *,
gss_OID_set *,
OM_uint32 *
);
OM_uint32 (KRB5_CALLCONV *gss_add_cred_impersonate_name)
(
OM_uint32 *,
gss_cred_id_t,
const gss_cred_id_t,
const gss_name_t,
const gss_OID,
gss_cred_usage_t,
OM_uint32,
OM_uint32,
gss_cred_id_t *,
gss_OID_set *,
OM_uint32 *,
OM_uint32 *
);
OM_uint32 (KRB5_CALLCONV *gss_display_name_ext)
(
OM_uint32 *,
gss_name_t,
gss_OID,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_name)
(
OM_uint32 *,
gss_name_t,
int *,
gss_OID *,
gss_buffer_set_t *
);
OM_uint32 (KRB5_CALLCONV *gss_get_name_attribute)
(
OM_uint32 *,
gss_name_t,
gss_buffer_t,
int *,
int *,
gss_buffer_t,
gss_buffer_t,
int *
);
OM_uint32 (KRB5_CALLCONV *gss_set_name_attribute)
(
OM_uint32 *,
gss_name_t,
int,
gss_buffer_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_delete_name_attribute)
(
OM_uint32 *,
gss_name_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_export_name_composite)
(
OM_uint32 *,
gss_name_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_map_name_to_any)
(
OM_uint32 *,
gss_name_t,
int,
gss_buffer_t,
gss_any_t *
);
OM_uint32 (KRB5_CALLCONV *gss_release_any_name_mapping)
(
OM_uint32 *,
gss_name_t,
gss_buffer_t,
gss_any_t *
);
OM_uint32 (KRB5_CALLCONV *gss_pseudo_random)
(
OM_uint32 *,
gss_ctx_id_t,
int,
const gss_buffer_t,
ssize_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_set_neg_mechs)
(
OM_uint32 *,
gss_cred_id_t,
const gss_OID_set
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_saslname_for_mech)
(
OM_uint32 *,
const gss_OID,
gss_buffer_t,
gss_buffer_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_mech_for_saslname)
(
OM_uint32 *,
const gss_buffer_t,
gss_OID *
);
OM_uint32 (KRB5_CALLCONV *gss_inquire_attrs_for_mech)
(
OM_uint32 *,
gss_const_OID,
gss_OID_set *,
gss_OID_set *
);
OM_uint32 (KRB5_CALLCONV *gss_acquire_cred_from)
(
OM_uint32 *,
gss_name_t,
OM_uint32,
gss_OID_set,
gss_cred_usage_t,
gss_const_key_value_set_t,
gss_cred_id_t *,
gss_OID_set *,
OM_uint32 *
);
OM_uint32 (KRB5_CALLCONV *gss_store_cred_into)
(
OM_uint32 *,
gss_cred_id_t,
gss_cred_usage_t,
gss_OID,
OM_uint32,
OM_uint32,
gss_const_key_value_set_t,
gss_OID_set *,
gss_cred_usage_t *
);
OM_uint32 (KRB5_CALLCONV *gssspi_acquire_cred_with_password)
(
OM_uint32 *,
const gss_name_t,
const gss_buffer_t,
OM_uint32,
const gss_OID_set,
int,
gss_cred_id_t *,
gss_OID_set *,
OM_uint32 *
);
OM_uint32 (KRB5_CALLCONV *gss_export_cred)
(
OM_uint32 *,
gss_cred_id_t,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gss_import_cred)
(
OM_uint32 *,
gss_buffer_t,
gss_cred_id_t *
);
OM_uint32 (KRB5_CALLCONV *gssspi_import_sec_context_by_mech)
(
OM_uint32 *,
gss_OID,
gss_buffer_t,
gss_ctx_id_t *
);
OM_uint32 (KRB5_CALLCONV *gssspi_import_name_by_mech)
(
OM_uint32 *,
gss_OID,
gss_buffer_t,
gss_OID,
gss_name_t*
);
OM_uint32 (KRB5_CALLCONV *gssspi_import_cred_by_mech)
(
OM_uint32 *,
gss_OID,
gss_buffer_t,
gss_cred_id_t *
);
OM_uint32 (KRB5_CALLCONV *gss_get_mic_iov)
(
OM_uint32 *,
gss_ctx_id_t,
gss_qop_t,
gss_iov_buffer_desc *,
int
);
OM_uint32 (KRB5_CALLCONV *gss_verify_mic_iov)
(
OM_uint32 *,
gss_ctx_id_t,
gss_qop_t *,
gss_iov_buffer_desc *,
int
);
OM_uint32 (KRB5_CALLCONV *gss_get_mic_iov_length)
(
OM_uint32 *,
gss_ctx_id_t,
gss_qop_t,
gss_iov_buffer_desc *,
int
);
OM_uint32 (KRB5_CALLCONV *gssspi_query_meta_data)
(
OM_uint32 *,
gss_const_OID,
gss_cred_id_t,
gss_ctx_id_t *,
const gss_name_t,
OM_uint32,
gss_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gssspi_exchange_meta_data)
(
OM_uint32 *,
gss_const_OID,
gss_cred_id_t,
gss_ctx_id_t *,
const gss_name_t,
OM_uint32,
gss_const_buffer_t
);
OM_uint32 (KRB5_CALLCONV *gssspi_query_mechanism_info)
(
OM_uint32 *,
gss_const_OID,
unsigned char[16]
);
} *gss_mechanism;
typedef struct gss_mech_config {
char *kmodName;
char *uLibName;
char *mechNameStr;
char *optionStr;
void *dl_handle;
gss_OID mech_type;
gss_mechanism mech;
int priority;
int freeMech;
int is_interposer;
gss_OID int_mech_type;
gss_mechanism int_mech;
struct gss_mech_config *next;
} *gss_mech_info;
OM_uint32 gssint_select_mech_type(OM_uint32 *minor, gss_const_OID in_oid,
gss_OID *selected_oid);
gss_OID gssint_get_public_oid(gss_const_OID internal_oid);
OM_uint32 gssint_make_public_oid_set(OM_uint32 *minor_status, gss_OID oids,
int count, gss_OID_set *public_set);
gss_mechanism gssint_get_mechanism (gss_const_OID);
OM_uint32 gssint_get_mech_type (gss_OID, gss_buffer_t);
char *gssint_get_kmodName(const gss_OID);
char *gssint_get_modOptions(const gss_OID);
OM_uint32 gssint_import_internal_name (OM_uint32 *, gss_OID, gss_union_name_t,
gss_name_t *);
OM_uint32 gssint_export_internal_name(OM_uint32 *, const gss_OID,
const gss_name_t, gss_buffer_t);
OM_uint32 gssint_display_internal_name (OM_uint32 *, gss_OID, gss_name_t,
gss_buffer_t, gss_OID *);
OM_uint32 gssint_release_internal_name (OM_uint32 *, gss_OID, gss_name_t *);
OM_uint32 gssint_delete_internal_sec_context (OM_uint32 *, gss_OID,
gss_ctx_id_t *, gss_buffer_t);
#ifdef _GSS_STATIC_LINK
int gssint_register_mechinfo(gss_mech_info template);
#endif
OM_uint32 gssint_convert_name_to_union_name
(OM_uint32 *,
gss_mechanism,
gss_name_t,
gss_name_t *
);
gss_cred_id_t gssint_get_mechanism_cred
(gss_union_cred_t,
gss_OID
);
OM_uint32 gssint_create_copy_buffer(
const gss_buffer_t,
gss_buffer_t *,
int
);
OM_uint32 gssint_create_union_context(
OM_uint32 *minor,
gss_const_OID,
gss_union_ctx_id_t *
);
OM_uint32
gssint_wrap_aead (gss_mechanism,
OM_uint32 *,
gss_union_ctx_id_t,
int,
gss_qop_t,
gss_buffer_t,
gss_buffer_t,
int *,
gss_buffer_t);
OM_uint32
gssint_unwrap_aead (gss_mechanism,
OM_uint32 *,
gss_union_ctx_id_t,
gss_buffer_t,
gss_buffer_t,
gss_buffer_t,
int *,
gss_qop_t *);
#define map_error(MINORP, MECH) \
(*(MINORP) = gssint_mecherrmap_map(*(MINORP), &(MECH)->mech_type))
#define map_error_oid(MINORP, MECHOID) \
(*(MINORP) = gssint_mecherrmap_map(*(MINORP), (MECHOID)))
#define map_errcode(MINORP) \
(*(MINORP) = gssint_mecherrmap_map_errcode(*(MINORP)))
#endif