The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
krb5.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17
18/**
19 * $Id: 048b360f013c215e8bb4a240e171a5a28cb00ff8 $
20 * @file krb5.h
21 * @brief types and function signatures for rlm_krb5.
22 *
23 * @copyright 2013 The FreeRADIUS server project
24 * @copyright 2013 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
25 */
26RCSIDH(krb5_h, "$Id: 048b360f013c215e8bb4a240e171a5a28cb00ff8 $")
27
28/* krb5 includes */
30#include <krb5.h>
31
32#ifdef KRB5_IS_THREAD_SAFE
33# include <freeradius-devel/util/slab.h>
34#endif
35
36typedef struct {
37 krb5_context context;
38 krb5_keytab keytab;
39
40#ifdef HEIMDAL_KRB5
41 krb5_ccache ccache;
42 krb5_verify_opt options;
43#endif
45
46/** Instance configuration for rlm_krb5
47 *
48 * Holds the configuration and preparsed data for a instance of rlm_krb5.
49 */
50typedef struct {
51#ifdef KRB5_IS_THREAD_SAFE
52 fr_slab_config_t reuse;
53#else
55#endif
56
57 char const *name; //!< This module's instance name.
58 char const *keytabname; //!< The keytab to resolve the service in.
59 char const *service_princ; //!< The service name provided by the
60 //!< config parser.
61
62 char *hostname; //!< The hostname component of
63 //!< service_princ, or NULL.
64 char *service; //!< The service component of service_princ, or NULL.
65
66 krb5_context context; //!< The kerberos context (cloned once per request).
67
68#ifndef HEIMDAL_KRB5
69 krb5_get_init_creds_opt *gic_options; //!< Options to pass to the get_initial_credentials
70 //!< function.
71 krb5_verify_init_creds_opt *vic_options; //!< Options to pass to the validate_initial_creds
72 //!< function.
73
74 krb5_principal server; //!< A structure representing the parsed
75 //!< service_princ.
76#endif
78
79#ifdef KRB5_IS_THREAD_SAFE
82
83typedef struct {
84 rlm_krb5_t const *inst;
85 krb5_slab_list_t *slab;
86} rlm_krb5_thread_t;
87#endif
88
89/*
90 * MIT Kerberos uses comm_err, so the macro just expands to a call
91 * to error_message.
92 */
93#ifndef HAVE_KRB5_GET_ERROR_MESSAGE
94# ifdef ET_COMM_ERR
95# include <et/com_err.h>
96# else
97# include <com_err.h>
98# endif
99# define rlm_krb5_error(_x, _y, _z) error_message(_z)
100# define KRB5_UNUSED UNUSED
101#else
102char const *rlm_krb5_error(rlm_krb5_t const *inst, krb5_context context, krb5_error_code code);
103# define KRB5_UNUSED
104#endif
105
106int krb5_handle_init(rlm_krb5_handle_t *conn, void *uctx);
107void *krb5_mod_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout);
static int context
Definition radmin.c:71
#define USES_APPLE_DEPRECATED_API
Definition build.h:470
#define RCSIDH(h, id)
Definition build.h:484
void * krb5_mod_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout)
char const * service_princ
The service name provided by the config parser.
Definition krb5.h:59
char const * name
This module's instance name.
Definition krb5.h:57
char * hostname
The hostname component of service_princ, or NULL.
Definition krb5.h:62
krb5_context context
The kerberos context (cloned once per request).
Definition krb5.h:66
rlm_krb5_handle_t * conn
Definition krb5.h:54
char * service
The service component of service_princ, or NULL.
Definition krb5.h:64
krb5_principal server
A structure representing the parsed service_princ.
Definition krb5.h:74
krb5_keytab keytab
Definition krb5.h:38
#define rlm_krb5_error(_x, _y, _z)
Definition krb5.h:99
krb5_context context
Definition krb5.h:37
int krb5_handle_init(rlm_krb5_handle_t *conn, void *uctx)
Definition krb5.c:101
krb5_get_init_creds_opt * gic_options
Options to pass to the get_initial_credentials function.
Definition krb5.h:69
krb5_verify_init_creds_opt * vic_options
Options to pass to the validate_initial_creds function.
Definition krb5.h:71
char const * keytabname
The keytab to resolve the service in.
Definition krb5.h:58
Instance configuration for rlm_krb5.
Definition krb5.h:50
#define FR_SLAB_FUNCS(_name, _type)
Define type specific wrapper functions for slabs and slab elements.
Definition slab.h:120
#define FR_SLAB_TYPES(_name, _type)
Define type specific wrapper structs for slabs and slab elements.
Definition slab.h:72
Tuneable parameters for slabs.
Definition slab.h:42
eap_aka_sim_process_conf_t * inst
A time delta, a difference in time measured in nanoseconds.
Definition time.h:80