25 RCSID(
"$Id: 55e99b4d892d1001dcd58d799411bdd26833e2ad $")
27 #define LOG_PREFIX inst->name
29 #include <freeradius-devel/util/debug.h>
30 #include <freeradius-devel/server/base.h>
33 #ifdef HAVE_KRB5_GET_ERROR_MESSAGE
34 # define KRB5_STRERROR_BUFSIZE (2048)
36 static _Thread_local
char *krb5_error_buffer;
41 static int _krb5_logging_free(
void *arg)
53 buffer = krb5_error_buffer;
55 buffer = talloc_array(NULL,
char, KRB5_STRERROR_BUFSIZE);
57 ERROR(
"Failed allocating memory for krb5 error buffer");
67 # ifdef HAVE_KRB5_FREE_ERROR_MESSAGE
69 # elif defined(HAVE_KRB5_FREE_ERROR_STRING)
72 # error "No way to free error strings, missing krb5_free_error_message() and krb5_free_error_string()"
90 krb5_free_context(conn->
context);
95 if (conn->ccache) krb5_cc_destroy(conn->
context, conn->ccache);
114 ret = krb5_init_context(&conn->
context);
122 ret =
inst->keytabname ?
132 ret = krb5_cc_new_unique(conn->
context,
"MEMORY", NULL, &conn->ccache);
139 krb5_verify_opt_init(&conn->options);
140 krb5_verify_opt_set_ccache(&conn->options, conn->ccache);
142 krb5_verify_opt_set_keytab(&conn->options, conn->
keytab);
143 krb5_verify_opt_set_secure(&conn->options,
true);
145 if (
inst->service) krb5_verify_opt_set_service(&conn->options,
inst->service);
147 krb5_verify_init_creds_opt_set_ap_req_nofail(
inst->vic_options,
true);
static int const char char buffer[256]
#define fr_atexit_thread_local(_name, _free, _uctx)
#define UNCONST(_type, _ptr)
Remove const qualification from a pointer.
#define fr_cond_assert(_x)
Calls panic_action ifndef NDEBUG, else logs error and evaluates to value of _x.
static fr_time_delta_t timeout
void * krb5_mod_conn_create(TALLOC_CTX *ctx, void *instance, UNUSED fr_time_delta_t timeout)
Create and return a new connection.
static int _mod_conn_free(rlm_krb5_handle_t *conn)
Frees libkrb5 resources associated with the handle.
Context management functions for rlm_krb5.
#define rlm_krb5_error(_x, _y, _z)
Instance configuration for rlm_krb5.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
eap_aka_sim_process_conf_t * inst
size_t strlcpy(char *dst, char const *src, size_t siz)
#define talloc_get_type_abort_const
A time delta, a difference in time measured in nanoseconds.