Exemplo n.º 1
0
AXIS2_EXTERN rp_username_token_t *AXIS2_CALL
rp_username_token_create(
    const axutil_env_t * env)
{
    rp_username_token_t *username_token = NULL;
    username_token = (rp_username_token_t *)AXIS2_MALLOC(env->allocator,
        sizeof(rp_username_token_t));

    if(!username_token)
    {
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
            "[neethi] User name token creation failed. Insufficient memory");
        return NULL;
    }

    username_token->token = rp_token_create(env);
    if(!username_token->token)
    {
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] User name token creation failed.");
        rp_username_token_free(username_token, env);
        return NULL;
    }

    username_token->inclusion = RP_INCLUDE_ALWAYS;
    username_token->password_type = PASSWORD_PLAIN;
    username_token->useUTprofile10 = AXIS2_TRUE;
    username_token->useUTprofile11 = AXIS2_FALSE;
    username_token->ref = 0;

    return username_token;
}
Exemplo n.º 2
0
AXIS2_EXTERN rp_x509_token_t *AXIS2_CALL
rp_x509_token_create(
    const axutil_env_t * env)
{
    rp_x509_token_t *x509_token = NULL;
    x509_token = (rp_x509_token_t *)AXIS2_MALLOC(env->allocator, sizeof(rp_x509_token_t));

    if(!x509_token)
    {
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
            "[neethi] X509 token assertion creation failed. Insufficient memory");
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
        return NULL;
    }
    x509_token->require_key_identifier_reference = AXIS2_FALSE;
    x509_token->require_issuer_serial_reference = AXIS2_FALSE;
    x509_token->require_embedded_token_reference = AXIS2_FALSE;
    x509_token->require_thumb_print_reference = AXIS2_FALSE;
    x509_token->token_version_and_type = RP_WSS_X509_V3_TOKEN_10;
    x509_token->ref = 0;

    x509_token->token = rp_token_create(env);
    if(!x509_token->token)
    {
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[neethi] X509 token assertion creation failed.");
        rp_x509_token_free(x509_token, env);
        return NULL;
    }
    return x509_token;
}