From: Mark Michelson Date: Tue, 10 Dec 2013 15:15:13 +0000 (+0000) Subject: Fix correct authentication behavior for artificial endpoint. X-Git-Tag: 13.0.0-beta1~769 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b4aab75ef39ee79d04bd8c48516a7d87d319a78;p=thirdparty%2Fasterisk.git Fix correct authentication behavior for artificial endpoint. When switching to using a vector for authentication, I initialized the vector for the artificial endpoint to be of size 1. However, this does not result in AST_VECTOR_SIZE() returning 1 since there isn't actually anything in the vector. Rather than trifle with the vector by putting unnecessary elements in, I simply changed the callback in res_pjsip_authenticator_digest.c to explicitly report that the artificial endpoint requires authentication. Thanks to Joshua Colp for pointing this out. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403605 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_authenticator_digest.c b/res/res_pjsip_authenticator_digest.c index 4a84a402a6..e0f633fceb 100644 --- a/res/res_pjsip_authenticator_digest.c +++ b/res/res_pjsip_authenticator_digest.c @@ -41,7 +41,9 @@ AO2_GLOBAL_OBJ_STATIC(entity_id); */ static int digest_requires_authentication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) { - return AST_VECTOR_SIZE(&endpoint->inbound_auths) > 0; + RAII_VAR(struct ast_sip_endpoint *, artificial, ast_sip_get_artificial_endpoint(), ao2_cleanup); + + return endpoint == artificial || AST_VECTOR_SIZE(&endpoint->inbound_auths) > 0; } static void auth_store_cleanup(void *data)