{
const gss_eap_saml_assertion_provider *saml;
const gss_eap_radius_attr_provider *radius;
+#if 0
gss_buffer_desc nameBuf = GSS_C_EMPTY_BUFFER;
- ShibbolethResolver *resolver;
OM_uint32 minor;
-
+#endif
if (!gss_eap_attr_provider::initFromGssContext(manager, gssCred, gssCtx))
return false;
radius = static_cast<const gss_eap_radius_attr_provider *>
(m_manager->getProvider(ATTR_TYPE_RADIUS));
- resolver = ShibbolethResolver::create();
+ auto_ptr<ShibbolethResolver> resolver(ShibbolethResolver::create());
+ /*
+ * For now, leave ApplicationID defaulted.
+ * Later on, we could allow this via config option to the mechanism
+ * or rely on an SPRequest interface to pass in a URI identifying the
+ * acceptor.
+ */
+#if 0
if (gssCred != GSS_C_NO_CREDENTIAL &&
gssEapDisplayName(&minor, gssCred->name, &nameBuf, NULL) == GSS_S_COMPLETE) {
resolver->setApplicationID((const char *)nameBuf.value);
gss_release_buffer(&minor, &nameBuf);
}
+#endif
m_authenticated = false;
m_attributes = resolver->getResolvedAttributes();
resolver->getResolvedAttributes().clear();
} catch (exception &e) {
-#if 0
- delete resolver;
- throw e;
-#endif
+ //fprintf(stderr, "%s", e.what());
}
- delete resolver;
return true;
}
else if (i >= nvalues)
return false;
- buf.value = (void *)shibAttr->getString(*more);
+ buf.value = (void *)shibAttr->getSerializedValues()[*more].c_str();
buf.length = strlen((char *)buf.value);
if (buf.length != 0) {
delete v;
}
-void
-gss_eap_shib_attr_provider::exportToBuffer(gss_buffer_t buffer) const
+const char *
+gss_eap_shib_attr_provider::marshallingKey(void) const
{
- DDF obj(NULL);
- DDF attrs(NULL);
+ return "local";
+}
- buffer->length = 0;
- buffer->value = NULL;
+DDF
+gss_eap_shib_attr_provider::marshall(void) const
+{
+ DDF obj(NULL);
- obj.addmember("version").integer(1);
obj.addmember("authenticated").integer(m_authenticated);
- attrs = obj.addmember("attributes").list();
+ DDF attrs = obj.addmember("attributes").list();
for (vector<Attribute*>::const_iterator a = m_attributes.begin();
a != m_attributes.end(); ++a) {
DDF attr = (*a)->marshall();
attrs.add(attr);
}
- ostringstream sink;
- sink << attrs;
- string str = sink.str();
-
- duplicateBuffer(str, buffer);
-
- attrs.destroy();
+ return obj;
}
bool
-gss_eap_shib_attr_provider::initFromBuffer(const gss_eap_attr_ctx *ctx,
- const gss_buffer_t buffer)
+gss_eap_shib_attr_provider::unmarshallAndInit(const gss_eap_attr_ctx *ctx,
+ DDF &obj)
{
- if (!gss_eap_attr_provider::initFromBuffer(ctx, buffer))
+ if (!gss_eap_attr_provider::unmarshallAndInit(ctx, obj))
return false;
- if (buffer->length == 0)
- return true;
-
assert(m_authenticated == false);
assert(m_attributes.size() == 0);
- DDF obj(NULL);
- string str((const char *)buffer->value, buffer->length);
- istringstream source(str);
-
- source >> obj;
-
- if (obj["version"].integer() != 1)
- return false;
-
m_authenticated = (obj["authenticated"].integer() != 0);
DDF attrs = obj["attributes"];
attr = attrs.next();
}
- attrs.destroy();
-
return true;
}