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,
|
||||
guint cid)
|
||||
{
|
||||
const gchar *user;
|
||||
const gchar *passwd;
|
||||
gboolean has_user;
|
||||
gboolean has_passwd;
|
||||
MMBearerAllowedAuth auth;
|
||||
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);
|
||||
passwd = mm_bearer_properties_get_password (config);
|
||||
@@ -236,11 +238,14 @@ build_auth_string (MMBroadbandBearerCinterion *self,
|
||||
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",
|
||||
cid,
|
||||
encoded_auth,
|
||||
passwd ? passwd : "",
|
||||
user ? user : "");
|
||||
quoted_passwd,
|
||||
quoted_user);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
Reference in New Issue
Block a user