aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacinto Cifelli <gciofono@gmail.com>2020-07-22 06:58:22 +0200
committerGiacinto Cifelli <gciofono@gmail.com>2020-07-24 16:34:40 +0200
commit4d58278d7ffd65375e93b0da85ca88c08cba96c2 (patch)
treebe5ebc57d133707809473a9d055761ef5dbc04b5
parentc70b3557184fdf1472ff0cb36e9fd937cc7f9024 (diff)
changed default authentication algorithm to CHAP
CHAP is almost universal nowadays, and so it is a better default than PAP Not changed for uBlox, that prefers an error if not specified, and for Huawei, which uses NONE with user/pwd and has 2 CHAP choices
-rw-r--r--plugins/cinterion/mm-broadband-bearer-cinterion.c6
-rw-r--r--plugins/huawei/mm-broadband-bearer-huawei.c12
-rw-r--r--plugins/icera/mm-broadband-bearer-icera.c10
-rw-r--r--plugins/option/mm-broadband-bearer-hso.c10
-rw-r--r--plugins/sierra/mm-broadband-bearer-sierra.c10
-rw-r--r--plugins/ublox/mm-broadband-bearer-ublox.c4
-rw-r--r--src/mm-bearer-qmi.c6
-rw-r--r--src/mm-modem-helpers-mbim.c8
8 files changed, 33 insertions, 33 deletions
diff --git a/plugins/cinterion/mm-broadband-bearer-cinterion.c b/plugins/cinterion/mm-broadband-bearer-cinterion.c
index b3b1d240..676bbbd9 100644
--- a/plugins/cinterion/mm-broadband-bearer-cinterion.c
+++ b/plugins/cinterion/mm-broadband-bearer-cinterion.c
@@ -233,9 +233,9 @@ build_auth_string (MMBroadbandBearerCinterion *self,
if (!has_user && !has_passwd)
return NULL;
- /* If user/passwd given, default to PAP */
- mm_obj_dbg (self, "APN user/password given but no authentication type explicitly requested: defaulting to 'PAP'");
- encoded_auth = BEARER_CINTERION_AUTH_PAP;
+ /* If user/passwd given, default to CHAP (more common than PAP) */
+ mm_obj_dbg (self, "APN user/password given but no authentication type explicitly requested: defaulting to 'CHAP'");
+ encoded_auth = BEARER_CINTERION_AUTH_CHAP;
}
quoted_user = mm_port_serial_at_quote_string (user ? user : "");
diff --git a/plugins/huawei/mm-broadband-bearer-huawei.c b/plugins/huawei/mm-broadband-bearer-huawei.c
index ca20c655..6548ae7f 100644
--- a/plugins/huawei/mm-broadband-bearer-huawei.c
+++ b/plugins/huawei/mm-broadband-bearer-huawei.c
@@ -391,17 +391,17 @@ connect_3gpp_context_step (GTask *task)
if (!user && !passwd)
command = g_strdup_printf ("AT^NDISDUP=1,1,\"%s\"",
apn == NULL ? "" : apn);
- else if (encoded_auth == MM_BEARER_HUAWEI_AUTH_NONE)
- command = g_strdup_printf ("AT^NDISDUP=1,1,\"%s\",\"%s\",\"%s\"",
- apn == NULL ? "" : apn,
- user == NULL ? "" : user,
- passwd == NULL ? "" : passwd);
- else
+ else {
+ if (encoded_auth == MM_BEARER_HUAWEI_AUTH_NONE) {
+ encoded_auth = MM_BEARER_HUAWEI_AUTH_CHAP;
+ mm_obj_dbg (self, "using default (CHAP) authentication method");
+ }
command = g_strdup_printf ("AT^NDISDUP=1,1,\"%s\",\"%s\",\"%s\",%d",
apn == NULL ? "" : apn,
user == NULL ? "" : user,
passwd == NULL ? "" : passwd,
encoded_auth);
+ }
mm_base_modem_at_command_full (ctx->modem,
ctx->primary,
diff --git a/plugins/icera/mm-broadband-bearer-icera.c b/plugins/icera/mm-broadband-bearer-icera.c
index 48bcf49a..caa8567f 100644
--- a/plugins/icera/mm-broadband-bearer-icera.c
+++ b/plugins/icera/mm-broadband-bearer-icera.c
@@ -734,14 +734,14 @@ authenticate (GTask *task)
guint icera_auth;
if (allowed_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
- mm_obj_dbg (self, "using default (PAP) authentication method");
- icera_auth = 1;
- } else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_PAP) {
- mm_obj_dbg (self, "using PAP authentication method");
- icera_auth = 1;
+ mm_obj_dbg (self, "using default (CHAP) authentication method");
+ icera_auth = 2;
} else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_CHAP) {
mm_obj_dbg (self, "using CHAP authentication method");
icera_auth = 2;
+ } else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_PAP) {
+ mm_obj_dbg (self, "using PAP authentication method");
+ icera_auth = 1;
} else {
gchar *str;
diff --git a/plugins/option/mm-broadband-bearer-hso.c b/plugins/option/mm-broadband-bearer-hso.c
index 3ca5cd77..a5702c01 100644
--- a/plugins/option/mm-broadband-bearer-hso.c
+++ b/plugins/option/mm-broadband-bearer-hso.c
@@ -526,14 +526,14 @@ authenticate (GTask *task)
guint hso_auth;
if (allowed_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
- mm_obj_dbg (self, "using default (PAP) authentication method");
- hso_auth = 1;
- } else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_PAP) {
- mm_obj_dbg (self, "using PAP authentication method");
- hso_auth = 1;
+ mm_obj_dbg (self, "using default (CHAP) authentication method");
+ hso_auth = 2;
} else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_CHAP) {
mm_obj_dbg (self, "using CHAP authentication method");
hso_auth = 2;
+ } else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_PAP) {
+ mm_obj_dbg (self, "using PAP authentication method");
+ hso_auth = 1;
} else {
gchar *str;
diff --git a/plugins/sierra/mm-broadband-bearer-sierra.c b/plugins/sierra/mm-broadband-bearer-sierra.c
index 24bde739..db9fdead 100644
--- a/plugins/sierra/mm-broadband-bearer-sierra.c
+++ b/plugins/sierra/mm-broadband-bearer-sierra.c
@@ -338,14 +338,14 @@ dial_3gpp_context_step (GTask *task)
guint sierra_auth;
if (allowed_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
- mm_obj_dbg (self, "using default (PAP) authentication method");
- sierra_auth = 1;
- } else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_PAP) {
- mm_obj_dbg (self, "using PAP authentication method");
- sierra_auth = 1;
+ mm_obj_dbg (self, "using default (CHAP) authentication method");
+ sierra_auth = 2;
} else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_CHAP) {
mm_obj_dbg (self, "using CHAP authentication method");
sierra_auth = 2;
+ } else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_PAP) {
+ mm_obj_dbg (self, "using PAP authentication method");
+ sierra_auth = 1;
} else {
gchar *str;
diff --git a/plugins/ublox/mm-broadband-bearer-ublox.c b/plugins/ublox/mm-broadband-bearer-ublox.c
index 1e2ea4d5..1b209841 100644
--- a/plugins/ublox/mm-broadband-bearer-ublox.c
+++ b/plugins/ublox/mm-broadband-bearer-ublox.c
@@ -498,10 +498,10 @@ authenticate_3gpp (GTask *task)
mm_obj_dbg (self, "using automatic authentication method");
if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_AUTO)
ublox_auth = 3;
- else if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_PAP)
- ublox_auth = 1;
else if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_CHAP)
ublox_auth = 2;
+ else if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_PAP)
+ ublox_auth = 1;
else if (self->priv->allowed_auths & MM_UBLOX_BEARER_ALLOWED_AUTH_NONE)
ublox_auth = 0;
} else if (allowed_auth & MM_BEARER_ALLOWED_AUTH_PAP) {
diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c
index 1afb6c25..91cb71d9 100644
--- a/src/mm-bearer-qmi.c
+++ b/src/mm-bearer-qmi.c
@@ -636,10 +636,10 @@ build_start_network_input (ConnectContext *ctx)
/* Need to add auth info? */
if (has_user || has_password || ctx->auth != QMI_WDS_AUTHENTICATION_NONE) {
/* We define a valid auth preference if we have either user or password, or an explicit
- * request for one to be set. If no explicit one was given, default to PAP. */
+ * request for one to be set. If no explicit one was given, default to CHAP. */
qmi_message_wds_start_network_input_set_authentication_preference (
input,
- (ctx->auth != QMI_WDS_AUTHENTICATION_NONE) ? ctx->auth : QMI_WDS_AUTHENTICATION_PAP,
+ (ctx->auth != QMI_WDS_AUTHENTICATION_NONE) ? ctx->auth : QMI_WDS_AUTHENTICATION_CHAP,
NULL);
if (has_user)
@@ -1740,7 +1740,7 @@ _connect (MMBaseBearer *_self,
g_object_unref (properties);
if (auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
- /* We'll default to PAP later if needed */
+ /* We'll default to CHAP later if needed */
ctx->auth = QMI_WDS_AUTHENTICATION_NONE;
} else if (auth & (MM_BEARER_ALLOWED_AUTH_PAP |
MM_BEARER_ALLOWED_AUTH_CHAP |
diff --git a/src/mm-modem-helpers-mbim.c b/src/mm-modem-helpers-mbim.c
index 8d8697b9..0d5ff5f9 100644
--- a/src/mm-modem-helpers-mbim.c
+++ b/src/mm-modem-helpers-mbim.c
@@ -375,13 +375,13 @@ mm_bearer_allowed_auth_to_mbim_auth_protocol (MMBearerAllowedAuth bearer_auth,
/* NOTE: the input is a BITMASK, so we try to find a "best match" */
if (bearer_auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
- mm_obj_dbg (log_object, "using default (PAP) authentication method");
- return MBIM_AUTH_PROTOCOL_PAP;
+ mm_obj_dbg (log_object, "using default (CHAP) authentication method");
+ return MBIM_AUTH_PROTOCOL_CHAP;
}
- if (bearer_auth & MM_BEARER_ALLOWED_AUTH_PAP)
- return MBIM_AUTH_PROTOCOL_PAP;
if (bearer_auth & MM_BEARER_ALLOWED_AUTH_CHAP)
return MBIM_AUTH_PROTOCOL_CHAP;
+ if (bearer_auth & MM_BEARER_ALLOWED_AUTH_PAP)
+ return MBIM_AUTH_PROTOCOL_PAP;
if (bearer_auth & MM_BEARER_ALLOWED_AUTH_MSCHAPV2)
return MBIM_AUTH_PROTOCOL_MSCHAPV2;
if (bearer_auth & MM_BEARER_ALLOWED_AUTH_NONE)