Changeset 2109 for pjproject


Ignore:
Timestamp:
Jul 7, 2008 8:00:10 PM (16 years ago)
Author:
bennylp
Message:

Related to ticket 554: handle the case where server rejects Authorization because of incorrect nonce but fails to set stale parameter to true. In this case we will retry the authentication as long as the nonce in the challenge is different than current nonce. This seems to have fixed ticket 554 too (to be confirmed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c

    r2039 r2109  
    942942     */ 
    943943    if (hdr != &tdata->msg->hdr) { 
    944         if (hchal->challenge.digest.stale == 0) { 
     944        pj_bool_t stale; 
     945 
     946        /* Detect "stale" state */ 
     947        stale = hchal->challenge.digest.stale; 
     948        if (!stale) { 
     949            /* If stale is false, check is nonce has changed. Some servers 
     950             * (broken ones!) want to change nonce but they fail to set 
     951             * stale to true. 
     952             */ 
     953            stale = pj_strcmp(&hchal->challenge.digest.nonce, 
     954                              &sent_auth->credential.digest.nonce); 
     955        } 
     956 
     957        if (stale == PJ_FALSE) { 
    945958            /* Our credential is rejected. No point in trying to re-supply 
    946959             * the same credential. 
Note: See TracChangeset for help on using the changeset viewer.