aboutsummaryrefslogtreecommitdiff
path: root/libmm-glib
diff options
context:
space:
mode:
authorAndrew Lassalle <andrewlassalle@chromium.org>2022-03-09 12:02:35 -0800
committerAleksander Morgado <aleksander@aleksander.es>2022-03-29 16:01:30 +0000
commit97933788704d7ea9fbde3004ea92c388888cb426 (patch)
tree539d8f4d409d8601654e335622f09d9d0db11d49 /libmm-glib
parentd5805002c196b52d6fbffab381f1b35c7b0ecf18 (diff)
bearer-properties: Match UNKNOWN auth to CHAP for loose comparison
MBIM and QMI fallback to CHAP when a username or password is present but no authentication type was provided. Consider CHAP==UNKNOWN when using loose comparison.
Diffstat (limited to 'libmm-glib')
-rw-r--r--libmm-glib/mm-bearer-properties.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libmm-glib/mm-bearer-properties.c b/libmm-glib/mm-bearer-properties.c
index dad93de9..0d2d1a75 100644
--- a/libmm-glib/mm-bearer-properties.c
+++ b/libmm-glib/mm-bearer-properties.c
@@ -871,9 +871,13 @@ cmp_allowed_auth (MMBearerAllowedAuth a,
if (a == b)
return TRUE;
/* Additional loose match UNKNOWN == NONE */
+ /* MBIM and QMI fallback to CHAP when a username or password is present,
+ but no authentication type was provided */
if (flags & MM_BEARER_PROPERTIES_CMP_FLAGS_LOOSE) {
if ((a == MM_BEARER_ALLOWED_AUTH_UNKNOWN && b == MM_BEARER_ALLOWED_AUTH_NONE) ||
- (b == MM_BEARER_ALLOWED_AUTH_UNKNOWN && a == MM_BEARER_ALLOWED_AUTH_NONE))
+ (b == MM_BEARER_ALLOWED_AUTH_UNKNOWN && a == MM_BEARER_ALLOWED_AUTH_NONE) ||
+ (a == MM_BEARER_ALLOWED_AUTH_UNKNOWN && b == MM_BEARER_ALLOWED_AUTH_CHAP) ||
+ (b == MM_BEARER_ALLOWED_AUTH_UNKNOWN && a == MM_BEARER_ALLOWED_AUTH_CHAP) )
return TRUE;
}
return FALSE;