After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 729671 - [PATCH] support TTLS/MD5 and TTLS/GTC
[PATCH] support TTLS/MD5 and TTLS/GTC
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nm-applet
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-05-06 18:53 UTC by Dan Williams
Modified: 2014-05-30 19:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eap-method-ttls.patch (2.02 KB, patch)
2014-05-06 18:53 UTC, Dan Williams
none Details | Review
0001-libnm-gtk-add-support-for-TTLS-EAP-MD5-and-TTLS-EAP-.patch (25.21 KB, patch)
2014-05-14 16:32 UTC, Dan Williams
none Details | Review

Description Dan Williams 2014-05-06 18:53:50 UTC
Created attachment 276019 [details] [review]
eap-method-ttls.patch

Allow the MD5 and GTC phase2 methods for TTLS.
Comment 1 Dan Williams 2014-05-06 18:54:20 UTC
Patch from Pali Rohár <pali.rohar@gmail.com>
Comment 2 Dan Williams 2014-05-06 18:57:20 UTC
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.
Comment 3 Thomas Haller 2014-05-13 11:53:03 UTC
(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.
Comment 4 Dan Williams 2014-05-13 23:05:37 UTC
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.
Comment 5 Dan Williams 2014-05-14 16:32:06 UTC
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.
Comment 6 Thomas Haller 2014-05-23 11:34:46 UTC
+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
Comment 7 Dan Williams 2014-05-30 19:01:16 UTC
Fixed up and pushed.