cert: Use builtin verifier on Android and Linux

This commit is contained in:
klzgrad 2021-05-16 00:46:34 +08:00
parent 434dab01ee
commit 9dc8a135ce
5 changed files with 10 additions and 6 deletions

View File

@ -1142,7 +1142,6 @@ component("net") {
"android/radio_activity_tracker.h", "android/radio_activity_tracker.h",
"android/traffic_stats.h", "android/traffic_stats.h",
"cert/cert_verify_proc_android.h", "cert/cert_verify_proc_android.h",
"cert/test_root_certs_android.cc",
"proxy_resolution/proxy_config_service_android.h", "proxy_resolution/proxy_config_service_android.h",
] ]
} }
@ -1184,6 +1183,7 @@ component("net") {
"base/network_interfaces_linux.cc", "base/network_interfaces_linux.cc",
"base/network_interfaces_linux.h", "base/network_interfaces_linux.h",
"base/platform_mime_util_linux.cc", "base/platform_mime_util_linux.cc",
"cert/test_root_certs_builtin.cc",
] ]
} }

View File

@ -87,7 +87,8 @@ std::unique_ptr<CertVerifier> CertVerifier::CreateDefaultWithoutCaching(
} }
#endif #endif
if (!verify_proc) { if (!verify_proc) {
#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
BUILDFLAG(IS_ANDROID)
verify_proc = verify_proc =
CertVerifyProc::CreateBuiltinVerifyProc(std::move(cert_net_fetcher)); CertVerifyProc::CreateBuiltinVerifyProc(std::move(cert_net_fetcher));
#else #else

View File

@ -52,7 +52,8 @@
#include "url/url_canon.h" #include "url/url_canon.h"
#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(USE_NSS_CERTS) || BUILDFLAG(IS_MAC) || \ #if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(USE_NSS_CERTS) || BUILDFLAG(IS_MAC) || \
BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED) || BUILDFLAG(IS_ANDROID) || \
BUILDFLAG(IS_LINUX)
#include "net/cert/cert_verify_proc_builtin.h" #include "net/cert/cert_verify_proc_builtin.h"
#endif #endif
@ -525,7 +526,8 @@ scoped_refptr<CertVerifyProc> CertVerifyProc::CreateSystemVerifyProc(
} }
#endif #endif
#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(USE_NSS_CERTS) #if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(USE_NSS_CERTS) || \
BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
// static // static
scoped_refptr<CertVerifyProc> CertVerifyProc::CreateBuiltinVerifyProc( scoped_refptr<CertVerifyProc> CertVerifyProc::CreateBuiltinVerifyProc(
scoped_refptr<CertNetFetcher> cert_net_fetcher) { scoped_refptr<CertNetFetcher> cert_net_fetcher) {

View File

@ -88,7 +88,8 @@ class NET_EXPORT CertVerifyProc
scoped_refptr<CertNetFetcher> cert_net_fetcher); scoped_refptr<CertNetFetcher> cert_net_fetcher);
#endif #endif
#if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(USE_NSS_CERTS) #if BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(USE_NSS_CERTS) || \
BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
// Creates and returns a CertVerifyProcBuiltin using the SSL SystemTrustStore. // Creates and returns a CertVerifyProcBuiltin using the SSL SystemTrustStore.
static scoped_refptr<CertVerifyProc> CreateBuiltinVerifyProc( static scoped_refptr<CertVerifyProc> CreateBuiltinVerifyProc(
scoped_refptr<CertNetFetcher> cert_net_fetcher); scoped_refptr<CertNetFetcher> cert_net_fetcher);

View File

@ -17,7 +17,7 @@
#include "net/cert/x509_certificate.h" #include "net/cert/x509_certificate.h"
#if BUILDFLAG(USE_NSS_CERTS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || \ #if BUILDFLAG(USE_NSS_CERTS) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_APPLE) || \
BUILDFLAG(IS_FUCHSIA) BUILDFLAG(IS_FUCHSIA) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX)
// When not defined, the EVRootCAMetadata singleton is a dumb placeholder // When not defined, the EVRootCAMetadata singleton is a dumb placeholder
// implementation that will fail all EV lookup operations. // implementation that will fail all EV lookup operations.
#define PLATFORM_USES_CHROMIUM_EV_METADATA #define PLATFORM_USES_CHROMIUM_EV_METADATA