[svn-commits] mmichelson: branch mmichelson/authenticate r381062 - /team/mmichelson/authent...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Feb 7 17:33:18 CST 2013


Author: mmichelson
Date: Thu Feb  7 17:33:15 2013
New Revision: 381062

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381062
Log:
Fix finding of authorization headers.

Unlike when iterating over the list of headers, when using pjsip_msg_find_hdr(),
the failure return is NULL, rather than the beginning of the list.


Modified:
    team/mmichelson/authenticate/res/res_sip_authenticator_digest.c

Modified: team/mmichelson/authenticate/res/res_sip_authenticator_digest.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/authenticate/res/res_sip_authenticator_digest.c?view=diff&rev=381062&r1=381061&r2=381062
==============================================================================
--- team/mmichelson/authenticate/res/res_sip_authenticator_digest.c (original)
+++ team/mmichelson/authenticate/res/res_sip_authenticator_digest.c Thu Feb  7 17:33:15 2013
@@ -214,9 +214,7 @@
 	int challenge_found = 0;
 	char nonce[64];
 
-	for (auth_hdr = (pjsip_authorization_hdr *) pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_AUTHORIZATION, auth_hdr->next);
-			auth_hdr != (pjsip_authorization_hdr *) &rdata->msg_info.msg->hdr;
-			auth_hdr = (pjsip_authorization_hdr *) pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_AUTHORIZATION,  auth_hdr->next)) {
+	while ((auth_hdr = (pjsip_authorization_hdr *) pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_AUTHORIZATION, auth_hdr->next))) {
 		/* Let's do a nonce check! */
 		ast_copy_pj_str(nonce, &auth_hdr->credential.digest.nonce, sizeof(nonce));
 		if (check_nonce(nonce, rdata, auth->realm) && !pj_strcmp2(&auth_hdr->credential.digest.realm, auth->realm)) {




More information about the svn-commits mailing list