]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Added an aggressive mode peer_cfg option
authorMartin Willi <martin@revosec.ch>
Mon, 9 Jan 2012 16:32:41 +0000 (16:32 +0000)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:34 +0000 (17:31 +0100)
13 files changed:
src/conftest/config.c
src/libcharon/config/peer_cfg.c
src/libcharon/config/peer_cfg.h
src/libcharon/plugins/android/android_service.c
src/libcharon/plugins/ha/ha_tunnel.c
src/libcharon/plugins/load_tester/load_tester_config.c
src/libcharon/plugins/maemo/maemo_service.c
src/libcharon/plugins/medcli/medcli_config.c
src/libcharon/plugins/medsrv/medsrv_config.c
src/libcharon/plugins/nm/nm_service.c
src/libcharon/plugins/sql/sql_config.c
src/libcharon/plugins/stroke/stroke_config.c
src/libcharon/plugins/uci/uci_config.c

index 51d491de56d37120fccaa53a4a12a932a84d214f..a62363cd8134249cc027df960e6933573694aa55 100644 (file)
@@ -252,7 +252,7 @@ static peer_cfg_t *load_peer_config(private_config_t *this,
 
        ike_cfg = load_ike_config(this, settings, config);
        peer_cfg = peer_cfg_create(config, IKEV2, ike_cfg, CERT_ALWAYS_SEND,
-                                                          UNIQUE_NO, 1, 0, 0, 0, 0, FALSE, 0,
+                                                          UNIQUE_NO, 1, 0, 0, 0, 0, FALSE, FALSE, 0,
                                                           NULL, NULL, FALSE, NULL, NULL);
 
        auth = auth_cfg_create();
index fb9d54bfe575237c9be7469029ed4d44f6b38287..b278dc3370b6e800f386e5cdd9ba0fc3a7814b3c 100644 (file)
@@ -105,6 +105,11 @@ struct private_peer_cfg_t {
         */
        bool use_mobike;
 
+       /**
+        * Use aggressive mode?
+        */
+       bool aggressive;
+
        /**
         * Time before starting rekeying
         */
@@ -381,6 +386,12 @@ METHOD(peer_cfg_t, use_mobike, bool,
        return this->use_mobike;
 }
 
+METHOD(peer_cfg_t, use_aggressive, bool,
+       private_peer_cfg_t *this)
+{
+       return this->aggressive;
+}
+
 METHOD(peer_cfg_t, get_dpd, u_int32_t,
        private_peer_cfg_t *this)
 {
@@ -574,9 +585,9 @@ peer_cfg_t *peer_cfg_create(char *name, ike_version_t ike_version,
                                                        unique_policy_t unique, u_int32_t keyingtries,
                                                        u_int32_t rekey_time, u_int32_t reauth_time,
                                                        u_int32_t jitter_time, u_int32_t over_time,
-                                                       bool mobike, u_int32_t dpd, host_t *virtual_ip,
-                                                       char *pool, bool mediation, peer_cfg_t *mediated_by,
-                                                       identification_t *peer_id)
+                                                       bool mobike, bool aggressive, u_int32_t dpd,
+                                                       host_t *virtual_ip, char *pool, bool mediation,
+                                                       peer_cfg_t *mediated_by, identification_t *peer_id)
 {
        private_peer_cfg_t *this;
 
@@ -605,6 +616,7 @@ peer_cfg_t *peer_cfg_create(char *name, ike_version_t ike_version,
                        .get_reauth_time = _get_reauth_time,
                        .get_over_time = _get_over_time,
                        .use_mobike = _use_mobike,
+                       .use_aggressive = _use_aggressive,
                        .get_dpd = _get_dpd,
                        .get_virtual_ip = _get_virtual_ip,
                        .get_pool = _get_pool,
@@ -632,6 +644,7 @@ peer_cfg_t *peer_cfg_create(char *name, ike_version_t ike_version,
                .jitter_time = jitter_time,
                .over_time = over_time,
                .use_mobike = mobike,
+               .aggressive = aggressive,
                .dpd = dpd,
                .virtual_ip = virtual_ip,
                .pool = strdupnull(pool),
index dcbe6aa9e169bf69952e0283d41a0f974b71604d..969ccabf2c5d0621e8b8c161c249b151996953e8 100644 (file)
@@ -256,6 +256,13 @@ struct peer_cfg_t {
         */
        bool (*use_mobike) (peer_cfg_t *this);
 
+       /**
+        * Use/Accept aggressive mode with IKEv1?.
+        *
+        * @return                      TRUE to use aggressive mode
+        */
+       bool (*use_aggressive)(peer_cfg_t *this);
+
        /**
         * Get the DPD check interval.
         *
@@ -357,6 +364,7 @@ struct peer_cfg_t {
  * @param jitter_time          timerange to randomly subtract from rekey/reauth time
  * @param over_time                    maximum overtime before closing a rekeying/reauth SA
  * @param mobike                       use MOBIKE (RFC4555) if peer supports it
+ * @param aggressive           use/accept aggressive mode with IKEv1
  * @param dpd                          DPD check interval, 0 to disable
  * @param virtual_ip           virtual IP for local host, or NULL
  * @param pool                         pool name to get configuration attributes from, or NULL
@@ -370,8 +378,8 @@ peer_cfg_t *peer_cfg_create(char *name, ike_version_t ike_version,
                                                        unique_policy_t unique, u_int32_t keyingtries,
                                                        u_int32_t rekey_time, u_int32_t reauth_time,
                                                        u_int32_t jitter_time, u_int32_t over_time,
-                                                       bool mobike, u_int32_t dpd, host_t *virtual_ip,
-                                                       char *pool, bool mediation, peer_cfg_t *mediated_by,
-                                                       identification_t *peer_id);
+                                                       bool mobike, bool aggressive, u_int32_t dpd,
+                                                       host_t *virtual_ip, char *pool, bool mediation,
+                                                       peer_cfg_t *mediated_by, identification_t *peer_id);
 
 #endif /** PEER_CFG_H_ @}*/
index 8aba925a27bad925c3f72dcbf3ac4f385a706903..62fd52b1211e7353d391bd1f6cabe532405bbdc6 100644 (file)
@@ -277,7 +277,7 @@ static job_requeue_t initiate(private_android_service_t *this)
                                                           UNIQUE_REPLACE, 1, /* keyingtries */
                                                           36000, 0, /* rekey 10h, reauth none */
                                                           600, 600, /* jitter, over 10min */
-                                                          TRUE, 0, /* mobike, DPD */
+                                                          TRUE, FALSE, 0, /* mobike, aggressive, DPD */
                                                           host_create_from_string("0.0.0.0", 0) /* virt */,
                                                           NULL, FALSE, NULL, NULL); /* pool, mediation */
 
index 1f87c3d86901cf01f749770ecb39056d8126eaba..6f20620f23a66e20fe6b58e2fe675bcd59c190a1 100644 (file)
@@ -207,7 +207,7 @@ static void setup_tunnel(private_ha_tunnel_t *this,
                                                         remote, IKEV2_UDP_PORT);
        ike_cfg->add_proposal(ike_cfg, proposal_create_default(PROTO_IKE));
        peer_cfg = peer_cfg_create("ha", IKEV2, ike_cfg, CERT_NEVER_SEND,
-                                               UNIQUE_KEEP, 0, 86400, 0, 7200, 3600, FALSE, 30,
+                                               UNIQUE_KEEP, 0, 86400, 0, 7200, 3600, FALSE, FALSE, 30,
                                                NULL, NULL, FALSE, NULL, NULL);
 
        auth_cfg = auth_cfg_create();
index 301c9cc6312e14920db5a1aa3a4101f9bb28f782..83853b8def3c0ee6987825e9e65896f26fc19b35 100644 (file)
@@ -253,7 +253,8 @@ static peer_cfg_t* generate_config(private_load_tester_config_t *this, uint num)
                                                           CERT_SEND_IF_ASKED, UNIQUE_NO, 1, /* keytries */
                                                           this->ike_rekey, 0, /* rekey, reauth */
                                                           0, this->ike_rekey, /* jitter, overtime */
-                                                          FALSE, this->dpd_delay, /* mobike, dpddelay */
+                                                          FALSE, FALSE, /* mobike, aggressive mode */
+                                                          this->dpd_delay, /* dpddelay */
                                                           this->vip ? this->vip->clone(this->vip) : NULL,
                                                           this->pool, FALSE, NULL, NULL);
        if (num)
index 69eac084c858c6d63406bae89dc73be5aff9c4f8..67d2b2984eed04f7aa3f6c1cb00657ae1749f063 100644 (file)
@@ -332,7 +332,7 @@ static gboolean initiate_connection(private_maemo_service_t *this,
                                                           UNIQUE_REPLACE, 1, /* keyingtries */
                                                           36000, 0, /* rekey 10h, reauth none */
                                                           600, 600, /* jitter, over 10min */
-                                                          TRUE, 0, /* mobike, DPD */
+                                                          TRUE, FALSE, 0, /* mobike, aggressive, DPD */
                                                           host_create_from_string("0.0.0.0", 0) /* virt */,
                                                           NULL, FALSE, NULL, NULL); /* pool, mediation */
 
index f768eeb4e3ed74673a6323a646fd8ea0e848e432..7fa0152bd57a89d77105ef9375003eccf4fe5a38 100644 (file)
@@ -126,7 +126,7 @@ METHOD(backend_t, get_peer_cfg_by_name, peer_cfg_t*,
                CERT_NEVER_SEND, UNIQUE_REPLACE,
                1, this->rekey*60, 0,                   /* keytries, rekey, reauth */
                this->rekey*5, this->rekey*3,   /* jitter, overtime */
-               TRUE, this->dpd,                                /* mobike, dpddelay */
+               TRUE, FALSE, this->dpd,                 /* mobike, aggressive, dpddelay */
                NULL, NULL,                                             /* vip, pool */
                TRUE, NULL, NULL);                              /* mediation, med by, peer id */
        e->destroy(e);
@@ -163,7 +163,7 @@ METHOD(backend_t, get_peer_cfg_by_name, peer_cfg_t*,
                CERT_NEVER_SEND, UNIQUE_REPLACE,
                1, this->rekey*60, 0,                   /* keytries, rekey, reauth */
                this->rekey*5, this->rekey*3,   /* jitter, overtime */
-               TRUE, this->dpd,                                /* mobike, dpddelay */
+               TRUE, FALSE, this->dpd,                 /* mobike, aggressive, dpddelay */
                NULL, NULL,                                             /* vip, pool */
                FALSE, med_cfg,                                 /* mediation, med by */
                identification_create_from_encoding(ID_KEY_ID, other));
@@ -238,7 +238,7 @@ METHOD(enumerator_t, peer_enumerator_enumerate, bool,
                                CERT_NEVER_SEND, UNIQUE_REPLACE,
                                1, this->rekey*60, 0,                   /* keytries, rekey, reauth */
                                this->rekey*5, this->rekey*3,   /* jitter, overtime */
-                               TRUE, this->dpd,                                /* mobike, dpddelay */
+                               TRUE, FALSE, this->dpd,                 /* mobike, aggr., dpddelay */
                                NULL, NULL,                                             /* vip, pool */
                                FALSE, NULL, NULL);                             /* mediation, med by, peer id */
 
index fc3963a3dc8b4783d47a661b5ef7a1c04f1d0143..366558ac29f8add177dca9010a0cf178dccc5c36 100644 (file)
@@ -92,7 +92,7 @@ METHOD(backend_t, create_peer_cfg_enumerator, enumerator_t*,
                                CERT_NEVER_SEND, UNIQUE_REPLACE,
                                1, this->rekey*60, 0,                   /* keytries, rekey, reauth */
                                this->rekey*5, this->rekey*3,   /* jitter, overtime */
-                               TRUE, this->dpd,                                /* mobike, dpddelay */
+                               TRUE, FALSE, this->dpd,                 /* mobike, aggr., dpddelay */
                                NULL, NULL,                                             /* vip, pool */
                                TRUE, NULL, NULL);                              /* mediation, med by, peer id */
                        e->destroy(e);
index 7882915312e9605a86432e66d2c9bea799b14275..d51b699ae6744968ff005eb7d7309f14577979cc 100644 (file)
@@ -503,7 +503,7 @@ static gboolean connect_(NMVPNPlugin *plugin, NMConnection *connection,
                                        CERT_SEND_IF_ASKED, UNIQUE_REPLACE, 1, /* keyingtries */
                                        36000, 0, /* rekey 10h, reauth none */
                                        600, 600, /* jitter, over 10min */
-                                       TRUE, 0, /* mobike, DPD */
+                                       TRUE, FALSE, 0, /* mobike, aggressive, DPD */
                                        virtual ? host_create_from_string("0.0.0.0", 0) : NULL,
                                        NULL, FALSE, NULL, NULL); /* pool, mediation */
        auth = auth_cfg_create();
index ef181f66ca714eec60dfb7e1270b93f69bbf2d0b..b06bd37066a11dbfa5cb538987c6dd5109daf7a3 100644 (file)
@@ -370,7 +370,7 @@ static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e,
                        peer_cfg = peer_cfg_create(
                                        name, IKEV2, ike, cert_policy, uniqueid,
                                        keyingtries, rekeytime, reauthtime, jitter, overtime,
-                                       mobike, dpd_delay, vip, pool,
+                                       mobike, FALSE, dpd_delay, vip, pool,
                                        mediation, mediated_cfg, peer_id);
                        auth = auth_cfg_create();
                        auth->add(auth, AUTH_RULE_AUTH_CLASS, auth_method);
index 08339a475fbaba27af5c260993c18653a7c7ec19..e39233b7eed08c15b6572797faa831bd715ff065 100644 (file)
@@ -689,7 +689,7 @@ static peer_cfg_t *build_peer_cfg(private_stroke_config_t *this,
                msg->add_conn.version, ike_cfg,
                msg->add_conn.me.sendcert, unique,
                msg->add_conn.rekey.tries, rekey, reauth, jitter, over,
-               msg->add_conn.mobike, msg->add_conn.dpd.delay,
+               msg->add_conn.mobike, FALSE, msg->add_conn.dpd.delay,
                vip, msg->add_conn.other.sourceip_mask ?
                                                        msg->add_conn.name : msg->add_conn.other.sourceip,
                msg->add_conn.ikeme.mediation, mediated_by, peer_id);
index 4e48b933a05f76f944c263adaacdf275d59554b7..b4e99c3f267f87438af7f7ccb2de091f9d095dac 100644 (file)
@@ -175,7 +175,7 @@ METHOD(enumerator_t, peer_enumerator_enumerate, bool,
                                        name, IKEV2, ike_cfg, CERT_SEND_IF_ASKED, UNIQUE_NO,
                                        1, create_rekey(ike_rekey), 0,  /* keytries, rekey, reauth */
                                        1800, 900,                                              /* jitter, overtime */
-                                       TRUE, 60,                                               /* mobike, dpddelay */
+                                       TRUE, FALSE, 60,                        /* mobike, aggr., dpddelay */
                                        NULL, NULL,                                     /* vip, pool */
                                        FALSE, NULL, NULL);                     /* mediation, med by, peer id */
                auth = auth_cfg_create();