The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
Loading...
Searching...
No Matches
alpn.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: f34c36c40360c6805705023aa982ba377a5ac1ae $
20 *
21 * @file lib/tls/alpn.h
22 * @brief Agree with the peer on what is spoken inside the tunnel.
23 *
24 * Application Layer Protocol Negotiation (ALPN) is configured in one of two ways:
25 *
26 * 1. The application declares a table of #fr_tls_alpn_t entries, one for each protocol that the application
27 * knows. It then calls fr_tls_alpn_set() or puts fr_tls_alpn_parse() in an `alpn` subsection rule. The
28 * TLS library builds the wire list, derives `alpn_required`, and sets `alpn_id` in #fr_tls_session_t once
29 * the handshake is done. Once the TLS connection is established, the application check the negotiated
30 * `alpn_id`
31 *
32 * 2. The application manually sets `alpn`, `sizeof_alpn` and `alpn_required` in #fr_tls_conf_t, and reads
33 * `alpn` and `sizeof_alpn` from #fr_tls_session_t once the handshake is done.
34 *
35 * @copyright 2026 Network RADIUS SAS (legal@networkradius.com)
36 */
37RCSIDH(alpn_h, "$Id: f34c36c40360c6805705023aa982ba377a5ac1ae $")
38
39#include "openssl_user_macros.h"
40
41#include <openssl/ssl.h>
42
43#include <freeradius-devel/tls/alpn_id.h>
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49int fr_tls_alpn_set(TALLOC_CTX *ctx, fr_tls_conf_t *conf, fr_tls_alpn_t const *table,
50 int const *ids, size_t num);
51
52int fr_tls_alpn_parse(TALLOC_CTX *ctx, void *out, void *parent, CONF_ITEM *ci, conf_parser_t const *rule);
53
54#ifdef _TLS_PRIVATE
55int fr_tls_ctx_alpn_set(SSL_CTX *ctx, fr_tls_conf_t const *conf, bool client);
56
57int fr_tls_session_alpn_check(request_t *request, fr_tls_session_t *tls_session);
58
59int fr_tls_session_alpn_client_hello(SSL *ssl, request_t *request, int *alert, bool tls13);
60
61void fr_tls_alpn_client_resume(request_t *request, SSL *ssl, SSL_SESSION const *sess,
62 fr_tls_conf_t const *conf);
63#endif
64
65#ifdef __cplusplus
66}
67#endif
68#endif /* WITH_TLS */
static uint8_t request[4]
#define RCSIDH(h, id)
Definition build.h:610
Defines a CONF_PAIR to C data type mapping.
Definition cf_parse.h:649
Common header for all CONF_* types.
Definition cf_priv.h:54
static rs_t * conf
Definition radsniff.c:52
static fr_slen_t parent
Definition pair.h:864
static fr_sbuff_err_t char ** out
Definition value.h:1061