time values in strongswan.conf can be optionally specified in days (d), hours (h...
[strongswan.git] / src / charon / plugins / medsrv / medsrv_config.c
index 4768a2c..bec6837 100644 (file)
@@ -85,9 +85,9 @@ static enumerator_t* create_peer_cfg_enumerator(private_medsrv_config_t *this,
                return NULL;
        }
        e = this->db->query(this->db,
-                       "SELECT CONCAT(Peer.Alias, CONCAT('@', User.Login)) FROM "
-                       "Peer JOIN User ON Peer.IdUser = User.IdUser "
-                       "WHERE Peer.KeyID = ?", DB_BLOB, other->get_encoding(other),
+                       "SELECT CONCAT(peer.alias, CONCAT('@', user.login)) FROM "
+                       "peer JOIN user ON peer.user = user.id "
+                       "WHERE peer.keyid = ?", DB_BLOB, other->get_encoding(other),
                        DB_TEXT);
        if (e)
        {
@@ -99,8 +99,7 @@ static enumerator_t* create_peer_cfg_enumerator(private_medsrv_config_t *this,
                        peer_cfg = peer_cfg_create(
                                name, 2, this->ike->get_ref(this->ike),
                                me->clone(me), other->clone(other),
-                               CERT_NEVER_SEND, UNIQUE_REPLACE, CONF_AUTH_PUBKEY,
-                               0, 0,                                                   /* EAP method, vendor */
+                               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 */
@@ -136,9 +135,8 @@ medsrv_config_t *medsrv_config_create(database_t *db)
        this->public.destroy = (void(*)(medsrv_config_t*))destroy;
        
        this->db = db;
-       this->rekey = lib->settings->get_int(lib->settings,
-                                                                                "medmanager.rekey", 20) * 60;
-       this->dpd = lib->settings->get_int(lib->settings, "medmanager.dpd", 300);
+       this->rekey = lib->settings->get_time(lib->settings, "medsrv.rekey", 1200);
+       this->dpd = lib->settings->get_time(lib->settings, "medsrv.dpd", 300);
        this->ike = ike_cfg_create(FALSE, FALSE, "0.0.0.0", "0.0.0.0");
        this->ike->add_proposal(this->ike, proposal_create_default(PROTO_IKE));