* [PATCH 0/3] Provision the PPP authentication method from mbpi
@ 2014-06-24 9:57 Philip Paeps
2014-06-24 9:57 ` [PATCH 1/3] include: add auth method to the provisioning API Philip Paeps
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Philip Paeps @ 2014-06-24 9:57 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 981 bytes --]
My patch to the mobile-broadband-provider-info database DTD to add an
attribute indicating the authentication method to use was accepted by
the maintainers[1] and merged in their tree[2].
This set of patches adds support for the new attribute in the mbpi
plugin so new GPRS contexts can be correctly provisioned. If the
authentication method is unspecified in the mbpi database we default
to CHAP (i.e.: previous behaviour).
[1] https://bugzilla.gnome.org/show_bug.cgi?id=731907
[2] https://git.gnome.org/browse/mobile-broadband-provider-info/commit/?id=752ccc5cdb34f427eefc26513a4c8e359883298f
Philip Paeps (3):
include: add auth method to the provisioning API
mbpi: add support for provisioning the auth method
gprs: provision the authentication method
include/gprs-provision.h | 1 +
plugins/mbpi.c | 35 +++++++++++++++++++++++++++++++++++
src/gprs.c | 2 ++
3 files changed, 38 insertions(+)
--
1.7.10.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] include: add auth method to the provisioning API
2014-06-24 9:57 [PATCH 0/3] Provision the PPP authentication method from mbpi Philip Paeps
@ 2014-06-24 9:57 ` Philip Paeps
2014-06-24 9:57 ` [PATCH 2/3] mbpi: add support for provisioning the auth method Philip Paeps
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Philip Paeps @ 2014-06-24 9:57 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]
---
include/gprs-provision.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/gprs-provision.h b/include/gprs-provision.h
index e9eec61..2dd792b 100644
--- a/include/gprs-provision.h
+++ b/include/gprs-provision.h
@@ -35,6 +35,7 @@ struct ofono_gprs_provision_data {
char *apn;
char *username;
char *password;
+ enum ofono_gprs_auth_method auth_method;
char *message_proxy;
char *message_center;
};
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] mbpi: add support for provisioning the auth method
2014-06-24 9:57 [PATCH 0/3] Provision the PPP authentication method from mbpi Philip Paeps
2014-06-24 9:57 ` [PATCH 1/3] include: add auth method to the provisioning API Philip Paeps
@ 2014-06-24 9:57 ` Philip Paeps
2014-06-24 9:57 ` [PATCH 3/3] gprs: provision the authentication method Philip Paeps
2014-06-24 17:49 ` [PATCH 0/3] Provision the PPP authentication method from mbpi Denis Kenzior
3 siblings, 0 replies; 5+ messages in thread
From: Philip Paeps @ 2014-06-24 9:57 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2425 bytes --]
Use the authentication method from the mobile-broadband-provider-info
database if it is specified and supported (we support CHAP and PAP).
Default to CHAP if the database does not specify a method (i.e.: the
previous behaviour).
---
plugins/mbpi.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/plugins/mbpi.c b/plugins/mbpi.c
index dff8752..ae92c76 100644
--- a/plugins/mbpi.c
+++ b/plugins/mbpi.c
@@ -128,6 +128,37 @@ static const GMarkupParser text_parser = {
NULL,
};
+static void authentication_start(GMarkupParseContext *context,
+ const gchar **attribute_names,
+ const gchar **attribute_values,
+ enum ofono_gprs_auth_method *auth_method,
+ GError **error)
+{
+ const char *text = NULL;
+ int i;
+
+ for (i = 0; attribute_names[i]; i++)
+ if (g_str_equal(attribute_names[i], "method") == TRUE)
+ text = attribute_values[i];
+
+ if (text == NULL) {
+ mbpi_g_set_error(context, error, G_MARKUP_ERROR,
+ G_MARKUP_ERROR_MISSING_ATTRIBUTE,
+ "Missing attribute: method");
+ return;
+ }
+
+ if (strcmp(text, "chap") == 0)
+ *auth_method = OFONO_GPRS_AUTH_METHOD_CHAP;
+ else if (strcmp(text, "pap") == 0)
+ *auth_method = OFONO_GPRS_AUTH_METHOD_PAP;
+ else
+ mbpi_g_set_error(context, error, G_MARKUP_ERROR,
+ G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
+ "Unknown authentication method: %s",
+ text);
+}
+
static void usage_start(GMarkupParseContext *context,
const gchar **attribute_names,
const gchar **attribute_values,
@@ -174,6 +205,9 @@ static void apn_start(GMarkupParseContext *context, const gchar *element_name,
else if (g_str_equal(element_name, "password"))
g_markup_parse_context_push(context, &text_parser,
&apn->password);
+ else if (g_str_equal(element_name, "authentication"))
+ authentication_start(context, attribute_names,
+ attribute_values, &apn->auth_method, error);
else if (g_str_equal(element_name, "mmsc"))
g_markup_parse_context_push(context, &text_parser,
&apn->message_center);
@@ -291,6 +325,7 @@ 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;
+ ap->auth_method = OFONO_GPRS_AUTH_METHOD_CHAP;
g_markup_parse_context_push(context, &apn_parser, ap);
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] gprs: provision the authentication method
2014-06-24 9:57 [PATCH 0/3] Provision the PPP authentication method from mbpi Philip Paeps
2014-06-24 9:57 ` [PATCH 1/3] include: add auth method to the provisioning API Philip Paeps
2014-06-24 9:57 ` [PATCH 2/3] mbpi: add support for provisioning the auth method Philip Paeps
@ 2014-06-24 9:57 ` Philip Paeps
2014-06-24 17:49 ` [PATCH 0/3] Provision the PPP authentication method from mbpi Denis Kenzior
3 siblings, 0 replies; 5+ messages in thread
From: Philip Paeps @ 2014-06-24 9:57 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 506 bytes --]
---
src/gprs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gprs.c b/src/gprs.c
index 1efcc0c..05ab499 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -3030,6 +3030,8 @@ static void provision_context(const struct ofono_gprs_provision_data *ap,
if (ap->password != NULL)
strcpy(context->context.password, ap->password);
+ context->context.auth_method = ap->auth_method;
+
strcpy(context->context.apn, ap->apn);
context->context.proto = ap->proto;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] Provision the PPP authentication method from mbpi
2014-06-24 9:57 [PATCH 0/3] Provision the PPP authentication method from mbpi Philip Paeps
` (2 preceding siblings ...)
2014-06-24 9:57 ` [PATCH 3/3] gprs: provision the authentication method Philip Paeps
@ 2014-06-24 17:49 ` Denis Kenzior
3 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2014-06-24 17:49 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]
Hi Philip,
On 06/24/2014 04:57 AM, Philip Paeps wrote:
> My patch to the mobile-broadband-provider-info database DTD to add an
> attribute indicating the authentication method to use was accepted by
> the maintainers[1] and merged in their tree[2].
>
> This set of patches adds support for the new attribute in the mbpi
> plugin so new GPRS contexts can be correctly provisioned. If the
> authentication method is unspecified in the mbpi database we default
> to CHAP (i.e.: previous behaviour).
>
> [1] https://bugzilla.gnome.org/show_bug.cgi?id=731907
> [2] https://git.gnome.org/browse/mobile-broadband-provider-info/commit/?id=752ccc5cdb34f427eefc26513a4c8e359883298f
>
> Philip Paeps (3):
> include: add auth method to the provisioning API
> mbpi: add support for provisioning the auth method
> gprs: provision the authentication method
>
> include/gprs-provision.h | 1 +
> plugins/mbpi.c | 35 +++++++++++++++++++++++++++++++++++
> src/gprs.c | 2 ++
> 3 files changed, 38 insertions(+)
>
All patches in this series have been pushed upstream, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-24 17:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24 9:57 [PATCH 0/3] Provision the PPP authentication method from mbpi Philip Paeps
2014-06-24 9:57 ` [PATCH 1/3] include: add auth method to the provisioning API Philip Paeps
2014-06-24 9:57 ` [PATCH 2/3] mbpi: add support for provisioning the auth method Philip Paeps
2014-06-24 9:57 ` [PATCH 3/3] gprs: provision the authentication method Philip Paeps
2014-06-24 17:49 ` [PATCH 0/3] Provision the PPP authentication method from mbpi Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.