* limitations under the License.
*/
+/*
+ * Local attribute provider implementation.
+ */
+
+#include <xmltooling/XMLObject.h>
+
+#include <saml/saml2/core/Assertions.h>
+
#include <shibsp/exceptions.h>
#include <shibsp/attribute/SimpleAttribute.h>
-
#include <shibresolver/resolver.h>
#include <sstream>
resolver = ShibbolethResolver::create();
if (gssCred != GSS_C_NO_CREDENTIAL &&
- gssEapDisplayName(&minor, gssCred->name, &nameBuf, NULL) == GSS_S_COMPLETE)
+ gssEapDisplayName(&minor, gssCred->name, &nameBuf, NULL) == GSS_S_COMPLETE) {
resolver->setApplicationID((const char *)nameBuf.value);
+ gss_release_buffer(&minor, &nameBuf);
+ }
m_authenticated = false;
m_authenticated = saml->authenticated();
}
- resolver->resolve();
-
- m_attributes = resolver->getResolvedAttributes();
- resolver->getResolvedAttributes().clear();
-
- gss_release_buffer(&minor, &nameBuf);
+ try {
+ resolver->resolve();
+ m_attributes = resolver->getResolvedAttributes();
+ resolver->getResolvedAttributes().clear();
+ } catch (exception &e) {
+#if 0
+ delete resolver;
+ throw e;
+#endif
+ }
delete resolver;
-
return true;
}
if (!ShibbolethResolver::init())
return false;
- gss_eap_attr_ctx::registerProvider(ATTR_TYPE_LOCAL,
- NULL,
- gss_eap_shib_attr_provider::createAttrContext);
+ gss_eap_attr_ctx::registerProvider(ATTR_TYPE_LOCAL, NULL, createAttrContext);
return true;
}
ShibbolethResolver::term();
}
+OM_uint32
+gss_eap_shib_attr_provider::mapException(OM_uint32 *minor,
+ std::exception &e) const
+{
+ if (typeid(e) == typeid(AttributeException))
+ *minor = GSSEAP_SHIB_ATTR_FAILURE;
+ else if (typeid(e) == typeid(AttributeExtractionException))
+ *minor = GSSEAP_SHIB_ATTR_EXTRACT_FAILURE;
+ else if (typeid(e) == typeid(AttributeFilteringException))
+ *minor = GSSEAP_SHIB_ATTR_FILTER_FAILURE;
+ else if (typeid(e) == typeid(AttributeResolutionException))
+ *minor = GSSEAP_SHIB_ATTR_RESOLVE_FAILURE;
+ else if (typeid(e) == typeid(ConfigurationException))
+ *minor = GSSEAP_SHIB_CONFIG_FAILURE;
+ else if (typeid(e) == typeid(ListenerException))
+ *minor = GSSEAP_SHIB_LISTENER_FAILURE;
+ else
+ return GSS_S_CONTINUE_NEEDED;
+
+ return GSS_S_FAILURE;
+}
+
gss_eap_attr_provider *
gss_eap_shib_attr_provider::createAttrContext(void)
{