The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
Data Structures | 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/unlang/call_env.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.

Data Structures

struct  krb5_auth_call_env_t
 

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, krb5_auth_call_env_t *env)
 Common function for transforming a User-Name string into a principal.
 
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.
 
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 const call_env_method_t krb5_auth_call_env
 
static const conf_parser_t module_config []
 
module_rlm_t rlm_krb5
 

Detailed Description

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

Id
3007de21eba2a53aeceb3a6aba76f00e10712d9c

Definition in file rlm_krb5.c.


Data Structure Documentation

◆ krb5_auth_call_env_t

struct krb5_auth_call_env_t

Definition at line 53 of file rlm_krb5.c.

+ Collaboration diagram for krb5_auth_call_env_t:
Data Fields
fr_value_box_t password
fr_value_box_t username

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,
krb5_auth_call_env_t env 
)
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.
[in]envcall env data containing username.

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

+ 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 407 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 81 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 100 of file rlm_krb5.c.

+ Here is the call graph for this function:

Variable Documentation

◆ krb5_auth_call_env

const call_env_method_t krb5_auth_call_env
static
Initial value:
= {
.env = (call_env_parser_t[]) {
.pair.dflt = "&User-Name", .pair.dflt_quote = T_BARE_WORD },
.pair.dflt = "&User-Password", .pair.dflt_quote = T_BARE_WORD },
}
}
#define CALL_ENV_TERMINATOR
Definition call_env.h:231
#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:235
@ CALL_ENV_FLAG_SECRET
The value is a secret, and should not be logged.
Definition call_env.h:91
@ CALL_ENV_FLAG_REQUIRED
Associated conf pair or section is required.
Definition call_env.h:75
#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:335
Per method call config.
Definition call_env.h:175
@ FR_TYPE_STRING
String of printable characters.
username
@ T_BARE_WORD
Definition token.h:120

Definition at line 485 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:642
#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 44 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, .method_env = &krb5_auth_call_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: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:81
static const call_env_method_t krb5_auth_call_env
Definition rlm_krb5.c:485
static unlang_action_t mod_authenticate(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
Definition rlm_krb5.c:407
static const conf_parser_t module_config[]
Definition rlm_krb5.c:44
static int mod_instantiate(module_inst_ctx_t const *mctx)
Definition rlm_krb5.c:100
static int instantiate(module_inst_ctx_t const *mctx)
Definition rlm_rest.c:1310
#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 497 of file rlm_krb5.c.