summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2016-05-27 15:16:16 +0000
committerjsing <jsing@openbsd.org>2016-05-27 15:16:16 +0000
commitb1b928e5d4513b8c6e2374e7bfb3a2cf1b8e5ed8 (patch)
tree9d050a8cac0d3579e08d5ca4f0131617939d4ec8
parentRename some of the internal error setting functions to more closely follow (diff)
downloadwireguard-openbsd-b1b928e5d4513b8c6e2374e7bfb3a2cf1b8e5ed8.tar.xz
wireguard-openbsd-b1b928e5d4513b8c6e2374e7bfb3a2cf1b8e5ed8.zip
Per the libtls man page, tls_init() must be called prior to any other
tls_* function; so actually do that.
-rw-r--r--usr.bin/ftp/fetch.c6
-rw-r--r--usr.bin/ftp/main.c4
2 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index bf72267164d..233769ea7d4 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.146 2016/05/06 22:06:09 jca Exp $ */
+/* $OpenBSD: fetch.c,v 1.147 2016/05/27 15:16:16 jsing Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -604,10 +604,6 @@ again:
if (sslhost == NULL)
errx(1, "Can't allocate memory for https host.");
}
- if (tls_init() != 0) {
- fprintf(ttyout, "SSL initialisation failed\n");
- goto cleanup_url_get;
- }
if ((tls = tls_client()) == NULL) {
fprintf(ttyout, "failed to create SSL client\n");
goto cleanup_url_get;
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index bff6c6b0784..08b657ccf78 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.107 2016/05/06 22:06:09 jca Exp $ */
+/* $OpenBSD: main.c,v 1.108 2016/05/27 15:16:16 jsing Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -194,6 +194,8 @@ main(volatile int argc, char *argv[])
#ifndef SMALL
cookiefile = getenv("http_cookies");
+ if (tls_init() != 0)
+ errx(1, "tls init failed");
if (tls_config == NULL) {
tls_config = tls_config_new();
if (tls_config == NULL)