../svn-commit.tmp
This commit is contained in:
@@ -12,25 +12,25 @@
|
||||
# for more details.
|
||||
#
|
||||
|
||||
SA_DIR= $(MAIN_DIR)sa/
|
||||
SA_DIR= $(CHARON_DIR)sa/
|
||||
|
||||
OBJS+= $(BUILD_DIR)ike_sa_id.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)ike_sa_id.o
|
||||
$(BUILD_DIR)ike_sa_id.o : $(SA_DIR)ike_sa_id.c $(SA_DIR)ike_sa_id.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)ike_sa_manager.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)ike_sa_manager.o
|
||||
$(BUILD_DIR)ike_sa_manager.o : $(SA_DIR)ike_sa_manager.c $(SA_DIR)ike_sa_manager.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)ike_sa.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)ike_sa.o
|
||||
$(BUILD_DIR)ike_sa.o : $(SA_DIR)ike_sa.c $(SA_DIR)ike_sa.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)authenticator.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)authenticator.o
|
||||
$(BUILD_DIR)authenticator.o : $(SA_DIR)authenticator.c $(SA_DIR)authenticator.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)child_sa.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)child_sa.o
|
||||
$(BUILD_DIR)child_sa.o : $(SA_DIR)child_sa.c $(SA_DIR)child_sa.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#define CHILD_SA_H_
|
||||
|
||||
#include <types.h>
|
||||
#include <transforms/prf_plus.h>
|
||||
#include <crypto/prf_plus.h>
|
||||
#include <encoding/payloads/proposal_substructure.h>
|
||||
|
||||
typedef struct child_sa_t child_sa_t;
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
#include <utils/linked_list.h>
|
||||
#include <utils/logger_manager.h>
|
||||
#include <utils/randomizer.h>
|
||||
#include <transforms/diffie_hellman.h>
|
||||
#include <transforms/prf_plus.h>
|
||||
#include <transforms/crypters/crypter.h>
|
||||
#include <crypto/diffie_hellman.h>
|
||||
#include <crypto/prf_plus.h>
|
||||
#include <crypto/crypters/crypter.h>
|
||||
#include <encoding/payloads/sa_payload.h>
|
||||
#include <encoding/payloads/nonce_payload.h>
|
||||
#include <encoding/payloads/ke_payload.h>
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
#include <config/configuration.h>
|
||||
#include <utils/logger.h>
|
||||
#include <utils/randomizer.h>
|
||||
#include <transforms/prfs/prf.h>
|
||||
#include <transforms/crypters/crypter.h>
|
||||
#include <transforms/signers/signer.h>
|
||||
#include <crypto/prfs/prf.h>
|
||||
#include <crypto/crypters/crypter.h>
|
||||
#include <crypto/signers/signer.h>
|
||||
#include <config/connection.h>
|
||||
#include <config/policy.h>
|
||||
|
||||
|
||||
@@ -14,30 +14,30 @@
|
||||
|
||||
STATES_DIR= $(SA_DIR)states/
|
||||
|
||||
OBJS+= $(BUILD_DIR)ike_auth_requested.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)ike_auth_requested.o
|
||||
$(BUILD_DIR)ike_auth_requested.o : $(STATES_DIR)ike_auth_requested.c $(STATES_DIR)ike_auth_requested.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)ike_sa_established.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)ike_sa_established.o
|
||||
$(BUILD_DIR)ike_sa_established.o : $(STATES_DIR)ike_sa_established.c $(STATES_DIR)ike_sa_established.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)ike_sa_init_requested.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)ike_sa_init_requested.o
|
||||
$(BUILD_DIR)ike_sa_init_requested.o : $(STATES_DIR)ike_sa_init_requested.c $(STATES_DIR)ike_sa_init_requested.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)ike_sa_init_responded.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)ike_sa_init_responded.o
|
||||
$(BUILD_DIR)ike_sa_init_responded.o : $(STATES_DIR)ike_sa_init_responded.c $(STATES_DIR)ike_sa_init_responded.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)initiator_init.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)initiator_init.o
|
||||
$(BUILD_DIR)initiator_init.o : $(STATES_DIR)initiator_init.c $(STATES_DIR)initiator_init.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)responder_init.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)responder_init.o
|
||||
$(BUILD_DIR)responder_init.o : $(STATES_DIR)responder_init.c $(STATES_DIR)responder_init.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)state.o
|
||||
CHARON_OBJS+= $(BUILD_DIR)state.o
|
||||
$(BUILD_DIR)state.o : $(STATES_DIR)state.c $(STATES_DIR)state.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
@@ -29,8 +29,8 @@
|
||||
#include <encoding/payloads/id_payload.h>
|
||||
#include <encoding/payloads/auth_payload.h>
|
||||
#include <encoding/payloads/notify_payload.h>
|
||||
#include <transforms/signers/signer.h>
|
||||
#include <transforms/crypters/crypter.h>
|
||||
#include <crypto/signers/signer.h>
|
||||
#include <crypto/crypters/crypter.h>
|
||||
#include <sa/states/ike_sa_established.h>
|
||||
#include <sa/authenticator.h>
|
||||
#include <sa/child_sa.h>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <encoding/payloads/id_payload.h>
|
||||
#include <encoding/payloads/auth_payload.h>
|
||||
#include <encoding/payloads/ts_payload.h>
|
||||
#include <transforms/diffie_hellman.h>
|
||||
#include <crypto/diffie_hellman.h>
|
||||
#include <sa/states/ike_auth_requested.h>
|
||||
#include <sa/states/initiator_init.h>
|
||||
#include <sa/authenticator.h>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <types.h>
|
||||
#include <sa/ike_sa.h>
|
||||
#include <sa/states/state.h>
|
||||
#include <transforms/diffie_hellman.h>
|
||||
#include <crypto/diffie_hellman.h>
|
||||
|
||||
typedef struct ike_sa_init_requested_t ike_sa_init_requested_t;
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#include <encoding/payloads/id_payload.h>
|
||||
#include <encoding/payloads/auth_payload.h>
|
||||
#include <encoding/payloads/notify_payload.h>
|
||||
#include <transforms/signers/signer.h>
|
||||
#include <transforms/crypters/crypter.h>
|
||||
#include <crypto/signers/signer.h>
|
||||
#include <crypto/crypters/crypter.h>
|
||||
#include <sa/states/ike_sa_established.h>
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <sa/states/ike_sa_init_requested.h>
|
||||
#include <utils/allocator.h>
|
||||
#include <queues/jobs/retransmit_request_job.h>
|
||||
#include <transforms/diffie_hellman.h>
|
||||
#include <crypto/diffie_hellman.h>
|
||||
#include <encoding/payloads/sa_payload.h>
|
||||
#include <encoding/payloads/ke_payload.h>
|
||||
#include <encoding/payloads/nonce_payload.h>
|
||||
@@ -92,7 +92,7 @@ struct private_initiator_init_t {
|
||||
* @param this calling object
|
||||
* @param request message_t object to add the NONCE payload
|
||||
*/
|
||||
void (*build_nonce_payload) (private_initiator_init_t *this,message_t *request);
|
||||
status_t (*build_nonce_payload) (private_initiator_init_t *this,message_t *request);
|
||||
|
||||
/**
|
||||
* Destroy function called internally of this class after state change to state
|
||||
@@ -177,9 +177,14 @@ status_t retry_initiate_connection (private_initiator_init_t *this, diffie_hellm
|
||||
this->build_ke_payload(this, message);
|
||||
|
||||
/* build Nonce payload */
|
||||
this->build_nonce_payload(this,message);
|
||||
|
||||
|
||||
status = this->build_nonce_payload(this, message);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
this->logger->log(this->logger, ERROR, "Building nonce payload failed. Aborting");
|
||||
message->destroy(message);
|
||||
return DELETE_ME;
|
||||
}
|
||||
|
||||
/* message can now be sent (must not be destroyed) */
|
||||
status = this->ike_sa->send_request(this->ike_sa, message);
|
||||
if (status != SUCCESS)
|
||||
@@ -251,17 +256,22 @@ static void build_ke_payload(private_initiator_init_t *this, message_t *request)
|
||||
/**
|
||||
* Implementation of private_initiator_init_t.build_nonce_payload.
|
||||
*/
|
||||
static void build_nonce_payload(private_initiator_init_t *this, message_t *request)
|
||||
static status_t build_nonce_payload(private_initiator_init_t *this, message_t *request)
|
||||
{
|
||||
nonce_payload_t *nonce_payload;
|
||||
randomizer_t *randomizer;
|
||||
status_t status;
|
||||
|
||||
this->logger->log(this->logger, CONTROL|LEVEL1, "Building NONCE payload");
|
||||
|
||||
this->logger->log(this->logger, CONTROL|LEVEL2, "Get pseudo random bytes for NONCE");
|
||||
randomizer = this->ike_sa->get_randomizer(this->ike_sa);
|
||||
|
||||
randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
|
||||
status = randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
this->logger->log(this->logger, RAW|LEVEL2, "Initiator NONCE",&(this->sent_nonce));
|
||||
|
||||
@@ -271,6 +281,7 @@ static void build_nonce_payload(private_initiator_init_t *this, message_t *reque
|
||||
|
||||
this->logger->log(this->logger, CONTROL|LEVEL2, "Add NONCE payload to message");
|
||||
request->add_payload(request, (payload_t *) nonce_payload);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <encoding/payloads/ke_payload.h>
|
||||
#include <encoding/payloads/nonce_payload.h>
|
||||
#include <encoding/payloads/notify_payload.h>
|
||||
#include <transforms/diffie_hellman.h>
|
||||
#include <crypto/diffie_hellman.h>
|
||||
|
||||
|
||||
typedef struct private_responder_init_t private_responder_init_t;
|
||||
@@ -428,6 +428,7 @@ static status_t build_nonce_payload(private_responder_init_t *this,nonce_payload
|
||||
{
|
||||
nonce_payload_t *nonce_payload;
|
||||
randomizer_t *randomizer;
|
||||
status_t status;
|
||||
|
||||
this->logger->log(this->logger, CONTROL | LEVEL2, "Process received NONCE payload");
|
||||
allocator_free(this->received_nonce.ptr);
|
||||
@@ -439,7 +440,11 @@ static status_t build_nonce_payload(private_responder_init_t *this,nonce_payload
|
||||
this->logger->log(this->logger, CONTROL | LEVEL2, "Create new NONCE value.");
|
||||
|
||||
randomizer = this->ike_sa->get_randomizer(this->ike_sa);
|
||||
randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
|
||||
status = randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
this->logger->log(this->logger, CONTROL|LEVEL2, "Building NONCE payload");
|
||||
nonce_payload = nonce_payload_create();
|
||||
|
||||
Reference in New Issue
Block a user