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