mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
eap-gtc: added support for agent in gtc
Now, EAP-GTC behaves similar to MSCHAPv2 where check_settings allows for missing EAP-Identity and GTC-Secret fields. Either or both can be missing and the agent will request the missing fields.
This commit is contained in:
parent
2e08b3e129
commit
3d2285ec7e
@ -77,14 +77,33 @@ static int eap_gtc_check_settings(struct l_settings *settings,
|
|||||||
struct l_queue **out_missing)
|
struct l_queue **out_missing)
|
||||||
{
|
{
|
||||||
char setting[64];
|
char setting[64];
|
||||||
|
char setting2[64];
|
||||||
|
L_AUTO_FREE_VAR(char *, identity);
|
||||||
|
const struct eap_secret_info *secret;
|
||||||
|
|
||||||
snprintf(setting, sizeof(setting), "%sGTC-Secret", prefix);
|
snprintf(setting, sizeof(setting), "%sIdentity", prefix);
|
||||||
|
identity = l_settings_get_string(settings, "Security", setting);
|
||||||
|
|
||||||
if (!l_settings_get_value(settings, "Security", setting)) {
|
snprintf(setting2, sizeof(setting2), "%sGTC-Secret", prefix);
|
||||||
l_error("Property %s is missing", setting);
|
|
||||||
return -ENOENT;
|
/* no identity setting found */
|
||||||
|
if (!identity) {
|
||||||
|
secret = l_queue_find(secrets, eap_secret_info_match, setting);
|
||||||
|
|
||||||
|
/* no secret found either */
|
||||||
|
if (!secret)
|
||||||
|
eap_append_secret(out_missing, EAP_SECRET_REMOTE_USER_PASSWORD,
|
||||||
|
setting, setting2, NULL);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
secret = l_queue_find(secrets, eap_secret_info_match, setting2);
|
||||||
|
/* identity found, but secret missing */
|
||||||
|
if (!secret)
|
||||||
|
eap_append_secret(out_missing, EAP_SECRET_REMOTE_PASSWORD,
|
||||||
|
setting2, NULL, identity);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user