- configuration_manager replaced by configuration_t interface
- current configuration_manager is now static_configuration (testing) - first draft of starter_configuration, which should once interact with ipsec starter (via whack?) - some cleanups - socket_t uses RAW socket, which allows parallel service of pluto/charon
This commit is contained in:
@@ -67,7 +67,7 @@ struct private_authenticator_t {
|
||||
|
||||
/**
|
||||
* @brief Creates the octets which are signed (RSA) or MACed (shared secret) as described in section
|
||||
* 2.15 of draft.
|
||||
* 2.15 of RFC.
|
||||
*
|
||||
* @param this calling object
|
||||
* @param last_message the last message to include in created octets
|
||||
@@ -211,7 +211,7 @@ static status_t verify_auth_data (private_authenticator_t *this,
|
||||
chunk_t preshared_secret;
|
||||
status_t status;
|
||||
|
||||
status = charon->configuration_manager->get_shared_secret(charon->configuration_manager,
|
||||
status = charon->configuration->get_shared_secret(charon->configuration,
|
||||
other_id,
|
||||
&preshared_secret);
|
||||
other_id->destroy(other_id);
|
||||
@@ -252,7 +252,7 @@ static status_t verify_auth_data (private_authenticator_t *this,
|
||||
|
||||
auth_data = auth_payload->get_data(auth_payload);
|
||||
|
||||
status = charon->configuration_manager->get_rsa_public_key(charon->configuration_manager,
|
||||
status = charon->configuration->get_rsa_public_key(charon->configuration,
|
||||
other_id,
|
||||
&public_key);
|
||||
other_id->destroy(other_id);
|
||||
@@ -295,7 +295,7 @@ static status_t compute_auth_data (private_authenticator_t *this,
|
||||
chunk_t preshared_secret;
|
||||
status_t status;
|
||||
|
||||
status = charon->configuration_manager->get_shared_secret(charon->configuration_manager,
|
||||
status = charon->configuration->get_shared_secret(charon->configuration,
|
||||
my_id,
|
||||
&preshared_secret);
|
||||
|
||||
@@ -326,7 +326,7 @@ static status_t compute_auth_data (private_authenticator_t *this,
|
||||
status_t status;
|
||||
chunk_t octets, auth_data;
|
||||
|
||||
status = charon->configuration_manager->get_rsa_private_key(charon->configuration_manager,
|
||||
status = charon->configuration->get_rsa_private_key(charon->configuration,
|
||||
my_id,
|
||||
&private_key);
|
||||
my_id->destroy(my_id);
|
||||
|
||||
@@ -40,7 +40,7 @@ typedef struct authenticator_t authenticator_t;
|
||||
* - RSA_DIGITAL_SIGNATURE
|
||||
*
|
||||
* This class retrieves needed data for specific AUTH methods (RSA keys, shared secrets, etc.)
|
||||
* over an internal stored protected_ike_sa_t object or directly from the configuration_manager_t over
|
||||
* over an internal stored protected_ike_sa_t object or directly from the configuration_t over
|
||||
* the daemon_t object "charon".
|
||||
*
|
||||
* @b Constructors:
|
||||
|
||||
@@ -484,6 +484,10 @@ static void set_sa_config (private_ike_sa_t *this,sa_config_t * sa_config)
|
||||
*/
|
||||
static void set_my_host (private_ike_sa_t *this, host_t *my_host)
|
||||
{
|
||||
if (this->me.host)
|
||||
{
|
||||
this->me.host->destroy(this->me.host);
|
||||
}
|
||||
this->me.host = my_host;
|
||||
}
|
||||
|
||||
@@ -492,6 +496,10 @@ static void set_my_host (private_ike_sa_t *this, host_t *my_host)
|
||||
*/
|
||||
static void set_other_host (private_ike_sa_t *this, host_t *other_host)
|
||||
{
|
||||
if (this->other.host)
|
||||
{
|
||||
this->other.host->destroy(this->other.host);
|
||||
}
|
||||
this->other.host = other_host;
|
||||
}
|
||||
|
||||
@@ -814,7 +822,7 @@ static status_t send_request (private_ike_sa_t *this,message_t * message)
|
||||
|
||||
retransmit_job = retransmit_request_job_create(this->message_id_out,this->ike_sa_id);
|
||||
|
||||
status = charon->configuration_manager->get_retransmit_timeout (charon->configuration_manager,
|
||||
status = charon->configuration->get_retransmit_timeout (charon->configuration,
|
||||
retransmit_job->get_retransmit_count(retransmit_job),&timeout);
|
||||
|
||||
if (status != SUCCESS)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <sa/ike_sa_id.h>
|
||||
#include <sa/child_sa.h>
|
||||
#include <sa/states/state.h>
|
||||
#include <config/configuration_manager.h>
|
||||
#include <config/configuration.h>
|
||||
#include <utils/logger.h>
|
||||
#include <utils/randomizer.h>
|
||||
#include <transforms/prfs/prf.h>
|
||||
|
||||
@@ -213,6 +213,7 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
|
||||
u_int64_t responder_spi;
|
||||
ike_sa_id_t *ike_sa_id;
|
||||
iterator_t *payloads;
|
||||
host_t *me;
|
||||
|
||||
message_t *request;
|
||||
status_t status;
|
||||
@@ -338,6 +339,10 @@ static status_t process_message(private_ike_sa_init_requested_t *this, message_t
|
||||
return DELETE_ME;
|
||||
}
|
||||
|
||||
/* apply the address on wich we really received the packet */
|
||||
me = ike_sa_init_reply->get_destination(ike_sa_init_reply);
|
||||
this->ike_sa->set_my_host(this->ike_sa, me->clone(me));
|
||||
|
||||
/* build empty message */
|
||||
this->ike_sa->build_message(this->ike_sa, IKE_AUTH, TRUE, &request);
|
||||
|
||||
|
||||
@@ -391,7 +391,7 @@ static status_t build_idr_payload(private_ike_sa_init_responded_t *this, id_payl
|
||||
|
||||
/* build new sa config */
|
||||
init_config = this->ike_sa->get_init_config(this->ike_sa);
|
||||
status = charon->configuration_manager->get_sa_config_for_init_config_and_id(charon->configuration_manager,init_config, other_id,my_id, &(this->sa_config));
|
||||
status = charon->configuration->get_sa_config_for_init_config_and_id(charon->configuration,init_config, other_id,my_id, &(this->sa_config));
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
if (my_id)
|
||||
|
||||
@@ -118,14 +118,14 @@ static status_t initiate_connection (private_initiator_init_t *this, char *name)
|
||||
this->logger->log(this->logger, CONTROL, "Initializing connection %s",name);
|
||||
|
||||
/* get configs */
|
||||
status = charon->configuration_manager->get_init_config_for_name(charon->configuration_manager,name,&init_config);
|
||||
status = charon->configuration->get_init_config_for_name(charon->configuration,name,&init_config);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
this->logger->log(this->logger, ERROR | LEVEL1, "Could not retrieve INIT configuration informations for %s",name);
|
||||
return DELETE_ME;
|
||||
}
|
||||
this->ike_sa->set_init_config(this->ike_sa,init_config);
|
||||
status = charon->configuration_manager->get_sa_config_for_name(charon->configuration_manager,name,&sa_config);
|
||||
status = charon->configuration->get_sa_config_for_name(charon->configuration,name,&sa_config);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
this->logger->log(this->logger, ERROR | LEVEL1, "Could not retrieve SA configuration informations for %s",name);
|
||||
|
||||
@@ -177,7 +177,7 @@ static status_t process_message(private_responder_init_t *this, message_t *messa
|
||||
source = message->get_source(message);
|
||||
destination = message->get_destination(message);
|
||||
|
||||
status = charon->configuration_manager->get_init_config_for_host(charon->configuration_manager,destination,source,&init_config);
|
||||
status = charon->configuration->get_init_config_for_host(charon->configuration,destination,source,&init_config);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
/* no configuration matches given host */
|
||||
|
||||
Reference in New Issue
Block a user