Bug 1363546 - Store and report HSTS upgrade source r=francois,keeler,mayhemer p=francois

Add a field to the HSTS cache which indicates the source of the HSTS
entry if known, from the preload list, organically seen header, or HSTS
priming, or unknown otherwise. Also adds telemetry to collect the source
when upgrading in NS_ShouldSecureUpgrade.

MozReview-Commit-ID: 3IwyYe3Cn73
This commit is contained in:
Kate McKinley
2017-05-23 15:31:37 -07:00
parent 5ba23e7bd5
commit 8335b9a82e
39 changed files with 325 additions and 93 deletions

View File

@@ -5031,10 +5031,11 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
do_GetService(NS_SSSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HSTS, aURI,
flags, mOriginAttributes, nullptr, &isStsHost);
flags, mOriginAttributes, nullptr, nullptr,
&isStsHost);
NS_ENSURE_SUCCESS(rv, rv);
rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HPKP, aURI,
flags, mOriginAttributes, nullptr,
flags, mOriginAttributes, nullptr, nullptr,
&isPinnedHost);
NS_ENSURE_SUCCESS(rv, rv);
} else {