Skip to content

Commit b1c3f57

Browse files
committed
resolve: always use openssl as backend of DNS-over-TLS
This drops support for dns-over-tls=gnutls meson option.
1 parent a68457e commit b1c3f57

File tree

11 files changed

+20
-343
lines changed

11 files changed

+20
-343
lines changed

.github/workflows/build_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fatal() { echo >&2 -e "\033[31;1m$1\033[0m"; exit 1; }
1010
success() { echo >&2 -e "\033[32;1m$1\033[0m"; }
1111

1212
ARGS=(
13-
"--optimization=0 -Dopenssl=disabled -Dcryptolib=gcrypt -Ddns-over-tls=gnutls -Dtpm=true -Dtpm2=enabled"
13+
"--optimization=0 -Dopenssl=disabled -Dcryptolib=gcrypt -Dtpm=true -Dtpm2=enabled"
1414
"--optimization=s -Dutmp=false"
1515
"--optimization=2 -Dc_args=-Wmaybe-uninitialized -Ddns-over-tls=openssl"
1616
"--optimization=3 -Db_lto=true -Ddns-over-tls=false"

README

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ REQUIREMENTS:
240240
libcurl >= 7.32.0 (optional)
241241
libidn2 or libidn (optional)
242242
gnutls >= 3.1.4 (optional)
243-
>= 3.6.0 is required to support DNS-over-TLS with gnutls
244-
openssl >= 1.1.0 (optional, required to support DNS-over-TLS with openssl)
243+
openssl >= 1.1.0 (optional, required to support DNS-over-TLS)
245244
p11-kit >= 0.23.3 (optional)
246245
libfido2 (optional)
247246
tpm2-tss (optional)

TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,6 @@ Features:
18071807
with matches, then activate app through that passing socket over
18081808

18091809
* unify on openssl:
1810-
- kill gnutls support in resolved
18111810
- figure out what to do about libmicrohttpd, which has a hard dependency on
18121811
gnutls
18131812
- port fsprg over to a dlopen lib, then switch it to openssl

meson.build

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,37 +1488,17 @@ conf.set10('HAVE_OPENSSL_OR_GCRYPT',
14881488
lib_openssl_or_gcrypt = conf.get('PREFER_OPENSSL') == 1 ? [libopenssl] : [libgcrypt, libgpg_error]
14891489

14901490
dns_over_tls = get_option('dns-over-tls')
1491-
if dns_over_tls != 'false'
1492-
if dns_over_tls == 'gnutls' and conf.get('PREFER_OPENSSL') == 1
1493-
error('Sorry, -Ddns-over-tls=gnutls is not supported when openssl is used as the cryptolib')
1494-
endif
1495-
1496-
if dns_over_tls == 'gnutls'
1497-
have_openssl = false
1498-
else
1499-
have_openssl = conf.get('HAVE_OPENSSL') == 1
1500-
if dns_over_tls == 'openssl' and not have_openssl
1501-
error('DNS-over-TLS support was requested with openssl, but dependencies are not available')
1502-
endif
1503-
endif
1504-
if dns_over_tls == 'openssl' or have_openssl
1505-
have_gnutls = false
1506-
else
1507-
have_gnutls = conf.get('HAVE_GNUTLS') == 1 and libgnutls.version().version_compare('>= 3.6.0')
1508-
if dns_over_tls != 'auto' and not have_gnutls
1509-
str = dns_over_tls == 'gnutls' ? ' with gnutls' : ''
1510-
error('DNS-over-TLS support was requested@0@, but dependencies are not available'.format(str))
1511-
endif
1512-
endif
1513-
have = have_gnutls or have_openssl
1514-
else
1491+
have_openssl = conf.get('HAVE_OPENSSL') == 1
1492+
if dns_over_tls == 'false'
15151493
have = false
1516-
have_gnutls = false
1517-
have_openssl = false
1494+
elif dns_over_tls == 'auto'
1495+
have = have_openssl
1496+
elif have_openssl
1497+
have = true
1498+
else
1499+
error('DNS-over-TLS support was requested, but OpenSSL support is disabled.')
15181500
endif
15191501
conf.set10('ENABLE_DNS_OVER_TLS', have)
1520-
conf.set10('DNS_OVER_TLS_USE_GNUTLS', have_gnutls)
1521-
conf.set10('DNS_OVER_TLS_USE_OPENSSL', have_openssl)
15221502

15231503
default_dns_over_tls = get_option('default-dns-over-tls')
15241504
if default_dns_over_tls != 'no' and conf.get('ENABLE_DNS_OVER_TLS') == 0
@@ -3080,6 +3060,7 @@ foreach tuple : [
30803060

30813061
# optional features
30823062
['dmi'],
3063+
['DNS-over-TLS'],
30833064
['idn'],
30843065
['polkit'],
30853066
['legacy-pkla', install_polkit_pkla],
@@ -3152,14 +3133,6 @@ else
31523133
missing += 'cryptolib'
31533134
endif
31543135

3155-
if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1
3156-
found += 'DNS-over-TLS(gnutls)'
3157-
elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1
3158-
found += 'DNS-over-TLS(openssl)'
3159-
else
3160-
missing += 'DNS-over-TLS'
3161-
endif
3162-
31633136
summary({
31643137
'enabled' : ', '.join(found),
31653138
'disabled' : ', '.join(missing)},

meson_options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ option('default-llmnr', type : 'combo',
363363
choices : ['yes', 'resolve', 'no'],
364364
description : 'default LLMNR mode',
365365
value : 'yes')
366-
option('dns-over-tls', type : 'combo', choices : ['auto', 'gnutls', 'openssl', 'true', 'false'],
366+
option('dns-over-tls', type : 'combo', choices : ['auto', 'openssl', 'true', 'false'],
367367
description : 'DNS-over-TLS support')
368368
option('dns-servers', type : 'string',
369369
description : 'space-separated list of default DNS servers',

src/resolve/meson.build

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,10 @@ systemd_resolved_sources += custom_target(
102102

103103
systemd_resolved_dependencies = [threads, libm] + [lib_openssl_or_gcrypt]
104104
if conf.get('ENABLE_DNS_OVER_TLS') == 1
105-
if conf.get('DNS_OVER_TLS_USE_GNUTLS') == 1
106-
systemd_resolved_sources += files(
107-
'resolved-dnstls-gnutls.c',
108-
)
109-
systemd_resolved_dependencies += libgnutls
110-
elif conf.get('DNS_OVER_TLS_USE_OPENSSL') == 1
111-
systemd_resolved_sources += files(
112-
'resolved-dnstls-openssl.c',
113-
)
114-
systemd_resolved_dependencies += libopenssl
115-
else
116-
error('unknown dependency for supporting DNS-over-TLS')
117-
endif
105+
systemd_resolved_sources += files(
106+
'resolved-dnstls-openssl.c',
107+
)
108+
systemd_resolved_dependencies += libopenssl
118109
endif
119110

120111
link_with = [

src/resolve/resolved-dnstls-gnutls.c

Lines changed: 0 additions & 255 deletions
This file was deleted.

0 commit comments

Comments
 (0)