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

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. | |
Definition in file rfc2617.c.
| 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.
| _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.
| _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().
Convert to hex form.
| _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().
1.5.6