ported parts of two-sim branch

eap_identity parameter to exchange in eap_identity
	some auth_info/peer_cfg refactorings
	fixed some bugs, introduced new ones
This commit is contained in:
Martin Willi
2008-08-22 10:44:51 +00:00
parent 7c112a12c0
commit 822901061b
40 changed files with 676 additions and 253 deletions
+18 -11
View File
@@ -827,20 +827,27 @@ static void load_secrets(private_stroke_cred_t *this)
{
continue;
}
/* NULL terminate the ID string */
*(id.ptr + id.len) = '\0';
peer_id = identification_create_from_string(id.ptr);
if (peer_id == NULL)
if (type == SHARED_EAP)
{
DBG1(DBG_CFG, "line %d: malformed ID: %s", line_nr, id.ptr);
goto error;
/* we use a special EAP identity type for EAP secrets */
peer_id = identification_create_from_encoding(ID_EAP, id);
}
if (peer_id->get_type(peer_id) == ID_ANY)
else
{
peer_id->destroy(peer_id);
continue;
/* NULL terminate the ID string */
*(id.ptr + id.len) = '\0';
peer_id = identification_create_from_string(id.ptr);
if (peer_id == NULL)
{
DBG1(DBG_CFG, "line %d: malformed ID: %s", line_nr, id.ptr);
goto error;
}
if (peer_id->get_type(peer_id) == ID_ANY)
{
peer_id->destroy(peer_id);
continue;
}
}
shared_key->add_owner(shared_key, peer_id);