+
+OM_uint32
+samlMapNametoAny(OM_uint32 *minor,
+ const struct eap_gss_saml_attr_ctx *ctx,
+ int authenticated,
+ gss_buffer_t type_id,
+ gss_any_t *output)
+{
+ if (bufferEqualString(type_id, "shibsp::Attribute")) {
+ vector <Attribute *>v = duplicateAttributes(ctx->getAttributes());
+
+ *output = (gss_any_t)new vector <Attribute *>(v);
+ } else if (bufferEqualString(type_id, "opensaml::Assertion")) {
+ *output = (gss_any_t)ctx->getAssertion()->clone();
+ } else {
+ *output = (gss_any_t)NULL;
+ return GSS_S_UNAVAILABLE;
+ }
+
+ return GSS_S_COMPLETE;
+}
+
+OM_uint32
+samlReleaseAnyNameMapping(OM_uint32 *minor,
+ const struct eap_gss_saml_attr_ctx *ctx,
+ gss_buffer_t type_id,
+ gss_any_t *input)
+{
+ if (bufferEqualString(type_id, "vector<shibsp::Attribute>")) {
+ vector <Attribute *> *v = ((vector <Attribute *> *)*input);
+ delete v;
+ } else if (bufferEqualString(type_id, "opensaml::Assertion")) {
+ delete (Assertion *)*input;
+ } else {
+ return GSS_S_UNAVAILABLE;
+ }
+
+ *input = (gss_any_t)NULL;
+ return GSS_S_COMPLETE;
+}