Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2024-01-25 12:22:19 +08:00
commit 35252384aa
16 changed files with 39 additions and 216 deletions

View file

@ -658,8 +658,11 @@ nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
*aCached = true;
}
if (siteState.mHSTSState == SecurityPropertySet) {
*aResult = siteState.mHSTSIncludeSubdomains;
break;
// We do not break here, and continue to walk up the domain in case
// any parent domain has HSTS set with included subdomains in which
// case it will take precedence. See RFC 6797.
// We latch the result with an or-assignment.
*aResult |= siteState.mHSTSIncludeSubdomains;
} else if (siteState.mHSTSState == SecurityPropertyNegative) {
*aResult = false;
break;
@ -675,7 +678,6 @@ nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
SSSLOG(("no HSTS data for %s found, walking up domain", subdomain));
}
// Use whatever we ended up with, which defaults to false.
return NS_OK;
}

View file

@ -441,7 +441,12 @@ ssl_SendSavedWriteData(sslSocket *ss)
if (rv < 0) {
return rv;
}
ss->pendingBuf.len -= rv;
if (rv > ss->pendingBuf.len) {
PORT_Assert(0); /* This shouldn't happen */
ss->pendingBuf.len = 0;
} else {
ss->pendingBuf.len -= rv;
}
if (ss->pendingBuf.len > 0 && rv > 0) {
/* UGH !! This shifts the whole buffer down by copying it */
PORT_Memmove(ss->pendingBuf.buf, ss->pendingBuf.buf + rv,