unit-tests: Make childless initiation configurable
authorTobias Brunner <tobias@strongswan.org>
Tue, 2 Apr 2019 14:24:01 +0000 (16:24 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 25 Apr 2019 13:23:19 +0000 (15:23 +0200)
src/libcharon/tests/utils/exchange_test_helper.c
src/libcharon/tests/utils/exchange_test_helper.h

index a267468..97fa6fe 100644 (file)
@@ -100,11 +100,14 @@ static ike_cfg_t *create_ike_cfg(bool initiator, exchange_test_sa_conf_t *conf)
        ike_cfg_t *ike_cfg;
        char *proposal = NULL;
 
-       ike_cfg = ike_cfg_create(&ike);
        if (conf)
        {
+               ike.childless = initiator ? conf->initiator.childless
+                                                                 : conf->responder.childless;
                proposal = initiator ? conf->initiator.ike : conf->responder.ike;
        }
+
+       ike_cfg = ike_cfg_create(&ike);
        if (proposal)
        {
                ike_cfg->add_proposal(ike_cfg,
index 8f43c09..1541e88 100644 (file)
@@ -109,6 +109,8 @@ struct exchange_test_sa_conf_t {
                char *ike;
                /** ESP proposal */
                char *esp;
+               /** Support for childless IKE_SAs */
+               childless_t childless;
        } initiator, responder;
 };