Update NSS to 3.48 while keeping vc2013 hackfix and no-sslkeylogfile intact.

This commit is contained in:
Roy Tam 2020-01-03 13:36:26 +08:00
commit 171849c8e5
351 changed files with 115185 additions and 57946 deletions

View file

@ -213,6 +213,9 @@ printSecurityInfo(PRFileDesc *fd)
" %u\n",
scts->len);
}
if (channel.peerDelegCred) {
fprintf(stderr, "Received a Delegated Credential\n");
}
}
static void
@ -272,6 +275,7 @@ PrintParameterUsage()
fprintf(stderr, "%-20s Enable false start.\n", "-g");
fprintf(stderr, "%-20s Enable the cert_status extension (OCSP stapling).\n", "-T");
fprintf(stderr, "%-20s Enable the signed_certificate_timestamp extension.\n", "-U");
fprintf(stderr, "%-20s Enable the delegated credentials extension.\n", "-B");
fprintf(stderr, "%-20s Require fresh revocation info from side channel.\n"
"%-20s -F once means: require for server cert only\n"
"%-20s -F twice means: require for intermediates, too\n"
@ -314,6 +318,13 @@ PrintParameterUsage()
fprintf(stderr, "%-20s Enable post-handshake authentication\n"
"%-20s for TLS 1.3; need to specify -n\n",
"-E", "");
fprintf(stderr, "%-20s Export and print keying material after successful handshake.\n"
"%-20s The argument is a comma separated list of exporters in the form:\n"
"%-20s LABEL[:OUTPUT-LENGTH[:CONTEXT]]\n"
"%-20s where LABEL and CONTEXT can be either a free-form string or\n"
"%-20s a hex string if it is preceded by \"0x\"; OUTPUT-LENGTH\n"
"%-20s is a decimal integer.\n",
"-x", "", "", "", "", "");
}
static void
@ -920,7 +931,7 @@ restartHandshakeAfterServerCertIfNeeded(PRFileDesc *fd,
PRBool override)
{
SECStatus rv;
PRErrorCode error;
PRErrorCode error = 0;
if (!serverCertAuth->isPaused)
return SECSuccess;
@ -993,6 +1004,9 @@ char *versionString = NULL;
PRBool handshakeComplete = PR_FALSE;
char *encryptedSNIKeys = NULL;
PRBool enablePostHandshakeAuth = PR_FALSE;
PRBool enableDelegatedCredentials = PR_FALSE;
const secuExporter *enabledExporters = NULL;
unsigned int enabledExporterCount = 0;
static int
writeBytesToServer(PRFileDesc *s, const PRUint8 *buf, int nb)
@ -1088,6 +1102,18 @@ handshakeCallback(PRFileDesc *fd, void *client_data)
requestToExit = PR_TRUE;
}
handshakeComplete = PR_TRUE;
if (enabledExporters) {
SECStatus rv;
rv = exportKeyingMaterials(fd, enabledExporters, enabledExporterCount);
if (rv != SECSuccess) {
PRErrorCode err = PR_GetError();
FPRINTF(stderr,
"couldn't export keying material: %s\n",
SECU_Strerror(err));
}
}
}
static SECStatus
@ -1308,8 +1334,11 @@ run()
}
if (cipher > 0) {
rv = SSL_CipherPrefSet(s, cipher, SSL_ALLOWED);
if (rv != SECSuccess)
if (rv != SECSuccess) {
SECU_PrintError(progName, "SSL_CipherPrefSet()");
error = 1;
goto done;
}
} else {
Usage();
}
@ -1365,6 +1394,14 @@ run()
goto done;
}
/* enable negotiation of delegated credentials (draft-ietf-tls-subcerts) */
rv = SSL_OptionSet(s, SSL_ENABLE_DELEGATED_CREDENTIALS, enableDelegatedCredentials);
if (rv != SECSuccess) {
SECU_PrintError(progName, "error enabling delegated credentials");
error = 1;
goto done;
}
/* enable extended master secret mode */
if (enableExtendedMasterSecret) {
rv = SSL_OptionSet(s, SSL_ENABLE_EXTENDED_MASTER_SECRET, PR_TRUE);
@ -1715,12 +1752,11 @@ main(int argc, char **argv)
}
}
/* Note: 'B' was used in the past but removed in 3.28
* 'z' was removed in 3.39
/* Note: 'z' was removed in 3.39
* Please leave some time before reusing these.
*/
optstate = PL_CreateOptState(argc, argv,
"46A:CDEFGHI:J:KL:M:N:OP:QR:STUV:W:X:YZa:bc:d:fgh:m:n:op:qr:st:uvw:");
"46A:BCDEFGHI:J:KL:M:N:OP:QR:STUV:W:X:YZa:bc:d:fgh:m:n:op:qr:st:uvw:x:");
while ((optstatus = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
switch (optstate->option) {
case '?':
@ -1743,6 +1779,10 @@ main(int argc, char **argv)
requestFile = PORT_Strdup(optstate->value);
break;
case 'B':
enableDelegatedCredentials = PR_TRUE;
break;
case 'C':
++dumpServerChain;
break;
@ -1964,6 +2004,17 @@ main(int argc, char **argv)
Usage();
}
break;
case 'x':
rv = parseExporters(optstate->value,
&enabledExporters,
&enabledExporterCount);
if (rv != SECSuccess) {
PL_DestroyOptState(optstate);
fprintf(stderr, "Bad exporter specified.\n");
Usage();
}
break;
}
}
PL_DestroyOptState(optstate);