rfc2617.h File Reference

Digest response calculation as per RFC2617

More...

#include "../../str.h"

Include dependency graph for rfc2617.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define HASHHEXLEN   32
#define HASHLEN   16

Typedefs

typedef char HASH [HASHLEN]
typedef char HASHHEX [HASHHEXLEN+1]

Enumerations

enum  ha_alg_t { HA_MD5, HA_MD5_SESS }

Functions

void calc_HA1 (ha_alg_t _alg, str *_username, str *_realm, str *_password, str *_nonce, str *_cnonce, HASHHEX _sess_key)
 Calculate H(A1) as per HTTP Digest spec.
void calc_response (HASHHEX _ha1, str *_nonce, str *_nc, str *_cnonce, str *_qop, int _auth_int, str *_method, str *_uri, HASHHEX _hentity, HASHHEX _response)
 Calculate request-digest/response-digest as per HTTP Digest spec.
void cvt_hex (HASH _b, HASHHEX _h)
 Convert to hex form.


Detailed Description

Digest response calculation as per RFC2617

Definition in file rfc2617.h.


Define Documentation

#define HASHHEXLEN   32

Definition at line 40 of file rfc2617.h.

Referenced by calc_response(), cvt_hex(), uac_calc_HA2(), and uac_calc_response().

#define HASHLEN   16

Definition at line 36 of file rfc2617.h.

Referenced by calc_HA1(), cvt_hex(), and uac_calc_HA1().


Typedef Documentation

typedef char HASH[HASHLEN]

Definition at line 37 of file rfc2617.h.

typedef char HASHHEX[HASHHEXLEN+1]

Definition at line 41 of file rfc2617.h.


Enumeration Type Documentation

enum ha_alg_t

Type of algorithm used

Enumerator:
HA_MD5  Plain MD5
HA_MD5_SESS  MD5-Session

Definition at line 45 of file rfc2617.h.


Function Documentation

void calc_HA1 ( ha_alg_t  _alg,
str _username,
str _realm,
str _password,
str _nonce,
str _cnonce,
HASHHEX  _sess_key 
)

Calculate H(A1) as per HTTP Digest spec.

Parameters:
_alg type of hash algorithm
_username username
_realm authentification realm
_password password
_nonce nonce value
_cnonce cnonce value
_sess_key session key, result will be stored there

Definition at line 79 of file rfc2617.c.

References cvt_hex(), HA_MD5_SESS, HASH, HASHLEN, _str::len, MD5Final(), MD5Init(), MD5Update(), and _str::s.

Referenced by auth_get_ha1(), and bind_auth().

void calc_response ( HASHHEX  _ha1,
str _nonce,
str _nc,
str _cnonce,
str _qop,
int  _auth_int,
str _method,
str _uri,
HASHHEX  _hentity,
HASHHEX  _response 
)

Calculate request-digest/response-digest as per HTTP Digest spec.

Parameters:
_ha1 H(A1)
_nonce nonce from server
_nc 8 hex digits
_cnonce 
_qop qop-value: "", "auth", "auth-int
_auth_int 1 if auth-int is used
_method method from the request
_uri requested URL/ URI
_hentity H(entity body) if qop="auth-int"
_response request-digest or response-digest
_ha1 H(A1)
_nonce nonce from server
_nc 8 hex digits
_cnonce cnonce value
_qop qop-value: "", "auth", "auth-int
_auth_int 1 if auth-int is used
_method method from the request
_uri requested URL/ URI
_hentity H(entity body) if qop="auth-int"
_response request-digest or response-digest

Definition at line 120 of file rfc2617.c.

References cvt_hex(), HASH, HASHHEXLEN, _str::len, MD5Final(), MD5Init(), MD5Update(), and _str::s.

Referenced by check_response().

void cvt_hex ( HASH  _b,
HASHHEX  _h 
) [inline]

Convert to hex form.

Parameters:
_b hash value
_h hex value

Definition at line 43 of file rfc2617.c.

References HASHHEXLEN, and HASHLEN.

Referenced by calc_HA1(), calc_response(), uac_calc_HA1(), uac_calc_HA2(), and uac_calc_response().


Generated on Thu May 24 10:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6