Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH] eap-gtc: Try to auth even if request not Password
@ 2019-12-11 12:39 xdavidwu
  2019-12-11 20:57 ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: xdavidwu @ 2019-12-11 12:39 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

There are some server implementations that send requests that are
not "Password" but still want us send password. This commit modify
the behavior to send a warning and still try to auth with password.

This makes me able to auth with server in my school which sends
"Enter Aruba Login".

wpa_supplicant does not check if it is "Password".
---
 src/eap-gtc.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/eap-gtc.c b/src/eap-gtc.c
index 9302257e..7788d44c 100644
--- a/src/eap-gtc.c
+++ b/src/eap-gtc.c
@@ -56,11 +56,9 @@ static void eap_gtc_handle_request(struct eap_state *eap,
 	size_t secret_len = strlen(gtc->password);
 	uint8_t response[5 + secret_len];
 
-	if (len < 8)
-		goto error;
-
-	if (strncmp((const char *)pkt, "Password", 8))
-		goto error;
+	if (len < 8 || strncmp((const char *)pkt, "Password", 8))
+		l_warn("GTC request not understood, proceeding anyway: %.*s",
+				(int) len, (const char *) pkt);
 
 	memcpy(response + 5, gtc->password, secret_len);
 
@@ -69,10 +67,6 @@ static void eap_gtc_handle_request(struct eap_state *eap,
 	eap_method_success(eap);
 
 	return;
-
-error:
-	l_error("invalid GTC request");
-	eap_method_error(eap);
 }
 
 static int eap_gtc_check_settings(struct l_settings *settings,
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] eap-gtc: Try to auth even if request not Password
  2019-12-11 12:39 [PATCH] eap-gtc: Try to auth even if request not Password xdavidwu
@ 2019-12-11 20:57 ` Denis Kenzior
  2019-12-12  1:23   ` Pinghao Wu
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Kenzior @ 2019-12-11 20:57 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

Hi,

On 12/11/19 6:39 AM, xdavidwu wrote:
> There are some server implementations that send requests that are
> not "Password" but still want us send password. This commit modify
> the behavior to send a warning and still try to auth with password.
> 
> This makes me able to auth with server in my school which sends
> "Enter Aruba Login".
> 
> wpa_supplicant does not check if it is "Password".
> ---
>   src/eap-gtc.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
>

Thanks for the patch.  Looks good.  Any chance you can resubmit with 
your real name as the author info so I can apply this?  While we don't 
use Signed-off-by, our expectation for submissions are similar to [1], 
including the real name requirement.

[1] 
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1

Regards,
-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] eap-gtc: Try to auth even if request not Password
  2019-12-11 20:57 ` Denis Kenzior
@ 2019-12-12  1:23   ` Pinghao Wu
  2019-12-12 16:24     ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Pinghao Wu @ 2019-12-12  1:23 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

There are some server implementations that send requests that are
not "Password" but still want us send password. This commit modify
the behavior to send a warning and still try to auth with password.

This makes me able to auth with server in my school which sends
"Enter Aruba Login".

wpa_supplicant does not check if it is "Password".
---
 src/eap-gtc.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/eap-gtc.c b/src/eap-gtc.c
index 9302257e..7788d44c 100644
--- a/src/eap-gtc.c
+++ b/src/eap-gtc.c
@@ -56,11 +56,9 @@ static void eap_gtc_handle_request(struct eap_state *eap,
 	size_t secret_len = strlen(gtc->password);
 	uint8_t response[5 + secret_len];
 
-	if (len < 8)
-		goto error;
-
-	if (strncmp((const char *)pkt, "Password", 8))
-		goto error;
+	if (len < 8 || strncmp((const char *)pkt, "Password", 8))
+		l_warn("GTC request not understood, proceeding anyway: %.*s",
+				(int) len, (const char *) pkt);
 
 	memcpy(response + 5, gtc->password, secret_len);
 
@@ -69,10 +67,6 @@ static void eap_gtc_handle_request(struct eap_state *eap,
 	eap_method_success(eap);
 
 	return;
-
-error:
-	l_error("invalid GTC request");
-	eap_method_error(eap);
 }
 
 static int eap_gtc_check_settings(struct l_settings *settings,
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] eap-gtc: Try to auth even if request not Password
  2019-12-12  1:23   ` Pinghao Wu
@ 2019-12-12 16:24     ` Denis Kenzior
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2019-12-12 16:24 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

Hi Pinghao,

On 12/11/19 7:23 PM, Pinghao Wu wrote:
> There are some server implementations that send requests that are
> not "Password" but still want us send password. This commit modify
> the behavior to send a warning and still try to auth with password.
> 
> This makes me able to auth with server in my school which sends
> "Enter Aruba Login".
> 
> wpa_supplicant does not check if it is "Password".
> ---
>   src/eap-gtc.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-12 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-11 12:39 [PATCH] eap-gtc: Try to auth even if request not Password xdavidwu
2019-12-11 20:57 ` Denis Kenzior
2019-12-12  1:23   ` Pinghao Wu
2019-12-12 16:24     ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox