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 "mschap.h"
#include "smbdes.h"
Go to the source code of this file.
Data Structures | |
struct | mschap_auth_ctx_t |
struct | mschap_autz_call_env_t |
struct | mschap_cpw_ctx_t |
struct | mschap_xlat_call_env_t |
Macros | |
#define | ACB_AUTOLOCK 0x04000000 |
Account auto locked. More... | |
#define | ACB_DISABLED 0x00010000 |
User account disabled. More... | |
#define | ACB_DOMTRUST 0x00400000 |
Interdomain trust account. More... | |
#define | ACB_FR_EXPIRED 0x00020000 |
Password Expired. More... | |
#define | ACB_HOMDIRREQ 0x00020000 |
Home directory required. More... | |
#define | ACB_MNS 0x00200000 |
MNS logon user account. More... | |
#define | ACB_NORMAL 0x00100000 |
Normal user account. More... | |
#define | ACB_PWNOEXP 0x02000000 |
User password does not expire. More... | |
#define | ACB_PWNOTREQ 0x00040000 |
User password not required. More... | |
#define | ACB_SVRTRUST 0x01000000 |
Server trust account. More... | |
#define | ACB_TEMPDUP 0x00080000 |
Temporary duplicate account. More... | |
#define | ACB_WSTRUST 0x00800000 |
Workstation trust account. More... | |
#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, fr_pair_t *password, uint8_t const *challenge, uint8_t const *response, uint8_t nthashhash[static NT_DIGEST_LENGTH], MSCHAP_AUTH_METHOD method, UNUSED mschap_auth_call_env_t *env_data) |
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. More... | |
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. More... | |
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_detach (UNUSED module_detach_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. More... | |
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, fr_pair_t *smb_ctrl, fr_pair_t *nt_password, fr_pair_t *challenge, fr_pair_t *response, MSCHAP_AUTH_METHOD method, mschap_auth_call_env_t *env_data) |
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, fr_pair_t *smb_ctrl, fr_pair_t *nt_password, fr_pair_t *challenge, fr_pair_t *response, MSCHAP_AUTH_METHOD method, mschap_auth_call_env_t *env_data) |
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. More... | |
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. More... | |
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_auth_ctx_t |
Definition at line 225 of file rlm_mschap.c.
Data Fields | ||
---|---|---|
fr_pair_t * | cpw | |
mschap_cpw_ctx_t * | cpw_ctx | |
mschap_auth_call_env_t * | env_data | |
rlm_mschap_t const * | inst | |
MSCHAP_AUTH_METHOD | method | |
char const * | name | |
fr_pair_t * | nt_password | |
fr_pair_t * | smb_ctrl |
struct mschap_autz_call_env_t |
struct mschap_cpw_ctx_t |
Definition at line 216 of file rlm_mschap.c.
Data Fields | ||
---|---|---|
fr_value_box_list_t | cpw_domain | |
fr_value_box_list_t | cpw_user | |
fr_value_box_list_t | local_cpw_result | |
fr_pair_t * | new_hash | |
uint8_t | new_nt_encrypted[516] | |
uint8_t | old_nt_hash[NT_DIGEST_LENGTH] |
struct mschap_xlat_call_env_t |
#define ACB_AUTOLOCK 0x04000000 |
Account auto locked.
Definition at line 80 of file rlm_mschap.c.
#define ACB_DISABLED 0x00010000 |
User account disabled.
Definition at line 70 of file rlm_mschap.c.
#define ACB_DOMTRUST 0x00400000 |
Interdomain trust account.
Definition at line 76 of file rlm_mschap.c.
#define ACB_FR_EXPIRED 0x00020000 |
Password Expired.
Definition at line 81 of file rlm_mschap.c.
#define ACB_HOMDIRREQ 0x00020000 |
Home directory required.
Definition at line 71 of file rlm_mschap.c.
#define ACB_MNS 0x00200000 |
MNS logon user account.
Definition at line 75 of file rlm_mschap.c.
#define ACB_NORMAL 0x00100000 |
Normal user account.
Definition at line 74 of file rlm_mschap.c.
#define ACB_PWNOEXP 0x02000000 |
User password does not expire.
Definition at line 79 of file rlm_mschap.c.
#define ACB_PWNOTREQ 0x00040000 |
User password not required.
Definition at line 72 of file rlm_mschap.c.
#define ACB_SVRTRUST 0x01000000 |
Server trust account.
Definition at line 78 of file rlm_mschap.c.
#define ACB_TEMPDUP 0x00080000 |
Temporary duplicate account.
Definition at line 73 of file rlm_mschap.c.
#define ACB_WSTRUST 0x00800000 |
Workstation trust account.
Definition at line 77 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 130 of file rlm_mschap.c.
#define MSCHAP_COMMON_CALL_ENV | ( | _x | ) |
Definition at line 139 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 147 of file rlm_mschap.c.
|
static |
Definition at line 1068 of file rlm_mschap.c.
|
static |
Definition at line 856 of file rlm_mschap.c.
|
static |
|
static |
When changing passwords using the ntlm_auth helper, evaluate the domain tmpl.
Definition at line 2098 of file rlm_mschap.c.
|
static |
Complete mschap authentication after any tmpls have been expanded.
Definition at line 1949 of file rlm_mschap.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 822 of file rlm_mschap.c.
|
static |
Definition at line 1358 of file rlm_mschap.c.
|
static |
Definition at line 1344 of file rlm_mschap.c.
|
static |
Definition at line 1318 of file rlm_mschap.c.
|
static |
Definition at line 1302 of file rlm_mschap.c.
MSCHAP_CALL_ENV | ( | autz | ) |
MSCHAP_CALL_ENV | ( | xlat | ) |
|
static |
Validate data required for change password requests.
Definition at line 1635 of file rlm_mschap.c.
|
static |
Definition at line 1417 of file rlm_mschap.c.
|
static |
Definition at line 275 of file rlm_mschap.c.
|
static |
Definition at line 1602 of file rlm_mschap.c.
|
static |
Definition at line 1735 of file rlm_mschap.c.
|
static |
Definition at line 1793 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 1515 of file rlm_mschap.c.
|
static |
|
static |
fr_dict_attr_t const* attr_auth_type |
Definition at line 246 of file rlm_mschap.c.
fr_dict_attr_t const* attr_cleartext_password |
Definition at line 247 of file rlm_mschap.c.
fr_dict_attr_t const* attr_eap_identity |
Definition at line 248 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_new_cleartext_password |
Definition at line 249 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_new_nt_password |
Definition at line 250 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_peer_challenge |
Definition at line 251 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_use_ntlm_auth |
Definition at line 252 of file rlm_mschap.c.
fr_dict_attr_t const* attr_ms_chap_user_name |
Definition at line 253 of file rlm_mschap.c.
fr_dict_attr_t const* attr_nt_password |
Definition at line 254 of file rlm_mschap.c.
fr_dict_attr_t const* attr_smb_account_ctrl |
Definition at line 256 of file rlm_mschap.c.
fr_dict_attr_t const* attr_smb_account_ctrl_text |
Definition at line 255 of file rlm_mschap.c.
|
static |
Definition at line 165 of file rlm_mschap.c.
|
static |
Definition at line 208 of file rlm_mschap.c.
|
static |
Definition at line 236 of file rlm_mschap.c.
|
static |
Definition at line 237 of file rlm_mschap.c.
|
static |
Definition at line 1274 of file rlm_mschap.c.
|
static |
Definition at line 1279 of file rlm_mschap.c.
|
static |
Definition at line 1290 of file rlm_mschap.c.
|
static |
Definition at line 96 of file rlm_mschap.c.
|
static |
Definition at line 180 of file rlm_mschap.c.
|
static |
Definition at line 368 of file rlm_mschap.c.
|
static |
Definition at line 83 of file rlm_mschap.c.
module_rlm_t rlm_mschap |
Definition at line 2522 of file rlm_mschap.c.
fr_dict_autoload_t rlm_mschap_dict |
Definition at line 240 of file rlm_mschap.c.
fr_dict_attr_autoload_t rlm_mschap_dict_attr |
Definition at line 259 of file rlm_mschap.c.
|
static |
Definition at line 1262 of file rlm_mschap.c.
|
static |
Definition at line 1268 of file rlm_mschap.c.
|
static |
Definition at line 88 of file rlm_mschap.c.
|
static |
Definition at line 157 of file rlm_mschap.c.