The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Functions | Variables
rlm_eap_mschapv2.c File Reference
#include <freeradius-devel/server/dependency.h>
#include <freeradius-devel/server/pair.h>
#include <freeradius-devel/server/virtual_servers.h>
#include <freeradius-devel/unlang/call.h>
#include <freeradius-devel/unlang/interpret.h>
#include <freeradius-devel/util/base16.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/rand.h>
#include "eap_mschapv2.h"
+ Include dependency graph for rlm_eap_mschapv2.c:

Go to the source code of this file.

Data Structures

struct  rlm_eap_mschapv2_t
 

Functions

static int auth_type_parse (TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
 
static int auth_type_parse (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)
 Translate a string auth_type into an enumeration value. More...
 
static int eap_mschapv2_compose (rlm_eap_mschapv2_t const *inst, request_t *request, eap_session_t *eap_session, fr_pair_t *reply)
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static unlang_action_t mod_process (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static unlang_action_t mod_session_init (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static void mppe_keys_store (request_t *request, mschapv2_opaque_t *data)
 
static unlang_action_t mschap_resume (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 

Variables

static fr_dict_attr_t const * attr_auth_type
 
static fr_dict_attr_t const * attr_microsoft
 
static fr_dict_attr_t const * attr_ms_chap2_cpw
 
static fr_dict_attr_t const * attr_ms_chap2_response
 
static fr_dict_attr_t const * attr_ms_chap2_success
 
static fr_dict_attr_t const * attr_ms_chap_challenge
 
static fr_dict_attr_t const * attr_ms_chap_error
 
static fr_dict_attr_t const * attr_ms_chap_nt_enc_pw
 
static fr_dict_attr_t const * attr_ms_chap_peer_challenge
 
static fr_dict_attr_t const * attr_ms_chap_user_name
 
static fr_dict_attr_t const * attr_ms_mppe_encryption_policy
 
static fr_dict_attr_t const * attr_ms_mppe_encryption_type
 
static fr_dict_attr_t const * attr_ms_mppe_recv_key
 
static fr_dict_attr_t const * attr_ms_mppe_send_key
 
static fr_dict_attr_t const * attr_state
 
static fr_dict_attr_t const * attr_user_name
 
static fr_dict_t const * dict_freeradius
 
static fr_dict_t const * dict_radius
 
rlm_eap_submodule_t rlm_eap_mschapv2
 
fr_dict_autoload_t rlm_eap_mschapv2_dict []
 
fr_dict_attr_autoload_t rlm_eap_mschapv2_dict_attr []
 
static conf_parser_t submodule_config []
 

Data Structure Documentation

◆ rlm_eap_mschapv2_t

struct rlm_eap_mschapv2_t

Definition at line 39 of file rlm_eap_mschapv2.c.

+ Collaboration diagram for rlm_eap_mschapv2_t:
Data Fields
fr_dict_enum_value_t * auth_type
char const * identity
bool send_error
bool with_ntdomain_hack

Function Documentation

◆ auth_type_parse() [1/2]

static int auth_type_parse ( TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
UNUSED conf_parser_t const *  rule 
)
static

◆ auth_type_parse() [2/2]

static int auth_type_parse ( UNUSED TALLOC_CTX *  ctx,
void *  out,
UNUSED void *  parent,
CONF_ITEM ci,
UNUSED conf_parser_t const *  rule 
)
static

Translate a string auth_type into an enumeration value.

Parameters
[in]ctxto allocate data.
[out]outWhere to write the auth_type we created or resolved.
[in]parentBase structure address.
[in]ciCONF_PAIR specifying the name of the auth_type.
[in]ruleunused.
Returns
  • 0 on success.
  • -1 on failure.

Definition at line 147 of file rlm_eap_mschapv2.c.

+ Here is the call graph for this function:

◆ eap_mschapv2_compose()

static int eap_mschapv2_compose ( rlm_eap_mschapv2_t const *  inst,
request_t request,
eap_session_t eap_session,
fr_pair_t reply 
)
static

Definition at line 166 of file rlm_eap_mschapv2.c.

+ Here is the caller graph for this function:

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 708 of file rlm_eap_mschapv2.c.

+ Here is the call graph for this function:

◆ mod_process()

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

Definition at line 370 of file rlm_eap_mschapv2.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mod_session_init()

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

Definition at line 619 of file rlm_eap_mschapv2.c.

+ Here is the call graph for this function:

◆ mppe_keys_store()

static void mppe_keys_store ( request_t request,
mschapv2_opaque_t data 
)
static

Definition at line 107 of file rlm_eap_mschapv2.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mschap_resume()

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

Definition at line 279 of file rlm_eap_mschapv2.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ attr_auth_type

fr_dict_attr_t const* attr_auth_type
static

Definition at line 65 of file rlm_eap_mschapv2.c.

◆ attr_microsoft

fr_dict_attr_t const* attr_microsoft
static

Definition at line 69 of file rlm_eap_mschapv2.c.

◆ attr_ms_chap2_cpw

fr_dict_attr_t const* attr_ms_chap2_cpw
static

Definition at line 74 of file rlm_eap_mschapv2.c.

◆ attr_ms_chap2_response

fr_dict_attr_t const* attr_ms_chap2_response
static

Definition at line 75 of file rlm_eap_mschapv2.c.

◆ attr_ms_chap2_success

fr_dict_attr_t const* attr_ms_chap2_success
static

Definition at line 76 of file rlm_eap_mschapv2.c.

◆ attr_ms_chap_challenge

fr_dict_attr_t const* attr_ms_chap_challenge
static

Definition at line 71 of file rlm_eap_mschapv2.c.

◆ attr_ms_chap_error

fr_dict_attr_t const* attr_ms_chap_error
static

Definition at line 72 of file rlm_eap_mschapv2.c.

◆ attr_ms_chap_nt_enc_pw

fr_dict_attr_t const* attr_ms_chap_nt_enc_pw
static

Definition at line 73 of file rlm_eap_mschapv2.c.

◆ attr_ms_chap_peer_challenge

fr_dict_attr_t const* attr_ms_chap_peer_challenge
static

Definition at line 66 of file rlm_eap_mschapv2.c.

◆ attr_ms_chap_user_name

fr_dict_attr_t const* attr_ms_chap_user_name
static

Definition at line 67 of file rlm_eap_mschapv2.c.

◆ attr_ms_mppe_encryption_policy

fr_dict_attr_t const* attr_ms_mppe_encryption_policy
static

Definition at line 77 of file rlm_eap_mschapv2.c.

◆ attr_ms_mppe_encryption_type

fr_dict_attr_t const* attr_ms_mppe_encryption_type
static

Definition at line 78 of file rlm_eap_mschapv2.c.

◆ attr_ms_mppe_recv_key

fr_dict_attr_t const* attr_ms_mppe_recv_key
static

Definition at line 80 of file rlm_eap_mschapv2.c.

◆ attr_ms_mppe_send_key

fr_dict_attr_t const* attr_ms_mppe_send_key
static

Definition at line 79 of file rlm_eap_mschapv2.c.

◆ attr_state

fr_dict_attr_t const* attr_state
static

Definition at line 81 of file rlm_eap_mschapv2.c.

◆ attr_user_name

fr_dict_attr_t const* attr_user_name
static

Definition at line 82 of file rlm_eap_mschapv2.c.

◆ dict_freeradius

fr_dict_t const* dict_freeradius
static

Definition at line 55 of file rlm_eap_mschapv2.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 56 of file rlm_eap_mschapv2.c.

◆ rlm_eap_mschapv2

rlm_eap_submodule_t rlm_eap_mschapv2
Initial value:
= {
.common = {
.name = "eap_mschapv2",
.inst_size = sizeof(rlm_eap_mschapv2_t),
},
.provides = { FR_EAP_METHOD_MSCHAPV2 },
.session_init = mod_session_init,
.clone_parent_lists = false
}
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:63
@ FR_EAP_METHOD_MSCHAPV2
Definition: types.h:71
static const conf_parser_t config[]
Definition: base.c:183
static conf_parser_t submodule_config[]
static int mod_instantiate(module_inst_ctx_t const *mctx)
static unlang_action_t mod_session_init(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static int instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1302

Definition at line 727 of file rlm_eap_mschapv2.c.

◆ rlm_eap_mschapv2_dict

fr_dict_autoload_t rlm_eap_mschapv2_dict
Initial value:
= {
{ .out = &dict_freeradius, .proto = "freeradius" },
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
static fr_dict_t const * dict_freeradius
static fr_dict_t const * dict_radius

Definition at line 59 of file rlm_eap_mschapv2.c.

◆ rlm_eap_mschapv2_dict_attr

fr_dict_attr_autoload_t rlm_eap_mschapv2_dict_attr
Initial value:
= {
{ .out = &attr_auth_type, .name = "Auth-Type", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
{ .out = &attr_ms_chap_peer_challenge, .name = "MS-CHAP-Peer-Challenge", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
{ .out = &attr_ms_chap_user_name, .name = "MS-CHAP-User-Name", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
{ .out = &attr_microsoft, .name = "Vendor-Specific.Microsoft", .type = FR_TYPE_VENDOR, .dict = &dict_radius },
{ .out = &attr_ms_chap_challenge, .name = "Vendor-Specific.Microsoft.CHAP-Challenge", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_ms_chap_error, .name = "Vendor-Specific.Microsoft.CHAP-Error", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ .out = &attr_ms_chap_nt_enc_pw, .name = "Vendor-Specific.Microsoft.CHAP-NT-Enc-PW", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_ms_chap2_cpw, .name = "Vendor-Specific.Microsoft.CHAP2-CPW", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_ms_chap2_response, .name = "Vendor-Specific.Microsoft.CHAP2-Response", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_ms_chap2_success, .name = "Vendor-Specific.Microsoft.CHAP2-Success", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_ms_mppe_encryption_policy, .name = "Vendor-Specific.Microsoft.MPPE-Encryption-Policy", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_ms_mppe_encryption_type, .name = "Vendor-Specific.Microsoft.MPPE-Encryption-Type", .type = FR_TYPE_UINT32, .dict = &dict_radius },
{ .out = &attr_ms_mppe_send_key, .name = "Vendor-Specific.Microsoft.MPPE-Send-Key", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_ms_mppe_recv_key, .name = "Vendor-Specific.Microsoft.MPPE-Recv-Key", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_state, .name = "State", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
{ .out = &attr_user_name, .name = "User-Name", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ NULL }
}
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
@ FR_TYPE_UINT32
32 Bit unsigned integer.
Definition: merged_model.c:99
@ FR_TYPE_VENDOR
Attribute that represents a vendor in the attribute tree.
Definition: merged_model.c:122
@ FR_TYPE_OCTETS
Raw octets.
Definition: merged_model.c:84
static fr_dict_attr_t const * attr_microsoft
static fr_dict_attr_t const * attr_state
static fr_dict_attr_t const * attr_ms_mppe_encryption_type
static fr_dict_attr_t const * attr_ms_chap2_success
static fr_dict_attr_t const * attr_ms_chap_challenge
static fr_dict_attr_t const * attr_auth_type
static fr_dict_attr_t const * attr_ms_chap_user_name
static fr_dict_attr_t const * attr_ms_chap_error
static fr_dict_attr_t const * attr_ms_mppe_send_key
static fr_dict_attr_t const * attr_ms_chap2_response
static fr_dict_attr_t const * attr_user_name
static fr_dict_attr_t const * attr_ms_mppe_recv_key
static fr_dict_attr_t const * attr_ms_chap_nt_enc_pw
static fr_dict_attr_t const * attr_ms_chap_peer_challenge
static fr_dict_attr_t const * attr_ms_chap2_cpw
static fr_dict_attr_t const * attr_ms_mppe_encryption_policy

Definition at line 85 of file rlm_eap_mschapv2.c.

◆ submodule_config

conf_parser_t submodule_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("with_ntdomain_hack", rlm_eap_mschapv2_t, with_ntdomain_hack), .dflt = "no" },
{ FR_CONF_OFFSET_TYPE_FLAGS("auth_type", FR_TYPE_VOID, 0, rlm_eap_mschapv2_t, auth_type), .func = auth_type_parse, .dflt = "mschap" },
{ FR_CONF_OFFSET("send_error", rlm_eap_mschapv2_t, send_error), .dflt = "no" },
{ FR_CONF_OFFSET("identity", rlm_eap_mschapv2_t, identity) },
}
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:627
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:268
#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_VOID
User data.
Definition: merged_model.c:127
static int auth_type_parse(TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule)

Definition at line 46 of file rlm_eap_mschapv2.c.