The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
ticket.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: 031e3d1581cef4a55260497440fc62e4a5710cff $
19 *
20 * @file tls/ticket.c
21 * @brief Functions shared by stateful and stateless TLS session resumption
22 *
23 * @copyright 2021 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
24 * @copyright 2026 Network RADIUS SAS (legal@networkradius.com)
25 */
26RCSID("$Id: 031e3d1581cef4a55260497440fc62e4a5710cff $")
27USES_APPLE_DEPRECATED_API /* OpenSSL API has been deprecated by Apple */
28
29#ifdef WITH_TLS
30#define LOG_PREFIX "tls"
31#define _TLS_PRIVATE 1
32
33#include <freeradius-devel/internal/internal.h>
34#include <freeradius-devel/server/pair.h>
35#include <freeradius-devel/server/module_rlm.h>
36#include <freeradius-devel/unlang/function.h>
37#include <freeradius-devel/unlang/subrequest.h>
38#include <freeradius-devel/util/debug.h>
39
40#include <freeradius-devel/protocol/tls/freeradius.h>
41
42#include "attrs.h"
43#include "base.h"
44#include "ticket.h"
45#include "log.h"
46#include "strerror.h"
47#include "verify.h"
48
49#include <openssl/ssl.h>
50
51/** Check if TLS caching is disabled.
52 *
53 * The TLS cache can be disabled for a host of reasons. Using a macro
54 * lets us check all of them at once:
55 *
56 * - there is no cache configuration
57 * - there is no virtual_server to run when poking the cache
58 *
59 * This check is only for static configuration. A particular session
60 * can still be marked as !tls_session->allow_session_resumption. In
61 * which case we don't load any cache entries, but we may still clear
62 * them.
63 */
64
65/** Copy the ID of a session into a box
66 *
67 * @param[in] ctx to allocate the ID in.
68 * @param[out] out box to fill. Left as-is when the session has no ID.
69 * @param[in] sess to retrieve the ID from.
70 * @return
71 * - 0 on success.
72 * - -1 if the session had no ID.
73 */
74int tls_ticket_id_to_box(TALLOC_CTX *ctx, fr_value_box_t *out, SSL_SESSION *sess)
75{
76 unsigned int len;
77 uint8_t const *id;
78
79 id = SSL_SESSION_get_id(sess, &len);
80 if (unlikely(!id)) return -1;
81
82 MEM(fr_value_box_memdup(ctx, out, NULL, id, len, true) == 0);
83
84 return 0;
85}
86
87/** Cache the ID of a session, if it is not cached already
88 *
89 * A session ID is fixed for the life of the session, so whichever code path
90 * sees the session first records the ID, and everything after that logs the
91 * cached copy instead of asking OpenSSL again.
92 *
93 * @param[in] tls_session to cache the ID in.
94 * @param[in] sess to take the ID from. May be NULL.
95 */
96void tls_session_id_cache(fr_tls_session_t *tls_session, SSL_SESSION *sess)
97{
98 if (!sess || !fr_type_is_null(tls_session->session_id.type)) return;
99
100 if (tls_ticket_id_to_box(tls_session, &tls_session->session_id, sess) < 0) return;
101
102 /*
103 * Copy the ID to the cache, instead of pointing the cache at the session.
104 */
105 if (tls_session->cache) tls_session->cache->session_id = &tls_session->session_id;
106}
107
108/** Allocate and initialize a subrequest for one of the TLS policy sections
109 *
110 * - allocate a subrequest
111 * - set the packet type
112 * - set the session ID
113 *
114 * @param[in] parent both allocation context and holds the subrequest stack frame
115 * @param[in] packet_type which section to run, as an
116 * enum_tls_packet_type_* value.
117 * @param[in] id of the session, or #FR_TYPE_NULL when there is none.
118 * @return the child request.
119 */
120request_t *tls_subrequest_alloc(request_t *parent, uint32_t packet_type, fr_value_box_t const *id)
121{
123 fr_pair_t *vp;
124
126
127 /*
128 * Setup the child request for the section being called.
129 */
131 vp->vp_uint32 = packet_type;
132
133 /*
134 * Add the session ID, if it exists. A session gets an
135 * ID only after it's established. And it can fail
136 * before then. So the ID might not exist.
137 *
138 * The ID is supplied by the peer, and is therefore
139 * tainted.
140 */
141 if (!fr_type_is_null(id->type)) {
143 fr_pair_value_memdup(vp, id->vb_octets, id->vb_length, true);
144 }
145
146 return request;
147}
148
149/** Serialize the session-state list and store it in the SSL_SESSION *
150 *
151 */
152int tls_ticket_app_data_set(request_t *request, SSL_SESSION *sess,
153 fr_value_box_t const *session_id)
154{
155 fr_dbuff_t dbuff;
156 fr_dbuff_uctx_talloc_t tctx;
157 fr_dcursor_t dcursor;
158 fr_pair_t *vp;
159 ssize_t slen;
160 int ret;
161
162 if (RDEBUG_ENABLED2) {
163 RDEBUG2("(TLS) Session ID %pV - Adding session-state[*] to data", session_id);
164 RINDENT();
165 log_request_pair_list(L_DBG_LVL_2, request, NULL, &request->session_state_pairs, NULL);
166 REXDENT();
167 }
168
169 /*
170 * Absolute maximum is `0..2^16-1`.
171 *
172 * We leave OpenSSL 2k to add anything else
173 */
174 MEM(fr_dbuff_init_talloc(NULL, &dbuff, &tctx, 1024, 1024 * 62));
175
176 /*
177 * Encode the session-state contents and add it to the ticket.
178 */
179 for (vp = fr_pair_dcursor_init(&dcursor, &request->session_state_pairs);
180 vp;
181 vp = fr_dcursor_current(&dcursor)) {
182 slen = fr_internal_encode_pair(&dbuff, &dcursor, NULL);
183 if (slen < 0) {
184 RPERROR("(TLS) Session ID %pV - Failed serialising session-state list", session_id);
185 fr_dbuff_free_talloc(&dbuff);
186 return 0; /* didn't store data */
187 }
188 if (slen == 0) (void) fr_dcursor_next(&dcursor);
189 }
190
191 RHEXDUMP4(fr_dbuff_start(&dbuff), fr_dbuff_used(&dbuff), "(TLS) session-ticket application data");
192
193 /*
194 * Pass the serialized session-state list
195 * over to OpenSSL.
196 */
197 ret = SSL_SESSION_set1_ticket_appdata(sess, fr_dbuff_start(&dbuff), fr_dbuff_used(&dbuff));
198 fr_dbuff_free_talloc(&dbuff); /* OpenSSL memdups the data */
199 if (ret != 1) {
200 fr_tls_log_perror(request, "Session ID %pV - Failed setting application data", session_id);
201 return -1;
202 }
203
204 return 1; /* successfully stored data */
205}
206
207int tls_ticket_app_data_get(request_t *request, SSL_SESSION *sess,
208 fr_value_box_t const *session_id)
209{
210 uint8_t *data;
211 size_t data_len;
212 fr_dbuff_t dbuff;
213 fr_pair_list_t tmp;
214
215 /*
216 * Extract the session-state list from the ticket.
217 */
218 if (SSL_SESSION_get0_ticket_appdata(sess, (void **)&data, &data_len) != 1) {
219 fr_tls_log_perror(request, "Session ID %pV - Failed retrieving application data", session_id);
220 return -1;
221 }
222
223 /*
224 * OpenSSL returns NULL and a length of zero both for a session with no application data, and for
225 * application data of zero octets. A session which was stored with an empty session-state list
226 * looks like a session without stored state. An empty list is valid.
227 */
228 if (!data) {
229 if (data_len == 0) {
230 RDEBUG2("(TLS) Session ID %pV - No session-state[*] to restore", session_id);
231 return 0;
232 }
233
234 fr_tls_log_perror(request, "Session ID %pV - Got NULL session application data", session_id);
235 return -1;
236 }
237
238 fr_pair_list_init(&tmp);
239 fr_dbuff_init(&dbuff, data, data_len);
240
241 RHEXDUMP4(fr_dbuff_start(&dbuff), fr_dbuff_len(&dbuff), "(TLS) session application data");
242
243 /*
244 * Decode the session-state data into a temporary list.
245 *
246 * It's very important that we decode _all_ attributes,
247 * or disallow session resumption.
248 */
249 while (fr_dbuff_remaining(&dbuff) > 0) {
250 if (fr_internal_decode_pair_dbuff(request->session_state_ctx, &tmp,
251 fr_dict_root(request->proto_dict), &dbuff, NULL) < 0) {
252 fr_pair_list_free(&tmp);
253 RPEDEBUG("(TLS) Session-ID %pV - Failed decoding session-state", session_id);
254 fr_tls_session_error_add(request, FR_ERROR_VALUE_SESSION_DATA_DECODE_FAILED);
255 return -1;
256 }
257 }
258
259 if (RDEBUG_ENABLED2) {
260 RDEBUG2("(TLS) Session-ID %pV - Restoring session-state[*]", session_id);
261 RINDENT();
262 log_request_pair_list(L_DBG_LVL_2, request, NULL, &tmp, "session-state.");
263 REXDENT();
264 }
265
266 fr_pair_list_append(&request->session_state_pairs, &tmp);
267
268 return 0;
269}
270
271/** Enforce lifetime on a TLS session ticket.
272 *
273 * There are three limits, and we pick the lowest one.
274 *
275 * - the lifetime OpenSSL recorded in the session itself,
276 * - `lifetime` from the configuration, so that a policy change reaches
277 * sessions which were stored before it,
278 * - FR_TLS_MAX_SESSION_LIFETIME (7 days), which is required by RFC
279 * 8446 for TLS and by RFC 9190 for EAP-TLS.
280 *
281 * @param[in] request for logging.
282 * @param[in] session_id of the session, for logging.
283 * @param[in] conf holding the configured lifetime.
284 * @param[in] sess to examine.
285 * @return
286 * - how long the session has left, if it is still live.
287 * - <= 0 if the session has expired.
288 */
289fr_time_delta_t tls_ticket_session_lifetime(request_t *request, fr_value_box_t const *session_id,
290 fr_tls_conf_t const *conf, SSL_SESSION *sess)
291{
292 time_t timeout = SSL_get_timeout(sess);
293 time_t lifetime = (time_t) fr_time_delta_to_sec(conf->cache.lifetime);
294 fr_time_t expires;
295
296 if (lifetime && (lifetime < timeout)) timeout = lifetime;
297
298 if (timeout > FR_TLS_MAX_SESSION_LIFETIME) {
299 RWDEBUG("(TLS) Session ID %pV - Session lifetime %pV is longer than the maximum of %pV, limiting it",
300 session_id, fr_box_time_delta(fr_time_delta_from_sec(timeout)),
301 fr_box_time_delta(fr_time_delta_from_sec(FR_TLS_MAX_SESSION_LIFETIME)));
302
303 timeout = FR_TLS_MAX_SESSION_LIFETIME;
304 }
305
306#if OPENSSL_VERSION_NUMBER >= 0x30400000L
307 expires = fr_time_from_sec((time_t)(SSL_SESSION_get_time_ex(sess) + timeout));
308#else
309 expires = fr_time_from_sec((time_t)(SSL_SESSION_get_time(sess) + timeout));
310#endif
311
312 return fr_time_sub(expires, fr_time());
313}
314
315/** Is the session ticket resumable?
316 *
317 * If the ticket is close to expiry, then we just force a full
318 * re-authentication.
319 *
320 * @param[in] request to log through.
321 * @param[in] session_id of the session, for the log message.
322 * @param[in] conf holding `lifetime` and `min_lifetime`.
323 * @param[in] sess to examine.
324 * @return
325 * - true if the session has at least `min_lifetime` left.
326 * - false if it has less, or has expired.
327 */
328bool tls_ticket_session_resumable(request_t *request, fr_value_box_t const *session_id,
329 fr_tls_conf_t const *conf, SSL_SESSION *sess)
330{
331 fr_time_delta_t left = tls_ticket_session_lifetime(request, session_id, conf, sess);
332
333 if (!fr_time_delta_ispos(left)) return false;
334
335 if (fr_time_delta_lt(left, conf->cache.min_lifetime)) {
336 RDEBUG2("(TLS) Session ID %pV - %pV left is less than min_lifetime of %pV",
337 session_id, fr_box_time_delta(left), fr_box_time_delta(conf->cache.min_lifetime));
338 return false;
339 }
340
341 return true;
342}
343
344/** Prevent a TLS session from being resumed in future
345 *
346 * @note In OpenSSL > 1.1.0 this should not be called directly, but passed as a callback to
347 * SSL_CTX_set_not_resumable_session_callback.
348 *
349 * @param ssl The current OpenSSL session.
350 * @param is_forward_secure Whether the cipher is forward secure, pass -1 if unknown.
351 * @return
352 * - 0 if session-resumption is allowed.
353 * - 1 if enabling session-resumption was disabled for this session.
354 */
355int fr_tls_ticket_disable_cb(SSL *ssl, int is_forward_secure)
356{
358
359 fr_tls_session_t *tls_session;
360 fr_pair_t *vp;
361
362 tls_session = fr_tls_session(ssl);
363 request = fr_tls_session_request(tls_session->ssl);
364
365 /*
366 * Request was cancelled, try and get OpenSSL to
367 * do as little work as possible.
368 */
370
371 {
372 fr_tls_conf_t *conf;
373
374 conf = talloc_get_type_abort(SSL_get_ex_data(ssl, FR_TLS_EX_INDEX_CONF), fr_tls_conf_t);
375 if (conf->cache.require_extms && (SSL_get_extms_support(tls_session->ssl) == 0)) {
376 RDEBUG2("(TLS) Client does not support the Extended Master Secret extension, "
377 "denying session resumption");
378 goto disable;
379 }
380
381 if (conf->cache.require_pfs && !is_forward_secure) {
382 RDEBUG2("(TLS) Cipher suite is not forward secure, denying session resumption");
383 goto disable;
384 }
385 }
386
387 /*
388 * If there's no session resumption, delete the entry
389 * from the cache. This means either it's disabled
390 * globally for this SSL context, OR we were told to
391 * disable it for this user.
392 *
393 * This also means you can't turn it on just for one
394 * user.
395 */
396 if (!tls_session->allow_session_resumption) {
397 RDEBUG2("(TLS) Session resumption not enabled for this TLS session, denying session resumption");
398 goto disable;
399 }
400
402 if (vp && (vp->vp_uint32 == 0)) {
403 RDEBUG2("(TLS) control.Allow-Session-Resumption == no, denying session resumption");
404 disable:
405 SSL_CTX_remove_session(tls_session->ctx, tls_session->session);
406 tls_session->allow_session_resumption = false;
407 return 1;
408 }
409
410 RDEBUG2("(TLS) Allowing future session-resumption");
411
412 return 0;
413}
414
415/** Does this session need a delayed stateless ticket?
416 *
417 * @param[in] tls_session to check.
418 * @return
419 * - true if the session is a TLS 1.3 server, and no stateless ticket has been created.
420 * - false otherwise.
421 */
422static bool tls_ticket_stateless_wanted(fr_tls_session_t *tls_session)
423{
424 fr_tls_conf_t *conf = tls_session->conf;
425
426 return conf->delayed_tickets &&
427 (conf->cache.mode & FR_TLS_TICKET_STATELESS) &&
428 !tls_session->disallow_stateless_tickets &&
429 !tls_session->session_ticket_created &&
430 SSL_is_server(tls_session->ssl) &&
431 (SSL_version(tls_session->ssl) == TLS1_3_VERSION) &&
432 tls_session->allow_session_resumption &&
433 tls_session->session_ticket_supported;
434}
435
436/** Create the delayed stateless ticket, and queue the ticket for the peer, and then run a function
437 *
438 * Callers which send a final message to the peer call this function, and write the message in
439 * the resume function. The ticket record is then ahead of the message in the output, and both
440 * leave in the same EAP request.
441 *
442 * - If the session needs a ticket, the function pushes a frame which runs `encode session`,
443 * creates the ticket, and then calls the resume function. The function returns
444 * #UNLANG_ACTION_PUSHED_CHILD.
445 * - If the session is not a TLS 1.3 server with a delayed stateless ticket, or the ticket has
446 * already been created, the function calls the resume function directly, and returns what
447 * the resume function returns.
448 *
449 * The resume function sets the unlang result, as a module function does.
450 *
451 * @param[out] p_result the caller's result. Passed to the resume function when no ticket is needed.
452 * @param[in] request to run `encode session` and the resume function in.
453 * @param[in] tls_session to create a ticket for.
454 * @param[in] resume function to run after the ticket has been created. May be NULL.
455 * @param[in] uctx passed to the resume function.
456 * @return
457 * - UNLANG_ACTION_PUSHED_CHILD - `encode session` and the ticket are running, and the
458 * resume function runs after them.
459 * - anything else the resume function returns, if no ticket is needed.
460 * - UNLANG_ACTION_CALCULATE_RESULT - no ticket is needed, and there is no resume function.
461 * - UNLANG_ACTION_FAIL - the frame could not be pushed.
462 */
463unlang_action_t fr_tls_ticket_stateless_issue(unlang_result_t *p_result, request_t *request, fr_tls_session_t *tls_session,
464 unlang_function_with_result_t resume, void *uctx)
465{
466 if (!tls_ticket_stateless_wanted(tls_session)) {
467 if (!resume) return UNLANG_ACTION_CALCULATE_RESULT;
468
469 return resume(p_result, request, uctx);
470 }
471
472 return tls_ticket_stateless_issue_push(request, tls_session, resume, uctx);
473}
474
475/** Issue the session ticket, or store the session, after the application has succeeded
476 *
477 * A TLS 1.3 server in a mode which includes stateless tickets, with delayed tickets, sent no
478 * ticket in the handshake (see fr_tls_session_msg_cb()). Run `encode session`, and send the
479 * ticket now. Every other session has already sent any ticket, so we only run `store session`.
480 *
481 * The `store session` and `encode session` sections are never both run for one session.
482 *
483 * @note The caller MUST set the caller's own unlang result before calling
484 * fr_tls_ticket_issue(). A pushed child returns to the caller's caller with that result
485 * already in place.
486 *
487 * @param[in] request to run the sections in.
488 * @param[in] tls_session to issue a ticket for.
489 * @return
490 * - UNLANG_ACTION_PUSHED_CHILD - sections are running.
491 * - UNLANG_ACTION_CALCULATE_RESULT - there was nothing to do.
492 * - UNLANG_ACTION_FAIL - the frame could not be pushed.
493 */
494unlang_action_t fr_tls_ticket_issue(request_t *request, fr_tls_session_t *tls_session)
495{
496 fr_tls_conf_t *conf = tls_session->conf;
497
498 /*
499 * Some TLS servers (EAP-TTLS) do not use stateless tickets with TLS 1.3.
500 * The call succeeds, but no stateless ticket is created.
501 */
502 if (tls_session->disallow_stateless_tickets &&
503 (conf->cache.mode & FR_TLS_TICKET_STATELESS) &&
504 SSL_is_server(tls_session->ssl) &&
505 (SSL_version(tls_session->ssl) == TLS1_3_VERSION)) {
506 RWDEBUG("(TLS) Stateless session resumption does not work for this session");
507 return fr_tls_ticket_stateful_store_session(request, tls_session);
508 }
509
510 if (tls_ticket_stateless_wanted(tls_session)) return tls_ticket_stateless_issue_push(request, tls_session, NULL, NULL);
511
512 return fr_tls_ticket_stateful_store_session(request, tls_session);
513}
514
515/** Sets callbacks and flags on a SSL_CTX to enable/disable session resumption
516 *
517 * @param[in] ctx to modify.
518 * @param[in] cache_conf Session caching configuration.
519 * @return
520 * - 0 on success.
521 * - -1 on failure.
522 */
523int fr_tls_ticket_ctx_init(SSL_CTX *ctx, fr_tls_ticket_conf_t const *cache_conf, bool client)
524{
525 switch (cache_conf->mode) {
526 case FR_TLS_TICKET_DISABLED:
527 fr_tls_ticket_stateless_disable(ctx, false);
528 fr_tls_ticket_stateful_disable(ctx);
529 return 0;
530
531 case FR_TLS_TICKET_STATEFUL:
532 /*
533 * Allow stateful tickets, and if we're a server, disable stateless tickets.
534 *
535 * We don't disable stateless tickets on the client, because doing so will tell the
536 * server that the client doesn't support stateless tickets. Since the client treats all
537 * tickets as opaque blobs, it doesn't matter whether the tickets are stateless or
538 * stateful.
539 */
540 fr_tls_ticket_stateful_ctx_init(ctx, cache_conf, client);
541
542 if (!client) fr_tls_ticket_stateless_disable(ctx, true);
543 break;
544
545 case FR_TLS_TICKET_STATELESS:
546 if (fr_tls_ticket_stateless_ctx_init(ctx, cache_conf) < 0) return -1;
547
548 if (!client) {
549 fr_tls_ticket_stateful_disable(ctx);
550 } else {
551 /*
552 * Stateless clients get stateful init, too, because the cache flag controls what
553 * we tell the server, but the client just runs `store session` and `load
554 * session`.
555 */
556 fr_tls_ticket_stateful_ctx_init(ctx, cache_conf, client);
557 }
558 break;
559
560 case FR_TLS_TICKET_AUTO:
561 fr_tls_ticket_stateful_ctx_init(ctx, cache_conf, client);
562 if (fr_tls_ticket_stateless_ctx_init(ctx, cache_conf) < 0) return -1;
563 break;
564 }
565
566 SSL_CTX_set_not_resumable_session_callback(ctx, fr_tls_ticket_disable_cb);
567 SSL_CTX_set_quiet_shutdown(ctx, 1);
568
569 return 0;
570}
571#endif /* WITH_TLS */
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
Definition action.h:35
@ UNLANG_ACTION_CALCULATE_RESULT
Calculate a new section rlm_rcode_t value.
Definition action.h:38
static uint8_t request[4]
#define USES_APPLE_DEPRECATED_API
Definition build.h:590
#define RCSID(id)
Definition build.h:603
#define unlikely(_x)
Definition build.h:486
#define fr_dbuff_used(_dbuff_or_marker)
Return the number of bytes remaining between the start of the dbuff or marker and the current positio...
Definition dbuff.h:819
static void fr_dbuff_free_talloc(fr_dbuff_t *dbuff)
Free the talloc buffer associated with a dbuff.
Definition dbuff.h:495
#define fr_dbuff_len(_dbuff_or_marker)
The length of the underlying buffer.
Definition dbuff.h:828
#define fr_dbuff_init(_out, _start, _len_or_end)
Initialise an dbuff for encoding or decoding.
Definition dbuff.h:387
#define fr_dbuff_start(_dbuff_or_marker)
Return the 'start' position of a dbuff or marker.
Definition dbuff.h:950
#define fr_dbuff_remaining(_dbuff_or_marker)
Return the number of bytes remaining between the dbuff or marker and the end of the buffer.
Definition dbuff.h:795
static fr_dbuff_t * fr_dbuff_init_talloc(TALLOC_CTX *ctx, fr_dbuff_t *dbuff, fr_dbuff_uctx_talloc_t *tctx, size_t init, size_t max)
Initialise a special dbuff which automatically extends as additional data is written.
Definition dbuff.h:453
static void * fr_dcursor_next(fr_dcursor_t *cursor)
Advanced the cursor to the next item.
Definition dcursor.h:288
static void * fr_dcursor_current(fr_dcursor_t *cursor)
Return the item the cursor current points to.
Definition dcursor.h:337
#define MEM(x)
Definition debug.h:38
fr_dict_attr_t const * fr_dict_root(fr_dict_t const *dict)
Return the root attribute of a dictionary.
Definition dict_util.c:2717
unlang_action_t(* unlang_function_with_result_t)(unlang_result_t *p_result, request_t *request, void *uctx)
A generic function pushed by a module or xlat to functions deeper in the C call stack to create resum...
Definition function.h:55
bool unlang_request_is_cancelled(request_t const *request)
Return whether a request has been cancelled.
Definition interpret.c:1985
void log_request_pair_list(fr_log_lvl_t lvl, request_t *request, fr_pair_t const *parent, fr_pair_list_t const *vps, char const *prefix)
Print a fr_pair_list_t.
Definition log.c:831
#define REXDENT()
Exdent (unindent) R* messages by one level.
Definition log.h:460
#define RWDEBUG(fmt,...)
Definition log.h:378
#define RHEXDUMP4(_data, _len, _fmt,...)
Definition log.h:725
#define RPERROR(fmt,...)
Definition log.h:319
#define RPEDEBUG(fmt,...)
Definition log.h:393
#define RINDENT()
Indent R* messages by one level.
Definition log.h:447
HIDDEN fr_dict_attr_t const * attr_tls_packet_type
HIDDEN fr_dict_attr_t const * attr_tls_session_id
HIDDEN fr_dict_attr_t const * attr_allow_session_resumption
#define fr_time()
Definition event.c:58
@ L_DBG_LVL_2
2nd highest priority debug messages (-xx | -X).
Definition log.h:68
unsigned int uint32_t
long int ssize_t
unsigned char uint8_t
int fr_pair_value_memdup(fr_pair_t *vp, uint8_t const *src, size_t len, bool tainted)
Copy data into an "octets" data type.
Definition pair.c:2906
fr_pair_t * fr_pair_find_by_da(fr_pair_list_t const *list, fr_pair_t const *prev, fr_dict_attr_t const *da)
Find the first pair with a matching da.
Definition pair.c:716
void fr_pair_list_init(fr_pair_list_t *list)
Initialise a pair list header.
Definition pair.c:47
ssize_t fr_internal_decode_pair_dbuff(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t const *parent, fr_dbuff_t *dbuff, void *decode_ctx)
Definition decode.c:285
ssize_t fr_internal_encode_pair(fr_dbuff_t *dbuff, fr_dcursor_t *cursor, void *encode_ctx)
Encode a data structure into an internal attribute.
Definition encode.c:282
#define RDEBUG_ENABLED2()
#define RDEBUG2(fmt,...)
static rs_t * conf
Definition radsniff.c:52
#define pair_append_request(_attr, _da)
Allocate and append a fr_pair_t to the request list.
Definition pair.h:37
#define pair_prepend_request(_attr, _da)
Allocate and prepend a fr_pair_t to the request list.
Definition pair.h:77
fr_pair_t * vp
Stores an attribute, a value and various bits of other data.
Definition pair.h:68
request_t * unlang_subrequest_alloc(request_t *parent, fr_dict_t const *namespace)
Allocate a subrequest to run through a virtual server at some point in the future.
Definition subrequest.c:316
#define fr_time_delta_lt(_a, _b)
Definition time.h:285
static fr_time_delta_t fr_time_delta_from_sec(int64_t sec)
Definition time.h:599
#define fr_time_delta_ispos(_a)
Definition time.h:290
static int64_t fr_time_delta_to_sec(fr_time_delta_t delta)
Definition time.h:656
static fr_time_t fr_time_from_sec(time_t when)
Convert a time_t (wallclock time) to a fr_time_t (internal time)
Definition time.h:876
#define fr_time_sub(_a, _b)
Subtract one time from another.
Definition time.h:229
A time delta, a difference in time measured in nanoseconds.
Definition time.h:80
"server local" time.
Definition time.h:69
static fr_dict_t const * dict_tls
void fr_pair_list_free(fr_pair_list_t *list)
Free memory used by a valuepair list.
void fr_pair_list_append(fr_pair_list_t *dst, fr_pair_list_t *src)
Appends a list of fr_pair_t from a temporary list to a destination list.
#define fr_pair_dcursor_init(_cursor, _list)
Initialises a special dcursor with callbacks that will maintain the attr sublists correctly.
Definition pair.h:605
static fr_slen_t parent
Definition pair.h:864
#define fr_type_is_null(_x)
Definition types.h:347
int fr_value_box_memdup(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_dict_attr_t const *enumv, uint8_t const *src, size_t len, bool tainted)
Copy a buffer to a fr_value_box_t.
Definition value.c:5255
static fr_slen_t data
Definition value.h:1366
static fr_sbuff_err_t char ** out
Definition value.h:1061
static fr_sbuff_err_t char size_t * len
Definition value.h:1061
#define fr_box_time_delta(_val)
Definition value.h:397