X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=util.h;h=5687d527d6ed75bc9cd2804e321854e84b41867b;hb=refs%2Fheads%2Fjson-name;hp=6a6b91241ca0bb199250cfefa9038479f8202872;hpb=000678e16f4311cca15cc5626f7c1ad32f67306f;p=mech_eap.orig diff --git a/util.h b/util.h index 6a6b912..5687d52 100644 --- a/util.h +++ b/util.h @@ -75,6 +75,12 @@ extern "C" { #define MIN(_a,_b) ((_a)<(_b)?(_a):(_b)) #endif +#if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +#define GSSEAP_UNUSED __attribute__ ((__unused__)) +#else +#define GSSEAP_UNUSED +#endif + /* util_buffer.c */ OM_uint32 makeStringBuffer(OM_uint32 *minor, @@ -154,7 +160,8 @@ enum gss_eap_token_type { TOK_TYPE_EXPORT_NAME = 0x0401, /* RFC 2743 exported name */ TOK_TYPE_EXPORT_NAME_COMPOSITE = 0x0402, /* exported composite name */ TOK_TYPE_DELETE_CONTEXT = 0x0405, /* RFC 2743 delete context */ - TOK_TYPE_ESTABLISH_CONTEXT = 0x0601, /* establish context */ + TOK_TYPE_INITIATOR_CONTEXT = 0x0601, /* initiator-sent context token */ + TOK_TYPE_ACCEPTOR_CONTEXT = 0x0602, /* acceptor-sent context token */ }; /* inner token types and flags */ @@ -198,12 +205,6 @@ gssEapContextTime(OM_uint32 *minor, gss_ctx_id_t context_handle, OM_uint32 *time_rec); -OM_uint32 -gssEapDisplayName(OM_uint32 *minor, - gss_name_t name, - gss_buffer_t output_name_buffer, - gss_OID *output_name_type); - /* util_cred.c */ OM_uint32 gssEapAllocCred(OM_uint32 *minor, gss_cred_id_t *pCred); OM_uint32 gssEapReleaseCred(OM_uint32 *minor, gss_cred_id_t *pCred); @@ -403,9 +404,16 @@ gssEapExportLucidSecContext(OM_uint32 *minor, /* util_mech.c */ extern gss_OID GSS_EAP_MECHANISM; -int -gssEapInternalizeOid(const gss_OID oid, - gss_OID *const pInternalizedOid); +#define OID_FLAG_NULL_VALID 0x00000001 +#define OID_FLAG_FAMILY_MECH_VALID 0x00000002 +#define OID_FLAG_MAP_NULL_TO_DEFAULT_MECH 0x00000004 +#define OID_FLAG_MAP_FAMILY_MECH_TO_NULL 0x00000008 + +OM_uint32 +gssEapCanonicalizeOid(OM_uint32 *minor, + const gss_OID oid, + OM_uint32 flags, + gss_OID *pOid); OM_uint32 gssEapReleaseOid(OM_uint32 *minor, gss_OID *oid); @@ -459,7 +467,8 @@ OM_uint32 gssEapExportNameInternal(OM_uint32 *minor, unsigned int flags); OM_uint32 gssEapImportName(OM_uint32 *minor, const gss_buffer_t input_name_buffer, - gss_OID input_name_type, + const gss_OID input_name_type, + const gss_OID input_mech_type, gss_name_t *output_name); OM_uint32 gssEapImportNameInternal(OM_uint32 *minor, const gss_buffer_t input_name_buffer, @@ -470,6 +479,24 @@ gssEapDuplicateName(OM_uint32 *minor, const gss_name_t input_name, gss_name_t *dest_name); +OM_uint32 +gssEapCanonicalizeName(OM_uint32 *minor, + const gss_name_t input_name, + const gss_OID mech_type, + gss_name_t *dest_name); + +OM_uint32 +gssEapDisplayName(OM_uint32 *minor, + gss_name_t name, + gss_buffer_t output_name_buffer, + gss_OID *output_name_type); + +OM_uint32 +gssEapCompareName(OM_uint32 *minor, + gss_name_t name1, + gss_name_t name2, + int *name_equal); + /* util_oid.c */ OM_uint32 composeOid(OM_uint32 *minor_status, @@ -539,7 +566,9 @@ enum gss_eap_state { GSSEAP_STATE_AUTHENTICATE = 0x02, /* exchange EAP messages */ GSSEAP_STATE_INITIATOR_EXTS = 0x04, /* initiator extensions */ GSSEAP_STATE_ACCEPTOR_EXTS = 0x08, /* acceptor extensions */ +#ifdef GSSEAP_ENABLE_REAUTH GSSEAP_STATE_REAUTHENTICATE = 0x10, /* GSS reauthentication messages */ +#endif GSSEAP_STATE_ESTABLISHED = 0x20, /* context established */ GSSEAP_STATE_ALL = 0x3F }; @@ -552,7 +581,7 @@ enum gss_eap_state { void gssEapSmTransition(gss_ctx_id_t ctx, enum gss_eap_state state); #define GSSEAP_SM_TRANSITION(ctx, state) gssEapSmTransition((ctx), (state)) #else -#define GSSEAP_SM_TRANSITION(ctx, state) do { (ctx)->state = (state); } while (0) +#define GSSEAP_SM_TRANSITION(ctx, newstate) do { (ctx)->state = (newstate); } while (0) #endif #define GSSEAP_SM_TRANSITION_NEXT(ctx) GSSEAP_SM_TRANSITION((ctx), GSSEAP_STATE_NEXT(GSSEAP_SM_STATE((ctx)))) @@ -816,7 +845,9 @@ gssBufferToKrbData(gss_buffer_t buffer, krb5_data *data) } #endif +#include "util_json.h" #include "util_attr.h" +#include "util_base64.h" #ifdef GSSEAP_ENABLE_REAUTH #include "util_reauth.h" #endif