}
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;
}
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)
{
* 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.
*
* @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.
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;
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);