diff options
author | Mark Michelson <mmichelson@digium.com> | 2013-07-30 15:17:56 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2013-07-30 15:17:56 +0000 |
commit | 895c8e0d2c97cd04299f3f179e99d8a3873c06c6 (patch) | |
tree | 87aa12b92909a9579198ac486fe8dc902c9d2d5a /res/res_sip_authenticator_digest.c | |
parent | 7fded3378948b9076cc092145bb4823a50b8501c (diff) |
Reorganize the ast_sip_endpoint structure into substructures.
(closes issue ASTERISK-22135)
reported by Matt Jordan
Review: https://reviewboard.asterisk.org/r/2707
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_sip_authenticator_digest.c')
-rw-r--r-- | res/res_sip_authenticator_digest.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/res/res_sip_authenticator_digest.c b/res/res_sip_authenticator_digest.c index 8e3ff6de7..8b6399b58 100644 --- a/res/res_sip_authenticator_digest.c +++ b/res/res_sip_authenticator_digest.c @@ -41,7 +41,7 @@ AO2_GLOBAL_OBJ_STATIC(entity_id); */ static int digest_requires_authentication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) { - return endpoint->num_inbound_auths > 0; + return endpoint->inbound_auths.num > 0; } static void auth_store_cleanup(void *data) @@ -380,8 +380,8 @@ static enum ast_sip_check_auth_result digest_check_auth(struct ast_sip_endpoint RAII_VAR(struct ast_sip_endpoint *, artificial_endpoint, ast_sip_get_artificial_endpoint(), ao2_cleanup); - auths = ast_alloca(endpoint->num_inbound_auths * sizeof(*auths)); - verify_res = ast_alloca(endpoint->num_inbound_auths * sizeof(*verify_res)); + auths = ast_alloca(endpoint->inbound_auths.num * sizeof(*auths)); + verify_res = ast_alloca(endpoint->inbound_auths.num * sizeof(*verify_res)); if (!auths) { return AST_SIP_AUTHENTICATION_ERROR; @@ -389,12 +389,12 @@ static enum ast_sip_check_auth_result digest_check_auth(struct ast_sip_endpoint if (endpoint == artificial_endpoint) { auths[0] = ast_sip_get_artificial_auth(); - } else if (ast_sip_retrieve_auths(endpoint->sip_inbound_auths, endpoint->num_inbound_auths, auths)) { + } else if (ast_sip_retrieve_auths(&endpoint->inbound_auths, auths)) { res = AST_SIP_AUTHENTICATION_ERROR; goto cleanup; } - for (i = 0; i < endpoint->num_inbound_auths; ++i) { + for (i = 0; i < endpoint->inbound_auths.num; ++i) { verify_res[i] = verify(auths[i], rdata, tdata->pool); if (verify_res[i] == AUTH_SUCCESS) { res = AST_SIP_AUTHENTICATION_SUCCESS; @@ -402,14 +402,14 @@ static enum ast_sip_check_auth_result digest_check_auth(struct ast_sip_endpoint } } - for (i = 0; i < endpoint->num_inbound_auths; ++i) { + for (i = 0; i < endpoint->inbound_auths.num; ++i) { challenge(auths[i]->realm, tdata, rdata, verify_res[i] == AUTH_STALE); } res = AST_SIP_AUTHENTICATION_CHALLENGE; cleanup: - ast_sip_cleanup_auths(auths, endpoint->num_inbound_auths); + ast_sip_cleanup_auths(auths, endpoint->inbound_auths.num); return res; } |