AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_supporting_tokens_add_token(
    rp_supporting_tokens_t * supporting_tokens,
    const axutil_env_t * env,
    rp_property_t * token)
{
    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
    AXIS2_PARAM_CHECK(env->error, token, AXIS2_FAILURE);

    rp_property_increment_ref(token, env);
    axutil_array_list_add(supporting_tokens->tokens, env, token);
    return AXIS2_SUCCESS;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_transport_binding_set_transport_token(
    rp_transport_binding_t * transport_binding,
    const axutil_env_t * env,
    rp_property_t * transport_token)
{
    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
    AXIS2_PARAM_CHECK(env->error, transport_token, AXIS2_FAILURE);

    rp_property_increment_ref(transport_token, env);
    transport_binding->transport_token = transport_token;
    return AXIS2_SUCCESS;
}
Beispiel #3
0
AXIS2_EXTERN axis2_status_t AXIS2_CALL
rp_symmetric_binding_set_signature_token(
    rp_symmetric_binding_t * symmetric_binding,
    const axutil_env_t * env,
    rp_property_t * signature_token)
{
    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
    AXIS2_PARAM_CHECK(env->error, signature_token, AXIS2_FAILURE);
    if(symmetric_binding->protection_token)
    {
        return AXIS2_FAILURE;
    }
    rp_property_increment_ref(signature_token, env);
    symmetric_binding->signature_token = signature_token;

    return AXIS2_SUCCESS;

}
Beispiel #4
0
neethi_assertion_t *AXIS2_CALL
neethi_assertion_create_with_args(
    const axutil_env_t *env,
    AXIS2_FREE_VOID_ARG free_func,
    void *value,
    neethi_assertion_type_t type)
{
    neethi_assertion_t *neethi_assertion = NULL;
    neethi_assertion = (neethi_assertion_t *)AXIS2_MALLOC(env->allocator,
        sizeof(neethi_assertion_t));

    if(!neethi_assertion)
    {
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Neethi assertion creation failed. Out of memory");
        return NULL;
    }

    neethi_assertion->policy_components = NULL;
    neethi_assertion->policy_components = axutil_array_list_create(env, 0);
    if(!(neethi_assertion->policy_components))
    {
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
            "Neethi assertion policy components creation failed.");
        return NULL;
    }

    /* This ref count is for asertions which are represented from a struct.
     * These assertion structs are more probably referenced from some other
     * struct. So we need to increment the ref count in order to prevent
     * unnecessary memory freeing */

    if(type == ASSERTION_TYPE_X509_TOKEN)
    {
        rp_x509_token_increment_ref((rp_x509_token_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_SECURITY_CONTEXT_TOKEN)
    {
        rp_security_context_token_increment_ref((rp_security_context_token_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_INITIATOR_TOKEN)
    {
        rp_property_increment_ref((rp_property_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_RECIPIENT_TOKEN)
    {
        rp_property_increment_ref((rp_property_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_PROTECTION_TOKEN)
    {
        rp_property_increment_ref((rp_property_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_ENCRYPTION_TOKEN)
    {
        rp_property_increment_ref((rp_property_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_TRANSPORT_TOKEN)
    {
        rp_property_increment_ref((rp_property_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_SIGNATURE_TOKEN)
    {
        rp_property_increment_ref((rp_property_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_LAYOUT)
    {
        rp_layout_increment_ref((rp_layout_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_ALGORITHM_SUITE)
    {
        rp_algorithmsuite_increment_ref((rp_algorithmsuite_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_WSS10)
    {
        rp_wss10_increment_ref((rp_wss10_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_WSS11)
    {
        rp_wss11_increment_ref((rp_wss11_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_TRUST10)
    {
        rp_trust10_increment_ref((rp_trust10_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_SUPPORTING_TOKENS)
    {
        rp_supporting_tokens_increment_ref((rp_supporting_tokens_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_USERNAME_TOKEN)
    {
        rp_username_token_increment_ref((rp_username_token_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_ASSYMMETRIC_BINDING)
    {
        rp_asymmetric_binding_increment_ref((rp_asymmetric_binding_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_SYMMETRIC_BINDING)
    {
        rp_symmetric_binding_increment_ref((rp_symmetric_binding_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_TRANSPORT_BINDING)
    {
        rp_transport_binding_increment_ref((rp_transport_binding_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS)
    {
        rp_signed_encrypted_parts_increment_ref((rp_signed_encrypted_parts_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_RAMPART_CONFIG)
    {
        rp_rampart_config_increment_ref((rp_rampart_config_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_ISSUED_TOKEN)
    {
        rp_issued_token_increment_ref((rp_issued_token_t *)value, env);
    }
    else if(type == ASSERTION_TYPE_SAML_TOKEN)
    {
        rp_saml_token_increment_ref((rp_saml_token_t *)value, env);
    }

    neethi_assertion->value = value;
    neethi_assertion->type = type;
    neethi_assertion->element = NULL;
    neethi_assertion->is_optional = AXIS2_FALSE;
    neethi_assertion->node = NULL;
    neethi_assertion->free_func = free_func;

    return neethi_assertion;
}