added mediation server web frontend
updated charons medsrv plugin to updated database scheme
This commit is contained in:
@@ -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)
|
||||
{
|
||||
@@ -137,8 +137,8 @@ medsrv_config_t *medsrv_config_create(database_t *db)
|
||||
|
||||
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);
|
||||
"medsrv.rekey", 20) * 60;
|
||||
this->dpd = lib->settings->get_int(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));
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ static enumerator_t* create_cert_enumerator(private_medsrv_creds_t *this,
|
||||
e->public.enumerate = (void*)cert_enumerator_enumerate;
|
||||
e->public.destroy = (void*)cert_enumerator_destroy;
|
||||
e->inner = this->db->query(this->db,
|
||||
"SELECT PublicKey FROM Peer WHERE KeyId = ?",
|
||||
"SELECT public_key FROM peer WHERE keyid = ?",
|
||||
DB_BLOB, id->get_encoding(id),
|
||||
DB_BLOB);
|
||||
if (!e->inner)
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `Peer` (
|
||||
`IdPeer` int(10) unsigned NOT NULL auto_increment,
|
||||
`IdUser` int(10) unsigned NOT NULL,
|
||||
`Alias` varchar(30) collate utf8_unicode_ci NOT NULL,
|
||||
`KeyId` varbinary(20) NOT NULL,
|
||||
`PublicKey` blob NOT NULL,
|
||||
PRIMARY KEY (`IdPeer`),
|
||||
KEY `KeyId` (`KeyId`),
|
||||
KEY `IdUser` (`IdUser`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
CREATE TABLE IF NOT EXISTS `peer` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`user` int(10) unsigned NOT NULL,
|
||||
`alias` varchar(30) NOT NULL,
|
||||
`keyid` varbinary(20) NOT NULL,
|
||||
`public_key` blob,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY (`user`,`alias`),
|
||||
UNIQUE KEY (`keyid`),
|
||||
KEY `user` (`user`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `user` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`login` varchar(30) NOT NULL,
|
||||
`password` varbinary(20) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY (`login`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user