reintegrated bus-refactoring branch
This commit is contained in:
@@ -199,12 +199,12 @@ static status_t select_and_install(private_child_create_t *this, bool no_dh)
|
||||
|
||||
if (this->proposals == NULL)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "SA payload missing in message");
|
||||
DBG1(DBG_IKE, "SA payload missing in message");
|
||||
return FAILED;
|
||||
}
|
||||
if (this->tsi == NULL || this->tsr == NULL)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "TS payloads missing in message");
|
||||
DBG1(DBG_IKE, "TS payloads missing in message");
|
||||
return NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ static status_t select_and_install(private_child_create_t *this, bool no_dh)
|
||||
no_dh);
|
||||
if (this->proposal == NULL)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "no acceptable proposal found");
|
||||
DBG1(DBG_IKE, "no acceptable proposal found");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -243,15 +243,15 @@ static status_t select_and_install(private_child_create_t *this, bool no_dh)
|
||||
if (this->proposal->get_algorithm(this->proposal, DIFFIE_HELLMAN_GROUP,
|
||||
&group, NULL))
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "DH group %N inacceptable, "
|
||||
"requesting %N", diffie_hellman_group_names, this->dh_group,
|
||||
diffie_hellman_group_names, group);
|
||||
DBG1(DBG_IKE, "DH group %N inacceptable, requesting %N",
|
||||
diffie_hellman_group_names, this->dh_group,
|
||||
diffie_hellman_group_names, group);
|
||||
this->dh_group = group;
|
||||
return INVALID_ARG;
|
||||
}
|
||||
else
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "no acceptable proposal found");
|
||||
DBG1(DBG_IKE, "no acceptable proposal found");
|
||||
return FAILED;
|
||||
}
|
||||
}
|
||||
@@ -279,7 +279,7 @@ static status_t select_and_install(private_child_create_t *this, bool no_dh)
|
||||
{
|
||||
my_ts->destroy_offset(my_ts, offsetof(traffic_selector_t, destroy));
|
||||
other_ts->destroy_offset(other_ts, offsetof(traffic_selector_t, destroy));
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "no acceptable traffic selectors found");
|
||||
DBG1(DBG_IKE, "no acceptable traffic selectors found");
|
||||
return NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ static status_t select_and_install(private_child_create_t *this, bool no_dh)
|
||||
{
|
||||
if (this->dh->get_shared_secret(this->dh, &secret) != SUCCESS)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "DH exchange incomplete");
|
||||
DBG1(DBG_IKE, "DH exchange incomplete");
|
||||
return FAILED;
|
||||
}
|
||||
DBG3(DBG_IKE, "DH secret %B", &secret);
|
||||
@@ -352,8 +352,7 @@ static status_t select_and_install(private_child_create_t *this, bool no_dh)
|
||||
this->mode, this->proposal->get_protocol(this->proposal));
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa,
|
||||
"unable to install IPsec policies (SPD) in kernel");
|
||||
DBG1(DBG_IKE, "unable to install IPsec policies (SPD) in kernel");
|
||||
return NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -372,8 +371,7 @@ static status_t select_and_install(private_child_create_t *this, bool no_dh)
|
||||
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa,
|
||||
"unable to install IPsec SA (SAD) in kernel");
|
||||
DBG1(DBG_IKE, "unable to install IPsec SA (SAD) in kernel");
|
||||
return FAILED;
|
||||
}
|
||||
/* add to IKE_SA, and remove from task */
|
||||
@@ -592,13 +590,13 @@ static status_t build_i(private_child_create_t *this, message_t *message)
|
||||
|
||||
if (this->reqid)
|
||||
{
|
||||
SIG_CHD(UP_START, NULL, "establishing CHILD_SA %s{%d}",
|
||||
this->config->get_name(this->config), this->reqid);
|
||||
DBG1(DBG_IKE, "establishing CHILD_SA %s{%d}",
|
||||
this->config->get_name(this->config), this->reqid);
|
||||
}
|
||||
else
|
||||
{
|
||||
SIG_CHD(UP_START, NULL, "establishing CHILD_SA %s",
|
||||
this->config->get_name(this->config));
|
||||
DBG1(DBG_IKE, "establishing CHILD_SA %s",
|
||||
this->config->get_name(this->config));
|
||||
}
|
||||
|
||||
/* reuse virtual IP if we already have one */
|
||||
@@ -650,8 +648,7 @@ static status_t build_i(private_child_create_t *this, message_t *message)
|
||||
|
||||
if (this->child_sa->alloc(this->child_sa, this->proposals) != SUCCESS)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa,
|
||||
"unable to allocate SPIs from kernel");
|
||||
DBG1(DBG_IKE, "unable to allocate SPIs from kernel");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -785,16 +782,15 @@ static status_t build_r(private_child_create_t *this, message_t *message)
|
||||
|
||||
if (this->ike_sa->get_state(this->ike_sa) == IKE_REKEYING)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, NULL,
|
||||
"unable to create CHILD_SA while rekeying IKE_SA");
|
||||
DBG1(DBG_IKE, "unable to create CHILD_SA while rekeying IKE_SA");
|
||||
message->add_notify(message, TRUE, NO_ADDITIONAL_SAS, chunk_empty);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (this->config == NULL)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, NULL, "traffic selectors %#R=== %#R inacceptable",
|
||||
this->tsr, this->tsi);
|
||||
DBG1(DBG_IKE, "traffic selectors %#R=== %#R inacceptable",
|
||||
this->tsr, this->tsi);
|
||||
message->add_notify(message, FALSE, TS_UNACCEPTABLE, chunk_empty);
|
||||
handle_child_sa_failure(this, message);
|
||||
return SUCCESS;
|
||||
@@ -813,8 +809,8 @@ static status_t build_r(private_child_create_t *this, message_t *message)
|
||||
case INTERNAL_ADDRESS_FAILURE:
|
||||
case FAILED_CP_REQUIRED:
|
||||
{
|
||||
SIG_CHD(UP_FAILED, NULL, "configuration payload negotation "
|
||||
"failed, no CHILD_SA built");
|
||||
DBG1(DBG_IKE,"configuration payload negotation "
|
||||
"failed, no CHILD_SA built");
|
||||
iterator->destroy(iterator);
|
||||
handle_child_sa_failure(this, message);
|
||||
return SUCCESS;
|
||||
@@ -870,14 +866,14 @@ static status_t build_r(private_child_create_t *this, message_t *message)
|
||||
|
||||
build_payloads(this, message);
|
||||
|
||||
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA %s{%d} established "
|
||||
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||
this->child_sa->get_name(this->child_sa),
|
||||
this->child_sa->get_reqid(this->child_sa),
|
||||
ntohl(this->child_sa->get_spi(this->child_sa, TRUE)),
|
||||
ntohl(this->child_sa->get_spi(this->child_sa, FALSE)),
|
||||
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
|
||||
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
|
||||
DBG0(DBG_IKE, "CHILD_SA %s{%d} established "
|
||||
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||
this->child_sa->get_name(this->child_sa),
|
||||
this->child_sa->get_reqid(this->child_sa),
|
||||
ntohl(this->child_sa->get_spi(this->child_sa, TRUE)),
|
||||
ntohl(this->child_sa->get_spi(this->child_sa, FALSE)),
|
||||
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
|
||||
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -929,8 +925,8 @@ static status_t process_i(private_child_create_t *this, message_t *message)
|
||||
case TS_UNACCEPTABLE:
|
||||
case INVALID_SELECTORS:
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "received %N notify, "
|
||||
"no CHILD_SA built", notify_type_names, type);
|
||||
DBG1(DBG_IKE, "received %N notify, no CHILD_SA built",
|
||||
notify_type_names, type);
|
||||
iterator->destroy(iterator);
|
||||
handle_child_sa_failure(this, message);
|
||||
/* an error in CHILD_SA creation is not critical */
|
||||
@@ -963,35 +959,35 @@ static status_t process_i(private_child_create_t *this, message_t *message)
|
||||
|
||||
if (this->ipcomp == IPCOMP_NONE && this->ipcomp_received != IPCOMP_NONE)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "received an IPCOMP_SUPPORTED notify"
|
||||
" but we did not send one previously, no CHILD_SA built");
|
||||
DBG1(DBG_IKE, "received an IPCOMP_SUPPORTED notify without requesting"
|
||||
" one, no CHILD_SA built");
|
||||
handle_child_sa_failure(this, message);
|
||||
return SUCCESS;
|
||||
}
|
||||
else if (this->ipcomp != IPCOMP_NONE && this->ipcomp_received == IPCOMP_NONE)
|
||||
{
|
||||
DBG1(DBG_IKE, "peer didn't accept our proposed IPComp transforms, "
|
||||
"IPComp is disabled");
|
||||
"IPComp is disabled");
|
||||
this->ipcomp = IPCOMP_NONE;
|
||||
}
|
||||
else if (this->ipcomp != IPCOMP_NONE && this->ipcomp != this->ipcomp_received)
|
||||
{
|
||||
SIG_CHD(UP_FAILED, this->child_sa, "received an IPCOMP_SUPPORTED notify"
|
||||
" for a transform we did not propose, no CHILD_SA built");
|
||||
DBG1(DBG_IKE, "received an IPCOMP_SUPPORTED notify we didn't propose, "
|
||||
"no CHILD_SA built");
|
||||
handle_child_sa_failure(this, message);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (select_and_install(this, no_dh) == SUCCESS)
|
||||
{
|
||||
SIG_CHD(UP_SUCCESS, this->child_sa, "CHILD_SA %s{%d} established "
|
||||
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||
this->child_sa->get_name(this->child_sa),
|
||||
this->child_sa->get_reqid(this->child_sa),
|
||||
ntohl(this->child_sa->get_spi(this->child_sa, TRUE)),
|
||||
ntohl(this->child_sa->get_spi(this->child_sa, FALSE)),
|
||||
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
|
||||
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
|
||||
DBG0(DBG_IKE, "CHILD_SA %s{%d} established "
|
||||
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||
this->child_sa->get_name(this->child_sa),
|
||||
this->child_sa->get_reqid(this->child_sa),
|
||||
ntohl(this->child_sa->get_spi(this->child_sa, TRUE)),
|
||||
ntohl(this->child_sa->get_spi(this->child_sa, FALSE)),
|
||||
this->child_sa->get_traffic_selectors(this->child_sa, TRUE),
|
||||
this->child_sa->get_traffic_selectors(this->child_sa, FALSE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -222,14 +222,13 @@ static void log_children(private_child_delete_t *this)
|
||||
iterator = this->child_sas->create_iterator(this->child_sas, TRUE);
|
||||
while (iterator->iterate(iterator, (void**)&child_sa))
|
||||
{
|
||||
SIG_CHD(DOWN_START, child_sa, "closing CHILD_SA %s{%d} "
|
||||
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||
child_sa->get_name(child_sa),
|
||||
child_sa->get_reqid(child_sa),
|
||||
ntohl(child_sa->get_spi(child_sa, TRUE)),
|
||||
ntohl(child_sa->get_spi(child_sa, FALSE)),
|
||||
child_sa->get_traffic_selectors(child_sa, TRUE),
|
||||
child_sa->get_traffic_selectors(child_sa, FALSE));
|
||||
DBG0(DBG_IKE, "closing CHILD_SA %s{%d} "
|
||||
"with SPIs %.8x_i %.8x_o and TS %#R=== %#R",
|
||||
child_sa->get_name(child_sa), child_sa->get_reqid(child_sa),
|
||||
ntohl(child_sa->get_spi(child_sa, TRUE)),
|
||||
ntohl(child_sa->get_spi(child_sa, FALSE)),
|
||||
child_sa->get_traffic_selectors(child_sa, TRUE),
|
||||
child_sa->get_traffic_selectors(child_sa, FALSE));
|
||||
}
|
||||
iterator->destroy(iterator);
|
||||
}
|
||||
@@ -254,7 +253,7 @@ static status_t process_i(private_child_delete_t *this, message_t *message)
|
||||
this->child_sas = linked_list_create();
|
||||
|
||||
process_payloads(this, message);
|
||||
SIG_CHD(DOWN_SUCCESS, NULL, "CHILD_SA closed");
|
||||
DBG1(DBG_IKE, "CHILD_SA closed");
|
||||
return destroy_and_reestablish(this);
|
||||
}
|
||||
|
||||
@@ -278,7 +277,7 @@ static status_t build_r(private_child_delete_t *this, message_t *message)
|
||||
{
|
||||
build_payloads(this, message);
|
||||
}
|
||||
SIG_CHD(DOWN_SUCCESS, NULL, "CHILD_SA closed");
|
||||
DBG1(DBG_IKE, "CHILD_SA closed");
|
||||
return destroy_and_reestablish(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -201,15 +201,15 @@ static status_t build_auth(private_ike_auth_t *this, message_t *message)
|
||||
config = this->ike_sa->get_peer_cfg(this->ike_sa);
|
||||
if (!config)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "unable to authenticate, no peer config found");
|
||||
DBG1(DBG_IKE, "unable to authenticate, no peer config found");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
auth = authenticator_create_from_class(this->ike_sa, get_auth_class(config));
|
||||
if (auth == NULL)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "configured authentication class %N not supported",
|
||||
auth_class_names, get_auth_class(config));
|
||||
DBG1(DBG_IKE, "configured authentication class %N not supported",
|
||||
auth_class_names, get_auth_class(config));
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ static status_t build_auth(private_ike_auth_t *this, message_t *message)
|
||||
auth->destroy(auth);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "generating authentication data failed");
|
||||
DBG1(DBG_IKE, "generating authentication data failed");
|
||||
return FAILED;
|
||||
}
|
||||
message->add_payload(message, (payload_t*)auth_payload);
|
||||
@@ -243,7 +243,7 @@ static status_t build_id(private_ike_auth_t *this, message_t *message)
|
||||
me = config->get_my_id(config);
|
||||
if (me->contains_wildcards(me))
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "negotiation of own ID failed");
|
||||
DBG1(DBG_IKE, "negotiation of own ID failed");
|
||||
return FAILED;
|
||||
}
|
||||
this->ike_sa->set_my_id(this->ike_sa, me->clone(me));
|
||||
@@ -284,8 +284,8 @@ static status_t process_auth(private_ike_auth_t *this, message_t *message)
|
||||
auth_payload->get_auth_method(auth_payload));
|
||||
if (auth == NULL)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "authentication method %N used by '%D' not "
|
||||
"supported", auth_method_names, auth_method,
|
||||
DBG1(DBG_IKE, "authentication method %N used by '%D' not supported",
|
||||
auth_method_names, auth_method,
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
return NOT_SUPPORTED;
|
||||
}
|
||||
@@ -294,7 +294,7 @@ static status_t process_auth(private_ike_auth_t *this, message_t *message)
|
||||
auth->destroy(auth);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "authentication of '%D' with %N failed",
|
||||
DBG0(DBG_IKE, "authentication of '%D' with %N failed",
|
||||
this->ike_sa->get_other_id(this->ike_sa),
|
||||
auth_method_names, auth_method);
|
||||
return FAILED;
|
||||
@@ -315,7 +315,7 @@ static status_t process_id(private_ike_auth_t *this, message_t *message)
|
||||
|
||||
if ((this->initiator && idr == NULL) || (!this->initiator && idi == NULL))
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "ID payload missing in message");
|
||||
DBG1(DBG_IKE, "ID payload missing in message");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ static status_t process_id(private_ike_auth_t *this, message_t *message)
|
||||
req = this->ike_sa->get_other_id(this->ike_sa);
|
||||
if (!id->matches(id, req))
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "peer ID '%D' unacceptable, '%D' required", id, req);
|
||||
DBG0(DBG_IKE, "peer ID '%D' unacceptable, '%D' required", id, req);
|
||||
id->destroy(id);
|
||||
return FAILED;
|
||||
}
|
||||
@@ -402,7 +402,7 @@ static status_t build_auth_eap(private_ike_auth_t *this, message_t *message)
|
||||
if (auth->build(auth, this->my_packet->get_data(this->my_packet),
|
||||
this->other_nonce, &auth_payload) != SUCCESS)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "generating authentication data failed");
|
||||
DBG1(DBG_IKE, "generating authentication data failed");
|
||||
if (!this->initiator)
|
||||
{
|
||||
message->add_notify(message, TRUE, AUTHENTICATION_FAILED, chunk_empty);
|
||||
@@ -413,13 +413,13 @@ static status_t build_auth_eap(private_ike_auth_t *this, message_t *message)
|
||||
if (!this->initiator)
|
||||
{
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
return SUCCESS;
|
||||
}
|
||||
return NEED_MORE;
|
||||
@@ -448,7 +448,7 @@ static status_t process_auth_eap(private_ike_auth_t *this, message_t *message)
|
||||
|
||||
if (!this->peer_authenticated)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "authentication of '%D' with %N failed",
|
||||
DBG0(DBG_IKE, "authentication of '%D' with %N failed",
|
||||
this->ike_sa->get_other_id(this->ike_sa),
|
||||
auth_class_names, AUTH_CLASS_EAP);
|
||||
if (this->initiator)
|
||||
@@ -460,13 +460,13 @@ static status_t process_auth_eap(private_ike_auth_t *this, message_t *message)
|
||||
if (this->initiator)
|
||||
{
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
return SUCCESS;
|
||||
}
|
||||
return NEED_MORE;
|
||||
@@ -482,7 +482,7 @@ static status_t process_eap_i(private_ike_auth_t *this, message_t *message)
|
||||
eap = (eap_payload_t*)message->get_payload(message, EXTENSIBLE_AUTHENTICATION);
|
||||
if (eap == NULL)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "EAP payload missing");
|
||||
DBG1(DBG_IKE, "EAP payload missing");
|
||||
return FAILED;
|
||||
}
|
||||
switch (this->eap_auth->process(this->eap_auth, eap, &eap))
|
||||
@@ -498,7 +498,7 @@ static status_t process_eap_i(private_ike_auth_t *this, message_t *message)
|
||||
return NEED_MORE;
|
||||
default:
|
||||
this->eap_payload = NULL;
|
||||
SIG_IKE(UP_FAILED, "failed to authenticate against '%D' using EAP",
|
||||
DBG0(DBG_IKE, "failed to authenticate against '%D' using EAP",
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
return FAILED;
|
||||
}
|
||||
@@ -533,7 +533,7 @@ static status_t build_eap_r(private_ike_auth_t *this, message_t *message)
|
||||
|
||||
if (this->eap_payload == NULL)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "EAP payload missing");
|
||||
DBG1(DBG_IKE, "EAP payload missing");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -548,9 +548,9 @@ static status_t build_eap_r(private_ike_auth_t *this, message_t *message)
|
||||
this->public.task.process = (status_t(*)(task_t*,message_t*))process_auth_eap;
|
||||
break;
|
||||
default:
|
||||
SIG_IKE(UP_FAILED, "authentication of '%D' with %N failed",
|
||||
this->ike_sa->get_other_id(this->ike_sa),
|
||||
auth_class_names, AUTH_CLASS_EAP);
|
||||
DBG0(DBG_IKE, "authentication of '%D' with %N failed",
|
||||
this->ike_sa->get_other_id(this->ike_sa),
|
||||
auth_class_names, AUTH_CLASS_EAP);
|
||||
status = FAILED;
|
||||
break;
|
||||
}
|
||||
@@ -665,9 +665,9 @@ static status_t build_r(private_ike_auth_t *this, message_t *message)
|
||||
config = this->ike_sa->get_peer_cfg(this->ike_sa);
|
||||
if (config == NULL)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "no matching config found for '%D'...'%D'",
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
DBG1(DBG_IKE, "no matching config found for '%D'...'%D'",
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
message->add_notify(message, TRUE, AUTHENTICATION_FAILED, chunk_empty);
|
||||
return FAILED;
|
||||
}
|
||||
@@ -689,13 +689,13 @@ static status_t build_r(private_ike_auth_t *this, message_t *message)
|
||||
if (this->peer_authenticated)
|
||||
{
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ static status_t build_r(private_ike_auth_t *this, message_t *message)
|
||||
message->add_payload(message, (payload_t*)eap_payload);
|
||||
if (status != NEED_MORE)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "unable to initiate EAP authentication");
|
||||
DBG1(DBG_IKE, "unable to initiate EAP authentication");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -766,7 +766,7 @@ static status_t process_i(private_ike_auth_t *this, message_t *message)
|
||||
{
|
||||
if (type < 16383)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "received %N notify error",
|
||||
DBG1(DBG_IKE, "received %N notify error",
|
||||
notify_type_names, type);
|
||||
iterator->destroy(iterator);
|
||||
return FAILED;
|
||||
@@ -798,18 +798,18 @@ static status_t process_i(private_ike_auth_t *this, message_t *message)
|
||||
auth = this->ike_sa->get_other_auth(this->ike_sa);
|
||||
if (!auth->complies(auth, config->get_auth(config)))
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "authorization of '%D' for config %s failed",
|
||||
DBG0(DBG_IKE, "authorization of '%D' for config %s failed",
|
||||
this->ike_sa->get_other_id(this->ike_sa), config->get_name(config));
|
||||
return FAILED;
|
||||
}
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_ESTABLISHED);
|
||||
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,21 +56,21 @@ static status_t build_i(private_ike_delete_t *this, message_t *message)
|
||||
{
|
||||
delete_payload_t *delete_payload;
|
||||
|
||||
SIG_IKE(DOWN_START, "deleting IKE_SA %s[%d] between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "deleting IKE_SA %s[%d] between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
|
||||
delete_payload = delete_payload_create(PROTO_IKE);
|
||||
message->add_payload(message, (payload_t*)delete_payload);
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_DELETING);
|
||||
|
||||
DBG1(DBG_IKE, "sending DELETE for IKE_SA %s[%d]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa));
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa));
|
||||
|
||||
return NEED_MORE;
|
||||
}
|
||||
@@ -92,15 +92,15 @@ static status_t process_r(private_ike_delete_t *this, message_t *message)
|
||||
/* we don't even scan the payloads, as the message wouldn't have
|
||||
* come so far without being correct */
|
||||
DBG1(DBG_IKE, "received DELETE for IKE_SA %s[%d]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa));
|
||||
SIG_IKE(DOWN_START, "deleting IKE_SA %s[%d] between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa));
|
||||
DBG1(DBG_IKE, "deleting IKE_SA %s[%d] between %H[%D]...%H[%D]",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
|
||||
switch (this->ike_sa->get_state(this->ike_sa))
|
||||
{
|
||||
@@ -123,7 +123,7 @@ static status_t process_r(private_ike_delete_t *this, message_t *message)
|
||||
*/
|
||||
static status_t build_r(private_ike_delete_t *this, message_t *message)
|
||||
{
|
||||
SIG_IKE(DOWN_SUCCESS, "IKE_SA deleted");
|
||||
DBG1(DBG_IKE, "IKE_SA deleted");
|
||||
|
||||
if (this->simultaneous)
|
||||
{
|
||||
|
||||
@@ -230,15 +230,15 @@ static status_t build_i(private_ike_init_t *this, message_t *message)
|
||||
rng_t *rng;
|
||||
|
||||
this->config = this->ike_sa->get_ike_cfg(this->ike_sa);
|
||||
SIG_IKE(UP_START, "initiating IKE_SA %s[%d] to %H",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa));
|
||||
DBG1(DBG_IKE, "initiating IKE_SA %s[%d] to %H",
|
||||
this->ike_sa->get_name(this->ike_sa),
|
||||
this->ike_sa->get_unique_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa));
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_CONNECTING);
|
||||
|
||||
if (this->retry++ >= MAX_RETRIES)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "giving up after %d retries", MAX_RETRIES);
|
||||
DBG1(DBG_IKE, "giving up after %d retries", MAX_RETRIES);
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ static status_t build_i(private_ike_init_t *this, message_t *message)
|
||||
this->dh = lib->crypto->create_dh(lib->crypto, this->dh_group);
|
||||
if (this->dh == NULL)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "configured DH group %N not supported",
|
||||
DBG1(DBG_IKE, "configured DH group %N not supported",
|
||||
diffie_hellman_group_names, this->dh_group);
|
||||
return FAILED;
|
||||
}
|
||||
@@ -261,7 +261,7 @@ static status_t build_i(private_ike_init_t *this, message_t *message)
|
||||
rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK);
|
||||
if (!rng)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "error generating nonce");
|
||||
DBG1(DBG_IKE, "error generating nonce");
|
||||
return FAILED;
|
||||
}
|
||||
rng->allocate_bytes(rng, NONCE_SIZE, &this->my_nonce);
|
||||
@@ -296,8 +296,7 @@ static status_t process_r(private_ike_init_t *this, message_t *message)
|
||||
rng_t *rng;
|
||||
|
||||
this->config = this->ike_sa->get_ike_cfg(this->ike_sa);
|
||||
SIG_IKE(UP_START, "%H is initiating an IKE_SA",
|
||||
message->get_source(message));
|
||||
DBG1(DBG_IKE, "%H is initiating an IKE_SA", message->get_source(message));
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_CONNECTING);
|
||||
|
||||
rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK);
|
||||
@@ -376,7 +375,7 @@ static status_t build_r(private_ike_init_t *this, message_t *message)
|
||||
if (this->proposal == NULL ||
|
||||
this->other_nonce.len == 0 || this->my_nonce.len == 0)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "received proposals inacceptable");
|
||||
DBG1(DBG_IKE, "received proposals inacceptable");
|
||||
message->add_notify(message, TRUE, NO_PROPOSAL_CHOSEN, chunk_empty);
|
||||
return FAILED;
|
||||
}
|
||||
@@ -390,9 +389,9 @@ static status_t build_r(private_ike_init_t *this, message_t *message)
|
||||
if (this->proposal->get_algorithm(this->proposal, DIFFIE_HELLMAN_GROUP,
|
||||
&group, NULL))
|
||||
{
|
||||
SIG_CHD(UP_FAILED, NULL, "DH group %N inacceptable, requesting %N",
|
||||
diffie_hellman_group_names, this->dh_group,
|
||||
diffie_hellman_group_names, group);
|
||||
DBG1(DBG_IKE, "DH group %N inacceptable, requesting %N",
|
||||
diffie_hellman_group_names, this->dh_group,
|
||||
diffie_hellman_group_names, group);
|
||||
this->dh_group = group;
|
||||
group = htons(group);
|
||||
message->add_notify(message, FALSE, INVALID_KE_PAYLOAD,
|
||||
@@ -400,7 +399,7 @@ static status_t build_r(private_ike_init_t *this, message_t *message)
|
||||
}
|
||||
else
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "no acceptable proposal found");
|
||||
DBG1(DBG_IKE, "no acceptable proposal found");
|
||||
}
|
||||
return FAILED;
|
||||
}
|
||||
@@ -430,7 +429,7 @@ static status_t build_r(private_ike_init_t *this, message_t *message)
|
||||
}
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "key derivation failed");
|
||||
DBG1(DBG_IKE, "key derivation failed");
|
||||
message->add_notify(message, TRUE, NO_PROPOSAL_CHOSEN, chunk_empty);
|
||||
return FAILED;
|
||||
}
|
||||
@@ -505,7 +504,7 @@ static status_t process_i(private_ike_init_t *this, message_t *message)
|
||||
{
|
||||
if (type < 16383)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "received %N notify error",
|
||||
DBG1(DBG_IKE, "received %N notify error",
|
||||
notify_type_names, type);
|
||||
iterator->destroy(iterator);
|
||||
return FAILED;
|
||||
@@ -525,7 +524,7 @@ static status_t process_i(private_ike_init_t *this, message_t *message)
|
||||
if (this->proposal == NULL ||
|
||||
this->other_nonce.len == 0 || this->my_nonce.len == 0)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "peer's proposal selection invalid");
|
||||
DBG1(DBG_IKE, "peers proposal selection invalid");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -533,7 +532,7 @@ static status_t process_i(private_ike_init_t *this, message_t *message)
|
||||
!this->proposal->has_dh_group(this->proposal, this->dh_group) ||
|
||||
this->dh->get_shared_secret(this->dh, &secret) != SUCCESS)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "peer's DH group selection invalid");
|
||||
DBG1(DBG_IKE, "peer DH group selection invalid");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
@@ -562,7 +561,7 @@ static status_t process_i(private_ike_init_t *this, message_t *message)
|
||||
}
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
SIG_IKE(UP_FAILED, "key derivation failed");
|
||||
DBG1(DBG_IKE, "key derivation failed");
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
|
||||
@@ -461,8 +461,7 @@ static status_t process_i(private_ike_me_t *this, message_t *message)
|
||||
this->ike_sa->set_server_reflexive_host(this->ike_sa, endpoint->clone(endpoint));
|
||||
}
|
||||
/* FIXME: what if it failed? e.g. AUTH failure */
|
||||
SIG_CHD(UP_SUCCESS, NULL, "established mediation connection "
|
||||
"without CHILD_SA successfully");
|
||||
DBG1(DBG_IKE, "established mediation connection successfully");
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -642,8 +641,7 @@ static status_t build_r_ms(private_ike_me_t *this, message_t *message)
|
||||
/* FIXME: we actually must delete any existing IKE_SAs with the same remote id */
|
||||
this->ike_sa->act_as_mediation_server(this->ike_sa);
|
||||
|
||||
SIG_CHD(UP_SUCCESS, NULL, "established mediation connection "
|
||||
"without CHILD_SA successfully");
|
||||
DBG1(DBG_IKE, "established mediation connection successfully");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ static status_t process_i(private_ike_reauth_t *this, message_t *message)
|
||||
|
||||
/* process delete response first */
|
||||
this->ike_delete->task.process(&this->ike_delete->task, message);
|
||||
SIG_IKE(DOWN_SUCCESS, "IKE_SA deleted");
|
||||
|
||||
peer_cfg = this->ike_sa->get_peer_cfg(this->ike_sa);
|
||||
|
||||
|
||||
@@ -152,13 +152,13 @@ static status_t build_r(private_ike_rekey_t *this, message_t *message)
|
||||
|
||||
this->ike_sa->set_state(this->ike_sa, IKE_REKEYING);
|
||||
this->new_sa->set_state(this->new_sa, IKE_ESTABLISHED);
|
||||
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->new_sa->get_name(this->new_sa),
|
||||
this->new_sa->get_unique_id(this->new_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->new_sa->get_name(this->new_sa),
|
||||
this->new_sa->get_unique_id(this->new_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -198,13 +198,13 @@ static status_t process_i(private_ike_rekey_t *this, message_t *message)
|
||||
}
|
||||
|
||||
this->new_sa->set_state(this->new_sa, IKE_ESTABLISHED);
|
||||
SIG_IKE(UP_SUCCESS, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->new_sa->get_name(this->new_sa),
|
||||
this->new_sa->get_unique_id(this->new_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
DBG0(DBG_IKE, "IKE_SA %s[%d] established between %H[%D]...%H[%D]",
|
||||
this->new_sa->get_name(this->new_sa),
|
||||
this->new_sa->get_unique_id(this->new_sa),
|
||||
this->ike_sa->get_my_host(this->ike_sa),
|
||||
this->ike_sa->get_my_id(this->ike_sa),
|
||||
this->ike_sa->get_other_host(this->ike_sa),
|
||||
this->ike_sa->get_other_id(this->ike_sa));
|
||||
|
||||
to_delete = this->ike_sa->get_id(this->ike_sa);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user