/*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include "gssapiP_eap.h"
+/*
+ * Wrapper for retrieving a naming attribute.
+ */
+
OM_uint32
gss_get_name_attribute(OM_uint32 *minor,
gss_name_t name,
gss_buffer_t display_value,
int *more)
{
- OM_uint32 major, tmpMinor;
- gss_buffer_desc prefix, suffix;
- enum gss_eap_attribute_type type;
+ OM_uint32 major;
+
+ *minor = 0;
if (name == GSS_C_NO_NAME) {
*minor = EINVAL;
return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_BAD_NAME;
}
- *authenticated = 0;
- *complete = 0;
- value->length = 0;
- value->value = NULL;
- display_value->length = 0;
- display_value->value = NULL;
- *more = -1;
-
GSSEAP_MUTEX_LOCK(&name->mutex);
- major = decomposeAttributeName(minor, attr, &prefix, &suffix);
- if (GSS_ERROR(major))
- goto cleanup;
-
- type = gssEapAttributePrefixToType(&prefix);
- if (type == ATTR_TYPE_SAML_AAA_ASSERTION) {
- major = samlGetAssertion(minor, name->samlCtx, value);
- } else {
- major = samlGetAttribute(minor, name->samlCtx, &suffix,
- authenticated, complete,
- value, display_value, more);
- }
+ major = gssEapGetNameAttribute(minor, name, attr,
+ authenticated, complete,
+ value, display_value, more);
-cleanup:
GSSEAP_MUTEX_UNLOCK(&name->mutex);
return major;