Changeset 1539 for pjproject


Ignore:
Timestamp:
Nov 3, 2007 1:46:03 AM (17 years ago)
Author:
bennylp
Message:

Ticket #410: Endless authentication retries when 401/407 response contains no challenge

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_errno.h

    r1488 r1539  
    392392 */ 
    393393#define PJSIP_EAUTHINAKACRED    (PJSIP_ERRNO_START_PJSIP + 113) /* 171113 */ 
    394  
     394/** 
     395 * No challenge is found in the challenge. 
     396 */ 
     397#define PJSIP_EAUTHNOCHAL       (PJSIP_ERRNO_START_PJSIP + 114) /* 171114 */ 
    395398 
    396399/************************************************************ 
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c

    r1514 r1539  
    902902    pjsip_tx_data *tdata; 
    903903    const pjsip_hdr *hdr; 
     904    unsigned chal_cnt; 
    904905    pjsip_via_hdr *via; 
    905906    pj_status_t status; 
     
    922923     */ 
    923924    hdr = rdata->msg_info.msg->hdr.next; 
     925    chal_cnt = 0; 
    924926    while (hdr != &rdata->msg_info.msg->hdr) { 
    925927        pjsip_cached_auth *cached_auth; 
     
    938940 
    939941        hchal = (const pjsip_www_authenticate_hdr*) hdr; 
     942        ++chal_cnt; 
    940943 
    941944        /* Find authentication session for this realm, create a new one 
     
    970973    } 
    971974 
     975    /* Check if challenge is present */ 
     976    if (chal_cnt == 0) 
     977        return PJSIP_EAUTHNOCHAL; 
    972978 
    973979    /* Remove branch param in Via header. */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_errno.c

    r1488 r1539  
    105105    PJ_BUILD_ERR( PJSIP_EAUTHINNONCE,      "Invalid nonce value in authentication challenge"), 
    106106    PJ_BUILD_ERR( PJSIP_EAUTHINAKACRED,    "Invalid AKA credential"), 
     107    PJ_BUILD_ERR( PJSIP_EAUTHNOCHAL,       "No challenge is found"), 
    107108 
    108109    /* UA/dialog layer. */ 
Note: See TracChangeset for help on using the changeset viewer.