cinterion: quote user/password strings in AT^SGAUTH calls
The ELS61 doesn't like authentication given without quotes: [modem3/ttyACM1/at] --> 'AT^SGAUTH=8,1,tm,t-mobile<CR>' [modem3/ttyACM1/at] <-- '<CR><LF>+CME ERROR: 4<CR><LF>' Only when user/pass strings are quoted it works: [modem6/ttyACM1/at] --> 'AT^SGAUTH=8,1,"t-mobile","tm"<CR>' [modem6/ttyACM1/at] <-- '<CR><LF>OK<CR><LF>'
This commit is contained in:
@@ -203,12 +203,14 @@ build_auth_string (MMBroadbandBearerCinterion *self,
|
|||||||
MMBearerProperties *config,
|
MMBearerProperties *config,
|
||||||
guint cid)
|
guint cid)
|
||||||
{
|
{
|
||||||
const gchar *user;
|
|
||||||
const gchar *passwd;
|
|
||||||
gboolean has_user;
|
|
||||||
gboolean has_passwd;
|
|
||||||
MMBearerAllowedAuth auth;
|
MMBearerAllowedAuth auth;
|
||||||
BearerCinterionAuthType encoded_auth = BEARER_CINTERION_AUTH_UNKNOWN;
|
BearerCinterionAuthType encoded_auth = BEARER_CINTERION_AUTH_UNKNOWN;
|
||||||
|
gboolean has_user;
|
||||||
|
gboolean has_passwd;
|
||||||
|
const gchar *user;
|
||||||
|
const gchar *passwd;
|
||||||
|
g_autofree gchar *quoted_user = NULL;
|
||||||
|
g_autofree gchar *quoted_passwd = NULL;
|
||||||
|
|
||||||
user = mm_bearer_properties_get_user (config);
|
user = mm_bearer_properties_get_user (config);
|
||||||
passwd = mm_bearer_properties_get_password (config);
|
passwd = mm_bearer_properties_get_password (config);
|
||||||
@@ -236,11 +238,14 @@ build_auth_string (MMBroadbandBearerCinterion *self,
|
|||||||
encoded_auth = BEARER_CINTERION_AUTH_PAP;
|
encoded_auth = BEARER_CINTERION_AUTH_PAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
quoted_user = mm_port_serial_at_quote_string (user ? user : "");
|
||||||
|
quoted_passwd = mm_port_serial_at_quote_string (passwd ? passwd : "");
|
||||||
|
|
||||||
return g_strdup_printf ("^SGAUTH=%u,%d,%s,%s",
|
return g_strdup_printf ("^SGAUTH=%u,%d,%s,%s",
|
||||||
cid,
|
cid,
|
||||||
encoded_auth,
|
encoded_auth,
|
||||||
passwd ? passwd : "",
|
quoted_passwd,
|
||||||
user ? user : "");
|
quoted_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
Reference in New Issue
Block a user