]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
libknot: rename knot_quic_creds and related functions to knot_creds...
authorDaniel Salzman <daniel.salzman@nic.cz>
Wed, 10 Apr 2024 07:08:25 +0000 (09:08 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Tue, 7 May 2024 05:52:29 +0000 (07:52 +0200)
16 files changed:
distro/pkg/deb/libknot14.symbols
src/knot/query/quic-requestor.c
src/knot/query/quic-requestor.h
src/knot/query/requestor.c
src/knot/query/requestor.h
src/knot/query/tls-requestor.c
src/knot/query/tls-requestor.h
src/knot/server/server.c
src/knot/server/server.h
src/libknot/quic/quic_conn.c
src/libknot/quic/quic_conn.h
src/libknot/quic/tls.c
src/libknot/quic/tls.h
src/libknot/quic/tls_common.c
src/libknot/quic/tls_common.h
src/utils/kxdpgun/main.c

index 81753f533a6eba7ffe9f810a62782cff8dc06304..17c321018b4b121100a0c69766391047ba05cf03 100644 (file)
@@ -8,6 +8,10 @@ libknot.so.14 libknot14 #MINVER#
  KNOT_DB_LMDB_RDONLY@Base 3.3.0
  KNOT_DB_LMDB_WRITEMAP@Base 3.3.0
  KNOT_DUMP_STYLE_DEFAULT@Base 3.3.0
+ knot_creds_cert@Base 3.4.0
+ knot_creds_free@Base 3.4.0
+ knot_creds_init@Base 3.4.0
+ knot_creds_init_peer@Base 3.4.0
  knot_ctl_accept@Base 3.3.0
  knot_ctl_alloc@Base 3.3.0
  knot_ctl_bind@Base 3.3.0
@@ -120,15 +124,10 @@ libknot.so.14 libknot14 #MINVER#
  knot_quic_conn_local_port@Base 3.3.0
  knot_quic_conn_new_stream@Base 3.3.0
  knot_quic_conn_next_timeout@Base 3.3.3
- knot_quic_conn_pin@Base 3.3.0
  knot_quic_conn_rtt@Base 3.3.0
  knot_quic_conn_stream_free@Base 3.3.0
- knot_quic_creds_cert@Base 3.3.0
- knot_quic_free_creds@Base 3.3.0
  knot_quic_handle@Base 3.3.0
  knot_quic_hanle_expiry@Base 3.3.3
- knot_quic_init_creds@Base 3.3.0
- knot_quic_init_creds_peer@Base 3.3.0
  knot_quic_send@Base 3.3.0
  knot_quic_session_available@Base 3.3.0
  knot_quic_session_load@Base 3.3.0
@@ -188,6 +187,18 @@ libknot.so.14 libknot14 #MINVER#
  knot_tcp_sweep@Base 3.3.0
  knot_tcp_table_free@Base 3.3.0
  knot_tcp_table_new@Base 3.3.0
+ knot_tls_conn_del@Base 3.4.0
+ knot_tls_conn_new@Base 3.4.0
+ knot_tls_ctx_free@Base 3.4.0
+ knot_tls_ctx_new@Base 3.4.0
+ knot_tls_handshake@Base 3.4.0
+ knot_tls_pin@Base 3.4.0
+ knot_tls_pin_check@Base 3.4.0
+ knot_tls_recv@Base 3.4.0
+ knot_tls_recv_dns@Base 3.4.0
+ knot_tls_send@Base 3.4.0
+ knot_tls_send_dns@Base 3.4.0
+ knot_tls_session@Base 3.4.0
  knot_tsig_add@Base 3.3.0
  knot_tsig_append@Base 3.3.0
  knot_tsig_client_check@Base 3.3.0
index 680d983dcc20d74ba4588b215b84216d5b7c36ff..7492efd79baf40ce8d432dd2cac73e1b19b32f2c 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2024 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     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
@@ -156,7 +156,7 @@ int knot_qreq_connect(struct knot_quic_reply **out,
                       int fd,
                       struct sockaddr_storage *remote,
                       struct sockaddr_storage *local,
-                      const struct knot_quic_creds *local_creds,
+                      const struct knot_creds *local_creds,
                       const uint8_t *peer_pin,
                       uint8_t peer_pin_len,
                       bool *reused_fd,
@@ -179,8 +179,7 @@ int knot_qreq_connect(struct knot_quic_reply **out,
        r->send_reply = qr_send_reply;
        r->free_reply = qr_free_reply;
 
-       struct knot_quic_creds *creds = knot_quic_init_creds_peer(local_creds,
-                                                                 peer_pin, peer_pin_len);
+       struct knot_creds *creds = knot_creds_init_peer(local_creds, peer_pin, peer_pin_len);
        if (creds == NULL) {
                free(r);
                return KNOT_ENOMEM;
@@ -190,7 +189,7 @@ int knot_qreq_connect(struct knot_quic_reply **out,
        knot_quic_table_t *table = knot_quic_table_new(1, QUIC_BUF_SIZE,
                                                       QUIC_BUF_SIZE, 0, creds);
        if (table == NULL) {
-               knot_quic_free_creds(creds);
+               knot_creds_free(creds);
                free(r);
                return KNOT_ENOMEM;
        }
@@ -294,7 +293,7 @@ void knot_qreq_close(struct knot_quic_reply *r, bool send_close)
        knot_quic_table_rem(conn, table);
        knot_quic_cleanup(&conn, 1);
        if (table != NULL) {
-               knot_quic_free_creds(table->creds);
+               knot_creds_free(table->creds);
        }
        knot_quic_table_free(table);
        free(r);
index c606d6c9d8b2d343c083de720b5f8c5e34ab14b2..083254d3ad7f642cda4ed5a285863770634aefbe 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2024 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     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
@@ -23,7 +23,7 @@ int knot_qreq_connect(struct knot_quic_reply **out,
                       int fd,
                       struct sockaddr_storage *remote,
                       struct sockaddr_storage *local,
-                      const struct knot_quic_creds *local_creds,
+                      const struct knot_creds *local_creds,
                       const uint8_t *peer_pin,
                       uint8_t peer_pin_len,
                       bool *reused_fd,
index 7e7ae0cbbaabfb3d8cf05fc25a825658d8fc386c..9d3a1b6979e47b309fe6261744fa82e9e5c5608e 100644 (file)
@@ -215,7 +215,7 @@ knot_request_t *knot_request_make_generic(knot_mm_t *mm,
                                           const struct sockaddr_storage *remote,
                                           const struct sockaddr_storage *source,
                                           knot_pkt_t *query,
-                                          const struct knot_quic_creds *creds,
+                                          const struct knot_creds *creds,
                                           const query_edns_data_t *edns,
                                           const knot_tsig_key_t *tsig_key,
                                           const uint8_t *pin,
@@ -266,7 +266,7 @@ knot_request_t *knot_request_make_generic(knot_mm_t *mm,
 knot_request_t *knot_request_make(knot_mm_t *mm,
                                   const conf_remote_t *remote,
                                   knot_pkt_t *query,
-                                  const struct knot_quic_creds *creds,
+                                  const struct knot_creds *creds,
                                   const query_edns_data_t *edns,
                                   knot_request_flag_t flags)
 {
index 97d9d04d4eef4135794941c5ce4ad64bcfe8500e..241be040d1913e3a4eee52a645f30778ce0c59ba 100644 (file)
@@ -74,7 +74,7 @@ typedef struct {
 
        knot_sign_context_t sign; /*!< Required for async. DDNS processing. */
 
-       const struct knot_quic_creds *creds;
+       const struct knot_creds *creds;
        size_t pin_len;
        uint8_t pin[];
 } knot_request_t;
@@ -110,7 +110,7 @@ knot_request_t *knot_request_make_generic(knot_mm_t *mm,
                                           const struct sockaddr_storage *remote,
                                           const struct sockaddr_storage *source,
                                           knot_pkt_t *query,
-                                          const struct knot_quic_creds *creds,
+                                          const struct knot_creds *creds,
                                           const query_edns_data_t *edns,
                                           const knot_tsig_key_t *tsig_key,
                                           const uint8_t *pin,
@@ -126,7 +126,7 @@ knot_request_t *knot_request_make_generic(knot_mm_t *mm,
 knot_request_t *knot_request_make(knot_mm_t *mm,
                                   const conf_remote_t *remote,
                                   knot_pkt_t *query,
-                                  const struct knot_quic_creds *creds,
+                                  const struct knot_creds *creds,
                                   const query_edns_data_t *edns,
                                   knot_request_flag_t flags);
 
index 01385dbe93c3adbe3a86c22ff31b4341548a196c..a466b9f565a24079ad678bfced487efdfdfa977a 100644 (file)
 #include "libknot/quic/tls.h"
 
 int knot_tls_req_ctx_init(knot_tls_req_ctx_t *ctx, int fd,
-                          const struct knot_quic_creds *local_creds,
+                          const struct knot_creds *local_creds,
                           const uint8_t *peer_pin, uint8_t peer_pin_len,
                           int io_timeout_ms)
 {
-       struct knot_quic_creds *creds = knot_quic_init_creds_peer(local_creds,
-                                                                 peer_pin, peer_pin_len);
+       struct knot_creds *creds = knot_creds_init_peer(local_creds, peer_pin, peer_pin_len);
        if (creds == NULL) {
                return KNOT_ENOMEM;
        }
 
        ctx->ctx = knot_tls_ctx_new(creds, io_timeout_ms, false);
        if (ctx->ctx == NULL) {
-               knot_quic_free_creds(creds);
+               knot_creds_free(creds);
                return KNOT_ENOMEM;
        }
 
@@ -49,7 +48,7 @@ int knot_tls_req_ctx_init(knot_tls_req_ctx_t *ctx, int fd,
 void knot_tls_req_ctx_deinit(knot_tls_req_ctx_t *ctx)
 {
        if (ctx != NULL && ctx->ctx != NULL) {
-               knot_quic_free_creds(ctx->ctx->creds);
+               knot_creds_free(ctx->ctx->creds);
                knot_tls_conn_del(ctx->conn);
                knot_tls_ctx_free(ctx->ctx);
                memset(ctx, 0, sizeof(*ctx));
index a3103ff97b86e62a0c8f805fcc9d95baaa86fcb0..535bbe8860bf671b7a98762e1d0894600a0bb435 100644 (file)
@@ -28,8 +28,6 @@ typedef struct knot_tls_req_ctx {
        struct knot_tls_conn *conn;
 } knot_tls_req_ctx_t;
 
-struct knot_quic_creds;
-
 /*!
  * \brief Initialize TLS requestor context.
  *
@@ -43,7 +41,7 @@ struct knot_quic_creds;
  * \return KNOT_E*
  */
 int knot_tls_req_ctx_init(knot_tls_req_ctx_t *ctx, int fd,
-                          const struct knot_quic_creds *local_creds,
+                          const struct knot_creds *local_creds,
                           const uint8_t *peer_pin, uint8_t peer_pin_len,
                           int io_timeout_ms);
 
index 0ad47b1371f502fc65ef4d04ea7e79afeb29a795..2a1285e5fe0cabbfa5f09095fa748d1d7f84b83e 100644 (file)
@@ -609,7 +609,7 @@ static int init_creds(server_t *server, conf_t *conf)
                log_debug("QUIC/TLS, using self-generated key '%s' with "
                          "one-time certificate", key_file);
        }
-       server->quic_creds = knot_quic_init_creds(cert_file, key_file);
+       server->quic_creds = knot_creds_init(cert_file, key_file);
        free(cert_file);
        if (server->quic_creds == NULL) {
                log_error("QUIC/TLS, failed to initialize server credentials with key '%s'",
@@ -901,7 +901,7 @@ void server_deinit(server_t *server)
        global_sessticket_pool = NULL;
        knot_unreachables_deinit(&global_unreachables);
 
-       knot_quic_free_creds(server->quic_creds);
+       knot_creds_free(server->quic_creds);
 }
 
 static int server_init_handler(server_t *server, int index, int thread_count,
@@ -1577,7 +1577,7 @@ size_t server_cert_pin(server_t *server, uint8_t *out, size_t out_size)
        size_t bin_pin_size = sizeof(bin_pin);
        gnutls_x509_crt_t cert = NULL;
        if (server->quic_creds != NULL &&
-           knot_quic_creds_cert(server->quic_creds, &cert) == KNOT_EOK &&
+           knot_creds_cert(server->quic_creds, &cert) == KNOT_EOK &&
            gnutls_x509_crt_get_key_id(cert, GNUTLS_KEYID_USE_SHA256,
                                       bin_pin, &bin_pin_size) == GNUTLS_E_SUCCESS) {
                pin_size = knot_base64_encode(bin_pin, bin_pin_size, out, out_size);
index 77c41714186f939efc11b9394ccff19a915c1bbf..8aa0093598a3857416b48e64411ea9f5310633b0 100644 (file)
@@ -31,7 +31,7 @@
 
 struct server;
 struct knot_xdp_socket;
-struct knot_quic_creds;
+struct knot_creds;
 
 /*!
  * \brief I/O handler structure.
@@ -129,7 +129,7 @@ typedef struct server {
        zone_backup_ctxs_t backup_ctxs;
 
        /*! \brief Crendentials context for QUIC. */
-       struct knot_quic_creds *quic_creds;
+       struct knot_creds *quic_creds;
 } server_t;
 
 /*!
index 7617e6f427873a0d404a9702cf061d29bfdfb0ef..420eb0b663f7470a75e70589055a19011b9960e8 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2024 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     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
@@ -45,7 +45,7 @@ static int cmp_expiry_heap_nodes(void *c1, void *c2)
 
 _public_
 knot_quic_table_t *knot_quic_table_new(size_t max_conns, size_t max_ibufs, size_t max_obufs,
-                                       size_t udp_payload, struct knot_quic_creds *creds)
+                                       size_t udp_payload, struct knot_creds *creds)
 {
        size_t table_size = max_conns * BUCKETS_PER_CONNS;
 
index ca21a5b19355c5481074f0650452134d150e8f34..689b133cddcb72317013f5b54ddc122a43d310c7 100644 (file)
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2024 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     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
@@ -34,7 +34,7 @@
 #define MAX_STREAMS_PER_CONN 10 // this limits the number of un-finished streams per conn (i.e. if response has been recvd with FIN, it doesn't count)
 
 struct ngtcp2_cid; // declaration taken from wherever in ngtcp2
-struct knot_quic_creds;
+struct knot_creds;
 struct knot_quic_reply;
 struct knot_sweep_stats;
 
@@ -119,7 +119,7 @@ typedef struct knot_quic_table {
        void (*log_cb)(const char *);
        const char *qlog_dir;
        uint64_t hash_secret[4];
-       struct knot_quic_creds *creds;
+       struct knot_creds *creds;
        struct heap *expiry_heap;
        knot_quic_cid_t *conns[];
 } knot_quic_table_t;
@@ -136,7 +136,7 @@ typedef struct knot_quic_table {
  * \return Allocated table, or NULL.
  */
 knot_quic_table_t *knot_quic_table_new(size_t max_conns, size_t max_ibufs, size_t max_obufs,
-                                       size_t udp_payload, struct knot_quic_creds *creds);
+                                       size_t udp_payload, struct knot_creds *creds);
 
 /*!
  * \brief Free QUIC table including its contents.
index a945d36e8c5ca8ae5cb733532d1810867c4e7ae2..1dee7f7dc7c98ec8b06bfa5913acc4defbc030fa 100644 (file)
@@ -37,7 +37,7 @@
 #define EAGAIN_MAX_FOR_GNUTLS 10 // gnutls_record_recv() has been observed to return GNUTLS_E_AGAIN repetitively and excessively, leading to infinite loops. This limits the number of re-tries.
 
 _public_
-knot_tls_ctx_t *knot_tls_ctx_new(struct knot_quic_creds *creds, unsigned io_timeout,
+knot_tls_ctx_t *knot_tls_ctx_new(struct knot_creds *creds, unsigned io_timeout,
                                  bool server)
 {
        knot_tls_ctx_t *res = calloc(1, sizeof(*res));
index 4b4ecfc6b980aab5cde020eb364d7c492378bdab..ca87079e18b442684e3a29c3196f5c782ee4a638 100644 (file)
     along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
+/*!
+ * \file
+ *
+ * \brief Pure TLS functionality.
+ *
+ * \addtogroup quic
+ * @{
+ */
+
 #pragma once
 
 #include <stdbool.h>
@@ -21,7 +30,7 @@
 #include <sys/types.h>
 
 typedef struct knot_tls_ctx {
-       struct knot_quic_creds *creds;
+       struct knot_creds *creds;
        unsigned handshake_timeout;
        unsigned io_timeout;
        bool server;
@@ -50,7 +59,7 @@ typedef struct knot_tls_conn {
  *
  * \return Initialized context or NULL.
  */
-knot_tls_ctx_t *knot_tls_ctx_new(struct knot_quic_creds *creds, unsigned io_timeout,
+knot_tls_ctx_t *knot_tls_ctx_new(struct knot_creds *creds, unsigned io_timeout,
                                  bool server);
 
 /*!
@@ -127,3 +136,5 @@ ssize_t knot_tls_recv_dns(knot_tls_conn_t *conn, void *data, size_t size);
  * \return Either exactly 'size' or a negative error code.
  */
 ssize_t knot_tls_send_dns(knot_tls_conn_t *conn, void *data, size_t size);
+
+/*! @} */
index e290772de1894e70d480d1531969967bdd65466e..210c59dddb203188c3483b629978cec6d6aca378 100644 (file)
 #include "libknot/attribute.h"
 #include "libknot/error.h"
 
-typedef struct knot_quic_creds {
+typedef struct knot_creds {
        gnutls_certificate_credentials_t tls_cert;
        gnutls_anti_replay_t tls_anti_replay;
        gnutls_datum_t tls_ticket_key;
        bool peer;
        uint8_t peer_pin_len;
        uint8_t peer_pin[];
-} knot_quic_creds_t;
+} knot_creds_t;
 
 static int tls_anti_replay_db_add_func(void *dbf, time_t exp_time,
                                        const gnutls_datum_t *key,
@@ -148,10 +148,9 @@ finish:
 }
 
 _public_
-struct knot_quic_creds *knot_quic_init_creds(const char *cert_file,
-                                             const char *key_file)
+struct knot_creds *knot_creds_init(const char *cert_file, const char *key_file)
 {
-       knot_quic_creds_t *creds = calloc(1, sizeof(*creds));
+       knot_creds_t *creds = calloc(1, sizeof(*creds));
        if (creds == NULL) {
                return NULL;
        }
@@ -186,16 +185,16 @@ struct knot_quic_creds *knot_quic_init_creds(const char *cert_file,
 
        return creds;
 fail:
-       knot_quic_free_creds(creds);
+       knot_creds_free(creds);
        return NULL;
 }
 
 _public_
-struct knot_quic_creds *knot_quic_init_creds_peer(const struct knot_quic_creds *local_creds,
-                                                  const uint8_t *peer_pin,
-                                                  uint8_t peer_pin_len)
+struct knot_creds *knot_creds_init_peer(const struct knot_creds *local_creds,
+                                        const uint8_t *peer_pin,
+                                        uint8_t peer_pin_len)
 {
-       knot_quic_creds_t *creds = calloc(1, sizeof(*creds) + peer_pin_len);
+       knot_creds_t *creds = calloc(1, sizeof(*creds) + peer_pin_len);
        if (creds == NULL) {
                return NULL;
        }
@@ -220,7 +219,7 @@ struct knot_quic_creds *knot_quic_init_creds_peer(const struct knot_quic_creds *
 }
 
 _public_
-int knot_quic_creds_cert(struct knot_quic_creds *creds, struct gnutls_x509_crt_int **cert)
+int knot_creds_cert(struct knot_creds *creds, struct gnutls_x509_crt_int **cert)
 {
        if (creds == NULL || cert == NULL) {
                return KNOT_EINVAL;
@@ -241,7 +240,7 @@ int knot_quic_creds_cert(struct knot_quic_creds *creds, struct gnutls_x509_crt_i
 }
 
 _public_
-void knot_quic_free_creds(struct knot_quic_creds *creds)
+void knot_creds_free(struct knot_creds *creds)
 {
        if (creds == NULL) {
                return;
@@ -259,7 +258,7 @@ void knot_quic_free_creds(struct knot_quic_creds *creds)
 
 _public_
 int knot_tls_session(struct gnutls_session_int **session,
-                     struct knot_quic_creds *creds,
+                     struct knot_creds *creds,
                      const char *priority,
                      const char *alpn,
                      bool early_data,
@@ -355,7 +354,7 @@ error:
 
 _public_
 int knot_tls_pin_check(struct gnutls_session_int *session,
-                       struct knot_quic_creds *creds)
+                       struct knot_creds *creds)
 {
        if (creds->peer_pin_len == 0) {
                return KNOT_EOK;
index 60af7fb5866b747ebf4c89fa4c550e3891e2bf7e..821018ec6e27b73db734feb4ab877cb96e87ab02 100644 (file)
     along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
+/*!
+ * \file
+ *
+ * \brief Credentials handling common to QUIC and TLS.
+ *
+ * \addtogroup quic
+ * @{
+ */
+
 #pragma once
 
 #include <stdbool.h>
@@ -24,7 +33,7 @@
 
 struct gnutls_session_int;
 struct gnutls_x509_crt_int;
-struct knot_quic_creds;
+struct knot_creds;
 
 /*!
  * \brief Init server TLS certificate for DoQ.
@@ -34,8 +43,7 @@ struct knot_quic_creds;
  *
  * \return Initialized creds.
  */
-struct knot_quic_creds *knot_quic_init_creds(const char *cert_file,
-                                             const char *key_file);
+struct knot_creds *knot_creds_init(const char *cert_file, const char *key_file);
 
 /*!
  * \brief Init peer TLS certificate for DoQ.
@@ -46,9 +54,9 @@ struct knot_quic_creds *knot_quic_init_creds(const char *cert_file,
  *
  * \return Initialized creds.
  */
-struct knot_quic_creds *knot_quic_init_creds_peer(const struct knot_quic_creds *local_creds,
-                                                  const uint8_t *peer_pin,
-                                                  uint8_t peer_pin_len);
+struct knot_creds *knot_creds_init_peer(const struct knot_creds *local_creds,
+                                        const uint8_t *peer_pin,
+                                        uint8_t peer_pin_len);
 
 /*!
  * \brief Gets the certificate from credentials.
@@ -58,12 +66,12 @@ struct knot_quic_creds *knot_quic_init_creds_peer(const struct knot_quic_creds *
  *
  * \return KNOT_E*
  */
-int knot_quic_creds_cert(struct knot_quic_creds *creds, struct gnutls_x509_crt_int **cert);
+int knot_creds_cert(struct knot_creds *creds, struct gnutls_x509_crt_int **cert);
 
 /*!
  * \brief Deinit server TLS certificate for DoQ.
  */
-void knot_quic_free_creds(struct knot_quic_creds *creds);
+void knot_creds_free(struct knot_creds *creds);
 
 /*!
  * \brief Initialize GnuTLS session with credentials, ALPN, etc.
@@ -78,7 +86,7 @@ void knot_quic_free_creds(struct knot_quic_creds *creds);
  * \return KNOT_E*
  */
 int knot_tls_session(struct gnutls_session_int **session,
-                     struct knot_quic_creds *creds,
+                     struct knot_creds *creds,
                      const char *priority,
                      const char *alpn,
                      bool early_data,
@@ -106,4 +114,6 @@ void knot_tls_pin(struct gnutls_session_int *session, uint8_t *pin,
  * \return KNOT_EOK or KNOT_EBADCERTKEY
  */
 int knot_tls_pin_check(struct gnutls_session_int *session,
-                       struct knot_quic_creds *creds);
+                       struct knot_creds *creds);
+
+/*! @} */
index 3384dbb8fd4527ae0125962415f412458993cfe4..4ea1756d2b83d44e22fb0e9dc6a9310710e39340 100644 (file)
@@ -485,7 +485,7 @@ void *xdp_gun_thread(void *_ctx)
        knot_tcp_table_t *tcp_table = NULL;
 #ifdef ENABLE_QUIC
        knot_quic_table_t *quic_table = NULL;
-       struct knot_quic_creds *quic_creds = NULL;
+       struct knot_creds *quic_creds = NULL;
        list_t quic_sessions;
        init_list(&quic_sessions);
 #endif // ENABLE_QUIC
@@ -502,7 +502,7 @@ void *xdp_gun_thread(void *_ctx)
        }
        if (ctx->quic) {
 #ifdef ENABLE_QUIC
-               quic_creds = knot_quic_init_creds_peer(NULL, NULL, 0);
+               quic_creds = knot_creds_init_peer(NULL, NULL, 0);
                if (quic_creds == NULL) {
                        ERR2("failed to initialize QUIC context");
                        return NULL;
@@ -930,7 +930,7 @@ void *xdp_gun_thread(void *_ctx)
        WALK_LIST_DELSAFE(n, nxt, quic_sessions) {
                knot_quic_session_load(NULL, n);
        }
-       knot_quic_free_creds(quic_creds);
+       knot_creds_free(quic_creds);
 #endif // ENABLE_QUIC
 
        char recv_str[40] = "", lost_str[40] = "", err_str[40] = "";