modem-helpers-qmi: fix auth validation always returning error
This commit is contained in:

committed by
Aleksander Morgado

parent
ba0701b67d
commit
f916d075a7
@@ -1472,7 +1472,6 @@ mm_bearer_allowed_auth_to_qmi_authentication (MMBearerAllowedAuth auth,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
QmiWdsAuthentication out;
|
QmiWdsAuthentication out;
|
||||||
g_autofree gchar *str = NULL;
|
|
||||||
|
|
||||||
if (auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
|
if (auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
|
||||||
mm_obj_dbg (log_object, "using default (CHAP) authentication method");
|
mm_obj_dbg (log_object, "using default (CHAP) authentication method");
|
||||||
@@ -1490,10 +1489,14 @@ mm_bearer_allowed_auth_to_qmi_authentication (MMBearerAllowedAuth auth,
|
|||||||
out |= QMI_WDS_AUTHENTICATION_CHAP;
|
out |= QMI_WDS_AUTHENTICATION_CHAP;
|
||||||
|
|
||||||
/* and if the bitmask cannot be built, error out */
|
/* and if the bitmask cannot be built, error out */
|
||||||
|
if (out == QMI_WDS_AUTHENTICATION_NONE) {
|
||||||
|
g_autofree gchar *str = NULL;
|
||||||
|
|
||||||
str = mm_bearer_allowed_auth_build_string_from_mask (auth);
|
str = mm_bearer_allowed_auth_build_string_from_mask (auth);
|
||||||
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED,
|
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED,
|
||||||
"Unsupported authentication methods (%s)",
|
"Unsupported authentication methods (%s)",
|
||||||
str);
|
str);
|
||||||
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user