Adapted the config backends to the new lifetime configuration.
[strongswan.git] / src / charon / plugins / sql / sql_config.c
index 802bbe7..71fb378 100644 (file)
@@ -11,8 +11,6 @@
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  * for more details.
- *
- * $Id$
  */
 
 #include <string.h>
@@ -132,8 +130,10 @@ static child_cfg_t *build_child_cfg(private_sql_config_t *this, enumerator_t *e)
        if (e->enumerate(e, &id, &name, &lifetime, &rekeytime, &jitter, 
                                                &updown, &hostaccess, &mode, &dpd, &close, &ipcomp))
        {
-               child_cfg = child_cfg_create(name, lifetime, rekeytime, jitter,
-                                                                        updown, hostaccess, mode, dpd, close, ipcomp);
+               lifetime_cfg_t *lft = lifetime_cfg_create_time(lifetime, rekeytime,
+                                                                                                          jitter);
+               child_cfg = child_cfg_create(name, lft, updown, hostaccess, mode,
+                                                                        dpd, close, ipcomp);
                /* TODO: read proposal from db */
                child_cfg->add_proposal(child_cfg, proposal_create_default(PROTO_ESP));
                add_traffic_selectors(this, child_cfg, id);
@@ -297,10 +297,10 @@ static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e,
                                        mediation, mediated_cfg, peer_id);
                        auth = auth_cfg_create();
                        auth->add(auth, AUTH_RULE_AUTH_CLASS, auth_method);
-                       auth->add(auth, AUTH_RULE_IDENTITY, local_id->clone(local_id));
+                       auth->add(auth, AUTH_RULE_IDENTITY, local_id);
                        peer_cfg->add_auth_cfg(peer_cfg, auth, TRUE);
                        auth = auth_cfg_create();
-                       auth->add(auth, AUTH_RULE_IDENTITY, remote_id->clone(remote_id));
+                       auth->add(auth, AUTH_RULE_IDENTITY, remote_id);
                        if (eap_type)
                        {
                                auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_EAP);