From 97933788704d7ea9fbde3004ea92c388888cb426 Mon Sep 17 00:00:00 2001 From: Andrew Lassalle Date: Wed, 9 Mar 2022 12:02:35 -0800 Subject: 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. --- libmm-glib/mm-bearer-properties.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libmm-glib') 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; -- cgit v1.2.3-70-g09d2