The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Functions | Variables
rlm_chap.c File Reference

Process chap authentication requests. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/password.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/util/chap.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include <freeradius-devel/unlang/call_env.h>
+ Include dependency graph for rlm_chap.c:

Go to the source code of this file.

Data Structures

struct  chap_auth_call_env_t
 
struct  chap_autz_call_env_t
 
struct  chap_xlat_call_env_t
 
struct  rlm_chap_t
 

Macros

#define LOG_PREFIX   mctx->inst->name
 

Functions

static unlang_action_t mod_authenticate (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
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 xlat_action_t xlat_func_chap_password (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in)
 Produce a CHAP-Password hash value. More...
 

Variables

static fr_dict_attr_t const * attr_auth_type
 
static fr_dict_attr_t const * attr_cleartext_password
 
static const call_env_method_t chap_auth_method_env
 
static const call_env_method_t chap_autz_method_env
 
static const call_env_method_t chap_xlat_method_env
 
static fr_dict_t const * dict_freeradius
 
static const conf_parser_t module_config []
 
module_rlm_t rlm_chap
 
fr_dict_autoload_t rlm_chap_dict []
 
fr_dict_attr_autoload_t rlm_chap_dict_attr []
 
static xlat_arg_parser_t const xlat_func_chap_password_args []
 

Detailed Description

Process chap authentication requests.

Id
166437cc2a7a80ad030c9f66f449b939ebca6f0d

Definition in file rlm_chap.c.


Data Structure Documentation

◆ chap_auth_call_env_t

struct chap_auth_call_env_t

Definition at line 82 of file rlm_chap.c.

+ Collaboration diagram for chap_auth_call_env_t:
Data Fields
fr_value_box_t chap_challenge
fr_value_box_t chap_password
fr_value_box_t username

◆ chap_autz_call_env_t

struct chap_autz_call_env_t

Definition at line 61 of file rlm_chap.c.

+ Collaboration diagram for chap_autz_call_env_t:
Data Fields
fr_value_box_t chap_challenge
tmpl_t * chap_challenge_tmpl
fr_value_box_t chap_password

◆ chap_xlat_call_env_t

struct chap_xlat_call_env_t

Definition at line 46 of file rlm_chap.c.

+ Collaboration diagram for chap_xlat_call_env_t:
Data Fields
fr_value_box_t chap_challenge

◆ rlm_chap_t

struct rlm_chap_t

Definition at line 36 of file rlm_chap.c.

+ Collaboration diagram for rlm_chap_t:
Data Fields
fr_dict_enum_value_t * auth_type
size_t min_challenge_len

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   mctx->inst->name

Definition at line 26 of file rlm_chap.c.

Function Documentation

◆ mod_authenticate()

static unlang_action_t mod_authenticate ( rlm_rcode_t p_result,
module_ctx_t const *  mctx,
request_t request 
)
static

Definition at line 228 of file rlm_chap.c.

+ Here is the call graph for this function:

◆ mod_authorize()

static unlang_action_t mod_authorize ( rlm_rcode_t p_result,
module_ctx_t const *  mctx,
request_t request 
)
static

Definition at line 176 of file rlm_chap.c.

+ Here is the call graph for this function:

◆ mod_bootstrap()

static int mod_bootstrap ( module_inst_ctx_t const *  mctx)
static

Definition at line 360 of file rlm_chap.c.

+ Here is the call graph for this function:

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 347 of file rlm_chap.c.

+ Here is the call graph for this function:

Variable Documentation

◆ attr_auth_type

fr_dict_attr_t const* attr_auth_type
static

Definition at line 115 of file rlm_chap.c.

◆ attr_cleartext_password

fr_dict_attr_t const* attr_cleartext_password
static

Definition at line 116 of file rlm_chap.c.

◆ chap_auth_method_env

const call_env_method_t chap_auth_method_env
static
Initial value:
= {
.env = (call_env_parser_t[]){
.pair.dflt = "&User-Name", .pair.dflt_quote = T_BARE_WORD },
{ FR_CALL_ENV_OFFSET("chap_password", FR_TYPE_OCTETS,
chap_auth_call_env_t, chap_password),
.pair.dflt = "&Chap-Password", .pair.dflt_quote = T_BARE_WORD },
{ FR_CALL_ENV_OFFSET("chap_challenge", FR_TYPE_OCTETS,
chap_auth_call_env_t, chap_challenge),
.pair.dflt = "&Chap-Challenge", .pair.dflt_quote = T_BARE_WORD },
}
}
#define CALL_ENV_TERMINATOR
Definition: call_env.h:212
#define FR_CALL_ENV_METHOD_OUT(_inst)
Helper macro for populating the size/type fields of a call_env_method_t from the output structure typ...
Definition: call_env.h:216
@ CALL_ENV_FLAG_CONCAT
If the tmpl produced multiple boxes they should be concatenated.
Definition: call_env.h:74
@ CALL_ENV_FLAG_ATTRIBUTE
Tmpl must contain an attribute reference.
Definition: call_env.h:84
@ CALL_ENV_FLAG_REQUIRED
Associated conf pair or section is required.
Definition: call_env.h:73
@ CALL_ENV_FLAG_NULLABLE
Tmpl expansions are allowed to produce no output.
Definition: call_env.h:78
#define FR_CALL_ENV_OFFSET(_name, _cast_type, _flags, _struct, _field)
Specify a call_env_parser_t which writes out runtime results to the specified field.
Definition: call_env.h:316
Per method call config.
Definition: call_env.h:171
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
@ FR_TYPE_OCTETS
Raw octets.
Definition: merged_model.c:84
username
Definition: rlm_securid.c:420
@ T_BARE_WORD
Definition: token.h:120

Definition at line 88 of file rlm_chap.c.

◆ chap_autz_method_env

const call_env_method_t chap_autz_method_env
static
Initial value:
= {
.env = (call_env_parser_t[]){
{ FR_CALL_ENV_OFFSET("chap_password", FR_TYPE_OCTETS,
chap_autz_call_env_t, chap_password),
.pair.dflt = "&Chap-Password", .pair.dflt_quote = T_BARE_WORD },
chap_autz_call_env_t, chap_challenge, chap_challenge_tmpl),
.pair.dflt = "&Chap-Challenge", .pair.dflt_quote = T_BARE_WORD },
}
}
#define FR_CALL_ENV_PARSE_OFFSET(_name, _cast_type, _flags, _struct, _field, _parse_field)
Specify a call_env_parser_t which writes out runtime results and the result of the parsing phase to t...
Definition: call_env.h:341

Definition at line 67 of file rlm_chap.c.

◆ chap_xlat_method_env

const call_env_method_t chap_xlat_method_env
static
Initial value:

Definition at line 50 of file rlm_chap.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius
static

Definition at line 107 of file rlm_chap.c.

◆ module_config

const conf_parser_t module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET_TYPE_FLAGS("min_challenge_len", FR_TYPE_SIZE, 0, rlm_chap_t, min_challenge_len), .dflt = "16" },
}
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:626
#define FR_CONF_OFFSET_TYPE_FLAGS(_name, _type, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:241
@ FR_TYPE_SIZE
Unsigned integer capable of representing any memory address on the local system.
Definition: merged_model.c:115

Definition at line 41 of file rlm_chap.c.

◆ rlm_chap

module_rlm_t rlm_chap
Initial value:
= {
.common = {
.name = "chap",
.inst_size = sizeof(rlm_chap_t),
.bootstrap = mod_bootstrap,
},
.method_names = (module_method_name_t[]){
{ .name1 = "recv", .name2 = "access-request", .method = mod_authorize,
.method_env = &chap_autz_method_env },
{ .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate,
.method_env = &chap_auth_method_env },
}
}
#define CF_IDENT_ANY
Definition: cf_util.h:78
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:65
Specifies a module method identifier.
Definition: module_method.c:36
static const conf_parser_t config[]
Definition: base.c:188
static const call_env_method_t chap_autz_method_env
Definition: rlm_chap.c:67
static unlang_action_t mod_authenticate(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Definition: rlm_chap.c:228
static int mod_bootstrap(module_inst_ctx_t const *mctx)
Definition: rlm_chap.c:360
static const call_env_method_t chap_auth_method_env
Definition: rlm_chap.c:88
static unlang_action_t mod_authorize(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Definition: rlm_chap.c:176
static const conf_parser_t module_config[]
Definition: rlm_chap.c:41
static int mod_instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_chap.c:347
static int instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1312
#define MODULE_NAME_TERMINATOR
Definition: module.h:135

Definition at line 382 of file rlm_chap.c.

◆ rlm_chap_dict

fr_dict_autoload_t rlm_chap_dict
Initial value:
= {
{ .out = &dict_freeradius, .proto = "freeradius" },
{ NULL }
}
static fr_dict_t const * dict_freeradius
Definition: rlm_chap.c:107

Definition at line 110 of file rlm_chap.c.

◆ rlm_chap_dict_attr

fr_dict_attr_autoload_t rlm_chap_dict_attr
Initial value:
= {
{ .out = &attr_auth_type, .name = "Auth-Type", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
{ .out = &attr_cleartext_password, .name = "Password.Cleartext", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
{ NULL }
}
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
static fr_dict_attr_t const * attr_auth_type
Definition: rlm_chap.c:115
static fr_dict_attr_t const * attr_cleartext_password
Definition: rlm_chap.c:116

Definition at line 119 of file rlm_chap.c.

◆ xlat_func_chap_password_args

xlat_arg_parser_t const xlat_func_chap_password_args[]
static
Initial value:
= {
{ .required = true, .single = true, .type = FR_TYPE_STRING },
}
#define XLAT_ARG_PARSER_TERMINATOR
Definition: xlat.h:166

Definition at line 126 of file rlm_chap.c.