X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=mech_eap%2Futil_saml.cpp;h=c4cdd98a3dcb80199c79f613007f4776d57b819f;hb=040fe91fb58c6c94e71e9c61f237c89d90eeec9d;hp=070014eb4357cc4a2798ab433a0350ebb155d5df;hpb=436babe46f9b49b51981af5583e20cdef6d5eb41;p=cyrus-sasl.git diff --git a/mech_eap/util_saml.cpp b/mech_eap/util_saml.cpp index 070014e..c4cdd98 100644 --- a/mech_eap/util_saml.cpp +++ b/mech_eap/util_saml.cpp @@ -88,7 +88,7 @@ gss_eap_saml_assertion_provider::initFromGssContext(const gss_eap_attr_ctx *mana radius = static_cast (m_manager->getProvider(ATTR_TYPE_RADIUS)); if (radius != NULL && - radius->getAttribute(512 /* XXX */, &authenticated, &complete, + radius->getAttribute(PW_SAML_ASSERTION, &authenticated, &complete, &value, NULL, &more)) { setAssertion(&value, authenticated); gss_release_buffer(&minor, &value); @@ -460,16 +460,19 @@ gss_eap_saml_attr_provider::getAttribute(const gss_buffer_t attr, av = dynamic_cast(a->getAttributeValues().at(i) ); if (av != NULL) { - value->value = toUTF8(av->getTextContent(), true); - value->length = strlen((char *)value->value); - - if (display_value != NULL) - duplicateBuffer(*value, display_value); - - if (nvalues > ++i) - *more = i; + if (value != NULL) { + value->value = toUTF8(av->getTextContent(), true); + value->length = strlen((char *)value->value); + } + if (display_value != NULL) { + display_value->value = toUTF8(av->getTextContent(), true); + display_value->length = strlen((char *)value->value); + } } + if (nvalues > ++i) + *more = i; + return true; }