- fixed some BAD bugs
- clean localhost-testcases for bad_dh, shared and rsa
This commit is contained in:
@@ -278,14 +278,16 @@ static status_t process_message(private_ike_auth_requested_t *this, message_t *i
|
||||
|
||||
this->ike_sa->set_last_replied_message_id(this->ike_sa,ike_auth_reply->get_message_id(ike_auth_reply));
|
||||
/* create new state */
|
||||
this->ike_sa->set_new_state(this->ike_sa, (state_t*)ike_sa_established_create(this->ike_sa));
|
||||
this->ike_sa->create_delete_established_ike_sa_job(this->ike_sa,this->sa_config->get_ike_sa_lifetime(this->sa_config));
|
||||
this->public.state_interface.destroy(&(this->public.state_interface));
|
||||
|
||||
|
||||
my_host = this->ike_sa->get_my_host(this->ike_sa);
|
||||
other_host = this->ike_sa->get_other_host(this->ike_sa);
|
||||
this->logger->log(this->logger, AUDIT, "IKE_SA established between %s - %s",
|
||||
my_host->get_address(my_host), other_host->get_address(other_host));
|
||||
this->logger->log(this->logger, AUDIT, "IKE_SA established between %s - %s, authenticated peer with %s",
|
||||
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->public.state_interface.destroy(&(this->public.state_interface));
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -336,7 +338,7 @@ static status_t process_sa_payload(private_ike_auth_requested_t *this, sa_payloa
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
/* there are no proposals. This is possible if the requester doesn't want to setup a child sa */
|
||||
this->logger->log(this->logger, CONTROL, "Responders SA_PAYLOAD contained no proposals, no CHILD_SA is built");
|
||||
this->logger->log(this->logger, AUDIT, "IKE_AUH reply did not contain any proposals. Don't create CHILD_SA");
|
||||
return SUCCESS;
|
||||
}
|
||||
if (proposal_count > 1)
|
||||
|
||||
@@ -651,7 +651,12 @@ static status_t process_notify_payload(private_ike_sa_init_requested_t *this, no
|
||||
new_dh_group_priority = this->dh_group_priority + 1;
|
||||
|
||||
this->public.state_interface.destroy(&(this->public.state_interface));
|
||||
return (initiator_init_state->retry_initiate_connection (initiator_init_state,new_dh_group_priority));
|
||||
if (initiator_init_state->retry_initiate_connection (initiator_init_state,new_dh_group_priority) != SUCCESS)
|
||||
{
|
||||
return DELETE_ME;
|
||||
}
|
||||
return FAILED;
|
||||
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
||||
@@ -313,15 +313,15 @@ static status_t process_message(private_ike_sa_init_responded_t *this, message_t
|
||||
return DELETE_ME;
|
||||
}
|
||||
|
||||
/* create new state */
|
||||
this->ike_sa->set_new_state(this->ike_sa, (state_t*)ike_sa_established_create(this->ike_sa));
|
||||
this->ike_sa->create_delete_established_ike_sa_job(this->ike_sa,this->sa_config->get_ike_sa_lifetime(this->sa_config));
|
||||
this->public.state_interface.destroy(&(this->public.state_interface));
|
||||
|
||||
my_host = this->ike_sa->get_my_host(this->ike_sa);
|
||||
/* create new state */my_host = this->ike_sa->get_my_host(this->ike_sa);
|
||||
other_host = this->ike_sa->get_other_host(this->ike_sa);
|
||||
this->logger->log(this->logger, AUDIT, "IKE_SA established between %s - %s",
|
||||
my_host->get_address(my_host), other_host->get_address(other_host));
|
||||
this->logger->log(this->logger, AUDIT, "IKE_SA established between %s - %s, authenticated peer with %s",
|
||||
my_host->get_address(my_host), other_host->get_address(other_host),
|
||||
mapping_find(auth_method_m, auth_request->get_auth_method(auth_request)));
|
||||
|
||||
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->public.state_interface.destroy(&(this->public.state_interface));
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -404,6 +404,7 @@ static status_t build_sa_payload(private_ike_sa_init_responded_t *this, sa_paylo
|
||||
{
|
||||
sa_response = sa_payload_create_from_child_proposals(proposal_chosen, 1);
|
||||
response->add_payload(response, (payload_t*)sa_response);
|
||||
allocator_free(proposal_chosen);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -411,22 +412,17 @@ static status_t build_sa_payload(private_ike_sa_init_responded_t *this, sa_paylo
|
||||
this->ike_sa->send_notify(this->ike_sa, IKE_AUTH, NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER);
|
||||
status = DELETE_ME;
|
||||
}
|
||||
allocator_free(proposals);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->logger->log(this->logger, AUDIT, "IKE_AUH request did not contain any proposals. Don't create CHILD_SA.");
|
||||
/* this->ike_sa->send_notify(this->ike_sa, IKE_AUTH, NO_PROPOSAL_CHOSEN, CHUNK_INITIALIZER);
|
||||
status = DELETE_ME; */
|
||||
this->logger->log(this->logger, AUDIT, "IKE_AUH request did not contain any proposals. Don't create CHILD_SA");
|
||||
sa_response = sa_payload_create();
|
||||
response->add_payload(response, (payload_t*)sa_response);
|
||||
|
||||
status = SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
allocator_free(proposal_chosen);
|
||||
allocator_free(proposals);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -557,6 +557,7 @@ responder_init_t *responder_init_create(protected_ike_sa_t *ike_sa)
|
||||
this->sent_nonce = CHUNK_INITIALIZER;
|
||||
this->received_nonce = CHUNK_INITIALIZER;
|
||||
this->dh_group_number = MODP_UNDEFINED;
|
||||
this->diffie_hellman = NULL;
|
||||
|
||||
return &(this->public);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user