Pass the CREATE_CHILD_SA initiator flag to the child_keys parameter
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user