mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:53:32 +03:00
nss: refuse previously loaded certificate from file
... when we are not asked to use a certificate from file
This commit is contained in:
parent
822082d832
commit
7700fcba64
2 changed files with 8 additions and 1 deletions
|
|
@ -1002,10 +1002,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;
|
||||
|
|
@ -1067,6 +1067,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue