Changeset 1370
- Timestamp:
- Jun 18, 2007 11:01:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c
r1294 r1370 70 70 const pj_str_t *qop, 71 71 const pj_str_t *uri, 72 const pj_str_t *realm, 72 73 const pjsip_cred_info *cred_info, 73 74 const pj_str_t *method) … … 89 90 MD5_APPEND( &pms, cred_info->username.ptr, cred_info->username.slen); 90 91 MD5_APPEND( &pms, ":", 1); 91 MD5_APPEND( &pms, cred_info->realm.ptr, cred_info->realm.slen);92 MD5_APPEND( &pms, realm->ptr, realm->slen); 92 93 MD5_APPEND( &pms, ":", 1); 93 94 MD5_APPEND( &pms, cred_info->data.ptr, cred_info->data.slen); … … 222 223 /* Convert digest to string and store in chal->response. */ 223 224 pjsip_auth_create_digest( &cred->response, &cred->nonce, NULL, NULL, 224 NULL, uri, cred_info, method);225 NULL, uri, &chal->realm, cred_info, method); 225 226 226 227 } else if (has_auth_qop(pool, &chal->qop)) { … … 240 241 241 242 pjsip_auth_create_digest( &cred->response, &cred->nonce, &cred->nc, 242 cnonce, &pjsip_AUTH_STR, uri, cred_info,243 method );243 cnonce, &pjsip_AUTH_STR, uri, &chal->realm, 244 cred_info, method ); 244 245 245 246 } else { … … 329 330 { 330 331 unsigned i; 332 int wildcard = -1; 333 331 334 PJ_UNUSED_ARG(auth_scheme); 335 332 336 for (i=0; i<sess->cred_cnt; ++i) { 333 337 if (pj_stricmp(&sess->cred_info[i].realm, realm) == 0) 334 338 return &sess->cred_info[i]; 335 } 339 else if (sess->cred_info[i].realm.slen == 1 && 340 sess->cred_info[i].realm.ptr[0] == '*') 341 { 342 wildcard = i; 343 } 344 } 345 346 /* No matching realm. See if we have credential with wildcard ('*') 347 * as the realm. 348 */ 349 if (wildcard != -1) 350 return &sess->cred_info[wildcard]; 351 352 /* Nothing is suitable */ 336 353 return NULL; 337 354 }
Note: See TracChangeset
for help on using the changeset viewer.