From b83d1002f0b991b24cdaf7a28bec38d485631be1 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Sat, 18 Sep 2010 01:30:33 +0200 Subject: [PATCH] cleanup --- mech_eap/gssapiP_eap.h | 2 -- mech_eap/util_attr.cpp | 11 ++++++++--- mech_eap/util_name.c | 9 --------- mech_eap/util_saml.h | 8 -------- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/mech_eap/gssapiP_eap.h b/mech_eap/gssapiP_eap.h index 1d97e73..31c4753 100644 --- a/mech_eap/gssapiP_eap.h +++ b/mech_eap/gssapiP_eap.h @@ -62,8 +62,6 @@ #define NAME_FLAG_NAI 0x00000001 #define NAME_FLAG_SERVICE 0x00000002 -#define NAME_FLAG_RADIUS_ATTRIBUTES 0x00000004 -#define NAME_FLAG_SAML_ATTRIBUTES 0x00000008 #define NAME_HAS_ATTRIBUTES(name) ((name)->attrCtx != NULL) diff --git a/mech_eap/util_attr.cpp b/mech_eap/util_attr.cpp index ebf0096..53ad003 100644 --- a/mech_eap/util_attr.cpp +++ b/mech_eap/util_attr.cpp @@ -556,8 +556,12 @@ gssEapExportAttrContext(OM_uint32 *minor, gss_name_t name, gss_buffer_t buffer) { - if (name->attrCtx == NULL) - return GSS_S_UNAVAILABLE; + if (name->attrCtx == NULL) { + buffer->length = 0; + buffer->value = NULL; + + return GSS_S_COMPLETE; + }; try { name->attrCtx->marshall(buffer); @@ -573,7 +577,8 @@ gssEapImportAttrContext(OM_uint32 *minor, gss_buffer_t buffer, gss_name_t name) { - GSSEAP_NOT_IMPLEMENTED; + if (buffer->length) + GSSEAP_NOT_IMPLEMENTED; } OM_uint32 diff --git a/mech_eap/util_name.c b/mech_eap/util_name.c index 29b0839..d0000b1 100644 --- a/mech_eap/util_name.c +++ b/mech_eap/util_name.c @@ -287,10 +287,6 @@ importExportedName(OM_uint32 *minor, gss_buffer_desc buf; CHECK_REMAIN(4); - name->flags = load_uint32_be(p); - UPDATE_REMAIN(4); - - CHECK_REMAIN(4); buf.length = load_uint32_be(p); UPDATE_REMAIN(4); @@ -370,8 +366,6 @@ gssEapExportName(OM_uint32 *minor, exportedName->length = 6 + GSS_EAP_MECHANISM->length + 4 + krbNameLen; if (composite) { - exportedName->length += 4; - major = gssEapExportAttrContext(minor, name, &attrs); if (GSS_ERROR(major)) goto cleanup; @@ -410,9 +404,6 @@ gssEapExportName(OM_uint32 *minor, p += krbNameLen; if (composite) { - store_uint32_be(name->flags, p); - p += 4; - store_uint32_be(attrs.length, p); memcpy(&p[4], attrs.value, attrs.length); p += 4 + attrs.length; diff --git a/mech_eap/util_saml.h b/mech_eap/util_saml.h index bbad54f..c380803 100644 --- a/mech_eap/util_saml.h +++ b/mech_eap/util_saml.h @@ -95,14 +95,6 @@ public: gss_eap_saml_attr_provider(void) {} ~gss_eap_saml_attr_provider(void); -#if 0 - bool initFromExistingContext(const gss_eap_attr_ctx *source, - const gss_eap_attr_provider *ctx); - bool initFromGssContext(const gss_eap_attr_ctx *source, - const gss_cred_id_t cred, - const gss_ctx_id_t ctx); -#endif - bool getAttributeTypes(gss_eap_attr_enumeration_cb, void *data) const; void setAttribute(int complete, const gss_buffer_t attr, -- 2.1.4