#include <ctype.h>#include <string.h>#include "../../cmpapi.h"#include "../../dprint.h"#include "../../pvar.h"#include "../../data_lump.h"#include "../../mem/mem.h"#include "../tm/tm_load.h"#include "auth.h"#include "auth_alg.h"#include "auth_hdr.h"

Go to the source code of this file.
Defines | |
| #define | duplicate_str(_strd, _strs, _error) |
| #define | PROXY_AUTH_CODE 407 |
| #define | PROXY_AUTH_HDR "Proxy-Authenticate" |
| #define | PROXY_AUTH_HDR_LEN (sizeof(PROXY_AUTH_HDR)-1) |
| #define | WWW_AUTH_CODE 401 |
| #define | WWW_AUTH_HDR "WWW-Authenticate" |
| #define | WWW_AUTH_HDR_LEN (sizeof(WWW_AUTH_HDR)-1) |
Functions | |
| int | add_credential (unsigned int type, void *val) |
| static int | apply_urihdr_changes (struct sip_msg *req, str *uri, str *hdr) |
| void | destroy_credentials (void) |
| static void | do_uac_auth (struct sip_msg *req, str *uri, struct uac_credential *crd, struct authenticate_body *auth, HASHHEX response) |
| void | free_credential (struct uac_credential *crd) |
| static struct hdr_field * | get_autenticate_hdr (struct sip_msg *rpl, int rpl_code) |
| static struct uac_credential * | get_avp_credential (struct sip_msg *msg, str *realm) |
| int | has_credentials (void) |
| static struct uac_credential * | lookup_realm (str *realm) |
| int | uac_auth (struct sip_msg *msg) |
Variables | |
| pv_spec_t | auth_password_spec |
| pv_spec_t | auth_realm_spec |
| pv_spec_t | auth_username_spec |
| static str | cnonce = {"o", 1} |
| static struct uac_credential * | crd_list = 0 |
| static str | nc = {"00000001", 8} |
| struct tm_binds | uac_tmb |
| #define PROXY_AUTH_CODE 407 |
| #define PROXY_AUTH_HDR "Proxy-Authenticate" |
| #define PROXY_AUTH_HDR_LEN (sizeof(PROXY_AUTH_HDR)-1) |
| #define WWW_AUTH_CODE 401 |
| #define WWW_AUTH_HDR "WWW-Authenticate" |
| #define WWW_AUTH_HDR_LEN (sizeof(WWW_AUTH_HDR)-1) |
| int add_credential | ( | unsigned int | type, | |
| void * | val | |||
| ) |
Definition at line 97 of file auth.c.
References duplicate_str, free_credential(), _str::len, LM_ERR, uac_credential::next, uac_credential::passwd, pkg_free, pkg_malloc, uac_credential::realm, _str::s, and uac_credential::user.
Definition at line 321 of file auth.c.
References anchor_lump(), sip_msg::buf, HDR_EOH_F, insert_new_lump_before(), _str::len, LM_ERR, sip_msg::new_uri, parse_headers(), sip_msg::parsed_uri_ok, pkg_free, pkg_malloc, _str::s, and sip_msg::unparsed.
Referenced by uac_auth().
| void destroy_credentials | ( | void | ) |
Definition at line 189 of file auth.c.
References free_credential(), and uac_credential::next.
Referenced by mod_destroy().
| static void do_uac_auth | ( | struct sip_msg * | req, | |
| str * | uri, | |||
| struct uac_credential * | crd, | |||
| struct authenticate_body * | auth, | |||
| HASHHEX | response | |||
| ) | [inline, static] |
Definition at line 290 of file auth.c.
References authenticate_body::cnonce, core_hash(), sip_msg::first_line, authenticate_body::flags, int2str(), _str::len, authenticate_body::nc, authenticate_body::nonce, QOP_AUTH, QOP_AUTH_INT, msg_start::request, _str::s, msg_start::u, uac_calc_HA1(), uac_calc_HA2(), and uac_calc_response().
Referenced by uac_auth().
| void free_credential | ( | struct uac_credential * | crd | ) |
Definition at line 82 of file auth.c.
References uac_credential::passwd, pkg_free, uac_credential::realm, _str::s, and uac_credential::user.
Referenced by add_credential(), and destroy_credentials().
Definition at line 203 of file auth.c.
References cmp_hdrname_str(), HDR_EOH_F, HDR_OTHER_T, sip_msg::headers, _str::len, LM_DBG, LM_ERR, hdr_field::name, hdr_field::next, parse_headers(), PROXY_AUTH_CODE, PROXY_AUTH_HDR, PROXY_AUTH_HDR_LEN, _str::s, hdr_field::type, WWW_AUTH_CODE, WWW_AUTH_HDR, and WWW_AUTH_HDR_LEN.
Referenced by uac_auth().
| static struct uac_credential* get_avp_credential | ( | struct sip_msg * | msg, | |
| str * | realm | |||
| ) | [static, read] |
Definition at line 259 of file auth.c.
References auth_username_spec, _str::len, uac_credential::passwd, pv_get_spec_value(), PV_VAL_NULL, uac_credential::realm, _str::s, and uac_credential::user.
Referenced by uac_auth().
| static struct uac_credential* lookup_realm | ( | str * | realm | ) | [static, read] |
Definition at line 247 of file auth.c.
References _str::len, uac_credential::next, uac_credential::realm, and _str::s.
Referenced by uac_auth().
| int uac_auth | ( | struct sip_msg * | msg | ) |
Definition at line 371 of file auth.c.
References apply_urihdr_changes(), hdr_field::body, build_authorization_hdr(), do_uac_auth(), FAKED_REPLY, get_autenticate_hdr(), get_avp_credential(), ua_client::last_received, _str::len, LM_CRIT, LM_DBG, LM_ERR, lookup_realm(), parse_authenticate_body(), PVT_AVP, authenticate_body::realm, ua_client::reply, _str::s, tm_binds::t_get_picked, tm_binds::t_gett, T_NULL_CELL, T_UNDEFINED, _pv_spec::type, cell::uac, uac_tmb, and ua_client::uri.
Referenced by w_uac_auth().
struct uac_credential* crd_list = 0 [static] |
Definition at line 66 of file uac/uac.c.
Referenced by mod_init(), replace_from(), rr_checker(), and uac_auth().
1.5.6