- fixed bug

This commit is contained in:
Jan Hutter
2005-12-12 14:29:54 +00:00
parent e9c0ca15e1
commit c00f1ece00
3 changed files with 37 additions and 6 deletions
+2 -1
View File
@@ -161,7 +161,8 @@ static void build_test_jobs(private_daemon_t *this)
char *config_name;
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-bad_dh_group"; */
+22 -3
View File
@@ -381,6 +381,9 @@ static void send_delete_ike_sa_request (private_ike_sa_t *this)
{
message_t *informational_request;
delete_payload_t *delete_payload;
crypter_t *crypter;
signer_t *signer;
packet_t *packet;
status_t status;
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);
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)
{
this->logger->log(this->logger, AUDIT, "Unable to send INFORMATIONAL DELETE request");
informational_request->destroy(informational_request);
this->logger->log(this->logger, ERROR, "Could not generate packet from message");
return ;
}
charon->send_queue->add(charon->send_queue,packet);
}
/**
+13 -2
View File
@@ -76,6 +76,7 @@ struct private_ike_sa_established_t {
static status_t process_message(private_ike_sa_established_t *this, message_t *message)
{
delete_payload_t *delete_request = NULL;
ike_sa_id_t *ike_sa_id;
iterator_t *payloads;
message_t *response;
crypter_t *crypter;
@@ -95,9 +96,19 @@ static status_t process_message(private_ike_sa_established_t *this, message_t *m
return FAILED;
}
ike_sa_id = this->ike_sa->public.get_id(&(this->ike_sa->public));
/* get signer for verification and crypter for decryption */
signer = this->ike_sa->get_signer_responder(this->ike_sa);
crypter = this->ike_sa->get_crypter_responder(this->ike_sa);
if (!ike_sa_id->is_initiator(ike_sa_id))
{
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 */
status = message->parse_body(message, crypter, signer);