X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=gssapiP_eap.h;h=81fcf3f686b95a3c574df240eb74345938e8190b;hb=refs%2Fheads%2Fjson-name;hp=274d694803cdccb2563deb1eae56ee3d61740965;hpb=b1fbe85f2a054d57a2c3f7edb6b967cc2ee2d3f2;p=mech_eap.orig diff --git a/gssapiP_eap.h b/gssapiP_eap.h index 274d694..81fcf3f 100644 --- a/gssapiP_eap.h +++ b/gssapiP_eap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, JANET(UK) + * Copyright (c) 2011, JANET(UK) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,18 +35,27 @@ #include "config.h" +#ifdef HAVE_HEIMDAL_VERSION +#define KRB5_DEPRECATED /* so we can use krb5_free_unparsed_name() */ +#endif + #include #include #include #include #include +#include #include #include /* GSS headers */ #include #include +#ifdef HAVE_HEIMDAL_VERSION +typedef struct gss_any *gss_any_t; +#else #include +#endif #include "gssapi_eap.h" /* Kerberos headers */ @@ -57,6 +66,7 @@ #include #include #include +#include #include /* FreeRADIUS headers */ @@ -89,9 +99,15 @@ extern "C" { struct gss_eap_saml_attr_ctx; struct gss_eap_attr_ctx; -struct gss_name_struct { +#ifdef HAVE_HEIMDAL_VERSION +struct gss_name_t_desc_struct +#else +struct gss_name_struct +#endif +{ GSSEAP_MUTEX mutex; /* mutex protects attrCtx */ OM_uint32 flags; + gss_OID mechanismUsed; /* this is immutable */ krb5_principal krbPrincipal; /* this is immutable */ struct gss_eap_attr_ctx *attrCtx; }; @@ -103,7 +119,12 @@ struct gss_name_struct { #define CRED_FLAG_DEFAULT_CCACHE 0x00100000 #define CRED_FLAG_PUBLIC_MASK 0x0000FFFF -struct gss_cred_id_struct { +#ifdef HAVE_HEIMDAL_VERSION +struct gss_cred_id_t_desc_struct +#else +struct gss_cred_id_struct +#endif +{ GSSEAP_MUTEX mutex; OM_uint32 flags; gss_name_t name; @@ -123,18 +144,6 @@ struct gss_cred_id_struct { #define CTX_IS_INITIATOR(ctx) (((ctx)->flags & CTX_FLAG_INITIATOR) != 0) -enum gss_eap_state { - GSSEAP_STATE_IDENTITY = 0, /* identify peer */ - GSSEAP_STATE_AUTHENTICATE, /* exchange EAP messages */ - GSSEAP_STATE_EXTENSIONS_REQ, /* initiator extensions */ - GSSEAP_STATE_EXTENSIONS_RESP, /* acceptor extensions */ - GSSEAP_STATE_ESTABLISHED, /* context established */ - GSSEAP_STATE_ERROR, /* context error */ -#ifdef GSSEAP_ENABLE_REAUTH - GSSEAP_STATE_KRB_REAUTH /* fast reauthentication */ -#endif -}; - #define CTX_IS_ESTABLISHED(ctx) ((ctx)->state == GSSEAP_STATE_ESTABLISHED) /* Initiator context flags */ @@ -150,7 +159,6 @@ enum gss_eap_state { #define CTX_FLAG_EAP_MASK 0xFFFF0000 struct gss_eap_initiator_ctx { - gss_cred_id_t defaultCred; unsigned int idleWhile; #ifndef __cplusplus struct eap_peer_config eapPeerConfig; @@ -167,7 +175,12 @@ struct gss_eap_acceptor_ctx { VALUE_PAIR *vps; }; -struct gss_ctx_id_struct { +#ifdef HAVE_HEIMDAL_VERSION +struct gss_ctx_id_t_desc_struct +#else +struct gss_ctx_id_struct +#endif +{ GSSEAP_MUTEX mutex; enum gss_eap_state state; OM_uint32 flags; @@ -181,6 +194,7 @@ struct gss_ctx_id_struct { time_t expiryTime; uint64_t sendSeq, recvSeq; void *seqState; + gss_cred_id_t defaultCred; union { struct gss_eap_initiator_ctx initiator; #define initiatorCtx ctxU.initiator