resolve: rename resolved-dnstls-openssl.c -> resolved-dnstls.c

and merge resolved-dnstls.h and resolved-dnstls-openssl.h.
This commit is contained in:
Yu Watanabe
2025-04-02 05:30:28 +09:00
parent b1c3f57e76
commit 0baf937763
4 changed files with 23 additions and 31 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ systemd_resolved_sources += custom_target(
systemd_resolved_dependencies = [threads, libm] + [lib_openssl_or_gcrypt]
if conf.get('ENABLE_DNS_OVER_TLS') == 1
systemd_resolved_sources += files(
'resolved-dnstls-openssl.c',
'resolved-dnstls.c',
)
systemd_resolved_dependencies += libopenssl
endif
-25
View File
@@ -1,25 +0,0 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#if !ENABLE_DNS_OVER_TLS || !HAVE_OPENSSL
#error This source file requires DNS-over-TLS to be enabled and OpenSSL to be available.
#endif
#include <openssl/ssl.h>
#include <stdbool.h>
struct DnsTlsManagerData {
SSL_CTX *ctx;
};
struct DnsTlsServerData {
SSL_SESSION *session;
};
struct DnsTlsStreamData {
int handshake;
bool shutdown;
SSL *ssl;
BUF_MEM *write_buffer;
size_t buffer_offset;
};
+22 -5
View File
@@ -3,18 +3,35 @@
#if ENABLE_DNS_OVER_TLS
#if !HAVE_OPENSSL
#error This source file requires OpenSSL to be available.
#endif
#include <openssl/ssl.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/uio.h>
#include "resolved-dnstls-openssl.h"
typedef struct DnsServer DnsServer;
typedef struct DnsStream DnsStream;
typedef struct DnsTlsManagerData DnsTlsManagerData;
typedef struct DnsTlsServerData DnsTlsServerData;
typedef struct DnsTlsStreamData DnsTlsStreamData;
typedef struct Manager Manager;
typedef struct DnsTlsManagerData {
SSL_CTX *ctx;
} DnsTlsManagerData;
typedef struct DnsTlsServerData {
SSL_SESSION *session;
} DnsTlsServerData;
typedef struct DnsTlsStreamData {
int handshake;
bool shutdown;
SSL *ssl;
BUF_MEM *write_buffer;
size_t buffer_offset;
} DnsTlsStreamData;
#define DNSTLS_STREAM_CLOSED 1
int dnstls_stream_connect_tls(DnsStream *stream, DnsServer *server);