[asterisk-commits] mmichelson: branch mmichelson/authenticate r380812 - /team/mmichelson/authent...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Feb 4 13:00:47 CST 2013
Author: mmichelson
Date: Mon Feb 4 13:00:43 2013
New Revision: 380812
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380812
Log:
Rename things in this file to indicate they are for digest authentication.
Added:
team/mmichelson/authenticate/res/res_sip_authenticator_digest.c
- copied, changed from r380811, team/mmichelson/authenticate/res/res_sip_authenticator.c
Removed:
team/mmichelson/authenticate/res/res_sip_authenticator.c
Copied: team/mmichelson/authenticate/res/res_sip_authenticator_digest.c (from r380811, team/mmichelson/authenticate/res/res_sip_authenticator.c)
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/authenticate/res/res_sip_authenticator_digest.c?view=diff&rev=380812&p1=team/mmichelson/authenticate/res/res_sip_authenticator.c&r1=380811&p2=team/mmichelson/authenticate/res/res_sip_authenticator_digest.c&r2=380812
==============================================================================
--- team/mmichelson/authenticate/res/res_sip_authenticator.c (original)
+++ team/mmichelson/authenticate/res/res_sip_authenticator_digest.c Mon Feb 4 13:00:43 2013
@@ -30,7 +30,7 @@
<support_level>core</support_level>
***/
-static int default_requires_authentication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
+static int digest_requires_authentication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
{
return ao2_container_count(endpoint->sip_auths);
}
@@ -82,7 +82,7 @@
return NULL;
}
-static pj_status_t default_lookup(pj_pool_t *pool, const pj_str_t *realm,
+static pj_status_t digest_lookup(pj_pool_t *pool, const pj_str_t *realm,
const pj_str_t *acc_name, pjsip_cred_info *info)
{
RAII_VAR(struct ast_sip_auth *, auth, get_auth(), ao2_cleanup);
@@ -120,7 +120,7 @@
pj_str_t realm;
pj_cstr(&realm, auth->realm);
- pjsip_auth_srv_init(pool, auth_server, &realm, default_lookup, 0);
+ pjsip_auth_srv_init(pool, auth_server, &realm, digest_lookup, 0);
}
static int verify(void *obj, void *arg, void *data, int flags)
@@ -157,14 +157,13 @@
return 0;
}
-static enum ast_sip_check_auth_result default_check_auth(struct ast_sip_endpoint *endpoint,
+static enum ast_sip_check_auth_result digest_check_auth(struct ast_sip_endpoint *endpoint,
pjsip_rx_data *rdata, pjsip_tx_data *tdata)
{
struct ast_sip_auth *auth;
auth = ao2_callback_data(endpoint->sip_auths, 0, verify, tdata, rdata);
if (auth) {
- /* Success! */
ao2_ref(auth, -1);
return AST_SIP_AUTHENTICATION_SUCCESS;
}
@@ -173,14 +172,14 @@
return AST_SIP_AUTHENTICATION_CHALLENGE;
}
-static struct ast_sip_authenticator default_authenticator = {
- .requires_authentication = default_requires_authentication,
- .check_authentication = default_check_auth,
+static struct ast_sip_authenticator digest_authenticator = {
+ .requires_authentication = digest_requires_authentication,
+ .check_authentication = digest_check_auth,
};
static int load_module(void)
{
- if (ast_sip_register_authenticator(&default_authenticator)) {
+ if (ast_sip_register_authenticator(&digest_authenticator)) {
return AST_MODULE_LOAD_DECLINE;
}
return AST_MODULE_LOAD_SUCCESS;
@@ -188,7 +187,7 @@
static int unload_module(void)
{
- ast_sip_unregister_authenticator(&default_authenticator);
+ ast_sip_unregister_authenticator(&digest_authenticator);
return 0;
}
More information about the asterisk-commits
mailing list