diff options
author | Giacinto Cifelli <gciofono@gmail.com> | 2018-10-06 07:45:19 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2018-10-09 10:44:17 -0500 |
commit | a5bdf48ca7be70a9b33a47dae0ea03bf842efdd2 (patch) | |
tree | 0536b4356501da72ba8eb9ccfe391d2f3a3cd420 /plugins/mbpi.c | |
parent | a5aa268747ce6d7180fb62c46ecbac5824f46b3b (diff) | |
download | ofono-a5bdf48ca7be70a9b33a47dae0ea03bf842efdd2.tar.gz |
mbpi: support for auth NONE
support of 'none' in mbpi:
the default method remains CHAP, but it is overridden by NONE after
parsing the entire key for the apn and detecting no username/password
Diffstat (limited to 'plugins/mbpi.c')
-rw-r--r-- | plugins/mbpi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mbpi.c b/plugins/mbpi.c index ae92c762..433f1b55 100644 --- a/plugins/mbpi.c +++ b/plugins/mbpi.c @@ -325,6 +325,8 @@ static void apn_handler(GMarkupParseContext *context, struct gsm_data *gsm, ap->apn = g_strdup(apn); ap->type = OFONO_GPRS_CONTEXT_TYPE_INTERNET; ap->proto = OFONO_GPRS_PROTO_IP; + + /* pre-select default authentication method */ ap->auth_method = OFONO_GPRS_AUTH_METHOD_CHAP; g_markup_parse_context_push(context, &apn_parser, ap); @@ -395,6 +397,10 @@ static void gsm_end(GMarkupParseContext *context, const gchar *element_name, if (ap == NULL) return; + /* select authentication method NONE if fit */ + if (!ap->username || !ap->password) + ap->auth_method = OFONO_GPRS_AUTH_METHOD_NONE; + if (gsm->allow_duplicates == FALSE) { GSList *l; |