mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-22 00:17:32 +09:00
nss: update nss to hg rev 2d6adc7d8bfc with vc2013 hackfix
This commit is contained in:
parent
6a07ab8503
commit
0daf4d9cc9
17 changed files with 382 additions and 64 deletions
|
|
@ -2683,7 +2683,12 @@ ssl3_HandleNoCertificate(sslSocket *ss)
|
|||
PRFileDesc *lower;
|
||||
|
||||
ssl_UncacheSessionID(ss);
|
||||
SSL3_SendAlert(ss, alert_fatal, bad_certificate);
|
||||
|
||||
if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
|
||||
SSL3_SendAlert(ss, alert_fatal, certificate_required);
|
||||
} else {
|
||||
SSL3_SendAlert(ss, alert_fatal, bad_certificate);
|
||||
}
|
||||
|
||||
lower = ss->fd->lower;
|
||||
#ifdef _WIN32
|
||||
|
|
@ -2919,6 +2924,9 @@ ssl3_HandleAlert(sslSocket *ss, sslBuffer *buf)
|
|||
case no_certificate:
|
||||
error = SSL_ERROR_NO_CERTIFICATE;
|
||||
break;
|
||||
case certificate_required:
|
||||
error = SSL_ERROR_RX_CERTIFICATE_REQUIRED_ALERT;
|
||||
break;
|
||||
case bad_certificate:
|
||||
error = SSL_ERROR_BAD_CERT_ALERT;
|
||||
break;
|
||||
|
|
@ -3719,6 +3727,10 @@ ssl3_RestartHandshakeHashes(sslSocket *ss)
|
|||
PK11_DestroyContext(ss->ssl3.hs.sha, PR_TRUE);
|
||||
ss->ssl3.hs.sha = NULL;
|
||||
}
|
||||
if (ss->ssl3.hs.shaPostHandshake) {
|
||||
PK11_DestroyContext(ss->ssl3.hs.shaPostHandshake, PR_TRUE);
|
||||
ss->ssl3.hs.shaPostHandshake = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -3778,6 +3790,24 @@ ssl3_UpdateHandshakeHashes(sslSocket *ss, const unsigned char *b, unsigned int l
|
|||
return rv;
|
||||
}
|
||||
|
||||
SECStatus
|
||||
ssl3_UpdatePostHandshakeHashes(sslSocket *ss, const unsigned char *b, unsigned int l)
|
||||
{
|
||||
SECStatus rv = SECSuccess;
|
||||
|
||||
PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
|
||||
|
||||
PRINT_BUF(90, (ss, "post handshake hash input:", b, l));
|
||||
|
||||
PORT_Assert(ss->ssl3.hs.hashType == handshake_hash_single);
|
||||
PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
|
||||
rv = PK11_DigestOp(ss->ssl3.hs.shaPostHandshake, b, l);
|
||||
if (rv != SECSuccess) {
|
||||
PORT_SetError(SSL_ERROR_DIGEST_FAILURE);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
SECStatus
|
||||
ssl3_AppendHandshakeHeader(sslSocket *ss, SSLHandshakeType t, PRUint32 length)
|
||||
{
|
||||
|
|
@ -11623,7 +11653,8 @@ ssl3_FinishHandshake(sslSocket *ss)
|
|||
SECStatus
|
||||
ssl_HashHandshakeMessageInt(sslSocket *ss, SSLHandshakeType ct,
|
||||
PRUint32 dtlsSeq,
|
||||
const PRUint8 *b, PRUint32 length)
|
||||
const PRUint8 *b, PRUint32 length,
|
||||
sslUpdateHandshakeHashes updateHashes)
|
||||
{
|
||||
PRUint8 hdr[4];
|
||||
PRUint8 dtlsData[8];
|
||||
|
|
@ -11636,7 +11667,7 @@ ssl_HashHandshakeMessageInt(sslSocket *ss, SSLHandshakeType ct,
|
|||
hdr[2] = (PRUint8)(length >> 8);
|
||||
hdr[3] = (PRUint8)(length);
|
||||
|
||||
rv = ssl3_UpdateHandshakeHashes(ss, (unsigned char *)hdr, 4);
|
||||
rv = updateHashes(ss, (unsigned char *)hdr, 4);
|
||||
if (rv != SECSuccess)
|
||||
return rv; /* err code already set. */
|
||||
|
||||
|
|
@ -11656,14 +11687,13 @@ ssl_HashHandshakeMessageInt(sslSocket *ss, SSLHandshakeType ct,
|
|||
dtlsData[6] = (PRUint8)(length >> 8);
|
||||
dtlsData[7] = (PRUint8)(length);
|
||||
|
||||
rv = ssl3_UpdateHandshakeHashes(ss, (unsigned char *)dtlsData,
|
||||
sizeof(dtlsData));
|
||||
rv = updateHashes(ss, (unsigned char *)dtlsData, sizeof(dtlsData));
|
||||
if (rv != SECSuccess)
|
||||
return rv; /* err code already set. */
|
||||
}
|
||||
|
||||
/* The message body */
|
||||
rv = ssl3_UpdateHandshakeHashes(ss, b, length);
|
||||
rv = updateHashes(ss, b, length);
|
||||
if (rv != SECSuccess)
|
||||
return rv; /* err code already set. */
|
||||
|
||||
|
|
@ -11675,7 +11705,15 @@ ssl_HashHandshakeMessage(sslSocket *ss, SSLHandshakeType ct,
|
|||
const PRUint8 *b, PRUint32 length)
|
||||
{
|
||||
return ssl_HashHandshakeMessageInt(ss, ct, ss->ssl3.hs.recvMessageSeq,
|
||||
b, length);
|
||||
b, length, ssl3_UpdateHandshakeHashes);
|
||||
}
|
||||
|
||||
SECStatus
|
||||
ssl_HashPostHandshakeMessage(sslSocket *ss, SSLHandshakeType ct,
|
||||
const PRUint8 *b, PRUint32 length)
|
||||
{
|
||||
return ssl_HashHandshakeMessageInt(ss, ct, ss->ssl3.hs.recvMessageSeq,
|
||||
b, length, ssl3_UpdatePostHandshakeHashes);
|
||||
}
|
||||
|
||||
/* Called from ssl3_HandleHandshake() when it has gathered a complete ssl3
|
||||
|
|
@ -11714,9 +11752,11 @@ ssl3_HandleHandshakeMessage(sslSocket *ss, PRUint8 *b, PRUint32 length,
|
|||
break;
|
||||
|
||||
default:
|
||||
rv = ssl_HashHandshakeMessage(ss, ss->ssl3.hs.msg_type, b, length);
|
||||
if (rv != SECSuccess) {
|
||||
return SECFailure;
|
||||
if (!tls13_IsPostHandshake(ss)) {
|
||||
rv = ssl_HashHandshakeMessage(ss, ss->ssl3.hs.msg_type, b, length);
|
||||
if (rv != SECSuccess) {
|
||||
return SECFailure;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13129,6 +13169,9 @@ ssl3_DestroySSL3Info(sslSocket *ss)
|
|||
if (ss->ssl3.hs.sha) {
|
||||
PK11_DestroyContext(ss->ssl3.hs.sha, PR_TRUE);
|
||||
}
|
||||
if (ss->ssl3.hs.shaPostHandshake) {
|
||||
PK11_DestroyContext(ss->ssl3.hs.shaPostHandshake, PR_TRUE);
|
||||
}
|
||||
if (ss->ssl3.hs.messages.buf) {
|
||||
sslBuffer_Clear(&ss->ssl3.hs.messages);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue