}
bool
-gss_eap_shib_attr_provider::initFromExistingContext(const gss_eap_attr_ctx *manager,
+gss_eap_shib_attr_provider::initWithExistingContext(const gss_eap_attr_ctx *manager,
const gss_eap_attr_provider *ctx)
{
const gss_eap_shib_attr_provider *shib;
- if (!gss_eap_attr_provider::initFromExistingContext(manager, ctx)) {
+ if (!gss_eap_attr_provider::initWithExistingContext(manager, ctx)) {
return false;
}
mechContext->value = p = (unsigned char *)GSSEAP_MALLOC(mechContext->length);
if (mechContext->value == NULL) {
gss_release_buffer(minor, &exportedCtx);
- throw new std::bad_alloc;
+ throw std::bad_alloc();
}
p = store_oid(gssCtx->mechanismUsed, p);
}
bool
-gss_eap_shib_attr_provider::initFromGssContext(const gss_eap_attr_ctx *manager,
+gss_eap_shib_attr_provider::initWithGssContext(const gss_eap_attr_ctx *manager,
const gss_cred_id_t gssCred,
const gss_ctx_id_t gssCtx)
{
- if (!gss_eap_attr_provider::initFromGssContext(manager, gssCred, gssCtx))
+ if (!gss_eap_attr_provider::initWithGssContext(manager, gssCred, gssCtx))
return false;
auto_ptr<ShibbolethResolver> resolver(ShibbolethResolver::create());
m_attributes = resolver->getResolvedAttributes();
resolver->getResolvedAttributes().clear();
} catch (exception &e) {
+ return false;
}
m_authenticated = true;
if (i == -1)
i = 0;
- else if (i >= nvalues)
+ if (i >= nvalues)
return false;
buf.value = (void *)shibAttr->getSerializedValues()[*more].c_str();
for (vector<Attribute*>::const_iterator a = m_attributes.begin();
a != m_attributes.end(); ++a) {
- try {
- DDF attr = (*a)->marshall();
- JSONObject jattr = JSONObject::ddf(attr);
- jattrs.append(jattr);
- } catch (AttributeException &e) {
- /* XXX FIXME ignore attribute exceptions? */
- }
+ DDF attr = (*a)->marshall();
+ JSONObject jattr = JSONObject::ddf(attr);
+ jattrs.append(jattr);
}
obj.set("attributes", jattrs);
for (size_t i = 0; i < nelems; i++) {
JSONObject jattr = jattrs.get(i);
- try {
- DDF attr = jattr.ddf();
- Attribute *attribute = Attribute::unmarshall(attr);
- m_attributes.push_back(attribute);
- } catch (AttributeException &e) {
- return false;
- }
+ DDF attr = jattr.ddf();
+ Attribute *attribute = Attribute::unmarshall(attr);
+ m_attributes.push_back(attribute);
}
m_authenticated = obj["authenticated"].integer();
bool
gss_eap_shib_attr_provider::init(void)
{
- if (!ShibbolethResolver::init())
+ if (SPConfig::getConfig().getFeatures() == 0 &&
+ ShibbolethResolver::init() == false)
return false;
gss_eap_attr_ctx::registerProvider(ATTR_TYPE_LOCAL, createAttrContext);
else
return GSS_S_CONTINUE_NEEDED;
+ gssEapSaveStatusInfo(*minor, "%s", e.what());
+
return GSS_S_FAILURE;
}