]> git.ipfire.org Git - thirdparty/strongswan.git/commit
ikev2: Trigger ike_updown() event after all IKE-specific tasks ran
authorTobias Brunner <tobias@strongswan.org>
Thu, 22 Sep 2022 14:14:44 +0000 (16:14 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 23 Sep 2022 14:28:35 +0000 (16:28 +0200)
commit5ce1c91b58a2d396632ca237524c9585f4d36a02
tree766068ff051d0c804d289801b3c894769e9e6fc5
parent14243dcdb53020227c4ae3f211f16ca394a91939
ikev2: Trigger ike_updown() event after all IKE-specific tasks ran

This makes sure the event is only triggered after the IKE_SA is fully
established and e.g. virtual IPs, additional peer addresses or
a modified reauth time (on the initiator) are assigned to it.  This was
e.g. a problem for the selinux plugin if virtual IPs are used.

We use a separate task to trigger the event that's queued before the
child-create task so the event is triggered before the child_updown()
event.  Same goes for the state change to IKE_ESTABLISHED.

A new condition is used to indicate the successful completion of all
authentication rounds, so we don't have to set the IKE_ESTABLISHED state
in the ike-auth task (it was used as condition in other tasks).

Since set_state() also sets the rekey and reauth times, this required
some minor changes in regards to how AUTH_LIFETIME notifies are handled.
17 files changed:
src/libcharon/Android.mk
src/libcharon/Makefile.am
src/libcharon/sa/ike_sa.c
src/libcharon/sa/ike_sa.h
src/libcharon/sa/ikev2/task_manager_v2.c
src/libcharon/sa/ikev2/tasks/child_create.c
src/libcharon/sa/ikev2/tasks/ike_auth.c
src/libcharon/sa/ikev2/tasks/ike_auth_lifetime.c
src/libcharon/sa/ikev2/tasks/ike_cert_post.c
src/libcharon/sa/ikev2/tasks/ike_config.c
src/libcharon/sa/ikev2/tasks/ike_establish.c [new file with mode: 0644]
src/libcharon/sa/ikev2/tasks/ike_establish.h [new file with mode: 0644]
src/libcharon/sa/ikev2/tasks/ike_mobike.c
src/libcharon/sa/task.c
src/libcharon/sa/task.h
testing/tests/ikev2/reauth-early/evaltest.dat
testing/tests/ikev2/reauth-late/evaltest.dat