0

Move crypto/wincrypt_shim.h to remove build dependency on crypto

The DEPS system and gn will enforce some kind of dependency on
//crypto if code needs to use crypto/wincrypt_shim.h. Now, that
header file will not in itself indicate a dependency on actual
code in //crypto so the dependency becomes a bit unexpected. By
moving it to base/win, code can avoid depending on //crypto just
to use that header file.

This became an issue when //printing needed to use wincrypt_shim.h

Change-Id: I68a3b8263da0d4307907a0b242444402675072a4
Reviewed-on: https://chromium-review.googlesource.com/c/1261024
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#597256}
This commit is contained in:
Daniel Bratell
2018-10-05 19:56:11 +00:00
committed by Commit Bot
parent 8012e46931
commit b2612e184a
14 changed files with 15 additions and 15 deletions

@ -1056,6 +1056,7 @@ jumbo_component("base") {
"win/wait_chain.h",
"win/win_util.cc",
"win/win_util.h",
"win/wincrypt_shim.h",
"win/windows_defines.inc",
"win/windows_types.h",
"win/windows_undefines.inc",

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CRYPTO_WINCRYPT_SHIM_H_
#define CRYPTO_WINCRYPT_SHIM_H_
#ifndef BASE_WIN_WINCRYPT_SHIM_H_
#define BASE_WIN_WINCRYPT_SHIM_H_
// wincrypt.h defines macros which conflict with OpenSSL's types. This header
// includes wincrypt and undefines the OpenSSL macros which conflict. Any
@ -22,4 +22,4 @@
#define WINCRYPT_X509_EXTENSIONS ((LPCSTR) 5)
#define WINCRYPT_X509_NAME ((LPCSTR) 7)
#endif // CRYPTO_WINCRYPT_SHIM_H_
#endif // BASE_WIN_WINCRYPT_SHIM_H_

@ -20,8 +20,8 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/scoped_handle.h"
#include "base/win/wincrypt_shim.h"
#include "chrome/common/safe_browsing/pe_image_reader_win.h"
#include "crypto/wincrypt_shim.h"
// This must be after wincrypt and wintrust.
#include <mscat.h>

@ -13,6 +13,6 @@
#include <windows.h>
#include <cryptuiapi.h>
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
#endif // CHROME_BROWSER_UI_CRYPTUIAPI_SHIM_H_

@ -9,7 +9,7 @@
#include "base/strings/string16.h"
#include "base/win/scoped_handle.h"
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
namespace chrome_cleaner {

@ -7,7 +7,7 @@
#include <windows.h>
#include "base/strings/utf_string_conversions.h"
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
bool OSCrypt::EncryptString16(const base::string16& plaintext,
std::string* ciphertext) {

@ -65,7 +65,7 @@
// XpsObjectModel.h indirectly includes <wincrypt.h> which is
// incompatible with Chromium's OpenSSL. By including wincrypt_shim.h
// first, problems are avoided.
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
#include <XpsObjectModel.h>
#include <objbase.h>

@ -67,7 +67,6 @@ component("crypto") {
"signature_verifier.h",
"symmetric_key.cc",
"symmetric_key.h",
"wincrypt_shim.h",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.

@ -11,7 +11,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
namespace crypto {

@ -5,7 +5,7 @@
#ifndef NET_CERT_KNOWN_ROOTS_WIN_H_
#define NET_CERT_KNOWN_ROOTS_WIN_H_
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
namespace net {

@ -18,7 +18,7 @@
#include "net/cert/scoped_nss_types.h"
#elif defined(OS_WIN)
#include <windows.h>
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
#elif defined(OS_MACOSX)
#include <CoreFoundation/CFArray.h>
#include <Security/SecTrust.h>

@ -11,7 +11,7 @@
#include <windows.h>
#include "base/memory/ref_counted.h"
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
#include "net/base/hash_value.h"
#include "net/base/net_export.h"
#include "net/cert/x509_certificate.h"

@ -20,7 +20,7 @@
#include "base/single_thread_task_runner.h"
#include "base/task_runner_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
#include "net/cert/x509_util.h"
#include "net/cert/x509_util_win.h"
#include "net/ssl/ssl_platform_key_util.h"

@ -11,7 +11,7 @@
#include <NCrypt.h>
#include "base/memory/ref_counted.h"
#include "crypto/wincrypt_shim.h"
#include "base/win/wincrypt_shim.h"
#include "net/base/net_export.h"
namespace net {