X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=blobdiff_plain;f=Source%2Fcharon%2Fsa%2Fstates%2Fike_auth_requested.c;h=ed5360dfedeb0be04903b2c6d6cae7e65c84e6ea;hp=35e4c24ff8ea88ff75dfd4e1d932255f4855efc7;hb=5d187bd234913b8b1004f3e21ca236d458949831;hpb=fb8aa445d27227bf2b04c1c09e94206a007a18aa;ds=sidebyside diff --git a/Source/charon/sa/states/ike_auth_requested.c b/Source/charon/sa/states/ike_auth_requested.c index 35e4c24..ed5360d 100644 --- a/Source/charon/sa/states/ike_auth_requested.c +++ b/Source/charon/sa/states/ike_auth_requested.c @@ -317,10 +317,14 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i if (!this->proposal) { this->logger->log(this->logger, CONTROL, "Proposal negotiation failed, no CHILD_SA built"); + this->child_sa->destroy(this->child_sa); + this->child_sa = NULL; } else if (this->my_ts->get_count(this->my_ts) == 0 || this->other_ts->get_count(this->other_ts) == 0) { this->logger->log(this->logger, CONTROL, "Traffic selector negotiation failed, no CHILD_SA built"); + this->child_sa->destroy(this->child_sa); + this->child_sa = NULL; } else { @@ -337,7 +341,7 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i this->logger->log(this->logger, AUDIT, "Could not install CHILD_SA! Deleting IKE_SA"); return DELETE_ME; } - status = this->child_sa->add_policy(this->child_sa, this->my_ts, this->other_ts); + status = this->child_sa->add_policies(this->child_sa, this->my_ts, this->other_ts); if (status != SUCCESS) { this->logger->log(this->logger, AUDIT, "Could not install CHILD_SA policy! Deleting IKE_SA"); @@ -354,7 +358,6 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i my_host->get_address(my_host), other_host->get_address(other_host), mapping_find(auth_method_m, auth_payload->get_auth_method(auth_payload))); - this->ike_sa->create_delete_established_ike_sa_job(this->ike_sa,this->sa_config->get_ike_sa_lifetime(this->sa_config)); this->ike_sa->set_new_state(this->ike_sa, (state_t*)ike_sa_established_create(this->ike_sa)); this->destroy_after_state_change(this); return SUCCESS;