GNOME Bugzilla – Bug 729671
[PATCH] support TTLS/MD5 and TTLS/GTC
Last modified: 2014-05-30 19:01:24 UTC
Created attachment 276019 [details] [review] eap-method-ttls.patch Allow the MD5 and GTC phase2 methods for TTLS.
Patch from Pali Rohár <pali.rohar@gmail.com>
Supplicant oddity here: most TTLS phase2 methods need to use "autheap" instead of "auth". This means that for the UI bits, whenever we have a TTLS Phase2 method in src/wireless-security/eap-method-simple.c, this code: if (parent->phase2) g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, eap, NULL); else nm_setting_802_1x_add_eap_method (s_8021x, eap); needs to instead set NM_SETTING_802_1X_PHASE2_AUTHEAP. I'll try to track down exactly *why* that should happen, and also to test this out to make sure that it's really what's required.
(In reply to comment #0) > Created an attachment (id=276019) [details] [review] > eap-method-ttls.patch > > Allow the MD5 and GTC phase2 methods for TTLS. I slightly dislike the use of strcasecmp, which is locale dependant. How about g_ascii_strcasecmp? -- yes, I know the existing code already uses strcasecmp. The patch looks good, and UI looks good to.
Looked into the auth vs. autheap thing and here's the deal. The only methods that are allowed for TTLS phase2="auth=XXXX" are MSCHAPV2, MSCHAP, PAP, and CHAP. All other TTLS phase2 methods should be given with phase2="autheap=XXXX", otherwise the supplicant will simply allow the server to determine which method to use, and ignore the user's request. So we need to adjust the code here to fill NM_SETTING_802_1X_PHASE2_AUTHEAP for MD5, PWD, GTC, and MSCHAPV2 when using EAP-TTLS, but fill NM_SETTING_802_1X_PHASE2_AUTH for all other methods when using EAP-TTLS. The existing patch will not set phase2="autheap=xxxx" for MD5 or GTC, and thus doesn't actually work correctly.
Created attachment 276544 [details] [review] 0001-libnm-gtk-add-support-for-TTLS-EAP-MD5-and-TTLS-EAP-.patch Updated patch which handles AUTH vs. AUTHEAP.
+static const EapType eap_table[EAP_METHOD_SIMPLE_TYPE_LAST] = { - { "pap", FALSE }, /* EAP_METHOD_SIMPLE_TYPE_PAP */ - { "mschap", FALSE }, /* EAP_METHOD_SIMPLE_TYPE_MSCHAP */ + [EAP_METHOD_SIMPLE_TYPE_PAP] = { "pap", FALSE }, + [EAP_METHOD_SIMPLE_TYPE_MSCHAP] = { "mschap", FALSE }, + if ((method->flags & EAP_METHOD_SIMPLE_FLAG_AUTHEAP_ALLOWED) && eap_type->autheap_allowed) + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTHEAP, eap_type->name, NULL); + else + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, eap_type->name, NULL); don't you want to set the other setting set to NULL, respectively? The rest looks good to me
Fixed up and pushed.