[asterisk-scf-commits] asterisk-scf/integration/pjproject.git branch "tweaked-auth" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Aug 3 12:56:51 CDT 2011


branch "tweaked-auth" has been updated
       via  b3f24bc0e352bcd552a4b2ccbd21b39d19fb4aec (commit)
      from  bb4bb893c5032761e450c6973be6ea3a51f63101 (commit)

Summary of changes:
 pjsip/src/pjsip/sip_auth_server.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)


- Log -----------------------------------------------------------------
commit b3f24bc0e352bcd552a4b2ccbd21b39d19fb4aec
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Aug 3 14:57:05 2011 -0300

    Remove some assertions since the comment above them is actually no longer true.

diff --git a/pjsip/src/pjsip/sip_auth_server.c b/pjsip/src/pjsip/sip_auth_server.c
index 03ed567..7aed122 100644
--- a/pjsip/src/pjsip/sip_auth_server.c
+++ b/pjsip/src/pjsip/sip_auth_server.c
@@ -60,14 +60,12 @@ static pj_status_t pjsip_auth_verify( const pjsip_authorization_hdr *hdr,
 	pj_str_t digest;
 	const pjsip_digest_credential *dig = &hdr->credential.digest;
 
-	/* Check that username and realm match. 
-	 * These checks should have been performed before entering this
-	 * function.
-	 */
-	PJ_ASSERT_RETURN(pj_strcmp(&dig->username, &cred_info->username) == 0,
-			 PJ_EINVALIDOP);
-	PJ_ASSERT_RETURN(pj_strcmp(&dig->realm, &cred_info->realm) == 0,
-			 PJ_EINVALIDOP);
+	/* Check that username and realm match.  */
+	if ((pj_strcmp(&dig->username, &cred_info->username) != 0) ||
+	    (pj_strcmp(&dig->realm, &cred_info->realm) != 0))
+	{
+	    return PJSIP_EAUTHINVALIDREALM;
+	}
 
 	/* Prepare for our digest calculation. */
 	digest.ptr = digest_buf;

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/pjproject.git



More information about the asterisk-scf-commits mailing list