mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 21:28:08 +00:00
fix bug about authentication
When ha1 password storage is enabled (the default), the lookup of LinphoneAuthInfo must be done with realm, otherwise the password will not work.
This commit is contained in:
parent
213206027f
commit
8f3ff2dbd9
1 changed files with 5 additions and 4 deletions
|
|
@ -200,7 +200,7 @@ static char * remove_quotes(char * input){
|
|||
return input;
|
||||
}
|
||||
|
||||
static int realm_match(const char *realm1, const char *realm2){
|
||||
static bool_t realm_match(const char *realm1, const char *realm2){
|
||||
if (realm1==NULL && realm2==NULL) return TRUE;
|
||||
if (realm1!=NULL && realm2!=NULL){
|
||||
if (strcmp(realm1,realm2)==0) return TRUE;
|
||||
|
|
@ -226,7 +226,7 @@ static const LinphoneAuthInfo *find_auth_info(LinphoneCore *lc, const char *user
|
|||
LinphoneAuthInfo *pinfo = (LinphoneAuthInfo*)elem->data;
|
||||
if (username && pinfo->username && strcmp(username,pinfo->username)==0) {
|
||||
if (realm && domain){
|
||||
if (pinfo->realm && strcmp(realm,pinfo->realm)==0
|
||||
if (pinfo->realm && realm_match(realm,pinfo->realm)
|
||||
&& pinfo->domain && strcmp(domain,pinfo->domain)==0) {
|
||||
return pinfo;
|
||||
}
|
||||
|
|
@ -238,9 +238,9 @@ static const LinphoneAuthInfo *find_auth_info(LinphoneCore *lc, const char *user
|
|||
}
|
||||
ret=pinfo;
|
||||
}
|
||||
} else if (domain && pinfo->domain && strcmp(domain,pinfo->domain)==0) {
|
||||
} else if (domain && pinfo->domain && strcmp(domain,pinfo->domain)==0 && pinfo->ha1==NULL) {
|
||||
return pinfo;
|
||||
} else if (!domain) {
|
||||
} else if (!domain && pinfo->ha1==NULL) {
|
||||
return pinfo;
|
||||
}
|
||||
}
|
||||
|
|
@ -271,6 +271,7 @@ const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const cha
|
|||
if (ai==NULL){
|
||||
ai=find_auth_info(lc,username,NULL,NULL);
|
||||
}
|
||||
/*if (ai) ms_message("linphone_core_find_auth_info(): returning auth info username=%s, realm=%s", ai->username, ai->realm);*/
|
||||
return ai;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue