All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
krb5.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 
17 /**
18  * $Id: 668e0a52e1ebc76c91af16a6ef99fd90a09d7324 $
19  * @file krb5.h
20  * @brief types and function signatures for rlm_krb5.
21  *
22  * @copyright 2013 The FreeRADIUS server project
23  * @copyright 2013 Arran Cudbard-Bell <a.cudbardb@freeradius.org>
24  */
25 RCSIDH(krb5_h, "$Id: 668e0a52e1ebc76c91af16a6ef99fd90a09d7324 $")
26 
27 #if defined(KRB5_IS_THREAD_SAFE) && !defined(HAVE_PTHREAD_H)
28 # undef KRB5_IS_THREAD_SAFE
29 #endif
30 
31 /* krb5 includes */
33 #include <krb5.h>
34 
35 typedef struct rlm_krb5_handle {
36  krb5_context context;
37  krb5_keytab keytab;
38 
39 #ifdef HEIMDAL_KRB5
40  krb5_ccache ccache;
41  krb5_verify_opt options;
42 #endif
44 
45 /** Instance configuration for rlm_krb5
46  *
47  * Holds the configuration and preparsed data for a instance of rlm_krb5.
48  */
49 typedef struct rlm_krb5_t {
50 #ifdef KRB5_IS_THREAD_SAFE
51  fr_connection_pool_t *pool; //!< Connection pool instance.
52 #else
54 #endif
55 
56  char const *xlat_name; //!< This module's instance name.
57  char const *keytabname; //!< The keytab to resolve the service in.
58  char const *service_princ; //!< The service name provided by the
59  //!< config parser.
60 
61  char *hostname; //!< The hostname component of
62  //!< service_princ, or NULL.
63  char *service; //!< The service component of service_princ, or NULL.
64 
65  krb5_context context; //!< The kerberos context (cloned once per request).
66 
67 #ifndef HEIMDAL_KRB5
68  krb5_get_init_creds_opt *gic_options; //!< Options to pass to the get_initial_credentials
69  //!< function.
70  krb5_verify_init_creds_opt *vic_options; //!< Options to pass to the validate_initial_creds
71  //!< function.
72 
73  krb5_principal server; //!< A structure representing the parsed
74  //!< service_princ.
75 #endif
76 } rlm_krb5_t;
77 
78 /*
79  * MIT Kerberos uses comm_err, so the macro just expands to a call
80  * to error_message.
81  */
82 #ifndef HAVE_KRB5_GET_ERROR_MESSAGE
83 # ifdef ET_COMM_ERR
84 # include <et/com_err.h>
85 # else
86 # include <com_err.h>
87 # endif
88 # define rlm_krb5_error(_x, _y) error_message(_y)
89 #else
90 char const *rlm_krb5_error(krb5_context context, krb5_error_code code);
91 #endif
92 
93 void *mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval const *timeout);
#define RCSIDH(h, id)
Definition: build.h:136
Instance configuration for rlm_krb5.
Definition: krb5.h:49
krb5_context context
The kerberos context (cloned once per request).
Definition: krb5.h:65
krb5_get_init_creds_opt * gic_options
Options to pass to the get_initial_credentials function.
Definition: krb5.h:68
static float timeout
Definition: radclient.c:43
struct rlm_krb5_t rlm_krb5_t
Instance configuration for rlm_krb5.
#define rlm_krb5_error(_x, _y)
Definition: krb5.h:88
krb5_context context
Definition: krb5.h:36
char const * keytabname
The keytab to resolve the service in.
Definition: krb5.h:57
rlm_krb5_handle_t * conn
Definition: krb5.h:53
char * hostname
The hostname component of service_princ, or NULL.
Definition: krb5.h:61
krb5_keytab keytab
Definition: krb5.h:37
char * service
The service component of service_princ, or NULL.
Definition: krb5.h:63
char const * xlat_name
This module's instance name.
Definition: krb5.h:56
A connection pool.
Definition: connection.c:85
krb5_principal server
A structure representing the parsed service_princ.
Definition: krb5.h:73
Context management functions for rlm_krb5.
char const * service_princ
The service name provided by the config parser.
Definition: krb5.h:58
void * mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval const *timeout)
Create a new connection pool handle.
Definition: mod.c:68
krb5_verify_init_creds_opt * vic_options
Options to pass to the validate_initial_creds function.
Definition: krb5.h:70
USES_APPLE_DEPRECATED_API struct rlm_krb5_handle rlm_krb5_handle_t
#define USES_APPLE_DEPRECATED_API
Definition: build.h:122