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
This commit is contained in:
@@ -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 : "");
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user