- fixed bug
This commit is contained in:
@@ -161,7 +161,8 @@ static void build_test_jobs(private_daemon_t *this)
|
|||||||
char *config_name;
|
char *config_name;
|
||||||
initiate_ike_sa_job_t *initiate_job;
|
initiate_ike_sa_job_t *initiate_job;
|
||||||
|
|
||||||
config_name = "localhost-rsa";
|
config_name = "pinflb30";
|
||||||
|
// config_name = "localhost-rsa";
|
||||||
/* config_name = "localhost-shared"; */
|
/* config_name = "localhost-shared"; */
|
||||||
/* config_name = "localhost-bad_dh_group"; */
|
/* config_name = "localhost-bad_dh_group"; */
|
||||||
|
|
||||||
|
|||||||
@@ -381,6 +381,9 @@ static void send_delete_ike_sa_request (private_ike_sa_t *this)
|
|||||||
{
|
{
|
||||||
message_t *informational_request;
|
message_t *informational_request;
|
||||||
delete_payload_t *delete_payload;
|
delete_payload_t *delete_payload;
|
||||||
|
crypter_t *crypter;
|
||||||
|
signer_t *signer;
|
||||||
|
packet_t *packet;
|
||||||
status_t status;
|
status_t status;
|
||||||
|
|
||||||
if (this->current_state->get_state(this->current_state) != IKE_SA_ESTABLISHED)
|
if (this->current_state->get_state(this->current_state) != IKE_SA_ESTABLISHED)
|
||||||
@@ -396,12 +399,28 @@ static void send_delete_ike_sa_request (private_ike_sa_t *this)
|
|||||||
|
|
||||||
informational_request->add_payload(informational_request,(payload_t *)delete_payload);
|
informational_request->add_payload(informational_request,(payload_t *)delete_payload);
|
||||||
|
|
||||||
status = this->protected.send_request(&(this->protected), informational_request);
|
if (this->ike_sa_id->is_initiator(this->ike_sa_id))
|
||||||
|
{
|
||||||
|
crypter = this->crypter_initiator;
|
||||||
|
signer = this->signer_initiator;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
crypter = this->crypter_responder;
|
||||||
|
signer = this->signer_responder;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = informational_request->generate(informational_request,
|
||||||
|
crypter,
|
||||||
|
signer, &packet);
|
||||||
|
informational_request->destroy(informational_request);
|
||||||
if (status != SUCCESS)
|
if (status != SUCCESS)
|
||||||
{
|
{
|
||||||
this->logger->log(this->logger, AUDIT, "Unable to send INFORMATIONAL DELETE request");
|
this->logger->log(this->logger, ERROR, "Could not generate packet from message");
|
||||||
informational_request->destroy(informational_request);
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
charon->send_queue->add(charon->send_queue,packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ struct private_ike_sa_established_t {
|
|||||||
static status_t process_message(private_ike_sa_established_t *this, message_t *message)
|
static status_t process_message(private_ike_sa_established_t *this, message_t *message)
|
||||||
{
|
{
|
||||||
delete_payload_t *delete_request = NULL;
|
delete_payload_t *delete_request = NULL;
|
||||||
|
ike_sa_id_t *ike_sa_id;
|
||||||
iterator_t *payloads;
|
iterator_t *payloads;
|
||||||
message_t *response;
|
message_t *response;
|
||||||
crypter_t *crypter;
|
crypter_t *crypter;
|
||||||
@@ -95,9 +96,19 @@ static status_t process_message(private_ike_sa_established_t *this, message_t *m
|
|||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ike_sa_id = this->ike_sa->public.get_id(&(this->ike_sa->public));
|
||||||
|
|
||||||
/* get signer for verification and crypter for decryption */
|
/* get signer for verification and crypter for decryption */
|
||||||
signer = this->ike_sa->get_signer_responder(this->ike_sa);
|
if (!ike_sa_id->is_initiator(ike_sa_id))
|
||||||
crypter = this->ike_sa->get_crypter_responder(this->ike_sa);
|
{
|
||||||
|
crypter = this->ike_sa->get_crypter_initiator(this->ike_sa);
|
||||||
|
signer = this->ike_sa->get_signer_initiator(this->ike_sa);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
crypter = this->ike_sa->get_crypter_responder(this->ike_sa);
|
||||||
|
signer = this->ike_sa->get_signer_responder(this->ike_sa);
|
||||||
|
}
|
||||||
|
|
||||||
/* parse incoming message */
|
/* parse incoming message */
|
||||||
status = message->parse_body(message, crypter, signer);
|
status = message->parse_body(message, crypter, signer);
|
||||||
|
|||||||
Reference in New Issue
Block a user