The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Loading...
Searching...
No Matches
base.c
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: 6bf9b501a88798015ddb7b9f5210805f52c8c959 $
19 *
20 * @file src/lib/tls/base.c
21 * @brief Initialise OpenSSL
22 *
23 * @copyright 2001 hereUare Communications, Inc. (raghud@hereuare.com)
24 * @copyright 2003 Alan DeKok (aland@freeradius.org)
25 * @copyright 2006-2016 The FreeRADIUS server project
26 */
27RCSID("$Id: 6bf9b501a88798015ddb7b9f5210805f52c8c959 $")
28USES_APPLE_DEPRECATED_API /* OpenSSL API has been deprecated by Apple */
29
30#ifdef WITH_TLS
31#define LOG_PREFIX "tls"
32
33#include "log.h"
34#include "bio.h"
35
36#include <sys/mman.h>
37#include <openssl/conf.h>
38#include <openssl/provider.h>
39
40#include <freeradius-devel/server/base.h>
41#include <freeradius-devel/tls/attrs.h>
42#include <freeradius-devel/tls/base.h>
43#include <freeradius-devel/tls/engine.h>
44#include <freeradius-devel/util/atexit.h>
45#include <freeradius-devel/util/debug.h>
46#include <freeradius-devel/util/math.h>
47#include <freeradius-devel/util/syserror.h>
48
49static uint32_t openssl_instance_count = 0;
50
51/** How big of a stack to allocate for aynsc fibres
52 */
53#define OPENSSL_ASYNC_STACK_SIZE 32768
54
55/** How big of a stack we allocate, rounded up to the nearest page size
56 */
57static size_t openssl_stack_size;
58
59/** Cached page size
60 */
61static size_t openssl_page_size;
62
63/** The context which holds any memory OpenSSL allocates
64 *
65 * This should be used to work around memory leaks in the OpenSSL.
66 */
67_Thread_local TALLOC_CTX *ssl_talloc_ctx;
68
69/** Used to control freeing of thread local OpenSSL resources
70 *
71 */
72static _Thread_local bool *async_pool_init;
73
74static OSSL_PROVIDER *openssl_default_provider = NULL;
75static OSSL_PROVIDER *openssl_legacy_provider = NULL;
76
77static uint32_t tls_instance_count = 0;
78
81fr_dict_t const *dict_tls;
82
83extern fr_dict_autoload_t tls_dict[];
84fr_dict_autoload_t tls_dict[] = {
85 { .out = &dict_freeradius, .proto = "freeradius" },
86 { .out = &dict_tls, .proto = "tls" },
87 { NULL }
88};
89
92
93/*
94 * Certificate decoding attributes
95 */
112
119
125
131
132extern fr_dict_attr_autoload_t tls_dict_attr[];
133fr_dict_attr_autoload_t tls_dict_attr[] = {
134 { .out = &attr_allow_session_resumption, .name = "Allow-Session-Resumption", .type = FR_TYPE_BOOL, .dict = &dict_freeradius },
135 { .out = &attr_session_resumed, .name = "EAP-Session-Resumed", .type = FR_TYPE_BOOL, .dict = &dict_freeradius },
136
137 /*
138 * Certificate decoding attributes
139 */
140 { .out = &attr_tls_certificate, .name = "TLS-Certificate", .type = FR_TYPE_TLV, .dict = &dict_freeradius },
141 { .out = &attr_tls_certificate_serial, .name = "TLS-Certificate.Serial", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
142 { .out = &attr_tls_certificate_signature, .name = "TLS-Certificate.Signature", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
143 { .out = &attr_tls_certificate_signature_algorithm, .name = "TLS-Certificate.Signature-Algorithm", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
144 { .out = &attr_tls_certificate_issuer, .name = "TLS-Certificate.Issuer", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
145 { .out = &attr_tls_certificate_not_before, .name = "TLS-Certificate.Not-Before", .type = FR_TYPE_DATE, .dict = &dict_freeradius },
146 { .out = &attr_tls_certificate_not_after, .name = "TLS-Certificate.Not-After", .type = FR_TYPE_DATE, .dict = &dict_freeradius },
147 { .out = &attr_tls_certificate_subject, .name = "TLS-Certificate.Subject", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
148 { .out = &attr_tls_certificate_common_name, .name = "TLS-Certificate.Common-Name", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
149 { .out = &attr_tls_certificate_subject_alt_name_dns, .name = "TLS-Certificate.Subject-Alt-Name-Dns", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
150 { .out = &attr_tls_certificate_subject_alt_name_email, .name = "TLS-Certificate.Subject-Alt-Name-Email", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
151 { .out = &attr_tls_certificate_subject_alt_name_upn, .name = "TLS-Certificate.Subject-Alt-Name-Upn", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
152 { .out = &attr_tls_certificate_x509v3_extended_key_usage, .name = "TLS-Certificate.X509v3-Extended-Key-Usage", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
153 { .out = &attr_tls_certificate_x509v3_subject_key_identifier, .name = "TLS-Certificate.X509v3-Subject-Key-Identifier", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
154 { .out = &attr_tls_certificate_x509v3_authority_key_identifier, .name = "TLS-Certificate.X509v3-Authority-Key-Identifier", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
155 { .out = &attr_tls_certificate_x509v3_basic_constraints, .name = "TLS-Certificate.X509v3-Basic-Constraints", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
156
157 { .out = &attr_tls_certificate_chain_depth, .name = "TLS-Certificate-Chain-Depth", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
158 { .out = &attr_tls_client_error_code, .name = "TLS-Client-Error-Code", .type = FR_TYPE_UINT8, .dict = &dict_freeradius },
159 { .out = &attr_tls_ocsp_cert_valid, .name = "TLS-OCSP-Cert-Valid", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
160 { .out = &attr_tls_ocsp_next_update, .name = "TLS-OCSP-Next-Update", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
161 { .out = &attr_tls_ocsp_response, .name = "TLS-OCSP-Response", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
162 { .out = &attr_tls_psk_identity, .name = "TLS-PSK-Identity", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
163
164 { .out = &attr_tls_session_cert_file, .name = "TLS-Session-Certificate-File", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
165 { .out = &attr_tls_session_require_client_cert, .name = "TLS-Session-Require-Client-Certificate", .type = FR_TYPE_BOOL, .dict = &dict_freeradius },
166 { .out = &attr_tls_session_cipher_suite, .name = "TLS-Session-Cipher-Suite", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
167 { .out = &attr_tls_session_version, .name = "TLS-Session-Version", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
168 { .out = &attr_tls_session_resume_type, .name = "TLS-Session-Resume-Type", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
169
170 /*
171 * Eventually all TLS attributes will be in the TLS dictionary
172 */
173 { .out = &attr_tls_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_tls },
174 { .out = &attr_tls_session_data, .name = "Session-Data", .type = FR_TYPE_OCTETS, .dict = &dict_tls },
175 { .out = &attr_tls_session_id, .name = "Session-Id", .type = FR_TYPE_OCTETS, .dict = &dict_tls },
176 { .out = &attr_tls_session_resumed, .name = "Session-Resumed", .type = FR_TYPE_BOOL, .dict = &dict_tls },
177 { .out = &attr_tls_session_ttl, .name = "Session-TTL", .type = FR_TYPE_TIME_DELTA, .dict = &dict_tls },
178 { NULL }
179};
180
181/*
182 * request types
183 */
190
191/*
192 * response types
193 */
197
198/*
199 * session resumption
200 */
203
204extern fr_dict_enum_autoload_t tls_dict_enum[];
205fr_dict_enum_autoload_t tls_dict_enum[] = {
206 { .out = &enum_tls_packet_type_load_session, .name = "Load-Session", .attr = &attr_tls_packet_type },
207 { .out = &enum_tls_packet_type_store_session, .name = "Store-Session", .attr = &attr_tls_packet_type },
208 { .out = &enum_tls_packet_type_clear_session, .name = "Clear-Session", .attr = &attr_tls_packet_type },
209 { .out = &enum_tls_packet_type_verify_certificate, .name = "Verify-Certificate", .attr = &attr_tls_packet_type },
210 { .out = &enum_tls_packet_type_new_session, .name = "New-Session", .attr = &attr_tls_packet_type },
211 { .out = &enum_tls_packet_type_establish_session, .name = "Establish-Session", .attr = &attr_tls_packet_type },
212
213 { .out = &enum_tls_packet_type_success, .name = "Success", .attr = &attr_tls_packet_type },
214 { .out = &enum_tls_packet_type_failure, .name = "Failure", .attr = &attr_tls_packet_type },
215 { .out = &enum_tls_packet_type_notfound, .name = "Notfound", .attr = &attr_tls_packet_type },
216
217 { .out = &enum_tls_session_resumed_stateful, .name = "stateful", .attr = &attr_tls_session_resume_type },
218 { .out = &enum_tls_session_resumed_stateless, .name = "stateless", .attr = &attr_tls_session_resume_type },
219 { NULL }
220};
221
222/*
223 * Updated by threads.c in the server, and left alone for everyone else.
224 */
225int fr_tls_max_threads = 1;
226
227/** Allocate memory for OpenSSL in the NULL context
228 *
229 * @param len to alloc.
230 * @return realloc.
231 */
232static void *fr_openssl_talloc(size_t len, char const *file, NDEBUG_UNUSED int line)
233{
234 static char const *async_file;
235 void *chunk;
236
237 if (!file) {
238 chunk = talloc_array(ssl_talloc_ctx, uint8_t, len);
239
240#ifndef NDEBUG
241 talloc_set_name(chunk, "fr_openssl_talloc");
242#endif
243 return chunk;
244 }
245
246 /*
247 * Cache the filename pointer for the async_posix.c
248 * source file, so we can figure out when we're
249 * being asked for stack memory.
250 *
251 * This is terrible, we're basically guessing at the
252 * stack size. OpenSSL 3.1.0 will have proper
253 * allocation functions so we can something more
254 * sensible.
255 */
256 if (!async_file) {
257 char const *sep;
258
259 sep = strrchr(file, '/');
260 if (!sep) {
261 sep = file;
262 } else {
263 sep++;
264 }
265 if (strcmp(sep, "async_posix.c") == 0) {
266 async_file = file;
267 alloc_stack:
268 len *= 4;
269 }
270 } else if (file == async_file) goto alloc_stack;
271
272 chunk = talloc_array(ssl_talloc_ctx, uint8_t, len);
273#ifndef NDEBUG
274 talloc_set_name(chunk, "%s:%d", file, line);
275#endif
276 return chunk;
277}
278
279/** Reallocate memory for OpenSSL in the NULL context
280 *
281 * @param old memory to realloc.
282 * @param len to extend to.
283 * @return realloced memory.
284 */
285static void *fr_openssl_talloc_realloc(void *old, size_t len, NDEBUG_UNUSED char const *file, NDEBUG_UNUSED int line)
286{
287 void *chunk;
288
289 chunk = talloc_realloc_size(ssl_talloc_ctx, old, len);
290#ifndef NDEBUG
291 talloc_set_name(chunk, "%s:%d", file, line);
292#endif
293 return chunk;
294}
295
296/** Free memory allocated by OpenSSL
297 *
298 * @param to_free memory to free.
299 */
300#ifdef NDEBUG
301/*
302 * If we're not debugging, use only the filename. Otherwise the
303 * cost of snprintf() is too large.
304 */
305static void fr_openssl_talloc_free(void *to_free, char const *file, UNUSED int line)
306{
307 (void)_talloc_free(to_free, file);
308}
309#else
310static void fr_openssl_talloc_free(void *to_free, char const *file, int line)
311{
312 char buffer[256];
313
314 snprintf(buffer, sizeof(buffer), "%s:%i", file, line);
315 (void)_talloc_free(to_free, buffer);
316}
317#endif
318
319/** Cleanup async pools if the thread exits
320 *
321 */
322static int _openssl_thread_free(void *init)
323{
324 ASYNC_cleanup_thread();
325 return talloc_free(init);
326}
327
328/** Perform thread-specific initialisation for OpenSSL
329 *
330 * Async contexts are what OpenSSL uses to track
331 *
332 * @param[in] async_pool_size_init The initial number of async contexts
333 * we keep in the pool.
334 * @param[in] async_pool_size_max The maximum number of async contexts
335 * we keep in the thread-local pool.
336 * @return
337 * - 0 on success.
338 * - -1 on failure.
339 */
340int fr_openssl_thread_init(size_t async_pool_size_init, size_t async_pool_size_max)
341{
342 /*
343 * Hack to use thread local destructor code
344 */
345 if (!async_pool_init) {
346 bool *init = talloc_zero(NULL, bool);
347
348 if (ASYNC_init_thread(async_pool_size_max, async_pool_size_init) != 1) {
349 fr_tls_log(NULL, "Failed initialising OpenSSL async context pool");
350 return -1;
351 }
352
353 fr_atexit_thread_local(async_pool_init, _openssl_thread_free, init);
354 }
355
356 return 0;
357}
358
359/** Free any memory alloced by libssl
360 *
361 * OpenSSL >= 1.1.0 uses an atexit handler to automatically free
362 * memory. However, we need to call OPENSSL_cleanup manually because
363 * some of the SSL ctx is parented to the main config which will get
364 * freed before the atexit handler, causing a segfault on exit.
365 */
366void fr_openssl_free(void)
367{
368 if (--openssl_instance_count > 0) return;
369
370 fr_tls_log_free();
371
372 fr_tls_bio_free();
373}
374
375static void _openssl_provider_free(void)
376{
377 if (openssl_default_provider && !OSSL_PROVIDER_unload(openssl_default_provider)) {
378 fr_tls_log(NULL, "Failed unloading default provider");
379 }
380 openssl_default_provider = NULL;
381
382 if (openssl_legacy_provider && !OSSL_PROVIDER_unload(openssl_legacy_provider)) {
383 fr_tls_log(NULL, "Failed unloading legacy provider");
384 }
385 openssl_legacy_provider = NULL;
386}
387
388static int fr_openssl_cleanup(UNUSED void *uctx)
389{
390 OPENSSL_cleanup();
391 return 0;
392}
393
394#if OPENSSL_VERSION_NUMBER >= 0x30400000L
395
396static void *fr_openssl_stack_alloc(size_t *len)
397{
398 void *stack;
399
400 if (posix_memalign(&stack, openssl_page_size, openssl_stack_size + openssl_page_size) != 0) {
401 fr_tls_log(NULL, "Failed allocating OpenSSL stack: %s", fr_syserror(errno));
402 return NULL;
403 }
404
405 /*
406 * Catch reads and writes going off the end of the stack.
407 */
408 if (mprotect((uint8_t *)stack + openssl_stack_size, openssl_page_size, PROT_NONE) < 0) {
409 fr_tls_log(NULL, "Failed adding guard page to OpenSSL stack: %s", fr_syserror(errno));
410 free(stack);
411 return NULL;
412 }
413 *len = openssl_stack_size;
414
415 return stack;
416}
417
418static void fr_openssl_stack_free(void *stack)
419{
420 /*
421 * Remove the guard page. If this failed, we can't continue
422 * as we'll have random protected memory chunks
423 */
424 if (unlikely(mprotect((uint8_t *)stack + openssl_stack_size, openssl_page_size, PROT_READ | PROT_WRITE) < 0)) {
425 fr_assert_msg(0, "Uprotecting OpenSSL stack memory failed, can't continue: %s", fr_syserror(errno));
426 fr_exit(1);
427 }
428 free(stack);
429}
430#endif
431
432/** Add all the default ciphers and message digests to our context.
433 *
434 * This should be called exactly once from main, before reading the main config
435 * or initialising any modules.
436 */
437int fr_openssl_init(void)
438{
439 if (openssl_instance_count > 0) {
440 openssl_instance_count++;
441 return 0;
442 }
443
444 openssl_page_size = (size_t)getpagesize();
445 openssl_stack_size = ROUND_UP_POW2(OPENSSL_ASYNC_STACK_SIZE, openssl_page_size);
446
447
448 /*
449 * This will only fail if memory has already been allocated
450 * by OpenSSL.
451 */
452 if (CRYPTO_set_mem_functions(fr_openssl_talloc, fr_openssl_talloc_realloc, fr_openssl_talloc_free) != 1) {
453 fr_tls_log(NULL, "Failed to set OpenSSL memory allocation functions. fr_openssl_init() called too late");
454 return -1;
455 }
456
457 /*
458 * Setup custom memory allocators for allocating greenthread
459 * stacks, so we can add guard pages.
460 */
461#if OPENSSL_VERSION_NUMBER >= 0x30400000L
462 if (ASYNC_set_mem_functions(fr_openssl_stack_alloc, fr_openssl_stack_free) != 1) {
463 fr_tls_log(NULL, "Failed to set OpenSSL async stack allocation functions");
464 return -1;
465 }
466#endif
467
468 /*
469 * NO_ATEXIT has no effect if init is done after
470 * loading providers, and we need to control the
471 * exit handler as it needs to be executed last
472 * after all the EVP_MD ctx have been called, as
473 * they may unload elements of providers once all
474 * the contexts have been cleaned up.
475 */
476 if (OPENSSL_init_ssl(OPENSSL_INIT_NO_ATEXIT | OPENSSL_INIT_LOAD_CONFIG, NULL) != 1) {
477 fr_tls_log(NULL, "Failed calling OPENSSL_init_crypto()");
478 return -1;
479 }
480
481 /*
482 * Load the default provider for most algorithms
483 */
484 openssl_default_provider = OSSL_PROVIDER_load(NULL, "default");
485 if (!openssl_default_provider) {
486 fr_tls_log(NULL, "Failed loading default provider");
487 return -1;
488 }
489
490 /*
491 * Needed for MD4
492 *
493 * https://www.openssl.org/docs/man3.0/man7/migration_guide.html#Legacy-Algorithms
494 */
495 openssl_legacy_provider = OSSL_PROVIDER_load(NULL, "legacy");
496 if (!openssl_legacy_provider) {
497 fr_tls_log(NULL, "Failed loading legacy provider");
498 return -1;
499 }
500
501 /*
502 * It's best to use OpenSSL's cleanup stack
503 * as then everything is cleaned up relative
504 * to the OPENSSL_cleanup() call.
505 */
506 OPENSSL_atexit(_openssl_provider_free);
507
508 /*
509 * SHA256 is in all versions of OpenSSL, but isn't
510 * initialized by default. It's needed for WiMAX
511 * certificates.
512 */
513 EVP_add_digest(EVP_sha256());
514
515 fr_tls_log_init();
516
517 fr_tls_bio_init();
518
519 /*
520 * Use an atexit handler to try and ensure
521 * that OpenSSL gets freed last.
522 *
523 * All EVP_*ctxs need to be freed before we
524 * de-initialise the libraries else we get
525 * crashes (at least with OpenSSL 3.0.1).
526 */
527 fr_atexit_global(fr_openssl_cleanup, NULL);
528
529 openssl_instance_count++;
530
531 return 0;
532}
533
534/** Enable or disable fips mode
535 *
536 * @param[in] enabled If true enable fips mode if false disable fips mode.
537 * @return
538 * - 0 on success.
539 * - -1 on failure
540 */
541int fr_openssl_fips_mode(bool enabled)
542{
543 if (!EVP_set_default_properties(NULL, enabled ? "fips=yes" : "fips=no")) {
544 fr_tls_log(NULL, "Failed %s OpenSSL FIPS mode", enabled ? "enabling" : "disabling");
545 return -1;
546 }
547
548 return 0;
549}
550
551/** Load dictionary attributes
552 *
553 * This is a separate function because of ordering issues.
554 * OpenSSL may need to be initialised before anything else
555 * including the dictionary loader.
556 *
557 * fr_openssl_free will unload both the dictionary and the
558 * OpenSSL library.
559 */
560int fr_tls_dict_init(void)
561{
562 if (tls_instance_count > 0) {
563 tls_instance_count++;
564 return 0;
565 }
566
567 tls_instance_count++;
568
569 if (fr_dict_autoload(tls_dict) < 0) {
570 PERROR("Failed initialising protocol library");
571 fail:
572 tls_instance_count--;
573 fr_openssl_free();
574 return -1;
575 }
576
577 if (fr_dict_attr_autoload(tls_dict_attr) < 0) {
578 PERROR("Failed resolving attributes");
579 goto fail;
580 }
581
582 if (fr_dict_enum_autoload(tls_dict_enum) < 0) {
583 PERROR("Failed resolving enums");
584 goto fail;
585 }
586
587 return 0;
588}
589
590void fr_tls_dict_free(void)
591{
592 if (--tls_instance_count > 0) return;
593
594 fr_dict_autofree(tls_dict);
595}
596#endif /* WITH_TLS */
static int const char char buffer[256]
Definition acutest.h:576
int const char * file
Definition acutest.h:702
int const char int line
Definition acutest.h:702
#define fr_atexit_global(_func, _uctx)
Add a free function to the global free list.
Definition atexit.h:59
#define fr_atexit_thread_local(_name, _free, _uctx)
Definition atexit.h:221
static bool init
Definition fuzzer.c:41
#define USES_APPLE_DEPRECATED_API
Definition build.h:472
#define RCSID(id)
Definition build.h:485
#define NDEBUG_UNUSED
Definition build.h:328
#define unlikely(_x)
Definition build.h:383
#define UNUSED
Definition build.h:317
#define fr_assert_msg(_x, _msg,...)
Calls panic_action ifndef NDEBUG, else logs error and causes the server to exit immediately with code...
Definition debug.h:210
#define fr_exit(_x)
Exit, producing a log message in debug builds.
Definition debug.h:228
int fr_dict_enum_autoload(fr_dict_enum_autoload_t const *to_load)
Process a dict_attr_autoload element to load/verify a dictionary attribute.
Definition dict_util.c:4095
#define fr_dict_autofree(_to_free)
Definition dict.h:869
fr_value_box_t const ** out
Enumeration value.
Definition dict.h:262
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
Definition dict.h:273
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
Definition dict.h:286
int fr_dict_attr_autoload(fr_dict_attr_autoload_t const *to_load)
Process a dict_attr_autoload element to load/verify a dictionary attribute.
Definition dict_util.c:4134
#define fr_dict_autoload(_to_load)
Definition dict.h:866
Specifies an attribute which must be present for the module to function.
Definition dict.h:272
Specifies a dictionary which must be loaded/loadable for the module to function.
Definition dict.h:285
Specifies a value which must be present for the module to function.
Definition dict.h:261
free(array)
static fr_dict_t const * dict_freeradius
Definition base.c:37
fr_dict_attr_t const * attr_tls_certificate
Attribute definitions for lib curl.
Definition base.c:36
fr_dict_t const * dict_tls
Definition base.c:79
fr_dict_t const * dict_radius
Definition base.c:78
#define PERROR(_fmt,...)
Definition log.h:228
fr_value_box_t const * enum_tls_packet_type_store_session
HIDDEN fr_dict_attr_t const * attr_tls_certificate_subject
HIDDEN fr_dict_attr_t const * attr_tls_certificate_x509v3_extended_key_usage
HIDDEN fr_dict_attr_t const * attr_tls_packet_type
HIDDEN fr_dict_attr_t const * attr_tls_certificate_x509v3_authority_key_identifier
HIDDEN fr_dict_attr_t const * attr_session_resumed
fr_value_box_t const * enum_tls_packet_type_failure
HIDDEN fr_dict_attr_t const * attr_tls_session_resumed
HIDDEN fr_dict_attr_t const * attr_tls_session_version
HIDDEN fr_dict_attr_t const * attr_tls_ocsp_cert_valid
HIDDEN fr_dict_attr_t const * attr_tls_certificate_x509v3_basic_constraints
fr_value_box_t const * enum_tls_packet_type_success
HIDDEN fr_dict_attr_t const * attr_tls_certificate_serial
HIDDEN fr_dict_attr_t const * attr_tls_session_require_client_cert
HIDDEN fr_dict_attr_t const * attr_tls_certificate_subject_alt_name_dns
HIDDEN fr_dict_attr_t const * attr_tls_session_ttl
fr_value_box_t const * enum_tls_session_resumed_stateful
HIDDEN fr_dict_attr_t const * attr_tls_session_data
HIDDEN fr_dict_attr_t const * attr_tls_certificate_not_after
HIDDEN fr_dict_attr_t const * attr_tls_certificate_not_before
fr_value_box_t const * enum_tls_packet_type_new_session
HIDDEN fr_dict_attr_t const * attr_tls_certificate_signature_algorithm
HIDDEN fr_dict_attr_t const * attr_tls_client_error_code
fr_value_box_t const * enum_tls_packet_type_load_session
fr_value_box_t const * enum_tls_packet_type_establish_session
HIDDEN fr_dict_attr_t const * attr_tls_certificate_subject_alt_name_upn
HIDDEN fr_dict_attr_t const * attr_tls_ocsp_response
HIDDEN fr_dict_attr_t const * attr_tls_session_id
HIDDEN fr_dict_attr_t const * attr_tls_certificate_x509v3_subject_key_identifier
fr_value_box_t const * enum_tls_packet_type_clear_session
HIDDEN fr_dict_attr_t const * attr_tls_session_cipher_suite
HIDDEN fr_dict_attr_t const * attr_tls_certificate_common_name
HIDDEN fr_dict_attr_t const * attr_tls_psk_identity
HIDDEN fr_dict_attr_t const * attr_tls_certificate_issuer
fr_value_box_t const * enum_tls_session_resumed_stateless
fr_value_box_t const * enum_tls_packet_type_notfound
HIDDEN fr_dict_attr_t const * attr_tls_certificate_signature
HIDDEN fr_dict_attr_t const * attr_tls_session_resume_type
HIDDEN fr_dict_attr_t const * attr_tls_ocsp_next_update
fr_value_box_t const * enum_tls_packet_type_verify_certificate
HIDDEN fr_dict_attr_t const * attr_tls_session_cert_file
HIDDEN fr_dict_attr_t const * attr_tls_certificate_chain_depth
HIDDEN fr_dict_attr_t const * attr_tls_certificate_subject_alt_name_email
HIDDEN fr_dict_attr_t const * attr_allow_session_resumption
talloc_free(reap)
static char * stack[MAX_STACK]
Definition radmin.c:159
#define ROUND_UP_POW2(_num, _mul)
Round up - Only works if _mul is a power of 2 but avoids division.
Definition math.h:144
@ FR_TYPE_TIME_DELTA
A period of time measured in nanoseconds.
@ FR_TYPE_TLV
Contains nested attributes.
@ FR_TYPE_STRING
String of printable characters.
@ FR_TYPE_DATE
Unix time stamp, always has value >2^31.
@ FR_TYPE_UINT8
8 Bit unsigned integer.
@ FR_TYPE_UINT32
32 Bit unsigned integer.
@ FR_TYPE_BOOL
A truth value.
@ FR_TYPE_OCTETS
Raw octets.
unsigned int uint32_t
unsigned char uint8_t
unsigned long int size_t
PUBLIC int snprintf(char *string, size_t length, char *format, va_alist)
Definition snprintf.c:689
char const * fr_syserror(int num)
Guaranteed to be thread-safe version of strerror.
Definition syserror.c:243