auth.c File Reference

#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"

Include dependency graph for auth.c:

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_fieldget_autenticate_hdr (struct sip_msg *rpl, int rpl_code)
static struct uac_credentialget_avp_credential (struct sip_msg *msg, str *realm)
int has_credentials (void)
static struct uac_credentiallookup_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_credentialcrd_list = 0
static str nc = {"00000001", 8}
struct tm_binds uac_tmb


Define Documentation

#define duplicate_str ( _strd,
_strs,
_error   ) 

Definition at line 54 of file auth.c.

#define PROXY_AUTH_CODE   407

Definition at line 70 of file auth.c.

Referenced by get_autenticate_hdr().

#define PROXY_AUTH_HDR   "Proxy-Authenticate"

Definition at line 71 of file auth.c.

Referenced by get_autenticate_hdr().

#define PROXY_AUTH_HDR_LEN   (sizeof(PROXY_AUTH_HDR)-1)

Definition at line 72 of file auth.c.

Referenced by get_autenticate_hdr().

#define WWW_AUTH_CODE   401

Definition at line 67 of file auth.c.

Referenced by get_autenticate_hdr().

#define WWW_AUTH_HDR   "WWW-Authenticate"

Definition at line 68 of file auth.c.

Referenced by get_autenticate_hdr().

#define WWW_AUTH_HDR_LEN   (sizeof(WWW_AUTH_HDR)-1)

Definition at line 69 of file auth.c.

Referenced by get_autenticate_hdr().


Function Documentation

int add_credential ( unsigned int  type,
void *  val 
)

static int apply_urihdr_changes ( struct sip_msg req,
str uri,
str hdr 
) [inline, static]

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]

void free_credential ( struct uac_credential crd  ) 

static struct hdr_field* get_autenticate_hdr ( struct sip_msg rpl,
int  rpl_code 
) [static, read]

static struct uac_credential* get_avp_credential ( struct sip_msg msg,
str realm 
) [static, read]

int has_credentials ( void   ) 

Definition at line 77 of file auth.c.

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  ) 


Variable Documentation

Definition at line 70 of file uac/uac.c.

Definition at line 69 of file uac/uac.c.

Definition at line 68 of file uac/uac.c.

Referenced by get_avp_credential().

str cnonce = {"o", 1} [static]

Definition at line 75 of file auth.c.

struct uac_credential* crd_list = 0 [static]

Definition at line 51 of file auth.c.

str nc = {"00000001", 8} [static]

Definition at line 74 of file auth.c.

Referenced by get_ha1(), set_body_f(), and set_rpl_body_f().

struct tm_binds uac_tmb

Definition at line 66 of file uac/uac.c.

Referenced by mod_init(), replace_from(), rr_checker(), and uac_auth().


Generated on Thu May 17 12:00:34 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6