#591 uac_auth does't work in 3.0

ver devel
closed-fixed
modules (357)
5
2009-11-16
2009-11-14
Mangust
No

in file modules_k/uac/auth.c

line 235:

for( hdr=rpl->headers ; hdr ; hdr=hdr->next )
{
// -->> if ( hdr->type!=HDR_OTHER_T)
// -->> continue;
if (cmp_hdrname_str(&hdr->name, &hdr_name)==0)
return hdr;
}

commented out line prevent from recognizing authentication field causing error.
Nov 14 04:02:28 v /usr/local/sbin/kamailio[24361]: ERROR: uac [auth.c:244]: reply has no auth hdr (WWW-Authenticate)
Nov 14 04:02:28 v /usr/local/sbin/kamailio[24361]: ERROR: uac [auth.c:419]: failed to extract authenticate hdr

maybe because authentication now not HDR_OTHER_T but
HDR_WWW_AUTHENTICATE_T /* WWW-Authenticate header field */,
HDR_PROXY_AUTHENTICATE_T /* Proxy-Authenticate header field */,
according to:
http://www.asipto.com/pub/kamailio-devel-guide/

for a moment i just comment it out
will also try:
if ( hdr->type!=HDR_WWW_AUTHENTICATE_T && hdr->type!=HDR_PROXY_AUTHENTICATE_T )
continue;
if (cmp_hdrname_str(&hdr->name, &hdr_name)==0)
return hdr;

Discussion

  • Mangust
    Mangust
    2009-11-14

    yes, this work as well:

    for( hdr=rpl->headers ; hdr ; hdr=hdr->next )
    {
    if ( hdr->type!=HDR_WWW_AUTHENTICATE_T &&
    hdr->type!=HDR_PROXY_AUTHENTICATE_T )
    continue;
    if (cmp_hdrname_str(&hdr->name, &hdr_name)==0)
    return hdr;
    }

     
  • Mangust
    Mangust
    2009-11-14

    A! it happen because before in v1.5 ./parser/hf.h
    /**
    * SIP Header types.
    * if you add a new type:
    * - make sure it's not greater than 63
    * - make sure you add the corresponding flag to the hdr_flags_t defs below
    * - update clean_hdr_field (in hf.c)
    * - update sip_msg_cloner (modules/tm/sip_msg.c)
    * - update parse_headers (msg_parser.c)
    */

    enum _hdr_types_t {
    HDR_ERROR_T = -1 /**< Error while parsing */,
    HDR_OTHER_T = 0 /**< Some other header field */,
    HDR_VIA_T = 1 /**< Via header field */,
    HDR_VIA1_T = 1 /**< First Via header field */,
    HDR_VIA2_T = 2 /**< only used as flag */,
    HDR_TO_T /**< To header field */,
    HDR_FROM_T /**< From header field */,
    HDR_CSEQ_T /**< CSeq header field */,
    HDR_CALLID_T /**< Call-Id header field */,
    HDR_CONTACT_T /**< Contact header field */,
    HDR_MAXFORWARDS_T /**< MaxForwards header field */,
    HDR_ROUTE_T /**< Route header field */,
    HDR_RECORDROUTE_T /**< Record-Route header field */,
    HDR_PATH_T /**< Path header fiels */,
    HDR_CONTENTTYPE_T /**< Content-Type header field */,
    HDR_CONTENTLENGTH_T /**< Content-Length header field */,
    HDR_AUTHORIZATION_T /**< Authorization header field */,
    HDR_EXPIRES_T /**< Expires header field */,
    HDR_PROXYAUTH_T /**< Proxy-Authorization hdr field */,
    HDR_SUPPORTED_T /**< Supported header field */,
    HDR_PROXYREQUIRE_T /**< Proxy-Require header field */,
    HDR_UNSUPPORTED_T /**< Unsupported header field */,
    HDR_ALLOW_T /**< Allow header field */,
    HDR_EVENT_T /**< Event header field */,
    HDR_ACCEPT_T /**< Accept header field */,
    HDR_ACCEPTLANGUAGE_T /**< Accept-Language header field */,
    HDR_ORGANIZATION_T /**< Organization header field */,
    HDR_PRIORITY_T /**< Priority header field */,
    HDR_SUBJECT_T /**< Subject header field */,
    HDR_USERAGENT_T /**< User-Agent header field */,
    HDR_ACCEPTDISPOSITION_T /**< Accept-Disposition hdr field */,
    HDR_CONTENTDISPOSITION_T /**< Content-Disposition hdr field */,
    HDR_DIVERSION_T /**< Diversion header field */,
    HDR_RPID_T /**< Remote-Party-ID header field */,
    HDR_REFER_TO_T /**< Refer-To header fiels */,
    HDR_SESSION_EXPIRES_T /**< Session-Expires header field */,
    HDR_MIN_SE_T /**< Min-SE header field */,
    HDR_PPI_T /**< P-Preferred-Identity header field */,
    HDR_PAI_T /**< P-Asserted-Identity header field */,
    HDR_PRIVACY_T /**< Privacy header field */,
    HDR_RETRY_AFTER_T /**< Retry-After header field */,
    HDR_EOH_T /**< Some other header field */
    };

    Was NO HDR_WWW_AUTHENTICATE_T or HDR_PROXY_AUTHENTICATE_T so authenticate header was matching HDR_OTHER_T

     
  • Your patch seems ok, I will double check and fix. Thanks!

     
  • I seen changes was made in code on GIT. I approve that authentication now works.

     
  • OK. Thanks for testing!

     
    • assigned_to: nobody --> miconda
    • status: open --> closed-fixed