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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Feb 1 11:06:51 CST 2013


Author: mmichelson
Date: Fri Feb  1 11:06:47 2013
New Revision: 380771

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380771
Log:
Prevent PJSIP from triggering an assertion on bad username or realm.

The lookup callback is expected to do username and realm checks. If we
don't do it, then PJSIP gets mad and throws a fit.


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

Modified: team/mmichelson/authenticate/res/res_sip_authenticator.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/authenticate/res/res_sip_authenticator.c?view=diff&rev=380771&r1=380770&r2=380771
==============================================================================
--- team/mmichelson/authenticate/res/res_sip_authenticator.c (original)
+++ team/mmichelson/authenticate/res/res_sip_authenticator.c Fri Feb  1 11:06:47 2013
@@ -50,6 +50,12 @@
 static pj_status_t default_lookup(pj_pool_t *pool, const pj_str_t *realm,
 		const pj_str_t *acc_name, pjsip_cred_info *info)
 {
+	if (pj_strcmp2(realm, default_realm)) {
+		return PJSIP_SC_FORBIDDEN;
+	}
+	if (pj_strcmp2(acc_name, default_username)) {
+		return PJSIP_SC_FORBIDDEN;
+	}
 	pj_strdup2(pool, &info->realm, default_realm);
 	pj_strdup2(pool, &info->username, default_username);
 	pj_strdup2(pool, &info->data, default_password);




More information about the svn-commits mailing list