The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Implemented mschap authentication. More...
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/exec_legacy.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/password.h>
#include <freeradius-devel/tls/strerror.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/radius/defs.h>
#include <freeradius-devel/util/base16.h>
#include <freeradius-devel/util/md4.h>
#include <freeradius-devel/util/md5.h>
#include <freeradius-devel/util/misc.h>
#include <freeradius-devel/util/sha1.h>
#include <freeradius-devel/unlang/function.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <sys/wait.h>
#include "rlm_mschap.h"
#include "smbdes.h"
Go to the source code of this file.
Data Structures | |
struct | mschap_autz_call_env_t |
struct | mschap_xlat_call_env_t |
Macros | |
#define | ACB_AUTOLOCK 0x04000000 |
Account auto locked. | |
#define | ACB_DISABLED 0x00010000 |
User account disabled. | |
#define | ACB_DOMTRUST 0x00400000 |
Interdomain trust account. | |
#define | ACB_FR_EXPIRED 0x00020000 |
Password Expired. | |
#define | ACB_HOMDIRREQ 0x00020000 |
Home directory required. | |
#define | ACB_MNS 0x00200000 |
MNS logon user account. | |
#define | ACB_NORMAL 0x00100000 |
Normal user account. | |
#define | ACB_PWNOEXP 0x02000000 |
User password does not expire. | |
#define | ACB_PWNOTREQ 0x00040000 |
User password not required. | |
#define | ACB_SVRTRUST 0x01000000 |
Server trust account. | |
#define | ACB_TEMPDUP 0x00080000 |
Temporary duplicate account. | |
#define | ACB_WSTRUST 0x00800000 |
Workstation trust account. | |
#define | CHECK_OPTION(_option) |
#define | LOG_PREFIX mctx->mi->name |
#define | MSCHAP_CALL_ENV(_x) |
#define | MSCHAP_COMMON_CALL_ENV(_x) |
#define | MSCHAP_OPT_CALL_ENV(_opt, _x) { FR_CALL_ENV_PARSE_ONLY_OFFSET(STRINGIFY(_opt), FR_TYPE_OCTETS, CALL_ENV_FLAG_ATTRIBUTE, mschap_ ## _x ## _call_env_t, _opt) } |
Functions | |
static int | do_mschap (rlm_mschap_t const *inst, request_t *request, mschap_auth_ctx_t *auth_ctx, uint8_t const *challenge, uint8_t const *response, uint8_t nthashhash[static NT_DIGEST_LENGTH]) |
static int | do_mschap_cpw (rlm_mschap_t const *inst, request_t *request, mschap_auth_ctx_t *auth_ctx, uint8_t *new_nt_password, uint8_t *old_nt_hash) |
static unlang_action_t | mod_authenticate (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
static unlang_action_t | mod_authenticate_domain_tmpl_push (rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx) |
When changing passwords using the ntlm_auth helper, evaluate the domain tmpl. | |
static unlang_action_t | mod_authenticate_resume (rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx) |
Complete mschap authentication after any tmpls have been expanded. | |
static unlang_action_t | mod_authorize (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request) |
static int | mod_bootstrap (module_inst_ctx_t const *mctx) |
static int | mod_instantiate (module_inst_ctx_t const *mctx) |
static void | mppe_add_reply (UNUSED rlm_mschap_t const *inst, request_t *request, fr_dict_attr_t const *da, uint8_t const *value, size_t len) |
static void | mppe_chap2_gen_keys128 (uint8_t const *nt_hashhash, uint8_t const *response, uint8_t *sendkey, uint8_t *recvkey) |
static void | mppe_chap2_get_keys128 (uint8_t const *nt_hashhash, uint8_t const *nt_response, uint8_t *sendkey, uint8_t *recvkey) |
static void | mppe_GetAsymmetricStartKey (uint8_t *masterkey, uint8_t *sesskey, int keylen, int issend) |
static void | mppe_GetMasterKey (uint8_t const *nt_hashhash, uint8_t const *nt_response, uint8_t *masterkey) |
MSCHAP_CALL_ENV (autz) | |
MSCHAP_CALL_ENV (xlat) | |
static int | mschap_cpw_prepare (request_t *request, mschap_auth_ctx_t *auth_ctx) |
Validate data required for change password requests. | |
static unlang_action_t | mschap_error (rlm_rcode_t *p_result, rlm_mschap_t const *inst, request_t *request, unsigned char ident, int mschap_result, int mschap_version, fr_pair_t *smb_ctrl, mschap_auth_call_env_t *env_data) |
static fr_pair_t * | mschap_identity_find (request_t *request, fr_dict_attr_t const *attr_user_name) |
static unlang_action_t | mschap_process_cpw_request (rlm_rcode_t *p_result, rlm_mschap_t const *inst, request_t *request, mschap_auth_ctx_t *auth_ctx) |
static unlang_action_t | mschap_process_response (rlm_rcode_t *p_result, int *mschap_version, uint8_t nthashhash[static NT_DIGEST_LENGTH], rlm_mschap_t const *inst, request_t *request, mschap_auth_ctx_t *auth_ctx, fr_pair_t *challenge, fr_pair_t *response) |
static unlang_action_t | mschap_process_v2_response (rlm_rcode_t *p_result, int *mschap_version, uint8_t nthashhash[static NT_DIGEST_LENGTH], rlm_mschap_t const *inst, request_t *request, mschap_auth_ctx_t *auth_ctx, fr_pair_t *challenge, fr_pair_t *response) |
static xlat_action_t | mschap_xlat (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
Get data from MSCHAP attributes. | |
static int | nt_password_find (TALLOC_CTX *ctx, fr_pair_t **out, rlm_mschap_t const *inst, request_t *request) |
Find a Password.NT value, or create one from a Password.Cleartext, or Password.With-Header attribute. | |
static int | pdb_decode_acct_ctrl (char const *p) |
static int | write_all (int fd, char const *buf, size_t len) |
Implemented mschap authentication.
Definition in file rlm_mschap.c.
struct mschap_autz_call_env_t |
struct mschap_xlat_call_env_t |
#define ACB_AUTOLOCK 0x04000000 |
Account auto locked.
Definition at line 79 of file rlm_mschap.c.
#define ACB_DISABLED 0x00010000 |
User account disabled.
Definition at line 69 of file rlm_mschap.c.
#define ACB_DOMTRUST 0x00400000 |
Interdomain trust account.
Definition at line 75 of file rlm_mschap.c.
#define ACB_FR_EXPIRED 0x00020000 |
Password Expired.
Definition at line 80 of file rlm_mschap.c.
#define ACB_HOMDIRREQ 0x00020000 |
Home directory required.
Definition at line 70 of file rlm_mschap.c.
#define ACB_MNS 0x00200000 |
MNS logon user account.
Definition at line 74 of file rlm_mschap.c.
#define ACB_NORMAL 0x00100000 |
Normal user account.
Definition at line 73 of file rlm_mschap.c.
#define ACB_PWNOEXP 0x02000000 |
User password does not expire.
Definition at line 78 of file rlm_mschap.c.
#define ACB_PWNOTREQ 0x00040000 |
User password not required.
Definition at line 71 of file rlm_mschap.c.
#define ACB_SVRTRUST 0x01000000 |
Server trust account.
Definition at line 77 of file rlm_mschap.c.
#define ACB_TEMPDUP 0x00080000 |
Temporary duplicate account.
Definition at line 72 of file rlm_mschap.c.
#define ACB_WSTRUST 0x00800000 |
Workstation trust account.
Definition at line 76 of file rlm_mschap.c.
#define CHECK_OPTION | ( | _option | ) |
Definition at line 29 of file rlm_mschap.c.
#define MSCHAP_CALL_ENV | ( | _x | ) |
Definition at line 137 of file rlm_mschap.c.
#define MSCHAP_COMMON_CALL_ENV | ( | _x | ) |
Definition at line 146 of file rlm_mschap.c.
#define MSCHAP_OPT_CALL_ENV | ( | _opt, | |
_x | |||
) | { FR_CALL_ENV_PARSE_ONLY_OFFSET(STRINGIFY(_opt), FR_TYPE_OCTETS, CALL_ENV_FLAG_ATTRIBUTE, mschap_ ## _x ## _call_env_t, _opt) } |
Definition at line 154 of file rlm_mschap.c.
|
static |
Definition at line 1054 of file rlm_mschap.c.
|
static |
Definition at line 842 of file rlm_mschap.c.
|
static |
|
static |
When changing passwords using the ntlm_auth helper, evaluate the domain tmpl.
Definition at line 2063 of file rlm_mschap.c.
|
static |
Complete mschap authentication after any tmpls have been expanded.
Definition at line 1916 of file rlm_mschap.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 799 of file rlm_mschap.c.
|
static |
Definition at line 1337 of file rlm_mschap.c.
|
static |
Definition at line 1323 of file rlm_mschap.c.
|
static |
Definition at line 1297 of file rlm_mschap.c.
|
static |
Definition at line 1281 of file rlm_mschap.c.
MSCHAP_CALL_ENV | ( | autz | ) |
MSCHAP_CALL_ENV | ( | xlat | ) |
|
static |
Validate data required for change password requests.
Definition at line 1614 of file rlm_mschap.c.
|
static |
Definition at line 1396 of file rlm_mschap.c.
|
static |
Definition at line 262 of file rlm_mschap.c.
|
static |
Definition at line 1581 of file rlm_mschap.c.
|
static |
Definition at line 1714 of file rlm_mschap.c.
|
static |
Definition at line 1766 of file rlm_mschap.c.
|
static |
Find a Password.NT value, or create one from a Password.Cleartext, or Password.With-Header attribute.
[in] | ctx | to allocate ephemeral passwords in. |
[out] | out | Our new Password.NT. |
[in] | inst | Module configuration. |
[in] | request | The current request. |
Definition at line 1494 of file rlm_mschap.c.
|
static |
|
static |
fr_dict_attr_t const* attr_auth_type |
Definition at line 233 of file rlm_mschap.c.
fr_dict_attr_t const* attr_cleartext_password |
Definition at line 234 of file rlm_mschap.c.
fr_dict_attr_t const* attr_eap_identity |
Definition at line 235 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_new_cleartext_password |
Definition at line 236 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_new_nt_password |
Definition at line 237 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_peer_challenge |
Definition at line 238 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_use_ntlm_auth |
Definition at line 239 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_user_name |
Definition at line 240 of file rlm_mschap.c.
fr_dict_attr_t const* attr_nt_password |
Definition at line 241 of file rlm_mschap.c.
fr_dict_attr_t const* attr_smb_account_ctrl |
Definition at line 243 of file rlm_mschap.c.
fr_dict_attr_t const* attr_smb_account_ctrl_text |
Definition at line 242 of file rlm_mschap.c.
|
static |
Definition at line 172 of file rlm_mschap.c.
|
static |
Definition at line 215 of file rlm_mschap.c.
|
static |
Definition at line 223 of file rlm_mschap.c.
|
static |
Definition at line 224 of file rlm_mschap.c.
|
static |
Definition at line 1253 of file rlm_mschap.c.
|
static |
Definition at line 1258 of file rlm_mschap.c.
|
static |
Definition at line 1269 of file rlm_mschap.c.
|
static |
Definition at line 103 of file rlm_mschap.c.
|
static |
Definition at line 187 of file rlm_mschap.c.
|
static |
Definition at line 355 of file rlm_mschap.c.
|
static |
Definition at line 82 of file rlm_mschap.c.
module_rlm_t rlm_mschap |
Definition at line 2491 of file rlm_mschap.c.
fr_dict_autoload_t rlm_mschap_dict |
Definition at line 227 of file rlm_mschap.c.
fr_dict_attr_autoload_t rlm_mschap_dict_attr |
Definition at line 246 of file rlm_mschap.c.
|
static |
Definition at line 1241 of file rlm_mschap.c.
|
static |
Definition at line 1247 of file rlm_mschap.c.
|
static |
Definition at line 94 of file rlm_mschap.c.
|
static |
Definition at line 164 of file rlm_mschap.c.