aboutsummaryrefslogtreecommitdiff
path: root/src/mm-bearer-mbim.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-bearer-mbim.c')
-rw-r--r--src/mm-bearer-mbim.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c
index 652f6825..8bf5d770 100644
--- a/src/mm-bearer-mbim.c
+++ b/src/mm-bearer-mbim.c
@@ -952,30 +952,12 @@ connect_context_step (GTask *task)
auth = MBIM_AUTH_PROTOCOL_NONE;
} else {
MMBearerAllowedAuth bearer_auth;
- bearer_auth = mm_bearer_properties_get_allowed_auth (ctx->properties);
- if (bearer_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
- mm_dbg ("Using default (PAP) authentication method");
- auth = MBIM_AUTH_PROTOCOL_PAP;
- } else if (bearer_auth & MM_BEARER_ALLOWED_AUTH_PAP) {
- auth = MBIM_AUTH_PROTOCOL_PAP;
- } else if (bearer_auth & MM_BEARER_ALLOWED_AUTH_CHAP) {
- auth = MBIM_AUTH_PROTOCOL_CHAP;
- } else if (bearer_auth & MM_BEARER_ALLOWED_AUTH_MSCHAPV2) {
- auth = MBIM_AUTH_PROTOCOL_MSCHAPV2;
- } else if (bearer_auth & MM_BEARER_ALLOWED_AUTH_NONE) {
- auth = MBIM_AUTH_PROTOCOL_NONE;
- } else {
- gchar *str;
- str = mm_bearer_allowed_auth_build_string_from_mask (bearer_auth);
- g_task_return_new_error (
- task,
- MM_CORE_ERROR,
- MM_CORE_ERROR_UNSUPPORTED,
- "Cannot use any of the specified authentication methods (%s)",
- str);
+ bearer_auth = mm_bearer_properties_get_allowed_auth (ctx->properties);
+ auth = mm_bearer_allowed_auth_to_mbim_auth_protocol (bearer_auth, &error);
+ if (error) {
+ g_task_return_error (task, error);
g_object_unref (task);
- g_free (str);
return;
}
}