merged multi-auth branch back into trunk
This commit is contained in:
@@ -401,11 +401,6 @@ static enumerator_t *create_lease_query(char *filter)
|
||||
{
|
||||
id = identification_create_from_string(value);
|
||||
}
|
||||
if (!id)
|
||||
{
|
||||
fprintf(stderr, "invalid 'id' in filter string.\n");
|
||||
exit(-1);
|
||||
}
|
||||
break;
|
||||
case FIL_ADDR:
|
||||
if (value)
|
||||
|
||||
@@ -179,7 +179,7 @@ static host_t *get_address(private_sql_attribute_t *this, char *name,
|
||||
*/
|
||||
static host_t* acquire_address(private_sql_attribute_t *this,
|
||||
char *name, identification_t *id,
|
||||
auth_info_t *auth, host_t *requested)
|
||||
host_t *requested)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
u_int pool, timeout, identity;
|
||||
@@ -263,7 +263,7 @@ sql_attribute_t *sql_attribute_create(database_t *db)
|
||||
private_sql_attribute_t *this = malloc_thing(private_sql_attribute_t);
|
||||
time_t now = time(NULL);
|
||||
|
||||
this->public.provider.acquire_address = (host_t*(*)(attribute_provider_t *this, char*, identification_t *,auth_info_t *, host_t *))acquire_address;
|
||||
this->public.provider.acquire_address = (host_t*(*)(attribute_provider_t *this, char*, identification_t *, host_t *))acquire_address;
|
||||
this->public.provider.release_address = (bool(*)(attribute_provider_t *this, char*,host_t *, identification_t*))release_address;
|
||||
this->public.destroy = (void(*)(sql_attribute_t*))destroy;
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e,
|
||||
peer_cfg_t *peer_cfg, *mediated_cfg;
|
||||
ike_cfg_t *ike;
|
||||
host_t *vip = NULL;
|
||||
auth_info_t *auth;
|
||||
auth_cfg_t *auth;
|
||||
|
||||
local_id = identification_create_from_encoding(l_type, l_data);
|
||||
remote_id = identification_create_from_encoding(r_type, r_data);
|
||||
@@ -291,20 +291,26 @@ static peer_cfg_t *build_peer_cfg(private_sql_config_t *this, enumerator_t *e,
|
||||
if (ike)
|
||||
{
|
||||
peer_cfg = peer_cfg_create(
|
||||
name, 2, ike, local_id, remote_id, cert_policy, uniqueid,
|
||||
name, 2, ike, cert_policy, uniqueid,
|
||||
keyingtries, rekeytime, reauthtime, jitter, overtime,
|
||||
mobike, dpd_delay, vip, pool,
|
||||
mediation, mediated_cfg, peer_id);
|
||||
auth = peer_cfg->get_auth(peer_cfg);
|
||||
auth->add_item(auth, AUTHN_AUTH_CLASS, &auth_method);
|
||||
auth = auth_cfg_create();
|
||||
auth->add(auth, AUTH_RULE_AUTH_CLASS, auth_method);
|
||||
auth->add(auth, AUTH_RULE_IDENTITY, local_id->clone(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));
|
||||
if (eap_type)
|
||||
{
|
||||
auth->add_item(auth, AUTHN_EAP_TYPE, &eap_type);
|
||||
auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_EAP);
|
||||
auth->add(auth, AUTH_RULE_EAP_TYPE, eap_type);
|
||||
if (eap_vendor)
|
||||
{
|
||||
auth->add_item(auth, AUTHN_EAP_VENDOR, &eap_vendor);
|
||||
auth->add(auth, AUTH_RULE_EAP_VENDOR, eap_vendor);
|
||||
}
|
||||
}
|
||||
peer_cfg->add_auth_cfg(peer_cfg, auth, FALSE);
|
||||
add_child_cfgs(this, peer_cfg, id);
|
||||
return peer_cfg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user