|
|
105fd7 |
From 1b6dc2b543446401fd38795f1ccf2b93633f01c0 Mon Sep 17 00:00:00 2001
|
|
|
105fd7 |
From: Daniel Stenberg <daniel@haxx.se>
|
|
|
105fd7 |
Date: Sun, 31 Jul 2016 00:51:48 +0200
|
|
|
105fd7 |
Subject: [PATCH 1/2] TLS: only reuse connections with the same client cert
|
|
|
105fd7 |
|
|
|
105fd7 |
CVE-2016-5420
|
|
|
105fd7 |
Bug: https://curl.haxx.se/docs/adv_20160803B.html
|
|
|
105fd7 |
|
|
|
105fd7 |
Upstream-commit: 11ec5ad4352bba384404c56e77c7fab9382fd22d
|
|
|
105fd7 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
105fd7 |
---
|
|
|
105fd7 |
lib/sslgen.c | 1 +
|
|
|
105fd7 |
1 file changed, 1 insertion(+)
|
|
|
105fd7 |
|
|
|
105fd7 |
diff --git a/lib/sslgen.c b/lib/sslgen.c
|
|
|
105fd7 |
index 3036bb2..79cbb6f 100644
|
|
|
105fd7 |
--- a/lib/sslgen.c
|
|
|
105fd7 |
+++ b/lib/sslgen.c
|
|
|
105fd7 |
@@ -90,6 +90,7 @@ Curl_ssl_config_matches(struct ssl_config_data* data,
|
|
|
105fd7 |
(data->verifyhost == needle->verifyhost) &&
|
|
|
105fd7 |
safe_strequal(data->CApath, needle->CApath) &&
|
|
|
105fd7 |
safe_strequal(data->CAfile, needle->CAfile) &&
|
|
|
105fd7 |
+ safe_strequal(data->clientcert, needle->clientcert) &&
|
|
|
105fd7 |
safe_strequal(data->random_file, needle->random_file) &&
|
|
|
105fd7 |
safe_strequal(data->egdsocket, needle->egdsocket) &&
|
|
|
105fd7 |
safe_strequal(data->cipher_list, needle->cipher_list))
|
|
|
105fd7 |
--
|
|
|
105fd7 |
2.5.5
|
|
|
105fd7 |
|
|
|
105fd7 |
|
|
|
105fd7 |
From 1a7116f8607868b26355c512e5844a9b85f16daf Mon Sep 17 00:00:00 2001
|
|
|
105fd7 |
From: Kamil Dudka <kdudka@redhat.com>
|
|
|
105fd7 |
Date: Mon, 22 Aug 2016 10:24:35 +0200
|
|
|
105fd7 |
Subject: [PATCH 2/2] nss: refuse previously loaded certificate from file
|
|
|
105fd7 |
|
|
|
105fd7 |
... when we are not asked to use a certificate from file
|
|
|
105fd7 |
|
|
|
105fd7 |
Upstream-commit: 7700fcba64bf5806de28f6c1c7da3b4f0b38567d
|
|
|
105fd7 |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
105fd7 |
---
|
|
|
105fd7 |
lib/nss.c | 8 +++++++-
|
|
|
105fd7 |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
105fd7 |
|
|
|
105fd7 |
diff --git a/lib/nss.c b/lib/nss.c
|
|
|
105fd7 |
index 1f02988..7b4fe57 100644
|
|
|
105fd7 |
--- a/lib/nss.c
|
|
|
105fd7 |
+++ b/lib/nss.c
|
|
|
105fd7 |
@@ -760,10 +760,10 @@ static SECStatus SelectClientCert(void *arg, PRFileDesc *sock,
|
|
|
105fd7 |
struct ssl_connect_data *connssl = (struct ssl_connect_data *)arg;
|
|
|
105fd7 |
struct SessionHandle *data = connssl->data;
|
|
|
105fd7 |
const char *nickname = connssl->client_nickname;
|
|
|
105fd7 |
+ static const char pem_slotname[] = "PEM Token #1";
|
|
|
105fd7 |
|
|
|
105fd7 |
if(connssl->obj_clicert) {
|
|
|
105fd7 |
/* use the cert/key provided by PEM reader */
|
|
|
105fd7 |
- static const char pem_slotname[] = "PEM Token #1";
|
|
|
105fd7 |
SECItem cert_der = { 0, NULL, 0 };
|
|
|
105fd7 |
void *proto_win = SSL_RevealPinArg(sock);
|
|
|
105fd7 |
struct CERTCertificateStr *cert;
|
|
|
105fd7 |
@@ -825,6 +825,12 @@ static SECStatus SelectClientCert(void *arg, PRFileDesc *sock,
|
|
|
105fd7 |
if(NULL == nickname)
|
|
|
105fd7 |
nickname = "[unknown]";
|
|
|
105fd7 |
|
|
|
105fd7 |
+ if(!strncmp(nickname, pem_slotname, sizeof(pem_slotname) - 1U)) {
|
|
|
105fd7 |
+ failf(data, "NSS: refusing previously loaded certificate from file: %s",
|
|
|
105fd7 |
+ nickname);
|
|
|
105fd7 |
+ return SECFailure;
|
|
|
105fd7 |
+ }
|
|
|
105fd7 |
+
|
|
|
105fd7 |
if(NULL == *pRetKey) {
|
|
|
105fd7 |
failf(data, "NSS: private key not found for certificate: %s", nickname);
|
|
|
105fd7 |
return SECFailure;
|
|
|
105fd7 |
--
|
|
|
105fd7 |
2.7.4
|
|
|
105fd7 |
|