summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormestre <mestre@openbsd.org>2016-11-30 07:54:36 +0000
committermestre <mestre@openbsd.org>2016-11-30 07:54:36 +0000
commit4ddf1c20b8b5b1e421aa37b93aa97231cfd8a6a9 (patch)
treecca85f519648caee89fd2ecf6d1c9c8cf7309937
parenttweak previous; (diff)
downloadwireguard-openbsd-4ddf1c20b8b5b1e421aa37b93aa97231cfd8a6a9.tar.xz
wireguard-openbsd-4ddf1c20b8b5b1e421aa37b93aa97231cfd8a6a9.zip
Check return value of tls_config_set_protocols(3) and bail out in case of
failure Feedback and OK jsing@
-rw-r--r--libexec/spamd/spamd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c
index 3e361a857df..86a97ebed1b 100644
--- a/libexec/spamd/spamd.c
+++ b/libexec/spamd/spamd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd.c,v 1.146 2016/11/08 09:31:55 mestre Exp $ */
+/* $OpenBSD: spamd.c,v 1.147 2016/11/30 07:54:36 mestre Exp $ */
/*
* Copyright (c) 2015 Henning Brauer <henning@openbsd.org>
@@ -455,7 +455,8 @@ spamd_tls_init()
if ((tlsctx = tls_server()) == NULL)
errx(1, "failed to get tls server");
- tls_config_set_protocols(tlscfg, TLS_PROTOCOLS_ALL);
+ if (tls_config_set_protocols(tlscfg, TLS_PROTOCOLS_ALL) != 0)
+ errx(1, "failed to set tls protocols");
/* might need user-specified ciphers, tls_config_set_ciphers */
if (tls_config_set_ciphers(tlscfg, "all") != 0)