The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
session.h
Go to the documentation of this file.
1#pragma once
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16 */
17#ifdef WITH_TLS
18/**
19 * $Id: d15db050994c341c706ed6bec4c6db285fad7c3a $
20 *
21 * @file lib/tls/session.h
22 * @brief Structures for session-resumption management.
23 *
24 * @copyright 2021 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
25 * @copyright 2026 Network RADIUS SAS (legal@networkradius.com)
26 */
27RCSIDH(session_h, "$Id: d15db050994c341c706ed6bec4c6db285fad7c3a $")
28
29#include "openssl_user_macros.h"
30
31#include <openssl/ssl.h>
32#include <openssl/err.h>
33
34typedef struct fr_tls_session_s fr_tls_session_t;
35
36#include <freeradius-devel/server/request.h>
37#include <freeradius-devel/util/dbuff.h>
38
39#include "bio.h"
40#include "ticket.h"
41#include "conf.h"
42#include "index.h"
43#include "verify.h"
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49/*
50 * A single TLS record carries at most SSL3_RT_MAX_PLAIN_LENGTH
51 * octets of plaintext, which OpenSSL defines as 16384. A TLS
52 * message may span multiple TLS records, and a TLS certificate
53 * message may in principle be as long as 16MB.
54 *
55 * However, note that in order to protect against reassembly
56 * lockup and denial of service attacks, it may be desirable for
57 * an implementation to set a maximum size for one such group of
58 * TLS messages.
59 *
60 * The TLS Message Length field is four octets, and provides the
61 * total length of the TLS message or set of messages that is
62 * being fragmented, which simplifies buffer allocation.
63 *
64 * A TLS record adds data on top of the application-layer
65 * plaintext: the TLS header (5 octets); encryption overhead
66 * (SSL3_RT_MAX_ENCRYPTED_OVERHEAD which is 256 octets of padding
67 * plus a 64 octet MAC); where OpenSSL was built with
68 * compression 1024 octets.
69 *
70 * SSL3_RT_MAX_PACKET_SIZE therefore depends on the local OpenSSL
71 * build, and build flags. Generally 17733 with compression,
72 * 16709 without. We round up on general principle.
73 */
74#define FR_TLS_MAX_PACKET_SIZE ((SSL3_RT_MAX_PACKET_SIZE + 255) & ~255)
75
76/*
77 * Cap the maximum number of handshakes that we receive in a row.
78 * If we don't make progress, then either the certificates are
79 * enormous, or the TLS chunks are deliberately small, or the
80 * other end is trying to catch us in an infinite ACK / ACK loop.
81 *
82 * The EAP code also caps the number of rounds it does, but there
83 * are non-TLS EAP methods which can use multiple rounds. We
84 * need both limits in order to catch all corner cases. Note
85 * also that TLS-based EAP methods will ACK each _fragment_ of a
86 * TLS record. So one TLS "round" could map to multple EAP
87 * "rounds".
88 */
89#define FR_TLS_MAX_ROUNDS 50U
90
91/*
92 * clean_in and clean_out are dbuffs over a fixed allocation of
93 * clean_size bytes, which is set from conf->buffer_size. The buffers
94 * should not be extensible, as doing so could allow the peer to send
95 * unlimited data.
96 *
97 * dirty_in and dirty_out allow for extensions. We therefore can't
98 * call the fill/drain helpers below on those buffers. Calling
99 * fr_tls_record_init() on one would re-init the dbuff and lose the
100 * talloc context which lets the buffer extend.
101 */
102
103/** Reset a record buffer so that it can be filled again
104 *
105 * A record buffer is filled, then drained. While the buffer is filling, the
106 * dbuff runs from the start of the buffer to the end of the memory, the
107 * current position is where the next octet is written, and fr_dbuff_used()
108 * says how many octets are in the buffer.
109 *
110 * Resetting returns the buffer to the filling state, and discards whatever
111 * the buffer held.
112 *
113 * The record buffers are talloc arrays of clean_size bytes, so the size of
114 * the allocation is the size of the buffer.
115 *
116 * @param[in] record to reset.
117 */
118static inline void fr_tls_record_init(fr_dbuff_t *record)
119{
120 uint8_t *start = fr_dbuff_start(record);
121
122 fr_dbuff_init(record, start, talloc_array_length(start));
123}
124
125/** Stop filling a record buffer, and start draining it
126 *
127 * While the buffer is draining, the dbuff runs from the start of the buffer
128 * to the end of the data which was written, the current position is where the
129 * next octet is read, and fr_dbuff_remaining() says how many octets are left
130 * to read.
131 *
132 * The buffer must not be written to while it is draining. Call
133 * fr_tls_record_init() to fill it again.
134 *
135 * @param[in] record to start draining.
136 */
137static inline void fr_tls_record_drain(fr_dbuff_t *record)
138{
139 size_t used = fr_dbuff_used(record);
140
141 fr_dbuff_init(record, fr_dbuff_start(record), used);
142}
143
144typedef enum : uint8_t {
145 TLS_INFO_ORIGIN_RECORD_RECEIVED,
146 TLS_INFO_ORIGIN_RECORD_SENT
147} fr_tls_info_origin_t;
148
149typedef struct {
150 int origin;
151 int content_type;
152 uint8_t handshake_type;
153 uint8_t alert_level;
154 uint8_t alert_description;
155 bool initialized;
156
157 size_t record_len;
158 int version; //!< NOT to be trusted! Use SSL_version(), see session.c
159
160 char info_description[256];
161} fr_tls_info_t;
162
163/** Result of the last operation on the session
164 *
165 * This is needed to record the result of an asynchronous
166 */
167typedef enum : uint8_t {
168 FR_TLS_RESULT_IN_PROGRESS = 0x00, //!< Handshake round in progress.
169 FR_TLS_RESULT_ERROR = 0x01, //!< Handshake failed.
170 FR_TLS_RESULT_SUCCESS = 0x02 //!< Handshake round succeed.
171} fr_tls_result_t;
172
173#ifdef PSK_MAX_IDENTITY_LEN
174/** State of the `load psk` call that the PSK callback requested
175 *
176 */
177typedef enum : uint8_t {
178 FR_TLS_PSK_INIT = 0, //!< No call is pending.
179 FR_TLS_PSK_REQUESTED, //!< `load psk` needs to run. The PSK callback has
180 ///< paused the handshake until the section finishes.
181 FR_TLS_PSK_SUCCESS, //!< `load psk` returned a key, and `key` holds the key.
182 FR_TLS_PSK_FAILED //!< `load psk` failed, or did not return a usable key.
183} fr_tls_psk_state_t;
184
185/** The `load psk` call that the PSK callback requested, and the key that the section returned
186 *
187 */
188typedef struct {
189 fr_tls_psk_state_t state; //!< Whether the call is pending, finished, or failed.
190 unsigned int max_psk_len; //!< The longest key that OpenSSL accepts, copied from
191 ///< the `max_psk_len` argument of the PSK callback.
192 uint8_t *key; //!< The key from `reply.TLS-PSK-Key`, copied out of the
193 ///< subrequest before the subrequest is freed.
194 size_t key_len; //!< Length of `key`.
195} fr_tls_psk_t;
196#endif
197
198/** Policy sections that an OpenSSL callback has asked the handshake to run
199 *
200 * A callback cannot run the unlang interpreter, so the callback raises a bit
201 * in `pending`, and pauses the handshake. tls_session_async_handshake_cont()
202 * pushes the section for each raised bit, lowest bit first, and only resumes
203 * the handshake once no bit is raised. Each bit is one shot, cleared before
204 * the push function for the bit is called. Each section writes the result
205 * of the section to the state for that section (`cache`, `ticket`, `psk`, or
206 * `validate`), not to `pending`.
207 */
208DIAG_OFF(attributes)
209typedef enum CC_HINT(flag_enum) : uint64_t {
210 FR_TLS_PENDING_STATEFUL_TICKET = 0x01, //!< `load session { ... }`, `store session { ... }`
211 ///< or `clear session { ... }`, for the session cache.
212 FR_TLS_PENDING_STATELESS_TICKET = 0x02, //!< `encode session { ... }` or `decode session { ... }`,
213 ///< for a stateless session ticket.
214 FR_TLS_PENDING_PSK = 0x04, //!< `load psk { ... }`
215 FR_TLS_PENDING_VERIFY = 0x08 //!< `verify certificate { ... }`
216} fr_tls_pending_t;
217DIAG_ON(attributes)
218
219#ifdef _TLS_PRIVATE
220/** Ask the handshake to run a section once the handshake has paused
221 */
222#define TLS_PENDING_SET(_tls_session, _bit) ((_tls_session)->pending |= (_bit))
223
224/** Clear a bit before the push function for the bit is called
225 */
226#define TLS_PENDING_CLEAR(_tls_session, _bit) ((_tls_session)->pending &= ~(_bit))
227#endif
228
229/** Tracks the state of a TLS session
230 *
231 * Currently used for RADSEC and EAP-TLS + dependents (EAP-TTLS, EAP-PEAP etc...).
232 *
233 * In the case of EAP-TLS + dependents a #eap_tls_session_t struct is used to track
234 * the transfer of TLS records.
235 */
236struct fr_tls_session_s {
237 fr_tls_conf_t *conf; //!< The parsed "tls" section this session was
238 ///< built from. It does not change, so it is
239 ///< recorded here rather than fetched from
240 ///< OpenSSL's ex_data on every use.
241
242 SSL_CTX *ctx; //!< TLS configuration context.
243 SSL *ssl; //!< This SSL session.
244 SSL_SESSION *session; //!< Session resumption data.
245 fr_tls_result_t result; //!< Result of the last handshake round.
246 fr_value_box_t session_id; //!< ID of the session
247
248 fr_tls_info_t info; //!< Information about the state of the TLS session.
249
250 fr_tls_bio_dbuff_t *into_ssl; //!< Encrypted data from the peer, which OpenSSL reads.
251 fr_tls_bio_dbuff_t *from_ssl; //!< Encrypted data OpenSSL wrote, waiting to be sent.
252 fr_dbuff_t clean_in; //!< Cleartext data that needs to be encrypted.
253 fr_dbuff_t clean_out; //!< Decrypted cleartext, for the caller to read.
254 fr_dbuff_t *dirty_in; //!< Encrypted data to decrypt. The producer
255 ///< cursor of into_ssl, which the caller fills.
256 fr_dbuff_t *dirty_out; //!< Encrypted data, ready to send. The consumer
257 ///< cursor of from_ssl, which the caller drains.
258 size_t clean_size; //!< Size of clean_in and clean_out.
259 size_t dirty_size; //!< Initial size of the into_ssl and from_ssl buffers,
260 ///< and the default maximum size of into_ssl.
261
262 int last_ret; //!< Last result returned by SSL_read().
263
264 uint32_t rounds; //!< Handshake round trips.
265
266 size_t mtu; //!< Maximum record fragment size.
267
268 int socket_type; //!< SOCK_STREAM for TLS, SOCK_DGRAM for DTLS.
269 ///< Taken from the context the session was
270 ///< allocated against, so that the rest of the
271 ///< code reads a field rather than asking
272 ///< OpenSSL the same question repeatedly.
273
274 fr_socket_t const *cookie; //!< What the DTLS cookie is bound to: the source
275 ///< and destination of the connection, which is
276 ///< how the rest of the server identifies a DTLS
277 ///< session. Set by the application, and hashed
278 ///< but never read by the library.
279
280 void *opaque; //!< Used to store module specific data.
281
282 unsigned char *alpn; //!< Protocol name both ends agreed on, as
283 ///< SSL_get0_alpn_selected() gives it: the name
284 ///< alone, with no leading length octet.
285 size_t sizeof_alpn; //!< Length of `alpn`.
286 bool alpn_checked; //!< fr_tls_session_alpn_check() has run. The caller runs
287 ///< the check each time the handshake is finished, and the
288 ///< check must run once for each session.
289 bool alpn_ignore; //!< Do we ignore ALPN for this session
290 int alpn_id; //!< Application ID which was negotiated,
291 ///< or which was flagged as `implied`,
292 ///< or #FR_TLS_ALPN_ID_NONE
293
294 fr_tls_ticket_stateful_t *cache; //!< Current session resumption state.
295
296 fr_tls_pending_t pending; //!< Policy sections that an OpenSSL callback has
297 ///< asked the handshake to run.
298
299 fr_tls_verify_t validate; //!< Current session certificate validation state.
300
301 fr_tls_ticket_stateless_state_t ticket; //!< Whether `encode session` or `decode session`
302 ///< is waiting to run, and what it returned.
303
304#ifdef PSK_MAX_IDENTITY_LEN
305 fr_tls_psk_t psk; //!< Whether `load psk` is waiting to run, and what
306 ///< `load psk` returned.
307#endif
308
309 bool disallow_stateless_tickets; //!< Stateless session tickets are not used, even if the
310 ///< configuration allows them. Set for EAP-TTLS on a
311 ///< TLS server. `false` is the default.
312 bool allow_session_resumption; //!< Whether session resumption is allowed.
313 bool verify_peer_cert; //!< Whether verification of the peer's certificate
314 ///< has been requested.
315
316 bool invalid; //!< Whether heartbleed attack was detected.
317
318 bool write_encrypted; //!< Whether the records we write are encrypted.
319 ///< which lets us track if we can send an alert
320
321 bool peer_cert_ok; //!< Whether the peer's certificate was validated
322 bool seen_application_data; //!< Application data has started moving, which
323 ///< indicates that all session tickets have been sent.
324
325 bool init_finished_processed; //!< Limit the "finish init" work in
326 ///< tls_session_async_handshake_done_round() to run only
327 ///< once. That function is also called when reading
328 ///< application data, because the application shouldn't
329 ///< know about the internals of the TLS state machine.
330
331 bool session_ticket_supported; //!< Did the client present a session_ticket in the hello.
332
333 bool session_ticket_created; //!< The stateless session ticket creation callback has
334 ///< successfully run.
335
336 bool app_data_ready; //!< The session-state list is already in the SSL_SESSION
337 ///< as ticket application data, so the ticket creation
338 ///< callback does not run `encode session` again. Set
339 ///< by fr_tls_ticket_issue(), and cleared by the callback
340 ///< after each ticket.
341
342 bool session_ticket_received; //!< A client has seen the NewSessionTicket which
343 ///< a TLS 1.3 server sends after the handshake.
344
345 bool can_pause; //!< If true, it's ok to pause the request
346 ///< using the OpenSSL async API.
347
348 bool sent_commitment; //!< Has the commitment message been sent.
349
350 uint8_t alerts_sent;
351 bool pending_alert;
352 uint8_t pending_alert_level;
353 uint8_t pending_alert_description;
354
355 fr_pair_list_t extra_pairs; //!< Pairs to add to cache and certificate validation
356 ///< calls. These will be duplicated for every call.
357};
358
359/** Return the tls config associated with a tls_session
360 *
361 * @param[in] ssl to retrieve the configuration from.
362 * @return #fr_tls_conf_t associated with the session.
363 */
364static inline fr_tls_conf_t *fr_tls_session_conf(SSL *ssl)
365{
366 return talloc_get_type_abort(SSL_get_ex_data(ssl, FR_TLS_EX_INDEX_CONF), fr_tls_conf_t);
367}
368
369/** Return the tls_session associated with a SSL *
370 *
371 * @param[in] ssl to retrieve the configuration from.
372 * @return #fr_tls_conf_t associated with the session.
373 */
374static inline fr_tls_session_t *fr_tls_session(SSL *ssl)
375{
376 return talloc_get_type_abort(SSL_get_ex_data(ssl, FR_TLS_EX_INDEX_TLS_SESSION), fr_tls_session_t);
377}
378
379/** Check to see if a request is bound to a session
380 *
381 * @param[in] ssl session to check for requests.
382 * @return
383 * - true if a request is bound to this session.
384 * - false if a request is not bound to this session.
385 */
386static inline CC_HINT(nonnull) bool fr_tls_session_request_bound(SSL *ssl)
387{
388 return (SSL_get_ex_data(ssl, FR_TLS_EX_INDEX_REQUEST) != NULL);
389}
390
391/** Return the request associated with a ssl session
392 *
393 * @param[in] ssl session to retrieve the configuration from.
394 * @return #request associated with the session.
395 */
396static inline request_t *fr_tls_session_request(SSL const *ssl)
397{
398 request_t *request = SSL_get_ex_data(ssl, FR_TLS_EX_INDEX_REQUEST);
399
400 if (!request) return NULL;
401
402 return talloc_get_type_abort(SSL_get_ex_data(ssl, FR_TLS_EX_INDEX_REQUEST), request_t);
403}
404
405static inline CC_HINT(nonnull) void _fr_tls_session_request_bind(char const *file, int line,
406 SSL *ssl, request_t *request)
407{
408 int ret;
409
410 RDEBUG3("(TLS) %s[%d] - Binding SSL * (%p) to request (%p)", file, line, ssl, request);
411
412#ifndef NDEBUG
413 {
414 request_t *old;
415 old = SSL_get_ex_data(ssl, FR_TLS_EX_INDEX_REQUEST);
416 if (old) {
417 (void)talloc_get_type_abort(old, request_t);
418 fr_assert(0);
419 }
420 }
421#endif
422 ret = SSL_set_ex_data(ssl, FR_TLS_EX_INDEX_REQUEST, request);
423 if (unlikely(ret == 0)) {
424 fr_assert(0);
425 return;
426 }
427}
428/** Place a request pointer in the SSL * for retrieval by callbacks
429 *
430 * @note A request must not already be bound to the SSL *
431 *
432 * @param[in] ssl to be bound.
433 * @param[in] request to bind to the tls_session.
434 */
435 #define fr_tls_session_request_bind(_ssl, _request) _fr_tls_session_request_bind(__FILE__, __LINE__, _ssl, _request)
436
437static inline CC_HINT(nonnull) void _fr_tls_session_request_unbind(char const *file, int line, SSL *ssl)
438{
439 request_t *request = fr_tls_session_request(ssl);
440 int ret;
441
442 if (!request) return;
443
444#ifndef NDEBUG
445 (void)talloc_get_type_abort(request, request_t);
446#endif
447
448 RDEBUG3("(TLS) %s[%d] - Unbinding SSL * (%p) from request (%p)", file, line, ssl, request);
449 ret = SSL_set_ex_data(ssl, FR_TLS_EX_INDEX_REQUEST, NULL);
450 if (unlikely(ret == 0)) {
451 fr_assert(0);
452 return;
453 }
454}
455/** Remove a request pointer from the tls_session
456 *
457 * @note A request must be bound to the tls_session
458 *
459 * @param[in] ssl session containing the request pointer.
460 */
461#define fr_tls_session_request_unbind(_ssl) _fr_tls_session_request_unbind(__FILE__, __LINE__, _ssl)
462
463/** Add extra pairs to the temporary subrequests
464 *
465 * @param[in] child to add extra pairs to.
466 * @param[in] tls_session to add extra pairs from.
467 */
468static inline CC_HINT(nonnull)
469void fr_tls_session_extra_pairs_copy_to_child(request_t *child, fr_tls_session_t *tls_session)
470{
471 if (!fr_pair_list_empty(&tls_session->extra_pairs)) {
472 MEM(fr_pair_list_copy(child->request_ctx, &child->request_pairs, &tls_session->extra_pairs) >= 0);
473 }
474}
475
476/** Add an additional pair (copying it) to the list of extra pairs
477 *
478 * @param[in] tls_session to add extra pairs to.
479 * @param[in] vp to add to tls_session.
480 */
481static inline CC_HINT(nonnull)
482void fr_tls_session_extra_pair_add(fr_tls_session_t *tls_session, fr_pair_t *vp)
483{
484 fr_pair_t *copy;
485
486 MEM(copy = fr_pair_copy(tls_session, vp));
487 fr_pair_append(&tls_session->extra_pairs, copy);
488}
489
490/** Add an additional pair to the list of extra pairs
491 *
492 * @param[in] tls_session to add extra pairs to.
493 * @param[in] vp to add to tls_session.
494 */
495static inline CC_HINT(nonnull)
496void fr_tls_session_extra_pair_add_shallow(fr_tls_session_t *tls_session, fr_pair_t *vp)
497{
498 fr_assert(talloc_parent(vp) == tls_session);
499 fr_pair_append(&tls_session->extra_pairs, vp);
500}
501
502/** How many octets the datagram at the head of `dirty_out` holds
503 *
504 * Only meaningful for a datagram session. A stream session writes everything
505 * which is waiting, and never asks.
506 *
507 * @param[in] tls_session to read.
508 * @return
509 * - the length of the next datagram.
510 * - 0 if no whole datagram is waiting.
511 */
512static inline CC_HINT(nonnull) size_t fr_tls_session_datagram_len(fr_tls_session_t *tls_session)
513{
514 return fr_tls_bio_dbuff_datagram_len(tls_session->from_ssl);
515}
516
517/** Discard the datagram at the head of `dirty_out`, which has now been sent
518 *
519 * The caller advances `dirty_out` itself, so the cursor and the boundary move
520 * together.
521 *
522 * @param[in] tls_session to advance.
523 */
524static inline CC_HINT(nonnull) void fr_tls_session_datagram_sent(fr_tls_session_t *tls_session)
525{
526 fr_tls_bio_dbuff_datagram_sent(tls_session->from_ssl);
527}
528
529int fr_tls_session_password_cb(char *buf, int num, int rwflag, void *userdata);
530
531unsigned int fr_tls_session_psk_client_cb(SSL *ssl, UNUSED char const *hint,
532 char *identity, unsigned int max_identity_len,
533 unsigned char *psk, unsigned int max_psk_len);
534
535unsigned int fr_tls_session_psk_server_cb(SSL *ssl, const char *identity,
536 unsigned char *psk, unsigned int max_psk_len);
537
538#ifdef PSK_MAX_IDENTITY_LEN
539unlang_action_t fr_tls_session_psk_pending_push(request_t *request, fr_tls_session_t *tls_session);
540#endif
541
542void fr_tls_session_info_cb(SSL const *s, int where, int ret);
543
544void fr_tls_session_msg_cb(int write_p, int msg_version, int content_type,
545 void const *buf, size_t len, SSL *ssl, void *arg);
546
547void fr_tls_session_keylog_cb(const SSL *ssl, const char *line);
548
549int fr_tls_session_pairs_from_x509_cert(fr_pair_list_t *pair_list, TALLOC_CTX *ctx,
550 request_t *request, X509 *cert, X509 *issuer,
551 bool der_decode) CC_HINT(nonnull(1,2,3,4));
552
553int fr_tls_session_client_hello_pairs(SSL *ssl, request_t *request);
554
555bool fr_tls_session_is_init_finished(fr_tls_session_t *tls_session);
556
557int fr_tls_session_recv(request_t *request, fr_tls_session_t *tls_session);
558
559int fr_tls_session_send(request_t *request, fr_tls_session_t *tls_session);
560
561int fr_tls_session_ticket_write(request_t *request, fr_tls_session_t *tls_session);
562
563int fr_tls_session_alert(request_t *request, fr_tls_session_t *tls_session, uint8_t level, uint8_t description);
564
565void fr_tls_session_error_alert(request_t *request, fr_tls_session_t *session,
566 uint32_t error, uint8_t description);
567
568void fr_tls_session_close_send(request_t *request, fr_tls_session_t *session);
569void fr_tls_session_error_add(request_t *request, uint32_t error);
570
571unlang_action_t fr_tls_session_async_handshake_push(request_t *request, fr_tls_session_t *tls_session);
572
573fr_tls_session_t *fr_tls_session_alloc_client(TALLOC_CTX *ctx, SSL_CTX *ssl_ctx, request_t *request);
574
575fr_tls_session_t *fr_tls_session_alloc_server(TALLOC_CTX *ctx, SSL_CTX *ssl_ctx, request_t *request, bool client_cert);
576
577unlang_action_t fr_tls_new_session_push(request_t *request, fr_tls_conf_t const *tls_conf);
578
579unlang_action_t fr_tls_session_fail_session(request_t *request, fr_tls_session_t *tls_session, bool clear);
580
581#ifdef __cplusplus
582}
583#endif
584#endif /* WITH_TLS */
unlang_action_t
Returned by unlang_op_t calls, determine the next action of the interpreter.
Definition action.h:35
void int line
Definition acutest.h:810
static uint8_t request[4]
#define DIAG_ON(_x)
Definition build.h:582
#define RCSIDH(h, id)
Definition build.h:610
#define unlikely(_x)
Definition build.h:492
#define UNUSED
Definition build.h:415
#define DIAG_OFF(_x)
Definition build.h:581
#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
#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 MEM(x)
Definition debug.h:38
#define RDEBUG3(fmt,...)
Definition log.h:360
unsigned int uint32_t
unsigned char uint8_t
static size_t used
int fr_pair_list_copy(TALLOC_CTX *ctx, fr_pair_list_t *to, fr_pair_list_t const *from)
Duplicate a list of pairs.
Definition pair.c:2312
int fr_pair_append(fr_pair_list_t *list, fr_pair_t *to_add)
Add a VP to the end of the list.
Definition pair.c:1306
fr_pair_t * fr_pair_copy(TALLOC_CTX *ctx, fr_pair_t const *vp)
Copy a single valuepair.
Definition pair.c:509
#define fr_assert(_expr)
Definition rad_assert.h:37
static rs_t * conf
Definition radsniff.c:52
fr_pair_t * vp
Stores an attribute, a value and various bits of other data.
Definition pair.h:68
bool fr_pair_list_empty(fr_pair_list_t const *list)
Is a valuepair list empty.
Holds information necessary for binding or connecting to a socket.
Definition socket.h:60
static fr_sbuff_err_t char size_t * len
Definition value.h:1061
int nonnull(2, 5))