old child_sa gets deleted after rekeying

rekeying almost complete, but:
	IKE_SA get in an invalid state when both initiate rekeying at the same time,
This commit is contained in:
Martin Willi
2006-06-09 15:12:43 +00:00
parent 2a13996de0
commit 695723d4e8
19 changed files with 586 additions and 102 deletions
+1
View File
@@ -20,6 +20,7 @@ $(top_srcdir)/src/charon/local_policy_store.o $(top_srcdir)/src/charon/local_cre
$(top_srcdir)/src/charon/proposal.o $(top_srcdir)/src/charon/configuration.o $(top_srcdir)/src/charon/state.o $(top_srcdir)/src/charon/ike_sa_init_requested.o \
$(top_srcdir)/src/charon/ike_sa_init_responded.o $(top_srcdir)/src/charon/ike_sa_established.o $(top_srcdir)/src/charon/responder_init.o \
$(top_srcdir)/src/charon/initiator_init.o $(top_srcdir)/src/charon/ike_auth_requested.o $(top_srcdir)/src/charon/delete_ike_sa_requested.o \
$(top_srcdir)/src/charon/delete_child_sa_requested.o \
$(top_srcdir)/src/charon/child_sa.o $(top_srcdir)/src/charon/ike_sa.o $(top_srcdir)/src/charon/ike_sa_manager.o $(top_srcdir)/src/charon/ike_sa_id.o \
$(top_srcdir)/src/charon/authenticator.o $(top_srcdir)/src/charon/encryption_payload.o $(top_srcdir)/src/charon/cert_payload.o \
$(top_srcdir)/src/charon/traffic_selector_substructure.o $(top_srcdir)/src/charon/transform_attribute.o $(top_srcdir)/src/charon/configuration_attribute.o \
+1 -2
View File
@@ -1091,13 +1091,12 @@ void test_generator_with_delete_payload(protected_tester_t *tester)
generator = generator_create();
tester->assert_true(tester,(generator != NULL), "generator create check");
delete_payload = delete_payload_create();
delete_payload = delete_payload_create(PROTO_AH);
spis.ptr = "123456789012";
spis.len = strlen(spis.ptr);
delete_payload->set_protocol_id(delete_payload, PROTO_AH);
delete_payload->set_spi_count(delete_payload,3);
delete_payload->set_spi_size(delete_payload,4);
delete_payload->set_spis(delete_payload,spis);
+13 -6
View File
@@ -57,28 +57,35 @@ void test_kernel_interface(protected_tester_t *tester)
me = host_create(AF_INET, "192.168.0.2", 0);
other = host_create(AF_INET, "192.168.0.3", 0);
status = kernel_interface->get_spi(kernel_interface, me, other, 50, 1234, &spi);
status = kernel_interface->get_spi(kernel_interface, me, other, PROTO_ESP, 1234, &spi);
tester->assert_true(tester, status == SUCCESS, "spi get");
status = kernel_interface->add_sa(kernel_interface, me, other, spi, 50, 1234, 5, 10, &enc_alg, &int_alg, prf_plus, TRUE);
status = kernel_interface->add_sa(kernel_interface, me, other, spi, PROTO_ESP, 1234, 0, 0, &enc_alg, &int_alg, prf_plus, TRUE);
tester->assert_true(tester, status == SUCCESS, "add sa");
left = host_create(AF_INET, "10.1.0.0", 0);
right = host_create(AF_INET, "10.2.0.0", 0);
status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 16, 16, XFRM_POLICY_OUT, 0, PROTO_ESP, 1234);
status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 24, 24, XFRM_POLICY_OUT, 0, PROTO_ESP, 1234);
tester->assert_true(tester, status == SUCCESS, "add policy OUT");
status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 16, 16, XFRM_POLICY_IN, 0, PROTO_ESP, 1234);
status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 24, 24, XFRM_POLICY_OUT, 0, PROTO_ESP, 2345);
tester->assert_true(tester, status == SUCCESS, "add policy OUT");
status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 24, 24, XFRM_POLICY_IN, 0, PROTO_ESP, 1234);
tester->assert_true(tester, status == SUCCESS, "add policy IN");
status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 16, 16, XFRM_POLICY_FWD, 0, PROTO_ESP, 1234);
status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 24, 24, XFRM_POLICY_FWD, 0, PROTO_ESP, 1234);
tester->assert_true(tester, status == SUCCESS, "add policy FWD");
kernel_interface->del_sa(kernel_interface, other, spi, PROTO_ESP);
sleep(10);
me->destroy(me);
other->destroy(other);
left->destroy(left);
right->destroy(right);
sleep(15);
kernel_interface->destroy(kernel_interface);
+2 -2
View File
@@ -159,12 +159,12 @@ daemon_t *daemon_create()
/* assign methods */
charon->kill = daemon_kill;
charon->socket = socket_create(500);
//charon->socket = socket_create(500);
charon->ike_sa_manager = ike_sa_manager_create();
charon->job_queue = job_queue_create();
charon->event_queue = event_queue_create();
charon->send_queue = send_queue_create();
charon->kernel_interface = kernel_interface_create();
//charon->kernel_interface = kernel_interface_create();
//charon->configuration = configuration_create(RETRANSMIT_TIMEOUT,MAX_RETRANSMIT_COUNT,HALF_OPEN_IKE_SA_TIMEOUT);
charon->sender = NULL;
charon->receiver = NULL;