{
for (unsigned int i = 0; i < ATTR_TYPE_MAX; i++) {
if (ctx.m_providers[i] != NULL) {
- m_providers[i] = (gss_eap_attr_factories[i])(&ctx, GSS_C_NO_CREDENTIAL,
+ m_providers[i] = (gss_eap_attr_factories[i])(&ctx,
+ GSS_C_NO_CREDENTIAL,
GSS_C_NO_CONTEXT);
}
}
void
gss_eap_attr_ctx::marshall(gss_buffer_t buffer) const
{
+ /* For now, just marshall the RADIUS context. */
}
+bool
+gss_eap_attr_ctx::unmarshall(const gss_eap_attr_ctx *ctx,
+ const gss_buffer_t buffer)
+{
+ int i;
+
+ for (i = 0; i < ATTR_TYPE_MAX; i++) {
+ gss_eap_attr_provider *provider = m_providers[i];
+
+ }
+}
+
+
/*
* C wrappers
*/
gss_OID *MN_mech,
gss_buffer_set_t *attrs)
{
- *minor = 0;
- *name_is_MN = false;
- *MN_mech = GSS_EAP_MECHANISM;
- *attrs = GSS_C_NO_BUFFER_SET;
-
if (name->attrCtx == NULL)
return GSS_S_UNAVAILABLE;
gss_any_t input) const {}
virtual void marshall(gss_buffer_t buffer) const {}
- static gss_eap_attr_provider *unmarshall(const gss_eap_attr_ctx *ctx,
- const gss_buffer_t buffer)
- { return NULL; }
+ virtual bool unmarshall(const gss_eap_attr_ctx *ctx,
+ const gss_buffer_t buffer) { return false; }
static bool init() { return true; }
static void finalize() {}
gss_any_t input) const;
void marshall(gss_buffer_t buffer) const;
- gss_eap_attr_provider *unmarshall(const gss_eap_attr_ctx *ctx,
- const gss_buffer_t buffer);
+ bool unmarshall(const gss_eap_attr_ctx *ctx,
+ const gss_buffer_t buffer);
static bool init();
static void finalize();
{
}
-gss_eap_attr_provider *
+bool
gss_eap_radius_attr_provider::unmarshall(const gss_eap_attr_ctx *ctx,
const gss_buffer_t buffer)
{
+ return false;
}
bool
gss_any_t input) const;
void marshall(gss_buffer_t buffer) const;
- static gss_eap_attr_provider *unmarshall(const gss_eap_attr_ctx *ctx,
- const gss_buffer_t buffer);
+ bool unmarshall(const gss_eap_attr_ctx *ctx,
+ const gss_buffer_t buffer);
bool getAttribute(unsigned int attribute,
int *authenticated,
* gss_eap_saml_assertion_provider is for retrieving the underlying
* assertion.
*/
+gss_eap_saml_assertion_provider::gss_eap_saml_assertion_provider(const gss_eap_attr_ctx *
+ctx)
+ : gss_eap_attr_provider(ctx)
+{
+ /* Then we may be creating from an existing attribute context */
+ gss_eap_saml_assertion_provider *saml;
+
+ saml = dynamic_cast<gss_eap_saml_assertion_provider *>
+ (ctx->getProvider(ATTR_TYPE_SAML_ASSERTION));
+ if (saml != NULL)
+ setAssertion(saml->getAssertion());
+}
+
gss_eap_saml_assertion_provider::gss_eap_saml_assertion_provider(const gss_eap_attr_ctx *ctx,
gss_cred_id_t gssCred,
gss_ctx_id_t gssCtx)
- : gss_eap_attr_provider(ctx, gssCred, gssCtx)
+ : gss_eap_attr_provider(ctx)
{
- if (gssCtx == GSS_C_NO_CONTEXT) {
- /* Then we are creating from an existing attribute context */
- gss_eap_saml_assertion_provider *saml;
-
- saml = dynamic_cast<gss_eap_saml_assertion_provider *>
- (ctx->getProvider(ATTR_TYPE_SAML_ASSERTION));
- if (saml != NULL)
- setAssertion(saml->getAssertion());
- } else {
- gss_eap_radius_attr_provider *radius;
- gss_buffer_desc value = GSS_C_EMPTY_BUFFER;
- int authenticated, complete, more = -1;
- OM_uint32 minor;
-
- radius = dynamic_cast<gss_eap_radius_attr_provider *>
- (ctx->getProvider(ATTR_TYPE_RADIUS));
- if (radius != NULL &&
- radius->getAttribute(512, &authenticated, &complete,
- &value, NULL, &more)) {
- m_assertion = parseAssertion(&value);
- gss_release_buffer(&minor, &value);
- }
+ gss_eap_radius_attr_provider *radius;
+ gss_buffer_desc value = GSS_C_EMPTY_BUFFER;
+ int authenticated, complete, more = -1;
+ OM_uint32 minor;
+
+ radius = dynamic_cast<gss_eap_radius_attr_provider *>
+ (ctx->getProvider(ATTR_TYPE_RADIUS));
+ if (radius != NULL &&
+ radius->getAttribute(512, &authenticated, &complete,
+ &value, NULL, &more)) {
+ m_assertion = parseAssertion(&value);
+ gss_release_buffer(&minor, &value);
}
}
bool
gss_eap_saml_assertion_provider::getAttributeTypes(gss_eap_attr_enumeration_cb addAttribute, void *data) const
{
- addAttribute(this, GSS_C_NO_BUFFER, data);
+ return addAttribute(this, GSS_C_NO_BUFFER, data);
}
void
duplicateBuffer(str, buffer);
}
-gss_eap_attr_provider *
+bool
gss_eap_saml_assertion_provider::unmarshall(const gss_eap_attr_ctx *ctx,
const gss_buffer_t buffer)
{
- return new gss_eap_saml_assertion_provider(ctx, buffer);
+ assert(m_assertion == NULL);
+
+ m_assertion = parseAssertion(buffer);
+
+ return (m_assertion != NULL);
}
bool
gss_eap_saml_assertion_provider::init(void)
{
+ return true;
}
void
{
}
-gss_eap_attr_provider *
+bool
gss_eap_saml_attr_provider::unmarshall(const gss_eap_attr_ctx *ctx,
const gss_buffer_t buffer)
{
- return new gss_eap_saml_attr_provider(ctx);
+ return false;
}
bool
gss_cred_id_t gssCred,
gss_ctx_id_t gssCtx)
{
- return new gss_eap_saml_attr_provider(ctx, gssCred, gssCtx);
+ if (gssCtx != GSS_C_NO_CONTEXT)
+ return new gss_eap_saml_attr_provider(ctx, gssCred, gssCtx);
+ else
+ return new gss_eap_saml_attr_provider(ctx);
}
struct gss_eap_saml_assertion_provider : gss_eap_attr_provider {
public:
- gss_eap_saml_assertion_provider(const gss_eap_attr_ctx *ctx,
- const gss_buffer_t buffer)
- : gss_eap_attr_provider(ctx)
- {
- m_assertion = parseAssertion(buffer);
- }
-
+ gss_eap_saml_assertion_provider(const gss_eap_attr_ctx *ctx);
gss_eap_saml_assertion_provider(const gss_eap_attr_ctx *ctx,
gss_cred_id_t acceptorCred,
gss_ctx_id_t acceptorCtx);
gss_any_t input) const;
void marshall(gss_buffer_t buffer) const;
- static gss_eap_attr_provider *unmarshall(const gss_eap_attr_ctx *ctx,
- const gss_buffer_t buffer);
+ bool unmarshall(const gss_eap_attr_ctx *ctx,
+ const gss_buffer_t buffer);
void setAssertion(const opensaml::saml2::Assertion *assertion);
gss_any_t input) const;
void marshall(gss_buffer_t buffer) const;
- static gss_eap_attr_provider *unmarshall(const gss_eap_attr_ctx *ctx,
- const gss_buffer_t buffer);
+ bool unmarshall(const gss_eap_attr_ctx *ctx,
+ const gss_buffer_t buffer);
const opensaml::saml2::Attribute *
getAttribute(const gss_buffer_t attr) const;
{
}
-gss_eap_attr_provider *
+bool
gss_eap_shib_attr_provider::unmarshall(const gss_eap_attr_ctx *ctx,
const gss_buffer_t buffer)
{
- return NULL;
+ return false;
}
bool
struct gss_eap_shib_attr_provider : gss_eap_attr_provider {
public:
+ gss_eap_shib_attr_provider(const gss_eap_attr_ctx *ctx);
gss_eap_shib_attr_provider(const gss_eap_attr_ctx *ctx,
gss_cred_id_t acceptorCred,
gss_ctx_id_t acceptorCtx);
gss_any_t input) const;
void marshall(gss_buffer_t buffer) const;
- static gss_eap_attr_provider *unmarshall(const gss_eap_attr_ctx *ctx,
- const gss_buffer_t buffer);
+ bool unmarshall(const gss_eap_attr_ctx *ctx,
+ const gss_buffer_t buffer);
+
static bool init();
static void finalize();