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.
This commit is contained in:

committed by
Aleksander Morgado

parent
d5805002c1
commit
9793378870
@@ -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;
|
||||
|
Reference in New Issue
Block a user