Commit f9a7141c authored by Pavol Marko's avatar Pavol Marko Committed by Commit Bot

Add cmd line switch to force CertVerifierBuiltin

This can be used in testing so it's easy to test with
CertVerifierBuiltin without setting up a local finch instances.

Also promote logging of chosen cert verifier to VLOG(0) so it's visibe
in test logs and potentially also if a user reports cert verification
errors,

                    --force-cert-verifier-builtin
      (watch log output for chosen cert verifier)

Bug: 978069
Test: browser_tests --gtest_filter=*SSLUITest* \
Change-Id: I74981fa0a2aecb94b7eab129ab5da155f18847a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715348Reviewed-by: default avatarRyan Sleevi <rsleevi@chromium.org>
Commit-Queue: Pavol Marko <pmarko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680164}
parent 676e4ce9
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/policy/profile_policy_connector.h"
#include "chromeos/constants/chromeos_switches.h"
#include "components/user_manager/user.h" #include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
#endif #endif
...@@ -101,6 +102,10 @@ Profile* GetPrimaryProfile() { ...@@ -101,6 +102,10 @@ Profile* GetPrimaryProfile() {
} }
bool ShouldUseBuiltinCertVerifier(Profile* profile) { bool ShouldUseBuiltinCertVerifier(Profile* profile) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(chromeos::switches::kForceCertVerifierBuiltin))
return true;
if (chromeos::ProfileHelper::Get()->IsSigninProfile(profile) || if (chromeos::ProfileHelper::Get()->IsSigninProfile(profile) ||
chromeos::ProfileHelper::Get()->IsLockScreenAppProfile(profile)) { chromeos::ProfileHelper::Get()->IsLockScreenAppProfile(profile)) {
// No need to override the feature-set setting through policy for sign-in // No need to override the feature-set setting through policy for sign-in
...@@ -181,8 +186,8 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) ...@@ -181,8 +186,8 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile)
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
using_builtin_cert_verifier_ = ShouldUseBuiltinCertVerifier(profile_); using_builtin_cert_verifier_ = ShouldUseBuiltinCertVerifier(profile_);
DVLOG(1) << "Using " << (using_builtin_cert_verifier_ ? "built-in" : "legacy") VLOG(0) << "Using " << (using_builtin_cert_verifier_ ? "built-in" : "legacy")
<< " cert verifier."; << " cert verifier.";
#endif #endif
// When any of the following CT preferences change, we schedule an update // When any of the following CT preferences change, we schedule an update
// to aggregate the actual update using a |ct_policy_update_timer_|. // to aggregate the actual update using a |ct_policy_update_timer_|.
......
...@@ -345,6 +345,11 @@ const char kFakeDriveFsLauncherChrootPath[] = ...@@ -345,6 +345,11 @@ const char kFakeDriveFsLauncherChrootPath[] =
const char kFakeDriveFsLauncherSocketPath[] = const char kFakeDriveFsLauncherSocketPath[] =
"fake-drivefs-launcher-socket-path"; "fake-drivefs-launcher-socket-path";
// Forces Chrome to use CertVerifyProcBuiltin for verification of server
// certificates, ignoring the status of
// net::features::kCertVerifierBuiltinFeature.
const char kForceCertVerifierBuiltin[] = "force-cert-verifier-builtin";
// Passed to Chrome the first time that it's run after the system boots. // Passed to Chrome the first time that it's run after the system boots.
// Not passed on restart after sign out. // Not passed on restart after sign out.
const char kFirstExecAfterBoot[] = "first-exec-after-boot"; const char kFirstExecAfterBoot[] = "first-exec-after-boot";
......
...@@ -136,6 +136,8 @@ extern const char kFakeDriveFsLauncherChrootPath[]; ...@@ -136,6 +136,8 @@ extern const char kFakeDriveFsLauncherChrootPath[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kFakeDriveFsLauncherSocketPath[]; extern const char kFakeDriveFsLauncherSocketPath[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kForceCertVerifierBuiltin[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kForceDevToolsAvailable[]; extern const char kForceDevToolsAvailable[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kForceFirstRunUI[]; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kForceFirstRunUI[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
......
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