Index: content/browser/browser_main_runner.cc |
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc |
index 2585c8dd870f2d0e8b3c2805bb7b0f9b5611ba67..9ee9ee17a1b3bddffdaa8c3f95efbd3df769fe02 100644 |
--- a/content/browser/browser_main_runner.cc |
+++ b/content/browser/browser_main_runner.cc |
@@ -34,12 +34,8 @@ |
#endif |
#if defined(OS_WIN) |
-#include "base/win/win_util.h" |
#include "base/win/windows_version.h" |
-#include "net/cert/sha256_legacy_support_win.h" |
-#include "sandbox/win/src/sidestep/preamble_patcher.h" |
#include "ui/base/win/scoped_ole_initializer.h" |
-#include "ui/gfx/switches.h" |
#include "ui/gfx/win/direct_write.h" |
#endif |
@@ -49,86 +45,6 @@ namespace { |
bool g_exited_main_message_loop = false; |
-#if defined(OS_WIN) |
-#if !defined(_WIN64) |
-// Pointer to the original CryptVerifyCertificateSignatureEx function. |
-net::sha256_interception::CryptVerifyCertificateSignatureExFunc |
- g_real_crypt_verify_signature_stub = NULL; |
- |
-// Stub function that is called whenever the Crypt32 function |
-// CryptVerifyCertificateSignatureEx is called. It just defers to net to perform |
-// the actual verification. |
-BOOL WINAPI CryptVerifyCertificateSignatureExStub( |
- HCRYPTPROV_LEGACY provider, |
- DWORD encoding_type, |
- DWORD subject_type, |
- void* subject_data, |
- DWORD issuer_type, |
- void* issuer_data, |
- DWORD flags, |
- void* extra) { |
- return net::sha256_interception::CryptVerifyCertificateSignatureExHook( |
- g_real_crypt_verify_signature_stub, provider, encoding_type, subject_type, |
- subject_data, issuer_type, issuer_data, flags, extra); |
-} |
-#endif // !defined(_WIN64) |
- |
-// If necessary, install an interception |
-void InstallSha256LegacyHooks() { |
-#if defined(_WIN64) |
- // Interception on x64 is not supported. |
- return; |
-#else |
- if (base::win::MaybeHasSHA256Support()) |
- return; |
- |
- net::sha256_interception::CryptVerifyCertificateSignatureExFunc |
- cert_verify_signature_ptr = reinterpret_cast< |
- net::sha256_interception::CryptVerifyCertificateSignatureExFunc>( |
- ::GetProcAddress(::GetModuleHandle(L"crypt32.dll"), |
- "CryptVerifyCertificateSignatureEx")); |
- CHECK(cert_verify_signature_ptr); |
- |
- DWORD old_protect = 0; |
- if (!::VirtualProtect(cert_verify_signature_ptr, 5, PAGE_EXECUTE_READWRITE, |
- &old_protect)) { |
- return; |
- } |
- |
- g_real_crypt_verify_signature_stub = |
- reinterpret_cast< |
- net::sha256_interception::CryptVerifyCertificateSignatureExFunc>( |
- VirtualAllocEx(::GetCurrentProcess(), NULL, |
- sidestep::kMaxPreambleStubSize, MEM_COMMIT, |
- PAGE_EXECUTE_READWRITE)); |
- if (g_real_crypt_verify_signature_stub == NULL) { |
- CHECK(::VirtualProtect(cert_verify_signature_ptr, 5, old_protect, |
- &old_protect)); |
- return; |
- } |
- |
- sidestep::SideStepError patch_result = |
- sidestep::PreamblePatcher::Patch( |
- cert_verify_signature_ptr, CryptVerifyCertificateSignatureExStub, |
- g_real_crypt_verify_signature_stub, sidestep::kMaxPreambleStubSize); |
- if (patch_result != sidestep::SIDESTEP_SUCCESS) { |
- CHECK(::VirtualFreeEx(::GetCurrentProcess(), |
- g_real_crypt_verify_signature_stub, 0, |
- MEM_RELEASE)); |
- CHECK(::VirtualProtect(cert_verify_signature_ptr, 5, old_protect, |
- &old_protect)); |
- return; |
- } |
- |
- DWORD dummy = 0; |
- CHECK(::VirtualProtect(cert_verify_signature_ptr, 5, old_protect, &dummy)); |
- CHECK(::VirtualProtect(g_real_crypt_verify_signature_stub, |
- sidestep::kMaxPreambleStubSize, old_protect, |
- &old_protect)); |
-#endif // _WIN64 |
-} |
-#endif // OS_WIN |
- |
} // namespace |
class BrowserMainRunnerImpl : public BrowserMainRunner { |
@@ -180,7 +96,6 @@ class BrowserMainRunnerImpl : public BrowserMainRunner { |
// Win32 API here directly. |
ImmDisableTextFrameService(static_cast<DWORD>(-1)); |
} |
- InstallSha256LegacyHooks(); |
#endif // OS_WIN |
base::StatisticsRecorder::Initialize(); |