Skip to content

Commit 0baf937

Browse files
committed
resolve: rename resolved-dnstls-openssl.c -> resolved-dnstls.c
and merge resolved-dnstls.h and resolved-dnstls-openssl.h.
1 parent b1c3f57 commit 0baf937

File tree

4 files changed

+23
-31
lines changed

4 files changed

+23
-31
lines changed

src/resolve/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ systemd_resolved_sources += custom_target(
103103
systemd_resolved_dependencies = [threads, libm] + [lib_openssl_or_gcrypt]
104104
if conf.get('ENABLE_DNS_OVER_TLS') == 1
105105
systemd_resolved_sources += files(
106-
'resolved-dnstls-openssl.c',
106+
'resolved-dnstls.c',
107107
)
108108
systemd_resolved_dependencies += libopenssl
109109
endif

src/resolve/resolved-dnstls-openssl.h

Lines changed: 0 additions & 25 deletions
This file was deleted.
File renamed without changes.

src/resolve/resolved-dnstls.h

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,35 @@
33

44
#if ENABLE_DNS_OVER_TLS
55

6+
#if !HAVE_OPENSSL
7+
#error This source file requires OpenSSL to be available.
8+
#endif
9+
10+
#include <openssl/ssl.h>
11+
#include <stdbool.h>
612
#include <stdint.h>
713
#include <sys/uio.h>
814

9-
#include "resolved-dnstls-openssl.h"
10-
1115
typedef struct DnsServer DnsServer;
1216
typedef struct DnsStream DnsStream;
13-
typedef struct DnsTlsManagerData DnsTlsManagerData;
14-
typedef struct DnsTlsServerData DnsTlsServerData;
15-
typedef struct DnsTlsStreamData DnsTlsStreamData;
1617
typedef struct Manager Manager;
1718

19+
typedef struct DnsTlsManagerData {
20+
SSL_CTX *ctx;
21+
} DnsTlsManagerData;
22+
23+
typedef struct DnsTlsServerData {
24+
SSL_SESSION *session;
25+
} DnsTlsServerData;
26+
27+
typedef struct DnsTlsStreamData {
28+
int handshake;
29+
bool shutdown;
30+
SSL *ssl;
31+
BUF_MEM *write_buffer;
32+
size_t buffer_offset;
33+
} DnsTlsStreamData;
34+
1835
#define DNSTLS_STREAM_CLOSED 1
1936

2037
int dnstls_stream_connect_tls(DnsStream *stream, DnsServer *server);

0 commit comments

Comments
 (0)