aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2022-10-20 16:21:06 +0400
committerSergey Kandaurov <pluknet@nginx.com>2022-10-20 16:21:06 +0400
commitce65faea95598bac9c95686d1d211d9fcd0b1ee3 (patch)
tree83d14c153501fc615aeed88f29a866bf6c2e4176 /src
parent1ad1b85feb11285c5b65cc2d53c3f7ec54e6fabd (diff)
downloadnginx-ce65faea95598bac9c95686d1d211d9fcd0b1ee3.tar.gz
nginx-ce65faea95598bac9c95686d1d211d9fcd0b1ee3.zip
QUIC: support for setting QUIC methods with LibreSSL.
Setting QUIC methods is converted to use C99 designated initializers for simplicity, as LibreSSL 3.6.0 has different SSL_QUIC_METHOD layout. Additionally, only set_read_secret/set_write_secret callbacks are set. Although they are preferred in LibreSSL over set_encryption_secrets, better be on a safe side as LibreSSL has unexpectedly incompatible set_encryption_secrets calling convention expressed in passing read and write secrets split in separate calls, unlike this is documented in old BoringSSL sources. To avoid introducing further changes for the old API, it is simply disabled.
Diffstat (limited to 'src')
-rw-r--r--src/event/quic/ngx_event_quic_ssl.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/event/quic/ngx_event_quic_ssl.c b/src/event/quic/ngx_event_quic_ssl.c
index bb5809d58..1eef2972d 100644
--- a/src/event/quic/ngx_event_quic_ssl.c
+++ b/src/event/quic/ngx_event_quic_ssl.c
@@ -18,7 +18,7 @@
#define NGX_QUIC_MAX_BUFFERED 65535
-#if BORINGSSL_API_VERSION >= 10
+#if BORINGSSL_API_VERSION >= 10 || defined LIBRESSL_VERSION_NUMBER
static int ngx_quic_set_read_secret(ngx_ssl_conn_t *ssl_conn,
enum ssl_encryption_level_t level, const SSL_CIPHER *cipher,
const uint8_t *secret, size_t secret_len);
@@ -40,19 +40,19 @@ static ngx_int_t ngx_quic_crypto_input(ngx_connection_t *c, ngx_chain_t *data);
static SSL_QUIC_METHOD quic_method = {
-#if BORINGSSL_API_VERSION >= 10
- ngx_quic_set_read_secret,
- ngx_quic_set_write_secret,
+#if BORINGSSL_API_VERSION >= 10 || defined LIBRESSL_VERSION_NUMBER
+ .set_read_secret = ngx_quic_set_read_secret,
+ .set_write_secret = ngx_quic_set_write_secret,
#else
- ngx_quic_set_encryption_secrets,
+ .set_encryption_secrets = ngx_quic_set_encryption_secrets,
#endif
- ngx_quic_add_handshake_data,
- ngx_quic_flush_flight,
- ngx_quic_send_alert,
+ .add_handshake_data = ngx_quic_add_handshake_data,
+ .flush_flight = ngx_quic_flush_flight,
+ .send_alert = ngx_quic_send_alert,
};
-#if BORINGSSL_API_VERSION >= 10
+#if BORINGSSL_API_VERSION >= 10 || defined LIBRESSL_VERSION_NUMBER
static int
ngx_quic_set_read_secret(ngx_ssl_conn_t *ssl_conn,