Skip to content

Commit

Permalink
include boringssl headers from third_party explicitly
Browse files Browse the repository at this point in the history
This also allow us to participate in DEPS checking, which will help
catch instances of directories including BoringSSL without adding to
build targets.

This patch was partly generated by the following command lines:

$ g grep -l -e '^#[[:blank:]]*include <\(openssl[^>]*\)>' | xargs sed -i
'/^#[[:blank:]]*include/s/<\(openssl[^>]*\)>/"\1"/'
$ g grep -l "#include \"openssl/" | xargs sed -i -e 's/\(#.*
\)"\(openssl\/.*\)"/\1"third_party\/boringssl\/src\/include\/\2"/'

The regex were taken from http://stackoverflow.com/a/25378698 and
https://svn.boost.org/trac/boost/ticket/12057, and adapted to suit our
needs.

Then the includes were put in their right places with some manual editing and
the help of tools/sort-headers.py.

BUG=446558
[email protected],[email protected],[email protected],[email protected]

Review-Url: https://codereview.chromium.org/2449873005
Cr-Commit-Position: refs/heads/master@{#428442}
  • Loading branch information
tfarina authored and Commit bot committed Oct 28, 2016
1 parent c346a85 commit 29a3a17
Show file tree
Hide file tree
Showing 60 changed files with 126 additions and 125 deletions.
1 change: 1 addition & 0 deletions chrome/browser/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ include_rules = [
"+services/service_manager",
"+skia/ext",
"+syzygy/kasko",
"+third_party/boringssl/src/include",
"+third_party/crashpad",
"+third_party/cros_system_api",
"+third_party/kasko",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/evp.h>
#include <openssl/rsa.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
Expand Down Expand Up @@ -37,6 +35,8 @@
#include "extensions/test/result_catcher.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/rsa.h"

using testing::Return;
using testing::_;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/io_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
#endif

#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL)
#include <openssl/cpu.h>
#include "crypto/openssl_util.h"
#include "third_party/boringssl/src/include/openssl/cpu.h"
#endif

using content::BrowserThread;
Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/ssl/chrome_security_state_model_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "chrome/browser/ssl/chrome_security_state_model_client.h"

#include <openssl/ssl.h>

#include <vector>

#include "base/command_line.h"
Expand Down Expand Up @@ -34,6 +32,7 @@
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_cipher_suite_names.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "ui/base/l10n/l10n_util.h"

DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeSecurityStateModelClient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "chrome/browser/ssl/chrome_security_state_model_client.h"

#include <openssl/ssl.h>

#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/macros.h"
Expand Down Expand Up @@ -55,6 +53,7 @@
#include "net/test/url_request/url_request_mock_http_job.h"
#include "net/url_request/url_request_filter.h"
#include "net/url_request/url_request_test_util.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "ui/base/l10n/l10n_util.h"

using security_state::SecurityStateModel;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/website_settings/website_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "chrome/browser/ui/website_settings/website_settings.h"

#include <openssl/ssl.h>
#include <stddef.h>
#include <stdint.h>

Expand Down Expand Up @@ -66,6 +65,7 @@
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_cipher_suite_names.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "ui/base/l10n/l10n_util.h"

#if defined(OS_CHROMEOS)
Expand Down
1 change: 1 addition & 0 deletions chrome/common/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ include_rules = [
"+ppapi/shared_impl",
"+ppapi/thunk",
"+sandbox/linux/services/credentials.h",
"+third_party/boringssl/src/include",
"+third_party/kasko",

# FIXME - refactor code and remove these dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

#include "chrome/common/extensions/api/networking_private/networking_private_crypto.h"

#include <openssl/digest.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
#include <openssl/x509.h>
#include <stddef.h>

#include <memory>
Expand All @@ -18,6 +14,10 @@
#include "crypto/openssl_util.h"
#include "crypto/rsa_private_key.h"
#include "net/cert/pem_tokenizer.h"
#include "third_party/boringssl/src/include/openssl/digest.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/rsa.h"
#include "third_party/boringssl/src/include/openssl/x509.h"

namespace {

Expand Down
1 change: 1 addition & 0 deletions chromecast/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ include_rules = [
"+chromecast/base",
"+chromecast/chromecast_features.h",
"+chromecast/public",
"+third_party/boringssl/src/include",
]
2 changes: 1 addition & 1 deletion chromecast/media/base/decrypt_context_impl_clearkey.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "chromecast/media/base/decrypt_context_impl_clearkey.h"

#include <openssl/aes.h>
#include <string.h>

#include <memory>
Expand All @@ -15,6 +14,7 @@
#include "chromecast/public/media/cast_decoder_buffer.h"
#include "chromecast/public/media/cast_decrypt_config.h"
#include "crypto/symmetric_key.h"
#include "third_party/boringssl/src/include/openssl/aes.h"

namespace chromecast {
namespace media {
Expand Down
1 change: 1 addition & 0 deletions components/gcm_driver/crypto/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ include_rules = [
"+components/leveldb_proto",
"+crypto",
"+net/http",
"+third_party/boringssl/src/include",
]
2 changes: 1 addition & 1 deletion components/gcm_driver/crypto/gcm_message_cryptographer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "components/gcm_driver/crypto/gcm_message_cryptographer.h"

#include <openssl/aead.h>
#include <stddef.h>
#include <stdint.h>

Expand All @@ -16,6 +15,7 @@
#include "base/strings/string_util.h"
#include "base/sys_byteorder.h"
#include "crypto/hkdf.h"
#include "third_party/boringssl/src/include/openssl/aead.h"

namespace gcm {
namespace {
Expand Down
6 changes: 3 additions & 3 deletions components/gcm_driver/crypto/p256_key_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

#include "components/gcm_driver/crypto/p256_key_util.h"

#include <openssl/ec.h>
#include <openssl/ecdh.h>
#include <openssl/evp.h>
#include <stddef.h>
#include <stdint.h>

Expand All @@ -16,6 +13,9 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "crypto/ec_private_key.h"
#include "third_party/boringssl/src/include/openssl/ec.h"
#include "third_party/boringssl/src/include/openssl/ecdh.h"
#include "third_party/boringssl/src/include/openssl/evp.h"

namespace gcm {

Expand Down
1 change: 1 addition & 0 deletions components/webcrypto/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include_rules = [
"+crypto",
"+third_party/boringssl/src/include",
"+third_party/re2",
"+third_party/WebKit/public/platform",
"+third_party/WebKit/public/web",
Expand Down
4 changes: 2 additions & 2 deletions components/webcrypto/algorithms/aes_cbc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/aes.h>
#include <openssl/cipher.h>
#include <stddef.h>
#include <stdint.h>

Expand All @@ -17,6 +15,8 @@
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/boringssl/src/include/openssl/aes.h"
#include "third_party/boringssl/src/include/openssl/cipher.h"

namespace webcrypto {

Expand Down
6 changes: 3 additions & 3 deletions components/webcrypto/algorithms/aes_ctr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/aes.h>
#include <openssl/bn.h>
#include <openssl/cipher.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
Expand All @@ -20,6 +17,9 @@
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/boringssl/src/include/openssl/aes.h"
#include "third_party/boringssl/src/include/openssl/bn.h"
#include "third_party/boringssl/src/include/openssl/cipher.h"

namespace webcrypto {

Expand Down
2 changes: 1 addition & 1 deletion components/webcrypto/algorithms/aes_gcm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/aead.h>
#include <stddef.h>
#include <stdint.h>

Expand All @@ -18,6 +17,7 @@
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/boringssl/src/include/openssl/aead.h"

namespace webcrypto {

Expand Down
2 changes: 1 addition & 1 deletion components/webcrypto/algorithms/aes_kw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/aes.h>
#include <stddef.h>
#include <stdint.h>

Expand All @@ -16,6 +15,7 @@
#include "components/webcrypto/crypto_data.h"
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
#include "third_party/boringssl/src/include/openssl/aes.h"

namespace webcrypto {

Expand Down
6 changes: 3 additions & 3 deletions components/webcrypto/algorithms/asymmetric_key_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

#include "components/webcrypto/algorithms/asymmetric_key_util.h"

#include <openssl/bytestring.h>
#include <openssl/evp.h>
#include <openssl/mem.h>
#include <stdint.h>
#include <utility>

Expand All @@ -16,6 +13,9 @@
#include "components/webcrypto/generate_key_result.h"
#include "components/webcrypto/status.h"
#include "crypto/openssl_util.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/mem.h"

namespace webcrypto {

Expand Down
3 changes: 1 addition & 2 deletions components/webcrypto/algorithms/asymmetric_key_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#ifndef COMPONENTS_WEBCRYPTO_ALGORITHMS_ASYMMETRIC_KEY_UTIL_
#define COMPONENTS_WEBCRYPTO_ALGORITHMS_ASYMMETRIC_KEY_UTIL_

#include <openssl/base.h>

#include "third_party/WebKit/public/platform/WebCryptoAlgorithm.h"
#include "third_party/WebKit/public/platform/WebCryptoKey.h"
#include "third_party/boringssl/src/include/openssl/base.h"

// This file contains functions shared by multiple asymmetric key algorithms.

Expand Down
12 changes: 6 additions & 6 deletions components/webcrypto/algorithms/ec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@

#include "components/webcrypto/algorithms/ec.h"

#include <openssl/bn.h>
#include <openssl/bytestring.h>
#include <openssl/ec.h>
#include <openssl/ec_key.h>
#include <openssl/evp.h>
#include <openssl/mem.h>
#include <stddef.h>
#include <utility>

Expand All @@ -25,6 +19,12 @@
#include "crypto/openssl_util.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
#include "third_party/boringssl/src/include/openssl/bn.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/ec.h"
#include "third_party/boringssl/src/include/openssl/ec_key.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/mem.h"

namespace webcrypto {

Expand Down
6 changes: 3 additions & 3 deletions components/webcrypto/algorithms/ecdh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/ec.h>
#include <openssl/ecdh.h>
#include <openssl/evp.h>
#include <stddef.h>
#include <stdint.h>

Expand All @@ -22,6 +19,9 @@
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/WebKit/public/platform/WebCryptoKey.h"
#include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
#include "third_party/boringssl/src/include/openssl/ec.h"
#include "third_party/boringssl/src/include/openssl/ecdh.h"
#include "third_party/boringssl/src/include/openssl/evp.h"

namespace webcrypto {

Expand Down
14 changes: 7 additions & 7 deletions components/webcrypto/algorithms/ecdsa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/bn.h>
#include <openssl/digest.h>
#include <openssl/ec.h>
#include <openssl/ec_key.h>
#include <openssl/ecdsa.h>
#include <openssl/evp.h>
#include <openssl/mem.h>
#include <stddef.h>
#include <stdint.h>

Expand All @@ -26,6 +19,13 @@
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/WebKit/public/platform/WebCryptoKey.h"
#include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
#include "third_party/boringssl/src/include/openssl/bn.h"
#include "third_party/boringssl/src/include/openssl/digest.h"
#include "third_party/boringssl/src/include/openssl/ec.h"
#include "third_party/boringssl/src/include/openssl/ec_key.h"
#include "third_party/boringssl/src/include/openssl/ecdsa.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/mem.h"

namespace webcrypto {

Expand Down
4 changes: 2 additions & 2 deletions components/webcrypto/algorithms/hkdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/err.h>
#include <openssl/hkdf.h>
#include <stdint.h>

#include "base/logging.h"
Expand All @@ -17,6 +15,8 @@
#include "crypto/openssl_util.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
#include "third_party/boringssl/src/include/openssl/err.h"
#include "third_party/boringssl/src/include/openssl/hkdf.h"

namespace webcrypto {

Expand Down
2 changes: 1 addition & 1 deletion components/webcrypto/algorithms/hmac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <openssl/hmac.h>
#include <stddef.h>
#include <stdint.h>

Expand All @@ -20,6 +19,7 @@
#include "crypto/secure_util.h"
#include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h"
#include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h"
#include "third_party/boringssl/src/include/openssl/hmac.h"

namespace webcrypto {

Expand Down
Loading

0 comments on commit 29a3a17

Please sign in to comment.