summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2015-02-13 08:41:34 +0000
committersthen <sthen@openbsd.org>2015-02-13 08:41:34 +0000
commitb1c2ae721e639575465f9c311cf9397723e3ace9 (patch)
treeca38f2199993901cb9e607d15c46b449f323647d
parentDon't leak memory on errors - fixes coverity issues 105353 105253 (diff)
downloadwireguard-openbsd-b1c2ae721e639575465f9c311cf9397723e3ace9.tar.xz
wireguard-openbsd-b1c2ae721e639575465f9c311cf9397723e3ace9.zip
Call tls_config earlier; otherwise TLS_PROTOCOLS_ALL (to allow TLSv1.0 etc)
was only called if -S was used. Fixes TLSv1.0/1.1. Problem reported by nigel@, ok jsing
-rw-r--r--usr.bin/ftp/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index ae333c0479f..3cf7719a068 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.98 2015/02/12 04:23:17 jsing Exp $ */
+/* $OpenBSD: main.c,v 1.99 2015/02/13 08:41:34 sthen Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -198,6 +198,14 @@ main(volatile int argc, char *argv[])
#ifndef SMALL
cookiefile = getenv("http_cookies");
+ if (tls_config == NULL) {
+ tls_config = tls_config_new();
+ if (tls_config == NULL)
+ errx(1, "tls config failed");
+ tls_config_set_protocols(tls_config,
+ TLS_PROTOCOLS_ALL);
+ }
+
#endif /* !SMALL */
httpuseragent = NULL;
@@ -308,14 +316,6 @@ main(volatile int argc, char *argv[])
case 'S':
#ifndef SMALL
- if (tls_config == NULL) {
- tls_config = tls_config_new();
- if (tls_config == NULL)
- errx(1, "tls config failed");
- tls_config_set_protocols(tls_config,
- TLS_PROTOCOLS_ALL);
- }
-
cp = optarg;
while (*cp) {
char *str;