fixed child rekey collision

implemented ike rekey collision
This commit is contained in:
Martin Willi
2007-03-21 14:42:49 +00:00
parent 195ada0b4b
commit eef0859043
8 changed files with 150 additions and 67 deletions
+17
View File
@@ -687,6 +687,22 @@ static child_sa_t* get_child(private_child_create_t *this)
return NULL;
}
/**
* Implementation of child_create_t.get_lower_nonce
*/
static chunk_t get_lower_nonce(private_child_create_t *this)
{
if (memcmp(this->my_nonce.ptr, this->other_nonce.ptr,
min(this->my_nonce.len, this->other_nonce.len)) < 0)
{
return this->my_nonce;
}
else
{
return this->other_nonce;
}
}
/**
* Implementation of task_t.migrate
*/
@@ -756,6 +772,7 @@ child_create_t *child_create_create(ike_sa_t *ike_sa, policy_t *policy)
private_child_create_t *this = malloc_thing(private_child_create_t);
this->public.get_child = (child_sa_t*(*)(child_create_t*))get_child;
this->public.get_lower_nonce = (chunk_t(*)(child_create_t*))get_lower_nonce;
this->public.use_reqid = (void(*)(child_create_t*,u_int32_t))use_reqid;
this->public.task.get_type = (task_type_t(*)(task_t*))get_type;
this->public.task.migrate = (void(*)(task_t*,ike_sa_t*))migrate;