aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-07-25 14:08:18 +0200
committerMartin Willi <martin@revosec.ch>2011-07-25 14:19:17 +0200
commit5d6b9815729e996a590a5ac8d30abc7fb688e046 (patch)
treee27330b696cd814b7a089ba29e954a1e58219443
parent446ff101c235a8e9d6bf71bf7d6eb6c9a846cb0d (diff)
downloadstrongswan-5d6b9815729e996a590a5ac8d30abc7fb688e046.tar.bz2
strongswan-5d6b9815729e996a590a5ac8d30abc7fb688e046.tar.xz
Inherit authentication information during IKE_SA rekeying
-rw-r--r--src/libcharon/sa/ike_sa.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c
index da429c884..243e11ede 100644
--- a/src/libcharon/sa/ike_sa.c
+++ b/src/libcharon/sa/ike_sa.c
@@ -1929,6 +1929,8 @@ METHOD(ike_sa_t, inherit, void,
private_ike_sa_t *other = (private_ike_sa_t*)other_public;
child_sa_t *child_sa;
attribute_entry_t *entry;
+ enumerator_t *enumerator;
+ auth_cfg_t *cfg;
/* apply hosts and ids */
this->my_host->destroy(this->my_host);
@@ -1952,6 +1954,20 @@ METHOD(ike_sa_t, inherit, void,
other->other_virtual_ip = NULL;
}
+ /* authentication information */
+ enumerator = other->my_auths->create_enumerator(other->my_auths);
+ while (enumerator->enumerate(enumerator, &cfg))
+ {
+ this->my_auths->insert_last(this->my_auths, cfg->clone(cfg));
+ }
+ enumerator->destroy(enumerator);
+ enumerator = other->other_auths->create_enumerator(other->other_auths);
+ while (enumerator->enumerate(enumerator, &cfg))
+ {
+ this->other_auths->insert_last(this->other_auths, cfg->clone(cfg));
+ }
+ enumerator->destroy(enumerator);
+
/* ... and configuration attributes */
while (other->attributes->remove_last(other->attributes,
(void**)&entry) == SUCCESS)