-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MINOR: quic: Add new "QUIC over SSL" C module.
Move the code which directly calls the functions of the OpenSSL QUIC API into quic_ssl.c new C file. Some code have been extracted from qc_conn_finalize() to implement only the QUIC TLS part (see quic_tls_finalize()) into quic_tls.c. qc_conn_finalize() has also been exported to be used from this new quic_ssl.c C module.
- Loading branch information
1 parent
1d33846
commit 8e4885f
Showing
9 changed files
with
817 additions
and
709 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* include/haproxy/quic_ssl-t.h | ||
* Definitions for QUIC over TLS/SSL api types, constants and flags. | ||
* | ||
* Copyright (C) 2023 | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
* | ||
*/ | ||
|
||
#ifndef _HAPROXY_QUIC_SSL_T_H | ||
#define _HAPROXY_QUIC_SSL_T_H | ||
|
||
extern struct pool_head *pool_head_quic_ssl_sock_ctx; | ||
|
||
#endif /* _HAPROXY_QUIC_SSL_T_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* include/haproxy/quic_ssl.h | ||
* This file contains QUIC over TLS/SSL api definitions. | ||
* | ||
* Copyright (C) 2023 | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation, version 2.1 | ||
* exclusively. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
#ifndef _HAPROXY_QUIC_SSL_H | ||
#define _HAPROXY_QUIC_SSL_H | ||
|
||
#include <haproxy/listener-t.h> | ||
#include <haproxy/pool.h> | ||
#include <haproxy/quic_ssl-t.h> | ||
#include <haproxy/ssl_sock-t.h> | ||
|
||
int ssl_quic_initial_ctx(struct bind_conf *bind_conf); | ||
int qc_alloc_ssl_sock_ctx(struct quic_conn *qc); | ||
int qc_ssl_provide_quic_data(struct quic_enc_level *el, struct ssl_sock_ctx *ctx, | ||
const unsigned char *data, size_t len, | ||
struct quic_rx_packet *pkt, struct quic_rx_crypto_frm *cf); | ||
|
||
static inline void qc_free_ssl_sock_ctx(struct ssl_sock_ctx **ctx) | ||
{ | ||
if (!*ctx) | ||
return; | ||
|
||
SSL_free((*ctx)->ssl); | ||
pool_free(pool_head_quic_ssl_sock_ctx, *ctx); | ||
*ctx = NULL; | ||
} | ||
|
||
#endif /* _HAPROXY_QUIC_SSL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.