rfc2617.c File Reference

Digest response calculation as per RFC2617

More...

#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include "rfc2617.h"
#include "../../md5.h"

Include dependency graph for rfc2617.c:

Go to the source code of this file.

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.c.


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