static status_t destroy(private_endpoint_notify_t *this)
{
DESTROY_IF(this->endpoint);
+ DESTROY_IF(this->base);
free(this);
return SUCCESS;
}
break;
}
+ /* FIXME: if there is more than one ip address we should vary this priority */
this->priority += 65535;
if (!host)
this->family = IPv6;
break;
default:
- /* unsupported family type, we do not set the hsot
+ /* unsupported family type, we do not set the host
* (family is set to NO_FAMILY) */
return &this->public;
}
chunk_free(&this->connect_id);
chunk_free(&this->endpoint_raw);
chunk_free(&this->auth);
+ DESTROY_IF(this->src);
+ DESTROY_IF(this->dst);
DESTROY_IF(this->endpoint);
free(this);
}
this->connect_id = chunk_empty;
this->auth = chunk_empty;
this->endpoint_raw = chunk_empty;
+ this->src = NULL;
+ this->dst = NULL;
this->endpoint = NULL;
this->mid = 0;
message->set_destination(message, check->dst->clone(check->dst));
message->set_source(message, check->src->clone(check->src));
- message->set_ike_sa_id(message, ike_sa_id_create(0, 0, request));
+ ike_sa_id_t *ike_sa_id = ike_sa_id_create(0, 0, request);
+ message->set_ike_sa_id(message, ike_sa_id);
+ ike_sa_id->destroy(ike_sa_id);
message->add_notify(message, FALSE, ME_CONNECTID, check->connect_id);
DBG2(DBG_IKE, "send ME_CONNECTID %#B", &check->connect_id);
packet->destroy(packet);
}
}
+ message->destroy(message);
}
/**
check_t *check = check_create();
check->mid = message->get_message_id(message);
check->src = message->get_source(message);
+ check->src = check->src->clone(check->src);
check->dst = message->get_destination(message);
+ check->dst = check->dst->clone(check->dst);
if (process_payloads(message, check) != SUCCESS)
{
}
/**
- * Implementation of task_t.process for initiator
+ * Implementation of task_t.build for initiator
*/
static status_t build_i(private_ike_me_t *this, message_t *message)
{
}
/**
- * Implementation of task_t.process for initiator (mediation server)
+ * Implementation of task_t.build for initiator (mediation server)
*/
static status_t build_i_ms(private_ike_me_t *this, message_t *message)
{
{
case IKE_SA_INIT:
{
+ /* FIXME: we should check for SA* and TS* payloads
+ * if any are there send NO_ADDITIONAL_SAS back and delete this SA */
process_payloads(this, message);
return this->mediation ? NEED_MORE : SUCCESS;
}
case IKE_AUTH:
{
+ /* FIXME: we should check whether the current peer_config is configured
+ * as mediation connection */
process_payloads(this, message);
break;
}
+ case CREATE_CHILD_SA:
+ {
+ /* FIXME: if this is not to rekey the IKE SA we have to return a
+ * NO_ADDITIONAL_SAS and then delete the SA */
+ break;
+ }
case ME_CONNECT:
{
id_payload_t *id_payload;
endpoint = endpoint_notify_create_from_host(SERVER_REFLEXIVE, host, NULL);
message->add_payload(message, (payload_t*)endpoint->build_notify(endpoint));
+ endpoint->destroy(endpoint);
}
+ /* FIXME: we must delete any existing IKE_SAs */
charon->mediation_manager->update_sa_id(charon->mediation_manager,
this->ike_sa->get_other_id(this->ike_sa),
this->ike_sa->get_id(this->ike_sa));
this->peer_id = requester->clone(requester);
this->connect_id = chunk_clone(connect_id);
this->connect_key = chunk_clone(connect_key);
+
+ this->remote_endpoints->destroy_offset(this->remote_endpoints, offsetof(endpoint_notify_t, destroy));
this->remote_endpoints = endpoints->clone_offset(endpoints, offsetof(endpoint_notify_t, clone));
+
this->response = response;
}