- added separate implementation for connection_store, credential_store, policy_store

- added folder structure to config
- credentials are fetched solely on IDs now
This commit is contained in:
Martin Willi
2006-04-25 10:06:30 +00:00
parent a8c09d8cc0
commit 13e4a62f5c
36 changed files with 1240 additions and 641 deletions
+7 -8
View File
@@ -250,15 +250,14 @@ static status_t verify_auth_data (private_authenticator_t *this,
auth_data = auth_payload->get_data(auth_payload);
status = charon->credentials->get_rsa_public_key(charon->credentials,
other_id,
&public_key);
if (status != SUCCESS)
public_key = charon->credentials->get_rsa_public_key(charon->credentials,
other_id);
if (public_key == NULL)
{
this->logger->log(this->logger, ERROR|LEVEL1, "No RSA public key found for %s",
other_id->get_string(other_id));
other_id->destroy(other_id);
return status;
return NOT_FOUND;
}
octets = this->allocate_octets(this,last_received_packet, my_nonce,other_id_payload, initiator);
@@ -338,13 +337,13 @@ static status_t compute_auth_data (private_authenticator_t *this,
status_t status;
chunk_t octets, auth_data;
status = charon->credentials->get_rsa_private_key(charon->credentials, my_id, &private_key);
if (status != SUCCESS)
private_key = charon->credentials->get_rsa_private_key(charon->credentials, my_id);
if (private_key == NULL)
{
this->logger->log(this->logger, ERROR|LEVEL1, "No RSA private key found for %s",
my_id->get_string(my_id));
my_id->destroy(my_id);
return status;
return NOT_FOUND;
}
my_id->destroy(my_id);
+18
View File
@@ -373,6 +373,22 @@ static host_t* get_other_host(private_ike_sa_t *this)
return this->connection->get_other_host(this->connection);;
}
/**
* Implementation of ike_sa_t.get_my_id.
*/
static identification_t* get_my_id(private_ike_sa_t *this)
{
return this->connection->get_my_id(this->connection);;
}
/**
* Implementation of ike_sa_t.get_other_id.
*/
static identification_t* get_other_id(private_ike_sa_t *this)
{
return this->connection->get_other_id(this->connection);;
}
/**
* Implementation of private_ike_sa_t.resend_last_reply.
*/
@@ -1054,6 +1070,8 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id)
this->protected.public.get_id = (ike_sa_id_t*(*)(ike_sa_t*)) get_id;
this->protected.public.get_my_host = (host_t*(*)(ike_sa_t*)) get_my_host;
this->protected.public.get_other_host = (host_t*(*)(ike_sa_t*)) get_other_host;
this->protected.public.get_my_id = (identification_t*(*)(ike_sa_t*)) get_my_id;
this->protected.public.get_other_id = (identification_t*(*)(ike_sa_t*)) get_other_id;
this->protected.public.retransmit_request = (status_t (*) (ike_sa_t *, u_int32_t)) retransmit_request;
this->protected.public.get_state = (ike_sa_state_t (*) (ike_sa_t *this)) get_state;
this->protected.public.send_delete_ike_sa_request = (void (*)(ike_sa_t*)) send_delete_ike_sa_request;
+18 -2
View File
@@ -35,8 +35,8 @@
#include <crypto/prfs/prf.h>
#include <crypto/crypters/crypter.h>
#include <crypto/signers/signer.h>
#include <config/connection.h>
#include <config/policy.h>
#include <config/connections/connection.h>
#include <config/policies/policy.h>
/**
* Nonce size in bytes for nonces sending to other peer.
@@ -136,6 +136,22 @@ struct ike_sa_t {
* @return remote host_t
*/
host_t* (*get_other_host) (ike_sa_t *this);
/**
* @brief Get own ID of the IKE_SA.
*
* @param this calling object
* @return local identification_t
*/
identification_t* (*get_my_id) (ike_sa_t *this);
/**
* @brief Get remote ID the IKE_SA.
*
* @param this calling object
* @return remote identification_t
*/
identification_t* (*get_other_id) (ike_sa_t *this);
/**
* @brief Get the state of type of associated state object.