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

Authenticate users, retrieving their TGT from a Kerberos V5 TDC. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/util/debug.h>
#include "krb5.h"
+ Include dependency graph for rlm_krb5.c:

Go to the source code of this file.

Macros

#define LOG_PREFIX   inst->name
 

Functions

static rlm_rcode_t krb5_parse_user (krb5_principal *client, KRB5_UNUSED rlm_krb5_t const *inst, request_t *request, krb5_context context)
 Common function for transforming a User-Name string into a principal. More...
 
static rlm_rcode_t krb5_process_error (rlm_krb5_t const *inst, request_t *request, rlm_krb5_handle_t *conn, int ret)
 Log error message and return appropriate rcode. More...
 
static unlang_action_t mod_authenticate (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static int mod_detach (module_detach_ctx_t const *mctx)
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 

Variables

static fr_dict_attr_t const * attr_user_name
 
static fr_dict_attr_t const * attr_user_password
 
static fr_dict_t const * dict_radius
 
static const conf_parser_t module_config []
 
module_rlm_t rlm_krb5
 
fr_dict_autoload_t rlm_krb5_dict []
 
fr_dict_attr_autoload_t rlm_krb5_dict_attr []
 

Detailed Description

Authenticate users, retrieving their TGT from a Kerberos V5 TDC.

Id
033f6148c216b1211ebc6f88ef4d121c50c44441

Definition in file rlm_krb5.c.

Macro Definition Documentation

◆ LOG_PREFIX

#define LOG_PREFIX   inst->name

Definition at line 29 of file rlm_krb5.c.

Function Documentation

◆ krb5_parse_user()

static rlm_rcode_t krb5_parse_user ( krb5_principal *  client,
KRB5_UNUSED rlm_krb5_t const *  inst,
request_t request,
krb5_context  context 
)
static

Common function for transforming a User-Name string into a principal.

Parameters
[out]clientWhere to write the client principal.
[in]instof rlm_krb5.
[in]requestCurrent request.
[in]contextKerberos context.

Definition at line 241 of file rlm_krb5.c.

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

◆ krb5_process_error()

static rlm_rcode_t krb5_process_error ( rlm_krb5_t const *  inst,
request_t request,
rlm_krb5_handle_t conn,
int  ret 
)
static

Log error message and return appropriate rcode.

Translate kerberos error codes into return codes.

Parameters
instof rlm_krb5.
requestCurrent request.
retcode from kerberos.
connused in the last operation.

Definition at line 284 of file rlm_krb5.c.

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

◆ 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 409 of file rlm_krb5.c.

+ Here is the call graph for this function:

◆ mod_detach()

static int mod_detach ( module_detach_ctx_t const *  mctx)
static

Definition at line 60 of file rlm_krb5.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 82 of file rlm_krb5.c.

+ Here is the call graph for this function:

Variable Documentation

◆ attr_user_name

fr_dict_attr_t const* attr_user_name
static

Definition at line 50 of file rlm_krb5.c.

◆ attr_user_password

fr_dict_attr_t const* attr_user_password
static

Definition at line 51 of file rlm_krb5.c.

◆ dict_radius

fr_dict_t const* dict_radius
static

Definition at line 42 of file rlm_krb5.c.

◆ module_config

const conf_parser_t module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("keytab", rlm_krb5_t, keytabname) },
{ FR_CONF_OFFSET("service_principal", rlm_krb5_t, service_princ) },
}
#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
Instance configuration for rlm_krb5.
Definition: krb5.h:50

Definition at line 36 of file rlm_krb5.c.

◆ rlm_krb5

module_rlm_t rlm_krb5
Initial value:
= {
.common = {
.name = "krb5",
.inst_size = sizeof(rlm_krb5_t),
.detach = mod_detach
},
.method_group = {
.bindings = (module_method_binding_t[]){
{ .section = SECTION_NAME("authenticate", CF_IDENT_ANY), .method = mod_authenticate },
}
}
}
#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:63
static const conf_parser_t config[]
Definition: base.c:183
static int mod_detach(module_detach_ctx_t const *mctx)
Definition: rlm_krb5.c:60
static unlang_action_t mod_authenticate(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Definition: rlm_krb5.c:409
static const conf_parser_t module_config[]
Definition: rlm_krb5.c:36
static int mod_instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_krb5.c:82
static int instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1302
#define SECTION_NAME(_name1, _name2)
Define a section name consisting of a verb and a noun.
Definition: section.h:40
@ MODULE_TYPE_THREAD_UNSAFE
Module is not threadsafe.
Definition: module.h:48
#define MODULE_BINDING_TERMINATOR
Terminate a module binding list.
Definition: module.h:151
Named methods exported by a module.
Definition: module.h:173

Definition at line 492 of file rlm_krb5.c.

◆ rlm_krb5_dict

fr_dict_autoload_t rlm_krb5_dict
Initial value:
= {
{ .out = &dict_radius, .proto = "radius" },
{ NULL }
}
static fr_dict_t const * dict_radius
Definition: rlm_krb5.c:42

Definition at line 45 of file rlm_krb5.c.

◆ rlm_krb5_dict_attr

fr_dict_attr_autoload_t rlm_krb5_dict_attr
Initial value:
= {
{ .out = &attr_user_name, .name = "User-Name", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ .out = &attr_user_password, .name = "User-Password", .type = FR_TYPE_STRING, .dict = &dict_radius },
{ NULL }
}
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
static fr_dict_attr_t const * attr_user_password
Definition: rlm_krb5.c:51
static fr_dict_attr_t const * attr_user_name
Definition: rlm_krb5.c:50

Definition at line 54 of file rlm_krb5.c.