mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
eap: Allow methods to request the Identity from agent
In eap_check_settings move the check for the EAP-Identity setting so that the method's check_setting call back has a chance to request it from the agent. Note the check can be also moved to the EAP methods so that they are free to skip it if not NULL identity is ok.
This commit is contained in:
parent
b9aaab9c63
commit
1a465aed4a
27
src/eap.c
27
src/eap.c
@ -422,6 +422,7 @@ int eap_check_settings(struct l_settings *settings, struct l_queue *secrets,
|
|||||||
const char *method_name;
|
const char *method_name;
|
||||||
const struct l_queue_entry *entry;
|
const struct l_queue_entry *entry;
|
||||||
struct eap_method *method;
|
struct eap_method *method;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
snprintf(setting, sizeof(setting), "%sMethod", prefix);
|
snprintf(setting, sizeof(setting), "%sMethod", prefix);
|
||||||
method_name = l_settings_get_value(settings, "Security", setting);
|
method_name = l_settings_get_value(settings, "Security", setting);
|
||||||
@ -454,20 +455,32 @@ int eap_check_settings(struct l_settings *settings, struct l_queue *secrets,
|
|||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* method may not store identity in settings file */
|
if (method->check_settings)
|
||||||
if (!method->get_identity) {
|
ret = method->check_settings(settings, secrets,
|
||||||
|
prefix, out_missing);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Methods that provide the get_identity callback are responsible
|
||||||
|
* for ensuring, inside check_settings(), that they have enough data
|
||||||
|
* to return the identity after load_settings().
|
||||||
|
*/
|
||||||
|
if (method->get_identity)
|
||||||
|
return 0;
|
||||||
|
|
||||||
snprintf(setting, sizeof(setting), "%sIdentity", prefix);
|
snprintf(setting, sizeof(setting), "%sIdentity", prefix);
|
||||||
if (!l_settings_get_value(settings, "Security", setting)) {
|
if (!l_settings_get_value(settings, "Security", setting) &&
|
||||||
|
!l_queue_find(secrets, eap_secret_info_match,
|
||||||
|
setting) &&
|
||||||
|
!l_queue_find(*out_missing, eap_secret_info_match,
|
||||||
|
setting)) {
|
||||||
l_error("Property %s is missing", setting);
|
l_error("Property %s is missing", setting);
|
||||||
|
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!method->check_settings)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return method->check_settings(settings, secrets, prefix, out_missing);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool eap_load_settings(struct eap_state *eap, struct l_settings *settings,
|
bool eap_load_settings(struct eap_state *eap, struct l_settings *settings,
|
||||||
|
Loading…
Reference in New Issue
Block a user