mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
eap: new method API for getting EAP-Identity
EAP-SIM/AKA/AKA' retrieve the EAP-Identity off the SIM card not from the settings file. This adds a new EAP method API which can optionally be implemented to retrieve the identity. If get_identity is implemented, the EAP layer will use it to retrieve the identity rather than looking in the settings file.
This commit is contained in:
parent
ec0aab7829
commit
c0fe2b78c4
16
src/eap.c
16
src/eap.c
@ -369,21 +369,25 @@ bool eap_load_settings(struct eap_state *eap, struct l_settings *settings,
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (eap->method->load_settings)
|
||||
if (!eap->method->load_settings(eap, settings, prefix))
|
||||
goto err;
|
||||
|
||||
/* get identity from settings or from EAP method */
|
||||
if (!eap->method->get_identity) {
|
||||
snprintf(setting, sizeof(setting), "%sIdentity", prefix);
|
||||
eap->identity = l_strdup(l_settings_get_value(settings,
|
||||
"Security", setting));
|
||||
} else {
|
||||
eap->identity = l_strdup(eap->method->get_identity(eap));
|
||||
}
|
||||
|
||||
if (!eap->identity) {
|
||||
l_error("EAP Identity is missing");
|
||||
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!eap->method->load_settings)
|
||||
return true;
|
||||
|
||||
if (!eap->method->load_settings(eap, settings, prefix))
|
||||
goto err;
|
||||
|
||||
return true;
|
||||
|
||||
err:
|
||||
|
Loading…
Reference in New Issue
Block a user