[asterisk-commits] mmichelson: trunk r405420 - /trunk/res/res_pjsip/pjsip_distributor.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 14 10:43:38 CST 2014


Author: mmichelson
Date: Tue Jan 14 10:43:33 2014
New Revision: 405420

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405420
Log:
Fix erroneous behavior when sending auth rejection to artificial endpoint.

We were not including an authentication challenge when sending a 401 response
to unmatched endpoints. This was due to the conversion to use a vector for
authentication section names on an endpoint. The vector for artificial endpoints
was empty, resulting in the challenge being sent back containing no challenges.

This is worked around by placing a bogus value in the artificial endpoint's auth
vector. This value is never looked up by anything, since they instead will directly
call ast_sip_get_artificial_auth().


Modified:
    trunk/res/res_pjsip/pjsip_distributor.c

Modified: trunk/res/res_pjsip/pjsip_distributor.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip/pjsip_distributor.c?view=diff&rev=405420&r1=405419&r2=405420
==============================================================================
--- trunk/res/res_pjsip/pjsip_distributor.c (original)
+++ trunk/res/res_pjsip/pjsip_distributor.c Tue Jan 14 10:43:33 2014
@@ -228,6 +228,11 @@
 	}
 
 	AST_VECTOR_INIT(&artificial_endpoint->inbound_auths, 1);
+	/* Pushing a bogus value into the vector will ensure that
+	 * the proper size of the vector is returned. This value is
+	 * not actually used anywhere
+	 */
+	AST_VECTOR_APPEND(&artificial_endpoint->inbound_auths, "artificial-auth");
 	return 0;
 }
 




More information about the asterisk-commits mailing list