Commit ad6f502b authored by rsleevi's avatar rsleevi Committed by Commit bot

Remove the SHA-1 deprecation field trial code; the plan is live

BUG=480919

Review URL: https://codereview.chromium.org/1102063002

Cr-Commit-Position: refs/heads/master@{#326849}
parent 87a25e53
......@@ -117,11 +117,7 @@ jboolean IsDeprecatedSHA1Present(JNIEnv* env,
static const int64_t kJanuary2016 = INT64_C(13096080000000000);
if (content::CertStore::GetInstance()->RetrieveCert(ssl.cert_id, &cert) &&
(ssl.cert_status & net::CERT_STATUS_SHA1_SIGNATURE_PRESENT) &&
cert->valid_expiry() > base::Time::FromInternalValue(kJanuary2016) &&
// NOTE: This use of SHA1IdentityUIWarning needs to be kept in sync
// with WebsiteSettings::Init().
base::FieldTrialList::FindFullName("SHA1IdentityUIWarning") ==
"Enabled") {
cert->valid_expiry() > base::Time::FromInternalValue(kJanuary2016)) {
return true;
}
}
......
......@@ -51,20 +51,6 @@ using content::WebContents;
namespace {
// Converts a SHA-1 field trial group into the appropriate SecurityLevel.
bool GetSecurityLevelForFieldTrialGroup(const std::string& group,
ToolbarModel::SecurityLevel* level) {
if (group == "Error")
*level = ToolbarModel::SECURITY_ERROR;
else if (group == "Warning")
*level = ToolbarModel::SECURITY_WARNING;
else if (group == "HTTP")
*level = ToolbarModel::NONE;
else
return false;
return true;
}
ToolbarModel::SecurityLevel GetSecurityLevelForNonSecureFieldTrial() {
std::string choice = base::CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::kMarkNonSecureAs);
......@@ -136,37 +122,16 @@ ToolbarModel::SecurityLevel ToolbarModelImpl::GetSecurityLevelForWebContents(
// The internal representation of the dates for UI treatment of SHA-1.
// See http://crbug.com/401365 for details
static const int64_t kJanuary2017 = INT64_C(13127702400000000);
static const int64_t kJune2016 = INT64_C(13109213000000000);
// kJanuary2016 needs to be kept in sync with
// ToolbarModelAndroid::IsDeprecatedSHA1Present().
static const int64_t kJanuary2016 = INT64_C(13096080000000000);
ToolbarModel::SecurityLevel security_level = NONE;
// Gated behind a field trial, so that it is possible to adjust the
// UI treatment (to be more or less severe, as necessary) over the
// course of multiple releases.
// See http://crbug.com/401365 for the timeline, with the end state
// being that > kJanuary2017 = Error, and > kJanuary2016 =
// Warning, and kJune2016 disappearing entirely.
if (cert->valid_expiry() >=
base::Time::FromInternalValue(kJanuary2017) &&
GetSecurityLevelForFieldTrialGroup(
base::FieldTrialList::FindFullName("SHA1ToolbarUIJanuary2017"),
&security_level)) {
return security_level;
}
if (cert->valid_expiry() >= base::Time::FromInternalValue(kJune2016) &&
GetSecurityLevelForFieldTrialGroup(
base::FieldTrialList::FindFullName("SHA1ToolbarUIJune2016"),
&security_level)) {
return security_level;
base::Time::FromInternalValue(kJanuary2017)) {
return SECURITY_ERROR;
}
if (cert->valid_expiry() >=
base::Time::FromInternalValue(kJanuary2016) &&
GetSecurityLevelForFieldTrialGroup(
base::FieldTrialList::FindFullName("SHA1ToolbarUIJanuary2016"),
&security_level)) {
return security_level;
base::Time::FromInternalValue(kJanuary2016)) {
return SECURITY_WARNING;
}
}
if (net::IsCertStatusError(ssl.cert_status)) {
......
......@@ -512,11 +512,7 @@ void WebsiteSettings::Init(Profile* profile,
static const int64_t kSHA1LastIssuanceDate = INT64_C(13096080000000000);
if ((ssl.cert_status & net::CERT_STATUS_SHA1_SIGNATURE_PRESENT) &&
cert->valid_expiry() >
base::Time::FromInternalValue(kSHA1LastIssuanceDate) &&
// NOTE: This use of SHA1IdentityUIWarning needs to be kept in sync
// with ToolbarModelImpl::IsDeprecatedSHA1Present().
base::FieldTrialList::FindFullName("SHA1IdentityUIWarning") ==
"Enabled") {
base::Time::FromInternalValue(kSHA1LastIssuanceDate)) {
site_identity_status_ =
SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM;
site_identity_details_ +=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment