- rewrite of logger_manager, uses now one instance per context

- cleanups for logger here and there
- removed critical flag check in payload verification (conformance to IKEv2)
- so thats and theres everywere... ;-)
This commit is contained in:
Martin Willi
2006-03-23 15:25:43 +00:00
parent 3264ce50b9
commit dec598220b
59 changed files with 461 additions and 762 deletions
+2 -2
View File
@@ -205,7 +205,7 @@ static diffie_hellman_group_t get_dh_group(private_connection_t *this)
while (iterator->has_next(iterator))
{
iterator->current(iterator, (void**)&proposal);
proposal->get_algorithm(proposal, IKE, DIFFIE_HELLMAN_GROUP, &algo);
proposal->get_algorithm(proposal, PROTO_IKE, DIFFIE_HELLMAN_GROUP, &algo);
if (algo)
{
iterator->destroy(iterator);
@@ -229,7 +229,7 @@ static bool check_dh_group(private_connection_t *this, diffie_hellman_group_t dh
while (prop_iter->has_next(prop_iter))
{
prop_iter->current(prop_iter, (void**)&proposal);
alg_iter = proposal->create_algorithm_iterator(proposal, IKE, DIFFIE_HELLMAN_GROUP);
alg_iter = proposal->create_algorithm_iterator(proposal, PROTO_IKE, DIFFIE_HELLMAN_GROUP);
while (alg_iter->has_next(alg_iter))
{
alg_iter->current(alg_iter, (void**)&algo);
+13 -13
View File
@@ -32,10 +32,10 @@
* String mappings for protocol_id_t.
*/
mapping_t protocol_id_m[] = {
{UNDEFINED_PROTOCOL_ID, "UNDEFINED_PROTOCOL_ID"},
{IKE, "IKE"},
{AH, "AH"},
{ESP, "ESP"},
{PROTO_NONE, "PROTO_NONE"},
{PROTO_IKE, "PROTO_IKE"},
{PROTO_AH, "PROTO_AH"},
{PROTO_ESP, "PROTO_ESP"},
{MAPPING_END, NULL}
};
@@ -159,7 +159,7 @@ static protocol_proposal_t *get_protocol_proposal(private_proposal_t *this, prot
proto_proposal->prf_algos = linked_list_create();
proto_proposal->dh_groups = linked_list_create();
proto_proposal->esns = linked_list_create();
if (proto == IKE)
if (proto == PROTO_IKE)
{
proto_proposal->spi.len = 8;
}
@@ -446,15 +446,15 @@ static proposal_t *select_proposal(private_proposal_t *this, private_proposal_t
iterator->destroy(iterator);
/* apply spis from "other" */
spi = other->public.get_spi(&(other->public), AH);
spi = other->public.get_spi(&(other->public), PROTO_AH);
if (spi)
{
selected->set_spi(selected, AH, spi);
selected->set_spi(selected, PROTO_AH, spi);
}
spi = other->public.get_spi(&(other->public), ESP);
spi = other->public.get_spi(&(other->public), PROTO_ESP);
if (spi)
{
selected->set_spi(selected, ESP, spi);
selected->set_spi(selected, PROTO_ESP, spi);
}
/* everything matched, return new proposal */
@@ -477,8 +477,8 @@ static void get_protocols(private_proposal_t *this, protocol_id_t ids[2])
iterator_t *iterator = this->protocol_proposals->create_iterator(this->protocol_proposals, TRUE);
u_int i = 0;
ids[0] = UNDEFINED_PROTOCOL_ID;
ids[1] = UNDEFINED_PROTOCOL_ID;
ids[0] = PROTO_NONE;
ids[1] = PROTO_NONE;
while (iterator->has_next(iterator))
{
protocol_proposal_t *proto_prop;
@@ -501,7 +501,7 @@ static void set_spi(private_proposal_t *this, protocol_id_t proto, u_int64_t spi
protocol_proposal_t *proto_proposal = get_protocol_proposal(this, proto, FALSE);
if (proto_proposal)
{
if (proto == AH || proto == ESP)
if (proto == PROTO_AH || proto == PROTO_ESP)
{
*((u_int32_t*)proto_proposal->spi.ptr) = (u_int32_t)spi;
}
@@ -520,7 +520,7 @@ static u_int64_t get_spi(private_proposal_t *this, protocol_id_t proto)
protocol_proposal_t *proto_proposal = get_protocol_proposal(this, proto, FALSE);
if (proto_proposal)
{
if (proto == AH || proto == ESP)
if (proto == PROTO_AH || proto == PROTO_ESP)
{
return (u_int64_t)*((u_int32_t*)proto_proposal->spi.ptr);
}
+4 -4
View File
@@ -41,10 +41,10 @@ typedef enum protocol_id_t protocol_id_t;
* @ingroup config
*/
enum protocol_id_t {
UNDEFINED_PROTOCOL_ID = 201,
IKE = 1,
AH = 2,
ESP = 3,
PROTO_NONE = 0,
PROTO_IKE = 1,
PROTO_AH = 2,
PROTO_ESP = 3,
};
/**