Related: CVE-2016-5420 - fix incorrect use of a previously loaded certificate from file

This commit is contained in:
Kamil Dudka 2016-08-26 15:36:16 +02:00
parent 2fd0a39aee
commit 0f6a97db34
2 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From ec122e23098aad8b6e3d97070cca5858b72558e2 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Mon, 22 Aug 2016 10:24:35 +0200
Subject: [PATCH] nss: refuse previously loaded certificate from file
... when we are not asked to use a certificate from file
Upstream-commit: 7700fcba64bf5806de28f6c1c7da3b4f0b38567d
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
lib/vtls/nss.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index ad33f25..e467360 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -1004,10 +1004,10 @@ static SECStatus SelectClientCert(void *arg, PRFileDesc *sock,
struct ssl_connect_data *connssl = (struct ssl_connect_data *)arg;
struct Curl_easy *data = connssl->data;
const char *nickname = connssl->client_nickname;
+ static const char pem_slotname[] = "PEM Token #1";
if(connssl->obj_clicert) {
/* use the cert/key provided by PEM reader */
- static const char pem_slotname[] = "PEM Token #1";
SECItem cert_der = { 0, NULL, 0 };
void *proto_win = SSL_RevealPinArg(sock);
struct CERTCertificateStr *cert;
@@ -1069,6 +1069,12 @@ static SECStatus SelectClientCert(void *arg, PRFileDesc *sock,
if(NULL == nickname)
nickname = "[unknown]";
+ if(!strncmp(nickname, pem_slotname, sizeof(pem_slotname) - 1U)) {
+ failf(data, "NSS: refusing previously loaded certificate from file: %s",
+ nickname);
+ return SECFailure;
+ }
+
if(NULL == *pRetKey) {
failf(data, "NSS: private key not found for certificate: %s", nickname);
return SECFailure;
--
2.7.4

View File

@ -1,11 +1,15 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.50.1
Release: 1%{?dist}
Release: 2%{?dist}
License: MIT
Group: Applications/Internet
Source: http://curl.haxx.se/download/%{name}-%{version}.tar.lzma
# fix incorrect use of a previously loaded certificate from file
# (related to CVE-2016-5420)
Patch1: 0001-curl-7.51.0-cert-reuse.patch
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@ -128,6 +132,7 @@ documentation of the library, too.
%setup -q
# upstream patches
%patch1 -p1
# Fedora patches
%patch101 -p1
@ -232,6 +237,10 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/aclocal/libcurl.m4
%changelog
* Fri Aug 26 2016 Kamil Dudka <kdudka@redhat.com> 7.50.1-2
- fix incorrect use of a previously loaded certificate from file
(related to CVE-2016-5420)
* Wed Aug 03 2016 Kamil Dudka <kdudka@redhat.com> 7.50.1-1
- new upstream release (fixes CVE-2016-5419, CVE-2016-5420, and CVE-2016-5421)