mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 03:58:08 +00:00
avoid crash with op->auth_info
This commit is contained in:
parent
53d4d1b7f8
commit
53128dec9d
4 changed files with 11 additions and 13 deletions
|
|
@ -363,14 +363,12 @@ static void process_transaction_terminated(void *user_ctx, const belle_sip_trans
|
|||
}
|
||||
|
||||
static void process_auth_requested(void *sal, belle_sip_auth_event_t *auth_event) {
|
||||
SalAuthInfo auth_info;
|
||||
memset(&auth_info,0,sizeof(SalAuthInfo));
|
||||
auth_info.username=(char*)belle_sip_auth_event_get_username(auth_event);
|
||||
auth_info.realm=(char*)belle_sip_auth_event_get_realm(auth_event);
|
||||
((Sal*)sal)->callbacks.auth_requested(sal,&auth_info);
|
||||
belle_sip_auth_event_set_passwd(auth_event,(const char*)auth_info.password);
|
||||
belle_sip_auth_event_set_ha1(auth_event,(const char*)auth_info.ha1);
|
||||
belle_sip_auth_event_set_userid(auth_event,(const char*)auth_info.userid);
|
||||
SalAuthInfo* auth_info = sal_auth_info_create(auth_event);
|
||||
((Sal*)sal)->callbacks.auth_requested(sal,auth_info);
|
||||
belle_sip_auth_event_set_passwd(auth_event,(const char*)auth_info->password);
|
||||
belle_sip_auth_event_set_ha1(auth_event,(const char*)auth_info->ha1);
|
||||
belle_sip_auth_event_set_userid(auth_event,(const char*)auth_info->userid);
|
||||
sal_auth_info_delete(auth_info);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ static void register_refresher_listener ( const belle_sip_refresher_t* refresher
|
|||
sal_add_pending_auth(op->base.root,op);
|
||||
if (status_code == 403) { /*in sase of 401 or 407, auth requested already invoked previouly*/
|
||||
/*auth previouly pending, probably wrong pasword, give a chance to authenticate again*/
|
||||
op->base.root->callbacks.auth_failure(op,op->auth_info);
|
||||
op->base.root->callbacks.auth_failure(op,op->auth_info); /*fixme*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -906,9 +906,9 @@ static void ping_reply(SalOp *op){
|
|||
static bool_t fill_auth_info(LinphoneCore *lc, SalAuthInfo* sai) {
|
||||
LinphoneAuthInfo *ai=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,sai->realm,sai->username);
|
||||
if (ai) {
|
||||
sai->userid=ai->userid?ai->userid:ai->username;
|
||||
sai->password=ai->passwd;
|
||||
sai->ha1=ai->ha1;
|
||||
sai->userid=ms_strdup(ai->userid?ai->userid:ai->username);
|
||||
sai->password=ai->passwd?ms_strdup(ai->passwd):NULL;
|
||||
sai->ha1=ai->ha1?ms_strdup(ai->ha1):NULL;
|
||||
ai->usecount++;
|
||||
ai->last_use_time=ms_time(NULL);
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 3f06cd60f1864b8c811e0f4e4590991802ce5ea7
|
||||
Subproject commit c898f5af06498ea9c6848e4342fab65cd4adcc4f
|
||||
Loading…
Add table
Reference in a new issue