/**
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014 - 2015 ForgeRock AS.
*/
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include "platform.h"
#include "am.h"
#include "utility.h"
#include "cmocka.h"
void am_net_init();
void am_net_shutdown();
void am_worker_pool_init_reset();
void am_net_init_ssl_reset();
#define TEST_TOKEN_VALUE "AQIC5wM2LY4Sfcyro187TdQ7LJIs373_tJP4Lb2VXBv-Qoc.*AAJTSQACMDEAAlNLABM5MjExNjg2Nzk3Mjg3MjI4MDA2*"
/**
* Compare only the prefix against the string.
* Return the result of strncmp, so 0 means no differences, etc.
*/
}
{
return AM_SUCCESS;
}
{
/* an unnormalised path */
return AM_SUCCESS;
}
{
/* the original intention was to check that the normalisation threw out this path */
return AM_SUCCESS;
}
{
/* note that the parser does not accept namespaces and it does not normalize character content.*/
char* saml =
"</x>";
return AM_SUCCESS;
}
/*****************************************************************************************************/
int array_len = 0;
struct ctx {
void *dummy;
} ctx;
.instance_id = 0,
.override_host = AM_TRUE,
.resolve_client_host = 0,
};
.instance_id = 0,
.client_ip = "209.173.53.167",
.client_host = "d.e.f",
.method = AM_REQUEST_GET,
};
setup = func_array [0];
am_net_init();
}
int array_len = 0;
struct ctx {
void *dummy;
} ctx;
.instance_id = 0,
.override_host = AM_TRUE,
.resolve_client_host = 0,
};
.instance_id = 0,
.client_ip = "2001:5c0:9168:0:0:0:0:1",
.client_host = "d.e.f:8090",
.method = AM_REQUEST_GET,
};
setup = func_array [0];
am_net_init();
}
int array_len = 0;
struct ctx {
void *dummy;
} ctx;
.instance_id = 0,
.override_host = AM_TRUE,
.resolve_client_host = 0,
};
.instance_id = 0,
.client_ip = "2001:5c0:9168:0:0:0:0:1",
.client_host = "d.e.f:8080",
.method = AM_REQUEST_GET,
};
setup = func_array [0];
am_net_init();
/* this should fail because the invalid path tried to refer outside of the root */
/* however, we have accepted the URL and the resulting path is this: */
}
int array_len = 0;
struct ctx {
void *dummy;
} ctx;
.instance_id = 0,
.override_port = AM_TRUE,
.cdsso_enable = 1,
.resolve_client_host = 0,
};
.instance_id = 0,
.client_ip = "209.173.53.167,09.173.53.168",
.client_host = "d.e.f:37289423,g.h.i",
.content_type = "application/xml",
};
setup = func_array [0];
am_net_init();
}
/*
* note: this test requires an Internet connection since it contacts a DNS server to verify the client host
*/
int array_len = 0;
struct ctx {
void *dummy;
} ctx;
.instance_id = 0,
.override_host = AM_TRUE,
.resolve_client_host = 1,
};
.instance_id = 0,
.client_ip = "2001:4860:4860::8888,2001:5c0:9168:0:0:0:0:1",
.client_host = "www.google.com",
.method = AM_REQUEST_GET,
};
setup = func_array [0];
am_net_init();
}