auth_hdr.c File Reference

#include "string.h"
#include "ctype.h"
#include "../../dprint.h"
#include "../../str.h"
#include "../../mem/mem.h"
#include "auth_hdr.h"
#include "auth.h"

Include dependency graph for auth_hdr.c:

Go to the source code of this file.

Defines

#define add_string(_p, _s, _l)
#define ALGORITHM_FIELD_LEN   (sizeof(ALGORITHM_FIELD_S)-1)
#define ALGORITHM_FIELD_S   "algorithm=MD5"
#define ALGORITHM_STATE   7
#define AUTHENTICATE_DIGEST_LEN   (sizeof(AUTHENTICATE_DIGEST_S)-1)
#define AUTHENTICATE_DIGEST_S   "Digest"
#define AUTHENTICATE_MD5   (1<<0)
#define AUTHENTICATE_MD5SESS   (1<<1)
#define AUTHENTICATE_STALE   (1<<2)
#define AUTHORIZATION_HDR_START   "Authorization: Digest "
#define AUTHORIZATION_HDR_START_LEN   (sizeof(AUTHORIZATION_HDR_START)-1)
#define CASE_5B(_hex4, _c5, _new_state, _quoted)
#define CASE_6B(_hex4, _c5, _c6, _new_state, _quoted)
#define CNONCE_FIELD_LEN   (sizeof(CNONCE_FIELD_S)-1)
#define CNONCE_FIELD_S   "cnonce=\""
#define DOMAIN_STATE   5
#define FIELD_SEPARATOR_LEN   (sizeof(FIELD_SEPARATOR_S)-1)
#define FIELD_SEPARATOR_S   "\", "
#define FIELD_SEPARATOR_UQ_LEN   (sizeof(FIELD_SEPARATOR_UQ_S)-1)
#define FIELD_SEPARATOR_UQ_S   ", "
#define GET3B(_p)   ((*(_p)<<24) + (*(_p+1)<<16) + (*(_p+2)<<8) + 0xff)
#define GET4B(_p)   ((*(_p)<<24) + (*(_p+1)<<16) + (*(_p+2)<<8) + *(_p+3))
#define LOWER1B(_n)   ((_n)|0x20)
#define LOWER4B(_n)   ((_n)|0x20202020)
#define NC_FIELD_LEN   (sizeof(NC_FIELD_S)-1)
#define NC_FIELD_S   "nc="
#define NONCE_FIELD_LEN   (sizeof(NONCE_FIELD_S)-1)
#define NONCE_FIELD_S   "nonce=\""
#define NONCE_STATE   3
#define OPAQUE_FIELD_LEN   (sizeof(OPAQUE_FIELD_S)-1)
#define OPAQUE_FIELD_S   "opaque=\""
#define OPAQUE_STATE   6
#define OTHER_STATE   0
#define PROXY_AUTHORIZATION_HDR_START   "Proxy-Authorization: Digest "
#define PROXY_AUTHORIZATION_HDR_START_LEN   (sizeof(PROXY_AUTHORIZATION_HDR_START)-1)
#define QOP_FIELD_LEN   (sizeof(QOP_FIELD_S)-1)
#define QOP_FIELD_S   "qop="
#define QOP_STATE   1
#define REALM_FIELD_LEN   (sizeof(REALM_FIELD_S)-1)
#define REALM_FIELD_S   "realm=\""
#define REALM_STATE   2
#define RESPONSE_FIELD_LEN   (sizeof(RESPONSE_FIELD_S)-1)
#define RESPONSE_FIELD_S   "response=\""
#define STALE_STATE   4
#define URI_FIELD_LEN   (sizeof(URI_FIELD_S)-1)
#define URI_FIELD_S   "uri=\""
#define USERNAME_FIELD_LEN   (sizeof(USERNAME_FIELD_S)-1)
#define USERNAME_FIELD_S   "username=\""

Functions

strbuild_authorization_hdr (int code, str *uri, struct uac_credential *crd, struct authenticate_body *auth, char *response)
int parse_authenticate_body (str *body, struct authenticate_body *auth)


Define Documentation

#define add_string ( _p,
_s,
_l   ) 

Value:

do {\
      memcpy( _p, _s, _l);\
      _p += _l; \
   }while(0)

Definition at line 306 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define ALGORITHM_FIELD_LEN   (sizeof(ALGORITHM_FIELD_S)-1)

Definition at line 293 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define ALGORITHM_FIELD_S   "algorithm=MD5"

Definition at line 292 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define ALGORITHM_STATE   7

Definition at line 87 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define AUTHENTICATE_DIGEST_LEN   (sizeof(AUTHENTICATE_DIGEST_S)-1)

Definition at line 45 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define AUTHENTICATE_DIGEST_S   "Digest"

Definition at line 44 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define AUTHENTICATE_MD5   (1<<0)

Definition at line 40 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define AUTHENTICATE_MD5SESS   (1<<1)

Definition at line 41 of file auth_hdr.c.

Referenced by uac_calc_HA1().

#define AUTHENTICATE_STALE   (1<<2)

Definition at line 42 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define AUTHORIZATION_HDR_START   "Authorization: Digest "

Definition at line 273 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define AUTHORIZATION_HDR_START_LEN   (sizeof(AUTHORIZATION_HDR_START)-1)

Definition at line 274 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define CASE_5B ( _hex4,
_c5,
_new_state,
_quoted   ) 

Definition at line 56 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define CASE_6B ( _hex4,
_c5,
_c6,
_new_state,
_quoted   ) 

Definition at line 68 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define CNONCE_FIELD_LEN   (sizeof(CNONCE_FIELD_S)-1)

Definition at line 304 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define CNONCE_FIELD_S   "cnonce=\""

Definition at line 303 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define DOMAIN_STATE   5

Definition at line 85 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define FIELD_SEPARATOR_LEN   (sizeof(FIELD_SEPARATOR_S)-1)

Definition at line 295 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define FIELD_SEPARATOR_S   "\", "

Definition at line 294 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define FIELD_SEPARATOR_UQ_LEN   (sizeof(FIELD_SEPARATOR_UQ_S)-1)

Definition at line 297 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define FIELD_SEPARATOR_UQ_S   ", "

Definition at line 296 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define GET3B ( _p   )     ((*(_p)<<24) + (*(_p+1)<<16) + (*(_p+2)<<8) + 0xff)

Definition at line 53 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define GET4B ( _p   )     ((*(_p)<<24) + (*(_p+1)<<16) + (*(_p+2)<<8) + *(_p+3))

Definition at line 51 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define LOWER1B ( _n   )     ((_n)|0x20)

Definition at line 47 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define LOWER4B ( _n   )     ((_n)|0x20202020)

Definition at line 49 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define NC_FIELD_LEN   (sizeof(NC_FIELD_S)-1)

Definition at line 302 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define NC_FIELD_S   "nc="

Definition at line 301 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define NONCE_FIELD_LEN   (sizeof(NONCE_FIELD_S)-1)

Definition at line 285 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define NONCE_FIELD_S   "nonce=\""

Definition at line 284 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define NONCE_STATE   3

Definition at line 83 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define OPAQUE_FIELD_LEN   (sizeof(OPAQUE_FIELD_S)-1)

Definition at line 289 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define OPAQUE_FIELD_S   "opaque=\""

Definition at line 288 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define OPAQUE_STATE   6

Definition at line 86 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define OTHER_STATE   0

Definition at line 80 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define PROXY_AUTHORIZATION_HDR_START   "Proxy-Authorization: Digest "

Definition at line 276 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define PROXY_AUTHORIZATION_HDR_START_LEN   (sizeof(PROXY_AUTHORIZATION_HDR_START)-1)

Definition at line 277 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define QOP_FIELD_LEN   (sizeof(QOP_FIELD_S)-1)

Definition at line 300 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define QOP_FIELD_S   "qop="

Definition at line 299 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define QOP_STATE   1

Definition at line 81 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define REALM_FIELD_LEN   (sizeof(REALM_FIELD_S)-1)

Definition at line 283 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define REALM_FIELD_S   "realm=\""

Definition at line 282 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define REALM_STATE   2

Definition at line 82 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define RESPONSE_FIELD_LEN   (sizeof(RESPONSE_FIELD_S)-1)

Definition at line 291 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define RESPONSE_FIELD_S   "response=\""

Definition at line 290 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define STALE_STATE   4

Definition at line 84 of file auth_hdr.c.

Referenced by parse_authenticate_body().

#define URI_FIELD_LEN   (sizeof(URI_FIELD_S)-1)

Definition at line 287 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define URI_FIELD_S   "uri=\""

Definition at line 286 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define USERNAME_FIELD_LEN   (sizeof(USERNAME_FIELD_S)-1)

Definition at line 281 of file auth_hdr.c.

Referenced by build_authorization_hdr().

#define USERNAME_FIELD_S   "username=\""

Definition at line 280 of file auth_hdr.c.

Referenced by build_authorization_hdr().


Function Documentation

str* build_authorization_hdr ( int  code,
str uri,
struct uac_credential crd,
struct authenticate_body auth,
char *  response 
)

int parse_authenticate_body ( str body,
struct authenticate_body auth 
)


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