|
|
0d1c57 |
From 0c36569c6541ed1eb924ccd60dea5caca0d1e957 Mon Sep 17 00:00:00 2001
|
|
|
0d1c57 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
0d1c57 |
Date: Thu, 27 Oct 2016 14:57:11 +0200
|
|
|
0d1c57 |
Subject: [PATCH 1/5] vtls: support TLS 1.3 via CURL_SSLVERSION_TLSv1_3
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Fully implemented with the NSS backend only for now.
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Reviewed-by: Ray Satiro
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Upstream-commit: 6ad3add60654182a747f5971afb40817488ef0e8
|
|
|
0d1c57 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
0d1c57 |
---
|
|
|
0d1c57 |
docs/libcurl/curl_easy_setopt.3 | 2 ++
|
|
|
0d1c57 |
docs/libcurl/symbols-in-versions | 1 +
|
|
|
0d1c57 |
include/curl/curl.h | 1 +
|
|
|
0d1c57 |
lib/nss.c | 8 ++++++++
|
|
|
0d1c57 |
packages/OS400/curl.inc.in | 2 ++
|
|
|
0d1c57 |
5 files changed, 14 insertions(+)
|
|
|
0d1c57 |
|
|
|
0d1c57 |
diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3
|
|
|
0d1c57 |
index 17b632f..226e0ca 100644
|
|
|
0d1c57 |
--- a/docs/libcurl/curl_easy_setopt.3
|
|
|
0d1c57 |
+++ b/docs/libcurl/curl_easy_setopt.3
|
|
|
0d1c57 |
@@ -2262,6 +2262,8 @@ Force TLSv1.0 (Added in 7.34.0)
|
|
|
0d1c57 |
Force TLSv1.1 (Added in 7.34.0)
|
|
|
0d1c57 |
.IP CURL_SSLVERSION_TLSv1_2
|
|
|
0d1c57 |
Force TLSv1.2 (Added in 7.34.0)
|
|
|
0d1c57 |
+.IP CURL_SSLVERSION_TLSv1_3
|
|
|
0d1c57 |
+Force TLSv1.3 (Added in 7.51.1)
|
|
|
0d1c57 |
.RE
|
|
|
0d1c57 |
.IP CURLOPT_SSL_VERIFYPEER
|
|
|
0d1c57 |
Pass a long as parameter. By default, curl assumes a value of 1.
|
|
|
0d1c57 |
diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions
|
|
|
0d1c57 |
index e2cce4c..a66bd97 100644
|
|
|
0d1c57 |
--- a/docs/libcurl/symbols-in-versions
|
|
|
0d1c57 |
+++ b/docs/libcurl/symbols-in-versions
|
|
|
0d1c57 |
@@ -685,6 +685,7 @@ CURL_SSLVERSION_TLSv1 7.9.2
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_0 7.34.0
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_1 7.34.0
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_2 7.34.0
|
|
|
0d1c57 |
+CURL_SSLVERSION_TLSv1_3 7.51.1
|
|
|
0d1c57 |
CURL_TIMECOND_IFMODSINCE 7.9.7
|
|
|
0d1c57 |
CURL_TIMECOND_IFUNMODSINCE 7.9.7
|
|
|
0d1c57 |
CURL_TIMECOND_LASTMOD 7.9.7
|
|
|
0d1c57 |
diff --git a/include/curl/curl.h b/include/curl/curl.h
|
|
|
0d1c57 |
index 8b639fa..0fb1885 100644
|
|
|
0d1c57 |
--- a/include/curl/curl.h
|
|
|
0d1c57 |
+++ b/include/curl/curl.h
|
|
|
0d1c57 |
@@ -1645,6 +1645,7 @@ enum {
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_0,
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_1,
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_2,
|
|
|
0d1c57 |
+ CURL_SSLVERSION_TLSv1_3,
|
|
|
0d1c57 |
|
|
|
0d1c57 |
CURL_SSLVERSION_LAST /* never use, keep last */
|
|
|
0d1c57 |
};
|
|
|
0d1c57 |
diff --git a/lib/nss.c b/lib/nss.c
|
|
|
0d1c57 |
index 31e5d75..8e26d1f 100644
|
|
|
0d1c57 |
--- a/lib/nss.c
|
|
|
0d1c57 |
+++ b/lib/nss.c
|
|
|
0d1c57 |
@@ -1331,6 +1331,14 @@ static CURLcode nss_init_sslver(SSLVersionRange *sslver,
|
|
|
0d1c57 |
sslver->min = SSL_LIBRARY_VERSION_TLS_1_2;
|
|
|
0d1c57 |
sslver->max = SSL_LIBRARY_VERSION_TLS_1_2;
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
+#endif
|
|
|
0d1c57 |
+ break;
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+ case CURL_SSLVERSION_TLSv1_3:
|
|
|
0d1c57 |
+#ifdef SSL_LIBRARY_VERSION_TLS_1_3
|
|
|
0d1c57 |
+ sslver->min = SSL_LIBRARY_VERSION_TLS_1_3;
|
|
|
0d1c57 |
+ sslver->max = SSL_LIBRARY_VERSION_TLS_1_3;
|
|
|
0d1c57 |
+ return CURLE_OK;
|
|
|
0d1c57 |
#endif
|
|
|
0d1c57 |
break;
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
diff --git a/packages/OS400/curl.inc.in b/packages/OS400/curl.inc.in
|
|
|
0d1c57 |
index 22a5511..30e6506 100644
|
|
|
0d1c57 |
--- a/packages/OS400/curl.inc.in
|
|
|
0d1c57 |
+++ b/packages/OS400/curl.inc.in
|
|
|
0d1c57 |
@@ -232,6 +232,8 @@
|
|
|
0d1c57 |
d c 5
|
|
|
0d1c57 |
d CURL_SSLVERSION_TLSv1_2...
|
|
|
0d1c57 |
d c 6
|
|
|
0d1c57 |
+ d CURL_SSLVERSION_TLSv1_3...
|
|
|
0d1c57 |
+ d c 7
|
|
|
0d1c57 |
*
|
|
|
0d1c57 |
d CURL_TLSAUTH_NONE...
|
|
|
0d1c57 |
d c 0
|
|
|
0d1c57 |
--
|
|
|
0d1c57 |
2.17.2
|
|
|
0d1c57 |
|
|
|
0d1c57 |
|
|
|
0d1c57 |
From d18da081cc26df5605b5a2995615660eb3270712 Mon Sep 17 00:00:00 2001
|
|
|
0d1c57 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
0d1c57 |
Date: Thu, 27 Oct 2016 14:58:43 +0200
|
|
|
0d1c57 |
Subject: [PATCH 2/5] curl: introduce the --tlsv1.3 option to force TLS 1.3
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Fully implemented with the NSS backend only for now.
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Reviewed-by: Ray Satiro
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Upstream-commit: a110a03b43057879643046538c79cc9dd20d399a
|
|
|
0d1c57 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
0d1c57 |
---
|
|
|
0d1c57 |
docs/curl.1 | 10 +++++++---
|
|
|
0d1c57 |
src/tool_getparam.c | 5 +++++
|
|
|
0d1c57 |
src/tool_help.c | 1 +
|
|
|
0d1c57 |
src/tool_setopt.c | 1 +
|
|
|
0d1c57 |
4 files changed, 14 insertions(+), 3 deletions(-)
|
|
|
0d1c57 |
|
|
|
0d1c57 |
diff --git a/docs/curl.1 b/docs/curl.1
|
|
|
0d1c57 |
index a26b03c..0c5ed9a 100644
|
|
|
0d1c57 |
--- a/docs/curl.1
|
|
|
0d1c57 |
+++ b/docs/curl.1
|
|
|
0d1c57 |
@@ -118,9 +118,9 @@ internally preferred: HTTP 1.1.
|
|
|
0d1c57 |
.IP "-1, --tlsv1"
|
|
|
0d1c57 |
(SSL)
|
|
|
0d1c57 |
Forces curl to use TLS version 1.x when negotiating with a remote TLS server.
|
|
|
0d1c57 |
-You can use options \fI--tlsv1.0\fP, \fI--tlsv1.1\fP, and \fI--tlsv1.2\fP to
|
|
|
0d1c57 |
-control the TLS version more precisely (if the SSL backend in use supports such
|
|
|
0d1c57 |
-a level of control).
|
|
|
0d1c57 |
+You can use options \fI--tlsv1.0\fP, \fI--tlsv1.1\fP, \fI--tlsv1.2\fP, and
|
|
|
0d1c57 |
+\fI--tlsv1.3\fP to control the TLS version more precisely (if the SSL backend
|
|
|
0d1c57 |
+in use supports such a level of control).
|
|
|
0d1c57 |
.IP "-2, --sslv2"
|
|
|
0d1c57 |
(SSL)
|
|
|
0d1c57 |
Forces curl to use SSL version 2 when negotiating with a remote SSL server.
|
|
|
0d1c57 |
@@ -1469,6 +1469,10 @@ Forces curl to use TLS version 1.1 when negotiating with a remote TLS server.
|
|
|
0d1c57 |
(SSL)
|
|
|
0d1c57 |
Forces curl to use TLS version 1.2 when negotiating with a remote TLS server.
|
|
|
0d1c57 |
(Added in 7.34.0)
|
|
|
0d1c57 |
+.IP "--tlsv1.3"
|
|
|
0d1c57 |
+(SSL)
|
|
|
0d1c57 |
+Forces curl to use TLS version 1.3 when negotiating with a remote TLS server.
|
|
|
0d1c57 |
+(Added in 7.51.1)
|
|
|
0d1c57 |
.IP "--tr-encoding"
|
|
|
0d1c57 |
(HTTP) Request a compressed Transfer-Encoding response using one of the
|
|
|
0d1c57 |
algorithms curl supports, and uncompress the data while receiving it.
|
|
|
0d1c57 |
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
|
|
|
0d1c57 |
index 32fc68b..86a7bb6 100644
|
|
|
0d1c57 |
--- a/src/tool_getparam.c
|
|
|
0d1c57 |
+++ b/src/tool_getparam.c
|
|
|
0d1c57 |
@@ -179,6 +179,7 @@ static const struct LongShort aliases[]= {
|
|
|
0d1c57 |
{"10", "tlsv1.0", FALSE},
|
|
|
0d1c57 |
{"11", "tlsv1.1", FALSE},
|
|
|
0d1c57 |
{"12", "tlsv1.2", FALSE},
|
|
|
0d1c57 |
+ {"13", "tlsv1.3", FALSE},
|
|
|
0d1c57 |
{"2", "sslv2", FALSE},
|
|
|
0d1c57 |
{"3", "sslv3", FALSE},
|
|
|
0d1c57 |
{"4", "ipv4", FALSE},
|
|
|
0d1c57 |
@@ -1000,6 +1001,10 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|
|
0d1c57 |
/* TLS version 1.2 */
|
|
|
0d1c57 |
config->ssl_version = CURL_SSLVERSION_TLSv1_2;
|
|
|
0d1c57 |
break;
|
|
|
0d1c57 |
+ case '3':
|
|
|
0d1c57 |
+ /* TLS version 1.3 */
|
|
|
0d1c57 |
+ config->ssl_version = CURL_SSLVERSION_TLSv1_3;
|
|
|
0d1c57 |
+ break;
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
break;
|
|
|
0d1c57 |
case '2':
|
|
|
0d1c57 |
diff --git a/src/tool_help.c b/src/tool_help.c
|
|
|
0d1c57 |
index c2883eb..0659db6 100644
|
|
|
0d1c57 |
--- a/src/tool_help.c
|
|
|
0d1c57 |
+++ b/src/tool_help.c
|
|
|
0d1c57 |
@@ -205,6 +205,7 @@ static const char *const helptext[] = {
|
|
|
0d1c57 |
" --tlsv1.0 Use TLSv1.0 (SSL)",
|
|
|
0d1c57 |
" --tlsv1.1 Use TLSv1.1 (SSL)",
|
|
|
0d1c57 |
" --tlsv1.2 Use TLSv1.2 (SSL)",
|
|
|
0d1c57 |
+ " --tlsv1.3 Use TLSv1.3 (SSL)",
|
|
|
0d1c57 |
" --trace FILE Write a debug trace to the given file",
|
|
|
0d1c57 |
" --trace-ascii FILE Like --trace but without the hex output",
|
|
|
0d1c57 |
" --trace-time Add time stamps to trace/verbose output",
|
|
|
0d1c57 |
diff --git a/src/tool_setopt.c b/src/tool_setopt.c
|
|
|
0d1c57 |
index 5ae32cd..0534118 100644
|
|
|
0d1c57 |
--- a/src/tool_setopt.c
|
|
|
0d1c57 |
+++ b/src/tool_setopt.c
|
|
|
0d1c57 |
@@ -81,6 +81,7 @@ const NameValue setopt_nv_CURL_SSLVERSION[] = {
|
|
|
0d1c57 |
NV(CURL_SSLVERSION_TLSv1_0),
|
|
|
0d1c57 |
NV(CURL_SSLVERSION_TLSv1_1),
|
|
|
0d1c57 |
NV(CURL_SSLVERSION_TLSv1_2),
|
|
|
0d1c57 |
+ NV(CURL_SSLVERSION_TLSv1_3),
|
|
|
0d1c57 |
NVEND,
|
|
|
0d1c57 |
};
|
|
|
0d1c57 |
|
|
|
0d1c57 |
--
|
|
|
0d1c57 |
2.17.2
|
|
|
0d1c57 |
|
|
|
0d1c57 |
|
|
|
0d1c57 |
From 6ffdc6a1ca867c0ed228ffba172cb910b77011f0 Mon Sep 17 00:00:00 2001
|
|
|
0d1c57 |
From: Jozef Kralik <jozef.kralik@eset.sk>
|
|
|
0d1c57 |
Date: Tue, 13 Dec 2016 21:10:00 +0100
|
|
|
0d1c57 |
Subject: [PATCH 3/5] vtls: add options to specify range of enabled TLS
|
|
|
0d1c57 |
versions
|
|
|
0d1c57 |
|
|
|
0d1c57 |
This commit introduces the CURL_SSLVERSION_MAX_* constants as well as
|
|
|
0d1c57 |
the --tls-max option of the curl tool.
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Closes https://github.com/curl/curl/pull/1166
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Upstream-commit: 6448f98c1857de521fb2dd3f9d4e5659845b5474
|
|
|
0d1c57 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
0d1c57 |
---
|
|
|
0d1c57 |
docs/curl.1 | 21 ++++++-
|
|
|
0d1c57 |
docs/libcurl/curl_easy_setopt.3 | 18 +++++-
|
|
|
0d1c57 |
docs/libcurl/symbols-in-versions | 8 ++-
|
|
|
0d1c57 |
include/curl/curl.h | 12 ++++
|
|
|
0d1c57 |
lib/nss.c | 94 ++++++++++++++++++++++----------
|
|
|
0d1c57 |
lib/sslgen.c | 2 +
|
|
|
0d1c57 |
lib/url.c | 7 ++-
|
|
|
0d1c57 |
lib/urldata.h | 1 +
|
|
|
0d1c57 |
src/tool_cfgable.h | 1 +
|
|
|
0d1c57 |
src/tool_getparam.c | 6 ++
|
|
|
0d1c57 |
src/tool_help.c | 1 +
|
|
|
0d1c57 |
src/tool_operate.c | 3 +-
|
|
|
0d1c57 |
src/tool_paramhlp.c | 32 +++++++++++
|
|
|
0d1c57 |
src/tool_paramhlp.h | 2 +
|
|
|
0d1c57 |
14 files changed, 175 insertions(+), 33 deletions(-)
|
|
|
0d1c57 |
|
|
|
0d1c57 |
diff --git a/docs/curl.1 b/docs/curl.1
|
|
|
0d1c57 |
index 0c5ed9a..35fae14 100644
|
|
|
0d1c57 |
--- a/docs/curl.1
|
|
|
0d1c57 |
+++ b/docs/curl.1
|
|
|
0d1c57 |
@@ -1472,7 +1472,26 @@ Forces curl to use TLS version 1.2 when negotiating with a remote TLS server.
|
|
|
0d1c57 |
.IP "--tlsv1.3"
|
|
|
0d1c57 |
(SSL)
|
|
|
0d1c57 |
Forces curl to use TLS version 1.3 when negotiating with a remote TLS server.
|
|
|
0d1c57 |
-(Added in 7.51.1)
|
|
|
0d1c57 |
+(Added in 7.52.0)
|
|
|
0d1c57 |
+.IP "--tls-max <VERSION>"
|
|
|
0d1c57 |
+(SSL) VERSION defines maximum supported TLS version. The minimum acceptable version
|
|
|
0d1c57 |
+is set by tlsv1.0, tlsv1.1, tlsv1.2 or tlsv1.3.
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+.RS
|
|
|
0d1c57 |
+.IP "default"
|
|
|
0d1c57 |
+Use up to recommended TLS version.
|
|
|
0d1c57 |
+.IP "1.0"
|
|
|
0d1c57 |
+Use up to TLSv1.0.
|
|
|
0d1c57 |
+.IP "1.1"
|
|
|
0d1c57 |
+Use up to TLSv1.1.
|
|
|
0d1c57 |
+.IP "1.2"
|
|
|
0d1c57 |
+Use up to TLSv1.2.
|
|
|
0d1c57 |
+.IP "1.3"
|
|
|
0d1c57 |
+Use up to TLSv1.3.
|
|
|
0d1c57 |
+.RE
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+See also \fI--tlsv1.0\fP and \fI--tlsv1.1\fP and \fI--tlsv1.2\fP and
|
|
|
0d1c57 |
+\fI--tlsv1.3\fP. Added in 7.54.0.
|
|
|
0d1c57 |
.IP "--tr-encoding"
|
|
|
0d1c57 |
(HTTP) Request a compressed Transfer-Encoding response using one of the
|
|
|
0d1c57 |
algorithms curl supports, and uncompress the data while receiving it.
|
|
|
0d1c57 |
diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3
|
|
|
0d1c57 |
index 226e0ca..55d207e 100644
|
|
|
0d1c57 |
--- a/docs/libcurl/curl_easy_setopt.3
|
|
|
0d1c57 |
+++ b/docs/libcurl/curl_easy_setopt.3
|
|
|
0d1c57 |
@@ -2263,7 +2263,23 @@ Force TLSv1.1 (Added in 7.34.0)
|
|
|
0d1c57 |
.IP CURL_SSLVERSION_TLSv1_2
|
|
|
0d1c57 |
Force TLSv1.2 (Added in 7.34.0)
|
|
|
0d1c57 |
.IP CURL_SSLVERSION_TLSv1_3
|
|
|
0d1c57 |
-Force TLSv1.3 (Added in 7.51.1)
|
|
|
0d1c57 |
+Force TLSv1.3 (Added in 7.52.0)
|
|
|
0d1c57 |
+.IP CURL_SSLVERSION_MAX_DEFAULT
|
|
|
0d1c57 |
+The flag defines maximum supported TLS version as TLSv1.2 or default
|
|
|
0d1c57 |
+value from SSL library.
|
|
|
0d1c57 |
+(Added in 7.54.0)
|
|
|
0d1c57 |
+.IP CURL_SSLVERSION_MAX_TLSv1_0
|
|
|
0d1c57 |
+The flag defines maximum supported TLS version as TLSv1.0.
|
|
|
0d1c57 |
+(Added in 7.54.0)
|
|
|
0d1c57 |
+.IP CURL_SSLVERSION_MAX_TLSv1_1
|
|
|
0d1c57 |
+The flag defines maximum supported TLS version as TLSv1.1.
|
|
|
0d1c57 |
+(Added in 7.54.0)
|
|
|
0d1c57 |
+.IP CURL_SSLVERSION_MAX_TLSv1_2
|
|
|
0d1c57 |
+The flag defines maximum supported TLS version as TLSv1.2.
|
|
|
0d1c57 |
+(Added in 7.54.0)
|
|
|
0d1c57 |
+.IP CURL_SSLVERSION_MAX_TLSv1_3
|
|
|
0d1c57 |
+The flag defines maximum supported TLS version as TLSv1.3.
|
|
|
0d1c57 |
+(Added in 7.54.0)
|
|
|
0d1c57 |
.RE
|
|
|
0d1c57 |
.IP CURLOPT_SSL_VERIFYPEER
|
|
|
0d1c57 |
Pass a long as parameter. By default, curl assumes a value of 1.
|
|
|
0d1c57 |
diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions
|
|
|
0d1c57 |
index a66bd97..34e0ac3 100644
|
|
|
0d1c57 |
--- a/docs/libcurl/symbols-in-versions
|
|
|
0d1c57 |
+++ b/docs/libcurl/symbols-in-versions
|
|
|
0d1c57 |
@@ -685,7 +685,13 @@ CURL_SSLVERSION_TLSv1 7.9.2
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_0 7.34.0
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_1 7.34.0
|
|
|
0d1c57 |
CURL_SSLVERSION_TLSv1_2 7.34.0
|
|
|
0d1c57 |
-CURL_SSLVERSION_TLSv1_3 7.51.1
|
|
|
0d1c57 |
+CURL_SSLVERSION_TLSv1_3 7.52.0
|
|
|
0d1c57 |
+CURL_SSLVERSION_MAX_NONE 7.54.0
|
|
|
0d1c57 |
+CURL_SSLVERSION_MAX_DEFAULT 7.54.0
|
|
|
0d1c57 |
+CURL_SSLVERSION_MAX_TLSv1_0 7.54.0
|
|
|
0d1c57 |
+CURL_SSLVERSION_MAX_TLSv1_1 7.54.0
|
|
|
0d1c57 |
+CURL_SSLVERSION_MAX_TLSv1_2 7.54.0
|
|
|
0d1c57 |
+CURL_SSLVERSION_MAX_TLSv1_3 7.54.0
|
|
|
0d1c57 |
CURL_TIMECOND_IFMODSINCE 7.9.7
|
|
|
0d1c57 |
CURL_TIMECOND_IFUNMODSINCE 7.9.7
|
|
|
0d1c57 |
CURL_TIMECOND_LASTMOD 7.9.7
|
|
|
0d1c57 |
diff --git a/include/curl/curl.h b/include/curl/curl.h
|
|
|
0d1c57 |
index 0fb1885..5a46925 100644
|
|
|
0d1c57 |
--- a/include/curl/curl.h
|
|
|
0d1c57 |
+++ b/include/curl/curl.h
|
|
|
0d1c57 |
@@ -1650,6 +1650,18 @@ enum {
|
|
|
0d1c57 |
CURL_SSLVERSION_LAST /* never use, keep last */
|
|
|
0d1c57 |
};
|
|
|
0d1c57 |
|
|
|
0d1c57 |
+enum {
|
|
|
0d1c57 |
+ CURL_SSLVERSION_MAX_NONE = 0,
|
|
|
0d1c57 |
+ CURL_SSLVERSION_MAX_DEFAULT = (CURL_SSLVERSION_TLSv1 << 16),
|
|
|
0d1c57 |
+ CURL_SSLVERSION_MAX_TLSv1_0 = (CURL_SSLVERSION_TLSv1_0 << 16),
|
|
|
0d1c57 |
+ CURL_SSLVERSION_MAX_TLSv1_1 = (CURL_SSLVERSION_TLSv1_1 << 16),
|
|
|
0d1c57 |
+ CURL_SSLVERSION_MAX_TLSv1_2 = (CURL_SSLVERSION_TLSv1_2 << 16),
|
|
|
0d1c57 |
+ CURL_SSLVERSION_MAX_TLSv1_3 = (CURL_SSLVERSION_TLSv1_3 << 16),
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+ /* never use, keep last */
|
|
|
0d1c57 |
+ CURL_SSLVERSION_MAX_LAST = (CURL_SSLVERSION_LAST << 16)
|
|
|
0d1c57 |
+};
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
enum CURL_TLSAUTH {
|
|
|
0d1c57 |
CURL_TLSAUTH_NONE,
|
|
|
0d1c57 |
CURL_TLSAUTH_SRP,
|
|
|
0d1c57 |
diff --git a/lib/nss.c b/lib/nss.c
|
|
|
0d1c57 |
index 8e26d1f..d8e481b 100644
|
|
|
0d1c57 |
--- a/lib/nss.c
|
|
|
0d1c57 |
+++ b/lib/nss.c
|
|
|
0d1c57 |
@@ -1284,67 +1284,105 @@ static CURLcode nss_load_ca_certificates(struct connectdata *conn,
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
|
|
|
0d1c57 |
-static CURLcode nss_init_sslver(SSLVersionRange *sslver,
|
|
|
0d1c57 |
- struct SessionHandle *data)
|
|
|
0d1c57 |
+static CURLcode nss_sslver_from_curl(PRUint16 *nssver, long version)
|
|
|
0d1c57 |
{
|
|
|
0d1c57 |
- switch (data->set.ssl.version) {
|
|
|
0d1c57 |
- default:
|
|
|
0d1c57 |
- case CURL_SSLVERSION_DEFAULT:
|
|
|
0d1c57 |
- break;
|
|
|
0d1c57 |
-
|
|
|
0d1c57 |
+ switch(version) {
|
|
|
0d1c57 |
case CURL_SSLVERSION_TLSv1:
|
|
|
0d1c57 |
- sslver->min = SSL_LIBRARY_VERSION_TLS_1_0;
|
|
|
0d1c57 |
#ifdef SSL_LIBRARY_VERSION_TLS_1_2
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_TLS_1_2;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_TLS_1_2;
|
|
|
0d1c57 |
#elif defined SSL_LIBRARY_VERSION_TLS_1_1
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_TLS_1_1;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_TLS_1_1;
|
|
|
0d1c57 |
#else
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_TLS_1_0;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_TLS_1_0;
|
|
|
0d1c57 |
#endif
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
case CURL_SSLVERSION_SSLv2:
|
|
|
0d1c57 |
- sslver->min = SSL_LIBRARY_VERSION_2;
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_2;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_2;
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
case CURL_SSLVERSION_SSLv3:
|
|
|
0d1c57 |
- sslver->min = SSL_LIBRARY_VERSION_3_0;
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_3_0;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_3_0;
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
case CURL_SSLVERSION_TLSv1_0:
|
|
|
0d1c57 |
- sslver->min = SSL_LIBRARY_VERSION_TLS_1_0;
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_TLS_1_0;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_TLS_1_0;
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
case CURL_SSLVERSION_TLSv1_1:
|
|
|
0d1c57 |
#ifdef SSL_LIBRARY_VERSION_TLS_1_1
|
|
|
0d1c57 |
- sslver->min = SSL_LIBRARY_VERSION_TLS_1_1;
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_TLS_1_1;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_TLS_1_1;
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
+#else
|
|
|
0d1c57 |
+ return CURLE_SSL_CONNECT_ERROR;
|
|
|
0d1c57 |
#endif
|
|
|
0d1c57 |
- break;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
case CURL_SSLVERSION_TLSv1_2:
|
|
|
0d1c57 |
#ifdef SSL_LIBRARY_VERSION_TLS_1_2
|
|
|
0d1c57 |
- sslver->min = SSL_LIBRARY_VERSION_TLS_1_2;
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_TLS_1_2;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_TLS_1_2;
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
+#else
|
|
|
0d1c57 |
+ return CURLE_SSL_CONNECT_ERROR;
|
|
|
0d1c57 |
#endif
|
|
|
0d1c57 |
- break;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
case CURL_SSLVERSION_TLSv1_3:
|
|
|
0d1c57 |
#ifdef SSL_LIBRARY_VERSION_TLS_1_3
|
|
|
0d1c57 |
- sslver->min = SSL_LIBRARY_VERSION_TLS_1_3;
|
|
|
0d1c57 |
- sslver->max = SSL_LIBRARY_VERSION_TLS_1_3;
|
|
|
0d1c57 |
+ *nssver = SSL_LIBRARY_VERSION_TLS_1_3;
|
|
|
0d1c57 |
return CURLE_OK;
|
|
|
0d1c57 |
+#else
|
|
|
0d1c57 |
+ return CURLE_SSL_CONNECT_ERROR;
|
|
|
0d1c57 |
#endif
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+ default:
|
|
|
0d1c57 |
+ return CURLE_SSL_CONNECT_ERROR;
|
|
|
0d1c57 |
+ }
|
|
|
0d1c57 |
+}
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+static CURLcode nss_init_sslver(SSLVersionRange *sslver,
|
|
|
0d1c57 |
+ struct SessionHandle *data)
|
|
|
0d1c57 |
+{
|
|
|
0d1c57 |
+ CURLcode result;
|
|
|
0d1c57 |
+ const long min = data->set.ssl.version;
|
|
|
0d1c57 |
+ const long max = data->set.ssl.version_max;
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+ if(min == CURL_SSLVERSION_DEFAULT || max == CURL_SSLVERSION_MAX_DEFAULT) {
|
|
|
0d1c57 |
+ /* map CURL_SSLVERSION_DEFAULT to NSS default */
|
|
|
0d1c57 |
+ if(SSL_VersionRangeGetDefault(ssl_variant_stream, sslver) != SECSuccess)
|
|
|
0d1c57 |
+ return CURLE_SSL_CONNECT_ERROR;
|
|
|
0d1c57 |
+ /* ... but make sure we use at least TLSv1.0 according to libcurl API */
|
|
|
0d1c57 |
+ if(sslver->min < SSL_LIBRARY_VERSION_TLS_1_0)
|
|
|
0d1c57 |
+ sslver->min = SSL_LIBRARY_VERSION_TLS_1_0;
|
|
|
0d1c57 |
+ }
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+ switch(min) {
|
|
|
0d1c57 |
+ case CURL_SSLVERSION_DEFAULT:
|
|
|
0d1c57 |
+ break;
|
|
|
0d1c57 |
+ case CURL_SSLVERSION_TLSv1:
|
|
|
0d1c57 |
+ sslver->min = SSL_LIBRARY_VERSION_TLS_1_0;
|
|
|
0d1c57 |
break;
|
|
|
0d1c57 |
+ default:
|
|
|
0d1c57 |
+ result = nss_sslver_from_curl(&sslver->min, min);
|
|
|
0d1c57 |
+ if(result) {
|
|
|
0d1c57 |
+ failf(data, "unsupported min version passed via CURLOPT_SSLVERSION");
|
|
|
0d1c57 |
+ return result;
|
|
|
0d1c57 |
+ }
|
|
|
0d1c57 |
+ if(max == CURL_SSLVERSION_MAX_NONE)
|
|
|
0d1c57 |
+ sslver->max = sslver->min;
|
|
|
0d1c57 |
+ }
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+ switch(max) {
|
|
|
0d1c57 |
+ case CURL_SSLVERSION_MAX_NONE:
|
|
|
0d1c57 |
+ case CURL_SSLVERSION_MAX_DEFAULT:
|
|
|
0d1c57 |
+ break;
|
|
|
0d1c57 |
+ default:
|
|
|
0d1c57 |
+ result = nss_sslver_from_curl(&sslver->max, max >> 16);
|
|
|
0d1c57 |
+ if(result) {
|
|
|
0d1c57 |
+ failf(data, "unsupported max version passed via CURLOPT_SSLVERSION");
|
|
|
0d1c57 |
+ return result;
|
|
|
0d1c57 |
+ }
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
|
|
|
0d1c57 |
- failf(data, "TLS minor version cannot be set");
|
|
|
0d1c57 |
- return CURLE_SSL_CONNECT_ERROR;
|
|
|
0d1c57 |
+ return CURLE_OK;
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
|
|
|
0d1c57 |
static CURLcode nss_fail_connect(struct ssl_connect_data *connssl,
|
|
|
0d1c57 |
@@ -1400,7 +1438,7 @@ static CURLcode nss_setup_connect(struct connectdata *conn, int sockindex)
|
|
|
0d1c57 |
CURLcode curlerr;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
SSLVersionRange sslver = {
|
|
|
0d1c57 |
- SSL_LIBRARY_VERSION_3_0, /* min */
|
|
|
0d1c57 |
+ SSL_LIBRARY_VERSION_TLS_1_0, /* min */
|
|
|
0d1c57 |
SSL_LIBRARY_VERSION_TLS_1_0 /* max */
|
|
|
0d1c57 |
};
|
|
|
0d1c57 |
|
|
|
0d1c57 |
diff --git a/lib/sslgen.c b/lib/sslgen.c
|
|
|
0d1c57 |
index 79cbb6f..d917f05 100644
|
|
|
0d1c57 |
--- a/lib/sslgen.c
|
|
|
0d1c57 |
+++ b/lib/sslgen.c
|
|
|
0d1c57 |
@@ -86,6 +86,7 @@ Curl_ssl_config_matches(struct ssl_config_data* data,
|
|
|
0d1c57 |
struct ssl_config_data* needle)
|
|
|
0d1c57 |
{
|
|
|
0d1c57 |
if((data->version == needle->version) &&
|
|
|
0d1c57 |
+ (data->version_max == needle->version_max) &&
|
|
|
0d1c57 |
(data->verifypeer == needle->verifypeer) &&
|
|
|
0d1c57 |
(data->verifyhost == needle->verifyhost) &&
|
|
|
0d1c57 |
safe_strequal(data->CApath, needle->CApath) &&
|
|
|
0d1c57 |
@@ -107,6 +108,7 @@ Curl_clone_ssl_config(struct ssl_config_data *source,
|
|
|
0d1c57 |
dest->verifyhost = source->verifyhost;
|
|
|
0d1c57 |
dest->verifypeer = source->verifypeer;
|
|
|
0d1c57 |
dest->version = source->version;
|
|
|
0d1c57 |
+ dest->version_max = source->version_max;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
if(source->CAfile) {
|
|
|
0d1c57 |
dest->CAfile = strdup(source->CAfile);
|
|
|
0d1c57 |
diff --git a/lib/url.c b/lib/url.c
|
|
|
0d1c57 |
index cb3f3c3..cc099a5 100644
|
|
|
0d1c57 |
--- a/lib/url.c
|
|
|
0d1c57 |
+++ b/lib/url.c
|
|
|
0d1c57 |
@@ -667,6 +667,9 @@ CURLcode Curl_open(struct SessionHandle **curl)
|
|
|
0d1c57 |
return res;
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
|
|
|
0d1c57 |
+#define C_SSLVERSION_VALUE(x) (x & 0xffff)
|
|
|
0d1c57 |
+#define C_SSLVERSION_MAX_VALUE(x) (x & 0xffff0000)
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|
|
0d1c57 |
va_list param)
|
|
|
0d1c57 |
{
|
|
|
0d1c57 |
@@ -882,7 +885,9 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
|
|
|
0d1c57 |
* Set explicit SSL version to try to connect with, as some SSL
|
|
|
0d1c57 |
* implementations are lame.
|
|
|
0d1c57 |
*/
|
|
|
0d1c57 |
- data->set.ssl.version = va_arg(param, long);
|
|
|
0d1c57 |
+ arg = va_arg(param, long);
|
|
|
0d1c57 |
+ data->set.ssl.version = C_SSLVERSION_VALUE(arg);
|
|
|
0d1c57 |
+ data->set.ssl.version_max = C_SSLVERSION_MAX_VALUE(arg);
|
|
|
0d1c57 |
break;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
#ifndef CURL_DISABLE_HTTP
|
|
|
0d1c57 |
diff --git a/lib/urldata.h b/lib/urldata.h
|
|
|
0d1c57 |
index d10c784..a5027ed 100644
|
|
|
0d1c57 |
--- a/lib/urldata.h
|
|
|
0d1c57 |
+++ b/lib/urldata.h
|
|
|
0d1c57 |
@@ -335,6 +335,7 @@ struct ssl_connect_data {
|
|
|
0d1c57 |
|
|
|
0d1c57 |
struct ssl_config_data {
|
|
|
0d1c57 |
long version; /* what version the client wants to use */
|
|
|
0d1c57 |
+ long version_max; /* max supported version the client wants to use*/
|
|
|
0d1c57 |
long certverifyresult; /* result from the certificate verification */
|
|
|
0d1c57 |
|
|
|
0d1c57 |
bool verifypeer; /* set TRUE if this is desired */
|
|
|
0d1c57 |
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
|
|
|
0d1c57 |
index 68d0297..5f45f63 100644
|
|
|
0d1c57 |
--- a/src/tool_cfgable.h
|
|
|
0d1c57 |
+++ b/src/tool_cfgable.h
|
|
|
0d1c57 |
@@ -146,6 +146,7 @@ struct Configurable {
|
|
|
0d1c57 |
struct curl_slist *postquote;
|
|
|
0d1c57 |
struct curl_slist *prequote;
|
|
|
0d1c57 |
long ssl_version;
|
|
|
0d1c57 |
+ long ssl_version_max;
|
|
|
0d1c57 |
long ip_version;
|
|
|
0d1c57 |
curl_TimeCond timecond;
|
|
|
0d1c57 |
time_t condtime;
|
|
|
0d1c57 |
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
|
|
|
0d1c57 |
index 86a7bb6..9a228b9 100644
|
|
|
0d1c57 |
--- a/src/tool_getparam.c
|
|
|
0d1c57 |
+++ b/src/tool_getparam.c
|
|
|
0d1c57 |
@@ -174,6 +174,7 @@ static const struct LongShort aliases[]= {
|
|
|
0d1c57 |
{"$I", "post303", FALSE},
|
|
|
0d1c57 |
{"$J", "metalink", FALSE},
|
|
|
0d1c57 |
{"$M", "unix-socket", TRUE},
|
|
|
0d1c57 |
+ {"$X", "tls-max", TRUE},
|
|
|
0d1c57 |
{"0", "http1.0", FALSE},
|
|
|
0d1c57 |
{"1", "tlsv1", FALSE},
|
|
|
0d1c57 |
{"10", "tlsv1.0", FALSE},
|
|
|
0d1c57 |
@@ -968,6 +969,11 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|
|
0d1c57 |
case 'M': /* --unix-socket */
|
|
|
0d1c57 |
GetStr(&config->unix_socket_path, nextarg);
|
|
|
0d1c57 |
break;
|
|
|
0d1c57 |
+ case 'X': /* --tls-max */
|
|
|
0d1c57 |
+ err = str2tls_max(&config->ssl_version_max, nextarg);
|
|
|
0d1c57 |
+ if(err)
|
|
|
0d1c57 |
+ return err;
|
|
|
0d1c57 |
+ break;
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
break;
|
|
|
0d1c57 |
case '#': /* --progress-bar */
|
|
|
0d1c57 |
diff --git a/src/tool_help.c b/src/tool_help.c
|
|
|
0d1c57 |
index 0659db6..3eeef6d 100644
|
|
|
0d1c57 |
--- a/src/tool_help.c
|
|
|
0d1c57 |
+++ b/src/tool_help.c
|
|
|
0d1c57 |
@@ -206,6 +206,7 @@ static const char *const helptext[] = {
|
|
|
0d1c57 |
" --tlsv1.1 Use TLSv1.1 (SSL)",
|
|
|
0d1c57 |
" --tlsv1.2 Use TLSv1.2 (SSL)",
|
|
|
0d1c57 |
" --tlsv1.3 Use TLSv1.3 (SSL)",
|
|
|
0d1c57 |
+ " --tls-max VERSION Use TLS up to VERSION (SSL)",
|
|
|
0d1c57 |
" --trace FILE Write a debug trace to the given file",
|
|
|
0d1c57 |
" --trace-ascii FILE Like --trace but without the hex output",
|
|
|
0d1c57 |
" --trace-time Add time stamps to trace/verbose output",
|
|
|
0d1c57 |
diff --git a/src/tool_operate.c b/src/tool_operate.c
|
|
|
0d1c57 |
index 185f9c6..052def1 100644
|
|
|
0d1c57 |
--- a/src/tool_operate.c
|
|
|
0d1c57 |
+++ b/src/tool_operate.c
|
|
|
0d1c57 |
@@ -1109,7 +1109,8 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
#endif
|
|
|
0d1c57 |
|
|
|
0d1c57 |
- my_setopt_enum(curl, CURLOPT_SSLVERSION, config->ssl_version);
|
|
|
0d1c57 |
+ my_setopt_enum(curl, CURLOPT_SSLVERSION,
|
|
|
0d1c57 |
+ config->ssl_version | config->ssl_version_max);
|
|
|
0d1c57 |
my_setopt_enum(curl, CURLOPT_TIMECONDITION, config->timecond);
|
|
|
0d1c57 |
my_setopt(curl, CURLOPT_TIMEVALUE, config->condtime);
|
|
|
0d1c57 |
my_setopt_str(curl, CURLOPT_CUSTOMREQUEST, config->customrequest);
|
|
|
0d1c57 |
diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c
|
|
|
0d1c57 |
index 5d6f8bb..5ceddb2 100644
|
|
|
0d1c57 |
--- a/src/tool_paramhlp.c
|
|
|
0d1c57 |
+++ b/src/tool_paramhlp.c
|
|
|
0d1c57 |
@@ -405,3 +405,35 @@ long delegation(struct Configurable *config, char *str)
|
|
|
0d1c57 |
return CURLGSSAPI_DELEGATION_NONE;
|
|
|
0d1c57 |
}
|
|
|
0d1c57 |
|
|
|
0d1c57 |
+/*
|
|
|
0d1c57 |
+ * Parse the string and modify ssl_version in the val argument. Return PARAM_OK
|
|
|
0d1c57 |
+ * on success, otherwise a parameter error enum. ONLY ACCEPTS POSITIVE NUMBERS!
|
|
|
0d1c57 |
+ *
|
|
|
0d1c57 |
+ * Since this function gets called with the 'nextarg' pointer from within the
|
|
|
0d1c57 |
+ * getparameter a lot, we must check it for NULL before accessing the str
|
|
|
0d1c57 |
+ * data.
|
|
|
0d1c57 |
+ */
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
+ParameterError str2tls_max(long *val, const char *str)
|
|
|
0d1c57 |
+{
|
|
|
0d1c57 |
+ static struct s_tls_max {
|
|
|
0d1c57 |
+ const char *tls_max_str;
|
|
|
0d1c57 |
+ long tls_max;
|
|
|
0d1c57 |
+ } const tls_max_array[] = {
|
|
|
0d1c57 |
+ { "default", CURL_SSLVERSION_MAX_DEFAULT },
|
|
|
0d1c57 |
+ { "1.0", CURL_SSLVERSION_MAX_TLSv1_0 },
|
|
|
0d1c57 |
+ { "1.1", CURL_SSLVERSION_MAX_TLSv1_1 },
|
|
|
0d1c57 |
+ { "1.2", CURL_SSLVERSION_MAX_TLSv1_2 },
|
|
|
0d1c57 |
+ { "1.3", CURL_SSLVERSION_MAX_TLSv1_3 }
|
|
|
0d1c57 |
+ };
|
|
|
0d1c57 |
+ size_t i = 0;
|
|
|
0d1c57 |
+ if(!str)
|
|
|
0d1c57 |
+ return PARAM_REQUIRES_PARAMETER;
|
|
|
0d1c57 |
+ for(i = 0; i < sizeof(tls_max_array)/sizeof(tls_max_array[0]); i++) {
|
|
|
0d1c57 |
+ if(!strcmp(str, tls_max_array[i].tls_max_str)) {
|
|
|
0d1c57 |
+ *val = tls_max_array[i].tls_max;
|
|
|
0d1c57 |
+ return PARAM_OK;
|
|
|
0d1c57 |
+ }
|
|
|
0d1c57 |
+ }
|
|
|
0d1c57 |
+ return PARAM_BAD_USE;
|
|
|
0d1c57 |
+}
|
|
|
0d1c57 |
diff --git a/src/tool_paramhlp.h b/src/tool_paramhlp.h
|
|
|
0d1c57 |
index de1604e..c848d1c 100644
|
|
|
0d1c57 |
--- a/src/tool_paramhlp.h
|
|
|
0d1c57 |
+++ b/src/tool_paramhlp.h
|
|
|
0d1c57 |
@@ -48,5 +48,7 @@ int ftpcccmethod(struct Configurable *config, const char *str);
|
|
|
0d1c57 |
|
|
|
0d1c57 |
long delegation(struct Configurable *config, char *str);
|
|
|
0d1c57 |
|
|
|
0d1c57 |
+ParameterError str2tls_max(long *val, const char *str);
|
|
|
0d1c57 |
+
|
|
|
0d1c57 |
#endif /* HEADER_CURL_TOOL_PARAMHLP_H */
|
|
|
0d1c57 |
|
|
|
0d1c57 |
--
|
|
|
0d1c57 |
2.20.1
|
|
|
0d1c57 |
|
|
|
0d1c57 |
|
|
|
0d1c57 |
From 6a332224ba66b7ad21f6a874af94c1b7441ca19f Mon Sep 17 00:00:00 2001
|
|
|
0d1c57 |
From: Hubert Kario <hkario@redhat.com>
|
|
|
0d1c57 |
Date: Fri, 17 May 2019 17:15:24 +0000
|
|
|
0d1c57 |
Subject: [PATCH 4/5] nss: allow to specify TLS 1.3 ciphers if supported by NSS
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Closes #3916
|
|
|
0d1c57 |
|
|
|
0d1c57 |
Upstream-commit: 319ae9075efba769c9d5e98e827bb325ad0fcb6f
|
|
|
0d1c57 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
0d1c57 |
---
|
|
|
0d1c57 |
lib/nss.c | 5 +++++
|
|
|
0d1c57 |
1 file changed, 5 insertions(+)
|
|
|
0d1c57 |
|
|
|
0d1c57 |
diff --git a/lib/nss.c b/lib/nss.c
|
|
|
0d1c57 |
index d8e481b..330387c 100644
|
|
|
0d1c57 |
--- a/lib/nss.c
|
|
|
0d1c57 |
+++ b/lib/nss.c
|
|
|
0d1c57 |
@@ -195,6 +195,11 @@ static const cipher_s cipherlist[] = {
|
|
|
0d1c57 |
{"dhe_rsa_chacha20_poly1305_sha_256",
|
|
|
0d1c57 |
TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256},
|
|
|
0d1c57 |
#endif
|
|
|
0d1c57 |
+#ifdef TLS_AES_256_GCM_SHA384
|
|
|
0d1c57 |
+ {"aes_128_gcm_sha_256", TLS_AES_128_GCM_SHA256},
|
|
|
0d1c57 |
+ {"aes_256_gcm_sha_384", TLS_AES_256_GCM_SHA384},
|
|
|
0d1c57 |
+ {"chacha20_poly1305_sha_256", TLS_CHACHA20_POLY1305_SHA256},
|
|
|
0d1c57 |
+#endif
|
|
|
0d1c57 |
};
|
|
|
0d1c57 |
|
|
|
0d1c57 |
static const char* pem_library = "libnsspem.so";
|
|
|
0d1c57 |
--
|
|
|
0d1c57 |
2.20.1
|
|
|
0d1c57 |
|
|
|
0d1c57 |
|
|
|
0d1c57 |
From 268dcd88beb3d270d5aaeda473d51550ea9a3f84 Mon Sep 17 00:00:00 2001
|
|
|
0d1c57 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
0d1c57 |
Date: Mon, 3 Jun 2019 12:31:21 +0200
|
|
|
0d1c57 |
Subject: [PATCH 5/5] nss: make `curl --tlsv1` compatible with
|
|
|
0d1c57 |
curl-7.29.0-52.el7
|
|
|
0d1c57 |
|
|
|
0d1c57 |
---
|
|
|
0d1c57 |
lib/nss.c | 4 +++-
|
|
|
0d1c57 |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
0d1c57 |
|
|
|
0d1c57 |
diff --git a/lib/nss.c b/lib/nss.c
|
|
|
0d1c57 |
index 330387c..f963c63 100644
|
|
|
0d1c57 |
--- a/lib/nss.c
|
|
|
0d1c57 |
+++ b/lib/nss.c
|
|
|
0d1c57 |
@@ -1350,7 +1350,9 @@ static CURLcode nss_init_sslver(SSLVersionRange *sslver,
|
|
|
0d1c57 |
const long min = data->set.ssl.version;
|
|
|
0d1c57 |
const long max = data->set.ssl.version_max;
|
|
|
0d1c57 |
|
|
|
0d1c57 |
- if(min == CURL_SSLVERSION_DEFAULT || max == CURL_SSLVERSION_MAX_DEFAULT) {
|
|
|
0d1c57 |
+ if(min == CURL_SSLVERSION_DEFAULT || max == CURL_SSLVERSION_MAX_DEFAULT
|
|
|
0d1c57 |
+ || min == CURL_SSLVERSION_TLSv1)
|
|
|
0d1c57 |
+ {
|
|
|
0d1c57 |
/* map CURL_SSLVERSION_DEFAULT to NSS default */
|
|
|
0d1c57 |
if(SSL_VersionRangeGetDefault(ssl_variant_stream, sslver) != SECSuccess)
|
|
|
0d1c57 |
return CURLE_SSL_CONNECT_ERROR;
|
|
|
0d1c57 |
--
|
|
|
0d1c57 |
2.20.1
|
|
|
0d1c57 |
|