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: 8c6520a829fb34b11e445f9681fb65310346fa02 $
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: 8c6520a829fb34b11e445f9681fb65310346fa02 $")
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, taken from the default thread stack size
56 */
57static size_t openssl_stack_size;
58
59/** The context which holds any memory OpenSSL allocates
60 *
61 * This should be used to work around memory leaks in the OpenSSL.
62 */
63_Thread_local TALLOC_CTX *ssl_talloc_ctx;
64
65/** Used to control freeing of thread local OpenSSL resources
66 *
67 */
68static _Thread_local bool *async_pool_init;
69
70static OSSL_PROVIDER *openssl_default_provider = NULL;
71static OSSL_PROVIDER *openssl_legacy_provider = NULL;
72
73static uint32_t tls_instance_count = 0;
74
77fr_dict_t const *dict_tls;
78fr_dict_t const *dict_der;
79
80extern fr_dict_autoload_t tls_dict[];
81fr_dict_autoload_t tls_dict[] = {
82 { .out = &dict_freeradius, .proto = "freeradius" },
83 { .out = &dict_tls, .proto = "tls" },
84 { .out = &dict_der, .proto = "der" },
85
87};
88
91
92/*
93 * Certificate decoding attributes
94 */
112
119
125
133
135
141
143
144extern fr_dict_attr_autoload_t tls_dict_attr[];
145fr_dict_attr_autoload_t tls_dict_attr[] = {
146 { .out = &attr_allow_session_resumption, .name = "Allow-Session-Resumption", .type = FR_TYPE_BOOL, .dict = &dict_freeradius },
147 { .out = &attr_session_resumed, .name = "EAP-Session-Resumed", .type = FR_TYPE_BOOL, .dict = &dict_freeradius },
148
149 /*
150 * Certificate decoding attributes
151 */
152 { .out = &attr_tls_certificate, .name = "TLS-Certificate", .type = FR_TYPE_TLV, .dict = &dict_freeradius },
153 { .out = &attr_tls_certificate_serial, .name = "TLS-Certificate.Serial", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
154 { .out = &attr_tls_certificate_signature, .name = "TLS-Certificate.Signature", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
155 { .out = &attr_tls_certificate_signature_algorithm, .name = "TLS-Certificate.Signature-Algorithm", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
156 { .out = &attr_tls_certificate_issuer, .name = "TLS-Certificate.Issuer", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
157 { .out = &attr_tls_certificate_not_before, .name = "TLS-Certificate.Not-Before", .type = FR_TYPE_DATE, .dict = &dict_freeradius },
158 { .out = &attr_tls_certificate_not_after, .name = "TLS-Certificate.Not-After", .type = FR_TYPE_DATE, .dict = &dict_freeradius },
159 { .out = &attr_tls_certificate_subject, .name = "TLS-Certificate.Subject", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
160 { .out = &attr_tls_certificate_common_name, .name = "TLS-Certificate.Common-Name", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
161 { .out = &attr_tls_certificate_subject_alt_name_dns, .name = "TLS-Certificate.Subject-Alt-Name-Dns", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
162 { .out = &attr_tls_certificate_subject_alt_name_email, .name = "TLS-Certificate.Subject-Alt-Name-Email", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
163 { .out = &attr_tls_certificate_subject_alt_name_upn, .name = "TLS-Certificate.Subject-Alt-Name-Upn", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
164 { .out = &attr_tls_certificate_x509v3_extended_key_usage, .name = "TLS-Certificate.X509v3-Extended-Key-Usage", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
165 { .out = &attr_tls_certificate_x509v3_subject_key_identifier, .name = "TLS-Certificate.X509v3-Subject-Key-Identifier", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
166 { .out = &attr_tls_certificate_x509v3_authority_key_identifier, .name = "TLS-Certificate.X509v3-Authority-Key-Identifier", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
167 { .out = &attr_tls_certificate_x509v3_basic_constraints, .name = "TLS-Certificate.X509v3-Basic-Constraints", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
168 { .out = &attr_tls_certificate_x509v3_crl_distribution_points, .name = "TLS-Certificate.X509v3-CRL-Distribution-Points", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
169
170 { .out = &attr_tls_certificate_chain_depth, .name = "TLS-Certificate-Chain-Depth", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
171 { .out = &attr_tls_client_error_code, .name = "TLS-Client-Error-Code", .type = FR_TYPE_UINT8, .dict = &dict_freeradius },
172 { .out = &attr_tls_ocsp_cert_valid, .name = "TLS-OCSP-Cert-Valid", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
173 { .out = &attr_tls_ocsp_next_update, .name = "TLS-OCSP-Next-Update", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
174 { .out = &attr_tls_ocsp_response, .name = "TLS-OCSP-Response", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
175 { .out = &attr_tls_psk_identity, .name = "TLS-PSK-Identity", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
176
177 { .out = &attr_tls_session_cert_file, .name = "TLS-Session-Certificate-File", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
178 { .out = &attr_tls_session_require_client_cert, .name = "TLS-Session-Require-Client-Certificate", .type = FR_TYPE_BOOL, .dict = &dict_freeradius },
179 { .out = &attr_tls_session_cipher_suite, .name = "TLS-Session-Cipher-Suite", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
180 { .out = &attr_tls_session_version, .name = "TLS-Session-Version", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
181 { .out = &attr_tls_session_resume_type, .name = "TLS-Session-Resume-Type", .type = FR_TYPE_UINT32, .dict = &dict_freeradius },
182
183 { .out = &attr_tls_client_hello, .name = "TLS-Client-Hello", .type = FR_TYPE_TLV, .dict = &dict_freeradius },
184 { .out = &attr_tls_client_hello_tls_version, .name = "TLS-Client-Hello.TLS-Version", .type = FR_TYPE_UINT16, .dict = &dict_freeradius },
185 { .out = &attr_tls_client_hello_cipher, .name = "TLS-Client-Hello.Cipher", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
186 { .out = &attr_tls_client_hello_sig_algo, .name = "TLS-Client-Hello.Signature-Algorithm", .type = FR_TYPE_UINT16, .dict = &dict_freeradius },
187 { .out = &attr_tls_client_hello_supported_group, .name = "TLS-Client-Hello.Supported-Group", .type = FR_TYPE_UINT16, .dict = &dict_freeradius },
188 { .out = &attr_tls_client_hello_ec_point_format, .name = "TLS-Client-Hello.EC-Point-Format", .type = FR_TYPE_UINT8, .dict = &dict_freeradius },
189 { .out = &attr_tls_client_hello_psk_key_mode, .name = "TLS-Client-Hello.PSK-Key-Mode", .type = FR_TYPE_UINT8, .dict = &dict_freeradius },
190
191 { .out = &attr_module_failure_message, .name = "Module-Failure-Message", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
192
193 /*
194 * Eventually all TLS attributes will be in the TLS dictionary
195 */
196 { .out = &attr_tls_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_tls },
197 { .out = &attr_tls_session_data, .name = "Session-Data", .type = FR_TYPE_OCTETS, .dict = &dict_tls },
198 { .out = &attr_tls_session_id, .name = "Session-Id", .type = FR_TYPE_OCTETS, .dict = &dict_tls },
199 { .out = &attr_tls_session_resumed, .name = "Session-Resumed", .type = FR_TYPE_BOOL, .dict = &dict_tls },
200 { .out = &attr_tls_session_ttl, .name = "Session-TTL", .type = FR_TYPE_TIME_DELTA, .dict = &dict_tls },
201
202 { .out = &attr_der_certificate, .name = "Certificate", .type = FR_TYPE_TLV, .dict = &dict_der },
203
205};
206
207/*
208 * request types
209 */
216
217/*
218 * response types
219 */
223
224/*
225 * session resumption
226 */
229
230extern fr_dict_enum_autoload_t tls_dict_enum[];
231fr_dict_enum_autoload_t tls_dict_enum[] = {
232 { .out = &enum_tls_packet_type_load_session, .name = "Load-Session", .attr = &attr_tls_packet_type },
233 { .out = &enum_tls_packet_type_store_session, .name = "Store-Session", .attr = &attr_tls_packet_type },
234 { .out = &enum_tls_packet_type_clear_session, .name = "Clear-Session", .attr = &attr_tls_packet_type },
235 { .out = &enum_tls_packet_type_verify_certificate, .name = "Verify-Certificate", .attr = &attr_tls_packet_type },
236 { .out = &enum_tls_packet_type_new_session, .name = "New-Session", .attr = &attr_tls_packet_type },
237 { .out = &enum_tls_packet_type_establish_session, .name = "Establish-Session", .attr = &attr_tls_packet_type },
238
239 { .out = &enum_tls_packet_type_success, .name = "Success", .attr = &attr_tls_packet_type },
240 { .out = &enum_tls_packet_type_failure, .name = "Failure", .attr = &attr_tls_packet_type },
241 { .out = &enum_tls_packet_type_notfound, .name = "Notfound", .attr = &attr_tls_packet_type },
242
243 { .out = &enum_tls_session_resumed_stateful, .name = "stateful", .attr = &attr_tls_session_resume_type },
244 { .out = &enum_tls_session_resumed_stateless, .name = "stateless", .attr = &attr_tls_session_resume_type },
245
247};
248
249/*
250 * Updated by threads.c in the server, and left alone for everyone else.
251 */
252int fr_tls_max_threads = 1;
253
254/** Allocate memory for OpenSSL in the NULL context
255 *
256 * @param len to alloc.
257 * @return realloc.
258 */
259static void *fr_openssl_talloc(size_t len, char const *file, NDEBUG_UNUSED int line)
260{
261 static char const *async_file;
262 void *chunk;
263
264 if (!file) {
265 chunk = talloc_array(ssl_talloc_ctx, uint8_t, len);
266
267#ifndef NDEBUG
268 talloc_set_name(chunk, "fr_openssl_talloc");
269#endif
270 return chunk;
271 }
272
273 /*
274 * Cache the filename pointer for the async_posix.c
275 * source file, so we can figure out when we're
276 * being asked for stack memory.
277 *
278 * This is terrible, we're basically guessing at the
279 * stack size. OpenSSL 3.1.0 will have proper
280 * allocation functions so we can something more
281 * sensible.
282 */
283 if (!async_file) {
284 char const *sep;
285
286 sep = strrchr(file, '/');
287 if (!sep) {
288 sep = file;
289 } else {
290 sep++;
291 }
292 if (strcmp(sep, "async_posix.c") == 0) {
293 async_file = file;
294 alloc_stack:
295 len *= 4;
296 }
297 } else if (file == async_file) goto alloc_stack;
298
299 chunk = talloc_array(ssl_talloc_ctx, uint8_t, len);
300#ifndef NDEBUG
301 talloc_set_name(chunk, "%s:%d", file, line);
302#endif
303 return chunk;
304}
305
306/** Reallocate memory for OpenSSL in the NULL context
307 *
308 * @param old memory to realloc.
309 * @param len to extend to.
310 * @return realloced memory.
311 */
312static void *fr_openssl_talloc_realloc(void *old, size_t len, NDEBUG_UNUSED char const *file, NDEBUG_UNUSED int line)
313{
314 void *chunk;
315
316 chunk = talloc_realloc_size(ssl_talloc_ctx, old, len);
317#ifndef NDEBUG
318 talloc_set_name(chunk, "%s:%d", file, line);
319#endif
320 return chunk;
321}
322
323/** Free memory allocated by OpenSSL
324 *
325 * @param to_free memory to free.
326 */
327#ifdef NDEBUG
328/*
329 * If we're not debugging, use only the filename. Otherwise the
330 * cost of snprintf() is too large.
331 */
332static void fr_openssl_talloc_free(void *to_free, char const *file, UNUSED int line)
333{
334 (void)_talloc_free(to_free, file);
335}
336#else
337static void fr_openssl_talloc_free(void *to_free, char const *file, int line)
338{
339 char buffer[256];
340
341 snprintf(buffer, sizeof(buffer), "%s:%i", file, line);
342 (void)_talloc_free(to_free, buffer);
343}
344#endif
345
346/** Cleanup async pools if the thread exits
347 *
348 */
349static int _openssl_thread_free(void *init)
350{
351 ASYNC_cleanup_thread();
352 return talloc_free(init);
353}
354
355/** Perform thread-specific initialisation for OpenSSL
356 *
357 * Async contexts are what OpenSSL uses to track
358 *
359 * @param[in] async_pool_size_init The initial number of async contexts
360 * we keep in the pool.
361 * @param[in] async_pool_size_max The maximum number of async contexts
362 * we keep in the thread-local pool.
363 * @return
364 * - 0 on success.
365 * - -1 on failure.
366 */
367int fr_openssl_thread_init(size_t async_pool_size_init, size_t async_pool_size_max)
368{
369 /*
370 * Hack to use thread local destructor code
371 */
372 if (!async_pool_init) {
373 bool *init = talloc_zero(NULL, bool);
374
375 if (ASYNC_init_thread(async_pool_size_max, async_pool_size_init) != 1) {
376 fr_tls_log(NULL, "Failed initialising OpenSSL async context pool");
377 return -1;
378 }
379
380 fr_atexit_thread_local(async_pool_init, _openssl_thread_free, init);
381 }
382
383 return 0;
384}
385
386/** Free any memory alloced by libssl
387 *
388 * OpenSSL >= 1.1.0 uses an atexit handler to automatically free
389 * memory. However, we need to call OPENSSL_cleanup manually because
390 * some of the SSL ctx is parented to the main config which will get
391 * freed before the atexit handler, causing a segfault on exit.
392 */
393void fr_openssl_free(void)
394{
395 if (--openssl_instance_count > 0) return;
396
397 fr_tls_log_free();
398
399 fr_tls_bio_free();
400}
401
402static void _openssl_provider_free(void)
403{
404 if (openssl_default_provider && !OSSL_PROVIDER_unload(openssl_default_provider)) {
405 fr_tls_log(NULL, "Failed unloading default provider");
406 }
407 openssl_default_provider = NULL;
408
409 if (openssl_legacy_provider && !OSSL_PROVIDER_unload(openssl_legacy_provider)) {
410 fr_tls_log(NULL, "Failed unloading legacy provider");
411 }
412 openssl_legacy_provider = NULL;
413}
414
415static int fr_openssl_cleanup(UNUSED void *uctx)
416{
417 OPENSSL_cleanup();
418 return 0;
419}
420
421#if OPENSSL_VERSION_NUMBER >= 0x30400000L
422
423static void *fr_openssl_stack_alloc(size_t *len)
424{
425 void *stack;
426
427 /*
428 * Use mmap to sparsely allocate the stack
429 */
430#if defined(__linux__) || defined(__FreeBSD__)
431 stack = mmap(NULL, openssl_stack_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_STACK, -1, 0);
432#else
433 stack = mmap(NULL, openssl_stack_size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
434#endif
435 if (stack == MAP_FAILED) {
436 fr_tls_log(NULL, "Failed allocating OpenSSL stack: %s", fr_syserror(errno));
437 return NULL;
438 }
439 *len = openssl_stack_size;
440
441 return stack;
442}
443
444static void fr_openssl_stack_free(void *stack)
445{
446 munmap(stack, openssl_stack_size);
447}
448#endif
449
450/** Add all the default ciphers and message digests to our context.
451 *
452 * This should be called exactly once from main, before reading the main config
453 * or initialising any modules.
454 */
455int fr_openssl_init(void)
456{
457 pthread_attr_t tattr;
458
459 if (openssl_instance_count > 0) {
460 openssl_instance_count++;
461 return 0;
462 }
463
464 pthread_attr_init(&tattr);
465 if (pthread_attr_getstacksize(&tattr, &openssl_stack_size) != 0) {
466 fr_tls_log(NULL, "Failed getting stack size");
467 return -1;
468 }
469
470 /*
471 * This will only fail if memory has already been allocated
472 * by OpenSSL.
473 */
474 if (CRYPTO_set_mem_functions(fr_openssl_talloc, fr_openssl_talloc_realloc, fr_openssl_talloc_free) != 1) {
475 fr_tls_log(NULL, "Failed to set OpenSSL memory allocation functions. fr_openssl_init() called too late");
476 return -1;
477 }
478
479 /*
480 * Setup custom memory allocators for allocating greenthread
481 * stacks, so we can add guard pages.
482 */
483#if OPENSSL_VERSION_NUMBER >= 0x30400000L
484 if (ASYNC_set_mem_functions(fr_openssl_stack_alloc, fr_openssl_stack_free) != 1) {
485 fr_tls_log(NULL, "Failed to set OpenSSL async stack allocation functions");
486 return -1;
487 }
488#endif
489
490 /*
491 * NO_ATEXIT has no effect if init is done after
492 * loading providers, and we need to control the
493 * exit handler as it needs to be executed last
494 * after all the EVP_MD ctx have been called, as
495 * they may unload elements of providers once all
496 * the contexts have been cleaned up.
497 */
498 if (OPENSSL_init_ssl(OPENSSL_INIT_NO_ATEXIT | OPENSSL_INIT_LOAD_CONFIG, NULL) != 1) {
499 fr_tls_log(NULL, "Failed calling OPENSSL_init_crypto()");
500 return -1;
501 }
502
503 /*
504 * Load the default provider for most algorithms
505 */
506 openssl_default_provider = OSSL_PROVIDER_load(NULL, "default");
507 if (!openssl_default_provider) {
508 fr_tls_log(NULL, "Failed loading default provider");
509 return -1;
510 }
511
512 /*
513 * Needed for MD4
514 *
515 * https://www.openssl.org/docs/man3.0/man7/migration_guide.html#Legacy-Algorithms
516 */
517 openssl_legacy_provider = OSSL_PROVIDER_load(NULL, "legacy");
518 if (!openssl_legacy_provider) {
519 fr_tls_log(NULL, "Failed loading legacy provider");
520 return -1;
521 }
522
523 /*
524 * It's best to use OpenSSL's cleanup stack
525 * as then everything is cleaned up relative
526 * to the OPENSSL_cleanup() call.
527 */
528 OPENSSL_atexit(_openssl_provider_free);
529
530 /*
531 * SHA256 is in all versions of OpenSSL, but isn't
532 * initialized by default. It's needed for WiMAX
533 * certificates.
534 */
535 EVP_add_digest(EVP_sha256());
536
537 fr_tls_log_init();
538
539 fr_tls_bio_init();
540
541 /*
542 * Use an atexit handler to try and ensure
543 * that OpenSSL gets freed last.
544 *
545 * All EVP_*ctxs need to be freed before we
546 * de-initialise the libraries else we get
547 * crashes (at least with OpenSSL 3.0.1).
548 */
549 fr_atexit_global(fr_openssl_cleanup, NULL);
550
551 openssl_instance_count++;
552
553 return 0;
554}
555
556/** Enable or disable fips mode
557 *
558 * @param[in] enabled If true enable fips mode if false disable fips mode.
559 * @return
560 * - 0 on success.
561 * - -1 on failure
562 */
563int fr_openssl_fips_mode(bool enabled)
564{
565 if (!EVP_set_default_properties(NULL, enabled ? "fips=yes" : "-fips")) {
566 fr_tls_log(NULL, "Failed %s OpenSSL FIPS mode", enabled ? "enabling" : "disabling");
567 return -1;
568 }
569
570 return 0;
571}
572
573/** Load dictionary attributes
574 *
575 * This is a separate function because of ordering issues.
576 * OpenSSL may need to be initialised before anything else
577 * including the dictionary loader.
578 *
579 * fr_openssl_free will unload both the dictionary and the
580 * OpenSSL library.
581 */
582int fr_tls_dict_init(void)
583{
584 if (tls_instance_count > 0) {
585 tls_instance_count++;
586 return 0;
587 }
588
589 tls_instance_count++;
590
591 if (fr_dict_autoload(tls_dict) < 0) {
592 PERROR("Failed initialising protocol library");
593 fail:
594 tls_instance_count--;
595 fr_openssl_free();
596 return -1;
597 }
598
599 if (fr_dict_attr_autoload(tls_dict_attr) < 0) {
600 PERROR("Failed resolving attributes");
601 goto fail;
602 }
603
604 if (fr_dict_enum_autoload(tls_dict_enum) < 0) {
605 PERROR("Failed resolving enums");
606 goto fail;
607 }
608
609 return 0;
610}
611
612void fr_tls_dict_free(void)
613{
614 if (--tls_instance_count > 0) return;
615
616 fr_dict_autofree(tls_dict);
617}
618#endif /* WITH_TLS */
static int const char char buffer[256]
Definition acutest.h:578
int const char * file
Definition acutest.h:704
int const char int line
Definition acutest.h:704
#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 UNUSED
Definition build.h:317
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:4231
#define fr_dict_autofree(_to_free)
Definition dict.h:900
fr_value_box_t const ** out
Enumeration value.
Definition dict.h:281
fr_dict_attr_t const ** out
Where to write a pointer to the resolved fr_dict_attr_t.
Definition dict.h:292
fr_dict_t const ** out
Where to write a pointer to the loaded/resolved fr_dict_t.
Definition dict.h:305
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:4270
#define fr_dict_autoload(_to_load)
Definition dict.h:897
#define DICT_AUTOLOAD_TERMINATOR
Definition dict.h:311
Specifies an attribute which must be present for the module to function.
Definition dict.h:291
Specifies a dictionary which must be loaded/loadable for the module to function.
Definition dict.h:304
Specifies a value which must be present for the module to function.
Definition dict.h:280
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
static fr_dict_attr_t const * attr_module_failure_message
Definition log.c:206
#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_client_hello
HIDDEN fr_dict_attr_t const * attr_tls_client_hello_psk_key_mode
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_t const * dict_der
Definition base.c:39
HIDDEN fr_dict_attr_t const * attr_tls_certificate_subject_alt_name_dns
HIDDEN fr_dict_attr_t const * attr_tls_client_hello_supported_group
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_client_hello_sig_algo
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
HIDDEN fr_dict_attr_t const * attr_tls_certificate_x509v3_crl_distribution_points
fr_value_box_t const * enum_tls_packet_type_notfound
HIDDEN fr_dict_attr_t const * attr_tls_client_hello_ec_point_format
HIDDEN fr_dict_attr_t const * attr_der_certificate
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
HIDDEN fr_dict_attr_t const * attr_tls_client_hello_tls_version
fr_value_box_t const * enum_tls_packet_type_verify_certificate
HIDDEN fr_dict_attr_t const * attr_tls_client_hello_cipher
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
@ 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_UINT16
16 Bit unsigned integer.
@ 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
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