Pass the CREATE_CHILD_SA initiator flag to the child_keys parameter

This commit is contained in:
Martin Willi
2010-07-26 13:53:53 +02:00
parent aa334daa9b
commit b2e447e24a
5 changed files with 12 additions and 9 deletions
+3 -3
View File
@@ -444,8 +444,8 @@ METHOD(bus_t, ike_keys, void,
}
METHOD(bus_t, child_keys, void,
private_bus_t *this, child_sa_t *child_sa, diffie_hellman_t *dh,
chunk_t nonce_i, chunk_t nonce_r)
private_bus_t *this, child_sa_t *child_sa, bool initiator,
diffie_hellman_t *dh, chunk_t nonce_i, chunk_t nonce_r)
{
enumerator_t *enumerator;
ike_sa_t *ike_sa;
@@ -464,7 +464,7 @@ METHOD(bus_t, child_keys, void,
}
entry->calling++;
keep = entry->listener->child_keys(entry->listener, ike_sa, child_sa,
dh, nonce_i, nonce_r);
initiator, dh, nonce_i, nonce_r);
entry->calling--;
if (!keep)
{
+3 -2
View File
@@ -268,12 +268,13 @@ struct bus_t {
* CHILD_SA keymat hook.
*
* @param child_sa CHILD_SA this keymat is used for
* @param initiator initiator of the CREATE_CHILD_SA exchange
* @param dh diffie hellman shared secret
* @param nonce_i initiators nonce
* @param nonce_r responders nonce
*/
void (*child_keys)(bus_t *this, child_sa_t *child_sa, diffie_hellman_t *dh,
chunk_t nonce_i, chunk_t nonce_r);
void (*child_keys)(bus_t *this, child_sa_t *child_sa, bool initiator,
diffie_hellman_t *dh, chunk_t nonce_i, chunk_t nonce_r);
/**
* IKE_SA up/down hook.
+3 -1
View File
@@ -110,13 +110,15 @@ struct listener_t {
*
* @param ike_sa IKE_SA the child sa belongs to
* @param child_sa CHILD_SA this keymat is used for
* @param initiator initiator of the CREATE_CHILD_SA exchange
* @param dh diffie hellman shared secret
* @param nonce_i initiators nonce
* @param nonce_r responders nonce
* @return TRUE to stay registered, FALSE to unregister
*/
bool (*child_keys)(listener_t *this, ike_sa_t *ike_sa, child_sa_t *child_sa,
diffie_hellman_t *dh, chunk_t nonce_i, chunk_t nonce_r);
bool initiator, diffie_hellman_t *dh,
chunk_t nonce_i, chunk_t nonce_r);
/**
* Hook called if an IKE_SA gets up or down.
+1 -1
View File
@@ -45,7 +45,7 @@ struct private_ha_child_t {
METHOD(listener_t, child_keys, bool,
private_ha_child_t *this, ike_sa_t *ike_sa, child_sa_t *child_sa,
diffie_hellman_t *dh, chunk_t nonce_i, chunk_t nonce_r)
bool initiator, diffie_hellman_t *dh, chunk_t nonce_i, chunk_t nonce_r)
{
ha_message_t *m;
chunk_t secret;
+2 -2
View File
@@ -489,8 +489,8 @@ static status_t select_and_install(private_child_create_t *this,
return NOT_FOUND;
}
charon->bus->child_keys(charon->bus, this->child_sa, this->dh,
nonce_i, nonce_r);
charon->bus->child_keys(charon->bus, this->child_sa, this->initiator,
this->dh, nonce_i, nonce_r);
/* add to IKE_SA, and remove from task */
this->child_sa->set_state(this->child_sa, CHILD_INSTALLED);