Example #1
0
bool
gss_eap_radius_attr_provider::deleteAttribute(const gss_buffer_t attr)
{
    gss_eap_attrid attrid;

    if (!getAttributeId(attr, &attrid))
        return false;

    return deleteAttribute(attrid);
}
Example #2
0
bool
gss_eap_radius_attr_provider::setAttribute(int complete,
                                           const gss_buffer_t attr,
                                           const gss_buffer_t value)
{
    gss_eap_attrid attrid;

    if (!getAttributeId(attr, &attrid))
        return false;

    return setAttribute(complete, attrid, value);
}
Example #3
0
File: http.c Project: ic-hep/emi3
/************************************************
Function:    constructResponse
Parameters:  xacml_response_t * response
Description:
             The XACML response message is constructed here.
             This implementation will use the Unix UID, Primary GID and
             multiple Secondary GIDs as input to contruct the obligations and
             its attributes. 
************************************************/
int constructResponse (xacml_response_t * response){

  /* Mapping Information Translated */
  aos_context_t*       context         = NULL;
  aos_attribute_t*     attribute       = NULL;
  xacml_obligation_t   tmp_obligation  = NULL;
  char*                attribute_name  = NULL;
  char*                attribute_value = NULL;
  char*                obligation_id   = NULL;

  rewindContexts();
  while((context = getNextContext(OBLIGATION, NULL)) != NULL){
    rewindAttributes(context);
    obligation_id = getContextObligationId(context),
    xacml_obligation_init(&tmp_obligation,
                          obligation_id,
                          XACML_EFFECT_Permit);
    /*printf("Obligation: %s at %p", obligation_id, tmp_obligation);*/
    /*EEF_log(LOG_DEBUG, "Obligation %s", obligation_id);*/
    while((attribute = getNextAttribute(context)) != NULL){
      attribute_name = getAttributeId(attribute);
      attribute_value = getAttributeValueAsString(attribute);
      if(attribute_name && attribute_value){
        /*EEF_log(LOG_DEBUG, "\t%s=%s\n", attribute_name, attribute_value);*/

        /* uid */
        xacml_obligation_add_attribute(tmp_obligation,
                                       attribute_name,
                                       XACML_DATATYPE_STRING,
                                       attribute_value);
        /*printf("Added obligation at: %p type %s\n", tmp_obligation, XACML_DATATYPE_STRING);*/
      }   
    }   
    xacml_response_add_obligation(*response, tmp_obligation);
    xacml_obligation_destroy(tmp_obligation);
    tmp_obligation = NULL;
  }

  /*********** E: Obligation UIDGID ***********/


  xacml_response_set_saml_status_code  (*response, SAML_STATUS_Success);
  xacml_response_set_xacml_status_code (*response, XACML_STATUS_ok);
  xacml_response_set_xacml_decision    (*response, XACML_DECISION_Permit);

  return 0;
}
Example #4
0
bool
gss_eap_radius_attr_provider::getAttribute(const gss_buffer_t attr,
                                           int *authenticated,
                                           int *complete,
                                           gss_buffer_t value,
                                           gss_buffer_t display_value,
                                           int *more) const
{
    gss_eap_attrid attrid;

    if (!getAttributeId(attr, &attrid))
        return false;

    return getAttribute(attrid,
                        authenticated, complete,
                        value, display_value, more);
}