Skip to contentSkip to conversation

gatchat: support for auth NONE

PATCH In review Giacinto Cifelli 2 participants 3 messages Oct 3, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 5/6 gatchat: support for auth NONE

Added authentication method G_AT_PPP_AUTH_METHOD_NONE and its handling.

---
 gatchat/gatppp.c  | 3 ++-
 gatchat/gatppp.h  | 1 +
 gatchat/ppp_lcp.c | 3 +++
 3 files changed, 6 insertions(+), 1 deletion(-)
gatchat/gatppp.c +2 -1
index 4a80b4b3..141e2746 100644
@@ -615,7 +615,8 @@ const char *g_at_ppp_get_password(GAtPPP *ppp)
 gboolean g_at_ppp_set_auth_method(GAtPPP *ppp, GAtPPPAuthMethod method)
 {
 	if (method != G_AT_PPP_AUTH_METHOD_CHAP &&
-					method != G_AT_PPP_AUTH_METHOD_PAP)
+					method != G_AT_PPP_AUTH_METHOD_PAP &&
+					method != G_AT_PPP_AUTH_METHOD_NONE)
 		return FALSE;
 
 	ppp->auth_method = method;
gatchat/gatppp.h +1 -0
index 213f7e90..dd203c28 100644
@@ -46,6 +46,7 @@ typedef enum _GAtPPPDisconnectReason {
 typedef enum _GAtPPPAuthMethod {
 	G_AT_PPP_AUTH_METHOD_CHAP,
 	G_AT_PPP_AUTH_METHOD_PAP,
+	G_AT_PPP_AUTH_METHOD_NONE,
 } GAtPPPAuthMethod;
 
 typedef void (*GAtPPPConnectFunc)(const char *iface, const char *local,
gatchat/ppp_lcp.c +3 -0
index df9cd0ef..3fe38217 100644
@@ -279,6 +279,9 @@ static enum rcr_result lcp_rcr(struct pppcp_data *pppcp,
 				*new_len = 4;
 
 				return RCR_NAK;
+
+			case G_AT_PPP_AUTH_METHOD_NONE:
+				return RCR_REJECT;
 			}
 			break;
 		}
Signature · 1 line
2.17.1
#1 lore raw
Quoted 7 lines · Giacinto Cifelli

Added authentication method G_AT_PPP_AUTH_METHOD_NONE and its handling.

---
  gatchat/gatppp.c  | 3 ++-
  gatchat/gatppp.h  | 1 +
  gatchat/ppp_lcp.c | 3 +++
  3 files changed, 6 insertions(+), 1 deletion(-)

I went ahead and applied this one. I'll look at the other 5 patches again soon.

Regards,
-Denis

#2 lore raw

Hi Denis,

Quoted 10 lines · Denis Kenzior
Quoted 7 lines · Giacinto Cifelli

Added authentication method G_AT_PPP_AUTH_METHOD_NONE and its handling.

---
  gatchat/gatppp.c  | 3 ++-
  gatchat/gatppp.h  | 1 +
  gatchat/ppp_lcp.c | 3 +++
  3 files changed, 6 insertions(+), 1 deletion(-)
Quoted 2 lines

I went ahead and applied this one. I'll look at the other 5 patches again soon.

thank you, I'll look forward to it.

Quoted 4 lines

Regards,
-Denis

Regards,
Giacinto