summaryrefslogtreecommitdiffstats
path: root/src/resolve/resolved-dnstls-gnutls.c
diff options
context:
space:
mode:
authorIwan Timmer <irtimmer@gmail.com>2019-06-17 22:33:50 +0200
committerIwan Timmer <irtimmer@gmail.com>2019-06-18 19:16:36 +0200
commit71a681ae50175a569bf832d2615fd11994c41d73 (patch)
tree0d55c735f7a654a03600203b8c9f92083a1b7ec1 /src/resolve/resolved-dnstls-gnutls.c
parentresolved: move TLS data shared by all servers to manager (diff)
downloadsystemd-71a681ae50175a569bf832d2615fd11994c41d73.tar.xz
systemd-71a681ae50175a569bf832d2615fd11994c41d73.zip
resolved: add missing error code check when initializing DNS-over-TLS
Diffstat (limited to 'src/resolve/resolved-dnstls-gnutls.c')
-rw-r--r--src/resolve/resolved-dnstls-gnutls.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/resolve/resolved-dnstls-gnutls.c b/src/resolve/resolved-dnstls-gnutls.c
index 7defd119a4..d824d6ca5a 100644
--- a/src/resolve/resolved-dnstls-gnutls.c
+++ b/src/resolve/resolved-dnstls-gnutls.c
@@ -194,14 +194,15 @@ void dnstls_server_free(DnsServer *server) {
gnutls_free(server->dnstls_data.session_data.data);
}
-void dnstls_manager_init(Manager *manager) {
+int dnstls_manager_init(Manager *manager) {
int r;
assert(manager);
- gnutls_certificate_allocate_credentials(&manager->dnstls_data.cert_cred);
- r = gnutls_certificate_set_x509_trust_file(manager->dnstls_data.cert_cred, manager->trusted_certificate_file, GNUTLS_X509_FMT_PEM);
+ r = gnutls_certificate_allocate_credentials(&manager->dnstls_data.cert_cred);
if (r < 0)
- log_error("Failed to load trusted certificate file %s: %s", manager->trusted_certificate_file, gnutls_strerror(r));
+ return -ENOMEM;
+
+ return 0;
}
void dnstls_manager_free(Manager *manager) {