summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-07 15:55:24 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-09-07 15:55:24 (GMT)
commit4dda1812f0c4d31eb587204098b05b20f796e67d (patch)
tree2eaf594b744bd9724ec9d90118dc4fd5d2903dee /Utilities
parent7f7e5eafd8bc00259c9922a68a60c06ab67c91a9 (diff)
parent4b53a693bd804b15380e8adfafc4de47f3f3e50e (diff)
downloadCMake-4dda1812f0c4d31eb587204098b05b20f796e67d.zip
CMake-4dda1812f0c4d31eb587204098b05b20f796e67d.tar.gz
CMake-4dda1812f0c4d31eb587204098b05b20f796e67d.tar.bz2
Merge topic 'backport-curl-fix'
4b53a693 curl: Backport certificate reuse fix from 7.50.2
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmcurl/lib/vtls/nss.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Utilities/cmcurl/lib/vtls/nss.c b/Utilities/cmcurl/lib/vtls/nss.c
index ad33f25..e467360 100644
--- a/Utilities/cmcurl/lib/vtls/nss.c
+++ b/Utilities/cmcurl/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;