#ifndef GSSAPI_MECH_H
#define GSSAPI_MECH_H 1
#include <gssapi.h>
struct _gss_name;
struct _gss_cred;
typedef OM_uint32 GSSAPI_CALLCONV _gss_acquire_cred_t
(OM_uint32 *,
const gss_name_t,
OM_uint32,
const gss_OID_set,
gss_cred_usage_t,
gss_cred_id_t *,
gss_OID_set *,
OM_uint32 *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_release_cred_t
(OM_uint32 *,
gss_cred_id_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_init_sec_context_t
(OM_uint32 *,
const gss_cred_id_t,
gss_ctx_id_t *,
const gss_name_t,
const gss_OID,
OM_uint32,
OM_uint32,
const gss_channel_bindings_t,
const gss_buffer_t,
gss_OID *,
gss_buffer_t,
OM_uint32 *,
OM_uint32 *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_accept_sec_context_t
(OM_uint32 *,
gss_ctx_id_t *,
const gss_cred_id_t,
const gss_buffer_t,
const gss_channel_bindings_t,
gss_name_t *,
gss_OID *,
gss_buffer_t,
OM_uint32 *,
OM_uint32 *,
gss_cred_id_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_process_context_token_t
(OM_uint32 *,
const gss_ctx_id_t,
const gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_delete_sec_context_t
(OM_uint32 *,
gss_ctx_id_t *,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_context_time_t
(OM_uint32 *,
const gss_ctx_id_t,
OM_uint32 *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_get_mic_t
(OM_uint32 *,
const gss_ctx_id_t,
gss_qop_t,
const gss_buffer_t,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_verify_mic_t
(OM_uint32 *,
const gss_ctx_id_t,
const gss_buffer_t,
const gss_buffer_t,
gss_qop_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_wrap_t
(OM_uint32 *,
const gss_ctx_id_t,
int,
gss_qop_t,
const gss_buffer_t,
int *,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_unwrap_t
(OM_uint32 *,
const gss_ctx_id_t,
const gss_buffer_t,
gss_buffer_t,
int *,
gss_qop_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_display_status_t
(OM_uint32 *,
OM_uint32,
int,
const gss_OID,
OM_uint32 *,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_indicate_mechs_t
(OM_uint32 *,
gss_OID_set *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_compare_name_t
(OM_uint32 *,
const gss_name_t,
const gss_name_t,
int *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_display_name_t
(OM_uint32 *,
const gss_name_t,
gss_buffer_t,
gss_OID *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_import_name_t
(OM_uint32 *,
const gss_buffer_t,
gss_const_OID,
gss_name_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_export_name_t
(OM_uint32 *,
const gss_name_t,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_release_name_t
(OM_uint32 *,
gss_name_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_t
(OM_uint32 *,
const gss_cred_id_t,
gss_name_t *,
OM_uint32 *,
gss_cred_usage_t *,
gss_OID_set *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_context_t
(OM_uint32 *,
const gss_ctx_id_t,
gss_name_t *,
gss_name_t *,
OM_uint32 *,
gss_OID *,
OM_uint32 *,
int *,
int *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_wrap_size_limit_t
(OM_uint32 *,
const gss_ctx_id_t,
int,
gss_qop_t,
OM_uint32,
OM_uint32 *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_add_cred_t (
OM_uint32 *,
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 *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_by_mech_t (
OM_uint32 *,
const gss_cred_id_t,
const gss_OID,
gss_name_t *,
OM_uint32 *,
OM_uint32 *,
gss_cred_usage_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_export_sec_context_t (
OM_uint32 *,
gss_ctx_id_t *,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_import_sec_context_t (
OM_uint32 *,
const gss_buffer_t,
gss_ctx_id_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_names_for_mech_t (
OM_uint32 *,
gss_const_OID,
gss_OID_set *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_mechs_for_name_t (
OM_uint32 *,
const gss_name_t,
gss_OID_set *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_canonicalize_name_t (
OM_uint32 *,
const gss_name_t,
const gss_OID,
gss_name_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_duplicate_name_t (
OM_uint32 *,
const gss_name_t,
gss_name_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_sec_context_by_oid (
OM_uint32 *minor_status,
const gss_ctx_id_t context_handle,
const gss_OID desired_object,
gss_buffer_set_t *data_set
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_by_oid (
OM_uint32 *minor_status,
const gss_cred_id_t cred,
const gss_OID desired_object,
gss_buffer_set_t *data_set
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_sec_context_option (
OM_uint32 *minor_status,
gss_ctx_id_t *cred_handle,
const gss_OID desired_object,
const gss_buffer_t value
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_cred_option (
OM_uint32 *minor_status,
gss_cred_id_t *cred_handle,
const gss_OID desired_object,
const gss_buffer_t value
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_pseudo_random(
OM_uint32 *minor_status,
gss_ctx_id_t context,
int prf_key,
const gss_buffer_t prf_in,
ssize_t desired_output_len,
gss_buffer_t prf_out
);
typedef OM_uint32 GSSAPI_CALLCONV
_gss_wrap_iov_t(OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req,
int * conf_state,
gss_iov_buffer_desc *iov,
int iov_count);
typedef OM_uint32 GSSAPI_CALLCONV
_gss_unwrap_iov_t(OM_uint32 *minor_status,
gss_ctx_id_t context_handle,
int *conf_state,
gss_qop_t *qop_state,
gss_iov_buffer_desc *iov,
int iov_count);
typedef OM_uint32 GSSAPI_CALLCONV
_gss_wrap_iov_length_t(OM_uint32 * minor_status,
gss_ctx_id_t context_handle,
int conf_req_flag,
gss_qop_t qop_req,
int *conf_state,
gss_iov_buffer_desc *iov,
int iov_count);
typedef OM_uint32 GSSAPI_CALLCONV
_gss_store_cred_t(OM_uint32 *minor_status,
gss_cred_id_t input_cred_handle,
gss_cred_usage_t cred_usage,
const gss_OID desired_mech,
OM_uint32 overwrite_cred,
OM_uint32 default_cred,
gss_OID_set *elements_stored,
gss_cred_usage_t *cred_usage_stored);
typedef OM_uint32 GSSAPI_CALLCONV
_gss_export_cred_t(OM_uint32 *minor_status,
gss_cred_id_t cred_handle,
gss_buffer_t cred_token);
typedef OM_uint32 GSSAPI_CALLCONV
_gss_import_cred_t(OM_uint32 * minor_status,
gss_buffer_t cred_token,
gss_cred_id_t * cred_handle);
typedef OM_uint32
_gss_acquire_cred_ex_t(gss_status_id_t ,
const gss_name_t ,
OM_uint32 ,
OM_uint32 ,
gss_cred_usage_t ,
gss_auth_identity_t ,
void * ,
void (* )(void *, OM_uint32, gss_status_id_t, gss_cred_id_t, OM_uint32));
typedef OM_uint32 GSSAPI_CALLCONV
_gss_acquire_cred_ext_t(OM_uint32 * ,
const gss_name_t ,
gss_const_OID ,
const void * ,
OM_uint32 ,
gss_const_OID ,
gss_cred_usage_t ,
gss_cred_id_t * );
typedef void GSSAPI_CALLCONV
_gss_iter_creds_t(OM_uint32 ,
void * ,
void (* )(void *, gss_OID, gss_cred_id_t));
typedef OM_uint32 GSSAPI_CALLCONV
_gss_destroy_cred_t(OM_uint32 * ,
gss_cred_id_t * );
typedef OM_uint32 GSSAPI_CALLCONV
_gss_cred_hold_t(OM_uint32 * ,
gss_cred_id_t );
typedef OM_uint32 GSSAPI_CALLCONV
_gss_cred_unhold_t(OM_uint32 * ,
gss_cred_id_t );
typedef OM_uint32 GSSAPI_CALLCONV
_gss_cred_label_set_t(OM_uint32 * ,
gss_cred_id_t ,
const char * ,
gss_buffer_t );
typedef OM_uint32 GSSAPI_CALLCONV
_gss_cred_label_get_t(OM_uint32 * ,
gss_cred_id_t ,
const char * ,
gss_buffer_t );
typedef OM_uint32 GSSAPI_CALLCONV _gss_display_name_ext_t (
OM_uint32 *,
gss_name_t,
gss_OID,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_name_t (
OM_uint32 *,
gss_name_t,
int *,
gss_OID *,
gss_buffer_set_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_get_name_attribute_t (
OM_uint32 *,
gss_name_t,
gss_buffer_t,
int *,
int *,
gss_buffer_t,
gss_buffer_t,
int *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_name_attribute_t (
OM_uint32 *,
gss_name_t,
int,
gss_buffer_t,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_delete_name_attribute_t (
OM_uint32 *,
gss_name_t,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_export_name_composite_t (
OM_uint32 *,
gss_name_t,
gss_buffer_t
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_aapl_change_password_t(
OM_uint32 *,
gss_name_t,
const char *,
const char *
);
typedef struct gss_mo_desc gss_mo_desc;
typedef OM_uint32 GSSAPI_CALLCONV
_gss_mo_init (OM_uint32 *, gss_OID, gss_mo_desc **, size_t *);
struct gss_mo_desc {
gss_OID option;
OM_uint32 flags;
#define GSS_MO_MA 1
#define GSS_MO_MA_CRITICAL 2
const char *name;
void *ctx;
int (*get)(gss_const_OID, gss_mo_desc *, gss_buffer_t);
int (*set)(gss_const_OID, gss_mo_desc *, int, gss_buffer_t);
};
typedef OM_uint32 GSSAPI_CALLCONV _gss_pname_to_uid_t (
OM_uint32 *,
const gss_name_t,
const gss_OID,
uid_t *
);
typedef OM_uint32 GSSAPI_CALLCONV _gss_authorize_localname_t (
OM_uint32 *,
const gss_name_t,
gss_const_buffer_t,
gss_const_OID
);
struct gss_mech_compat_desc_struct;
#define GMI_VERSION 5
#define GM_USE_MG_CRED 1
typedef struct gssapi_mech_interface_desc {
unsigned gm_version;
const char *gm_name;
gss_OID_desc gm_mech_oid;
unsigned gm_flags;
_gss_acquire_cred_t *gm_acquire_cred;
_gss_release_cred_t *gm_release_cred;
_gss_init_sec_context_t *gm_init_sec_context;
_gss_accept_sec_context_t *gm_accept_sec_context;
_gss_process_context_token_t *gm_process_context_token;
_gss_delete_sec_context_t *gm_delete_sec_context;
_gss_context_time_t *gm_context_time;
_gss_get_mic_t *gm_get_mic;
_gss_verify_mic_t *gm_verify_mic;
_gss_wrap_t *gm_wrap;
_gss_unwrap_t *gm_unwrap;
_gss_display_status_t *gm_display_status;
_gss_indicate_mechs_t *gm_indicate_mechs;
_gss_compare_name_t *gm_compare_name;
_gss_display_name_t *gm_display_name;
_gss_import_name_t *gm_import_name;
_gss_export_name_t *gm_export_name;
_gss_release_name_t *gm_release_name;
_gss_inquire_cred_t *gm_inquire_cred;
_gss_inquire_context_t *gm_inquire_context;
_gss_wrap_size_limit_t *gm_wrap_size_limit;
_gss_add_cred_t *gm_add_cred;
_gss_inquire_cred_by_mech_t *gm_inquire_cred_by_mech;
_gss_export_sec_context_t *gm_export_sec_context;
_gss_import_sec_context_t *gm_import_sec_context;
_gss_inquire_names_for_mech_t *gm_inquire_names_for_mech;
_gss_inquire_mechs_for_name_t *gm_inquire_mechs_for_name;
_gss_canonicalize_name_t *gm_canonicalize_name;
_gss_duplicate_name_t *gm_duplicate_name;
_gss_inquire_sec_context_by_oid *gm_inquire_sec_context_by_oid;
_gss_inquire_cred_by_oid *gm_inquire_cred_by_oid;
_gss_set_sec_context_option *gm_set_sec_context_option;
_gss_set_cred_option *gm_set_cred_option;
_gss_pseudo_random *gm_pseudo_random;
_gss_wrap_iov_t *gm_wrap_iov;
_gss_unwrap_iov_t *gm_unwrap_iov;
_gss_wrap_iov_length_t *gm_wrap_iov_length;
_gss_store_cred_t *gm_store_cred;
_gss_export_cred_t *gm_export_cred;
_gss_import_cred_t *gm_import_cred;
_gss_acquire_cred_ext_t *gm_acquire_cred_ext;
_gss_iter_creds_t *gm_iter_creds;
_gss_destroy_cred_t *gm_destroy_cred;
_gss_cred_hold_t *gm_cred_hold;
_gss_cred_unhold_t *gm_cred_unhold;
_gss_cred_label_get_t *gm_cred_label_get;
_gss_cred_label_set_t *gm_cred_label_set;
gss_mo_desc *gm_mo;
size_t gm_mo_num;
_gss_pname_to_uid_t *gm_pname_to_uid;
_gss_authorize_localname_t *gm_authorize_localname;
_gss_display_name_ext_t *gm_display_name_ext;
_gss_inquire_name_t *gm_inquire_name;
_gss_get_name_attribute_t *gm_get_name_attribute;
_gss_set_name_attribute_t *gm_set_name_attribute;
_gss_delete_name_attribute_t *gm_delete_name_attribute;
_gss_export_name_composite_t *gm_export_name_composite;
struct gss_mech_compat_desc_struct *gm_compat;
_gss_aapl_change_password_t *gm_aapl_change_password;
} gssapi_mech_interface_desc, *gssapi_mech_interface;
__nullable gssapi_mech_interface
__gss_get_mechanism(gss_const_OID );
__nullable gssapi_mech_interface __gss_spnego_initialize(void);
__nullable gssapi_mech_interface __gss_krb5_initialize(void);
__nullable gssapi_mech_interface __gss_pku2u_initialize(void);
__nullable gssapi_mech_interface __gss_iakerb_initialize(void);
__nullable gssapi_mech_interface __gss_ntlm_initialize(void);
__nullable gssapi_mech_interface __gss_scram_initialize(void);
__nullable gssapi_mech_interface __gss_netlogon_initialize(void);
struct _gss_name_type {
gss_OID gnt_name_type;
OM_uint32 (*gnt_parse)(OM_uint32 *, gss_const_OID, const gss_buffer_t,
gss_const_OID, gss_name_t *);
};
struct _gss_oid_name_table {
gss_OID oid;
const char *name;
const char *short_desc;
const char *long_desc;
};
extern struct _gss_oid_name_table _gss_ont_mech[];
extern struct _gss_oid_name_table _gss_ont_ma[];
extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_cred_password_oid_desc;
#define GSS_C_CRED_PASSWORD (&__gss_c_cred_password_oid_desc)
extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_cred_certificate_oid_desc;
#define GSS_C_CRED_CERTIFICATE (&__gss_c_cred_certificate_oid_desc)
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
__nullable CFTypeRef
_gss_mg_copy_key(__nonnull CFStringRef domain, __nonnull CFStringRef key);
__nullable CFErrorRef
_gss_mg_cferror(OM_uint32 major,
OM_uint32 minor,
__nullable gss_const_OID mech);
#endif
#endif