The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
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: 593b07953d8715d2162236563f30fc978ed6c3b0 $
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  */
26 RCSIDH(krb5_h, "$Id: 593b07953d8715d2162236563f30fc978ed6c3b0 $")
27 
28 /* krb5 includes */
30 #include <krb5.h>
31 
32 #ifdef KRB5_IS_THREAD_SAFE
33 # include <freeradius-devel/server/pool.h>
34 #endif
35 
36 typedef 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  */
50 typedef struct {
51 #ifdef KRB5_IS_THREAD_SAFE
52  fr_pool_t *pool; //!< Connection pool instance.
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
77 } rlm_krb5_t;
78 
79 /*
80  * MIT Kerberos uses comm_err, so the macro just expands to a call
81  * to error_message.
82  */
83 #ifndef HAVE_KRB5_GET_ERROR_MESSAGE
84 # ifdef ET_COMM_ERR
85 # include <et/com_err.h>
86 # else
87 # include <com_err.h>
88 # endif
89 # define rlm_krb5_error(_x, _y, _z) error_message(_z)
90 # define KRB5_UNUSED UNUSED
91 #else
92 char const *rlm_krb5_error(rlm_krb5_t const *inst, krb5_context context, krb5_error_code code);
93 # define KRB5_UNUSED
94 #endif
95 
96 void *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:431
#define RCSIDH(h, id)
Definition: build.h:445
static fr_time_delta_t timeout
Definition: dhcpclient.c:54
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:89
krb5_context context
Definition: krb5.h:37
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
A connection pool.
Definition: pool.c:85
eap_aka_sim_process_conf_t * inst
A time delta, a difference in time measured in nanoseconds.
Definition: time.h:80