#include <time.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include "../../md5.h"
#include "../../dprint.h"
#include "../../ut.h"
#include "../../timer.h"
#include "nonce.h"
#include "index.h"
#include "auth_mod.h"

Go to the source code of this file.
Functions | |
| void | calc_nonce (char *_nonce, int _expires, int _index, str *_secret) |
| Calculate nonce value. | |
| int | check_nonce (str *_nonce, str *_secret) |
| Check nonce value received from user agent. | |
| static time_t | get_nonce_expires (str *_n) |
| Get expiry time from nonce string. | |
| int | get_nonce_index (str *_n) |
| Get index from nonce string. | |
| static int | hex2integer (char *_s) |
| Convert hex string to integer. | |
| static void | integer2hex (char *_d, int _s) |
| int | is_nonce_stale (str *_n) |
| Check if a nonce is stale. | |
Definition in file nonce.c.
| void calc_nonce | ( | char * | _nonce, | |
| int | _expires, | |||
| int | _index, | |||
| str * | _secret | |||
| ) |
Calculate nonce value.
Calculate nonce value value. The nonce value consists of the expires time (in seconds since 1.1 1970) and a secret phrase.
| _nonce | nonce value | |
| _expires | expires value | |
| _index | nonce index | |
| _secret | secret |
Definition at line 110 of file nonce.c.
References integer2hex(), _str::len, MD5Init(), MD5Update(), nonce_reuse, _str::s, string2hex(), and U_MD5Final().
Referenced by build_auth_hf(), and check_nonce().
Check nonce value received from user agent.
| _nonce | nonce value | |
| _secret | secret phrase |
Definition at line 163 of file nonce.c.
References calc_nonce(), get_nonce_expires(), get_nonce_index(), _str::len, LM_DBG, NONCE_LEN, nonce_reuse, _str::s, and ZSW.
Referenced by pre_auth().
| static time_t get_nonce_expires | ( | str * | _n | ) | [inline, static] |
Get expiry time from nonce string.
| _n | nonce string |
Definition at line 151 of file nonce.c.
References hex2integer(), and _str::s.
Referenced by check_nonce(), and is_nonce_stale().
| int get_nonce_index | ( | str * | _n | ) |
Get index from nonce string.
| _n | nonce string |
Definition at line 140 of file nonce.c.
References hex2integer(), and _str::s.
Referenced by check_nonce(), and post_auth().
| static int hex2integer | ( | char * | _s | ) | [inline, static] |
Convert hex string to integer.
| _s | hex string |
Definition at line 81 of file nonce.c.
Referenced by get_nonce_expires(), and get_nonce_index().
| static void integer2hex | ( | char * | _d, | |
| int | _s | |||
| ) | [inline, static] |
Convert an integer to its hex representation, destination array must be at least 8 bytes long, this string is NOT zero terminated
Definition at line 48 of file nonce.c.
References s.
Referenced by calc_nonce().
| int is_nonce_stale | ( | str * | _n | ) |
Check if a nonce is stale.
| _n | nonce string |
Definition at line 199 of file nonce.c.
References get_nonce_expires(), and _str::s.
Referenced by post_auth().
1.5.6