You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.8 KiB

# Chrome asumes boringssl, while system installed ssl library may not.
--- a/crypto/openssl_util.cc
+++ b/crypto/openssl_util.cc
@@ -4,6 +4,13 @@
#include "crypto/openssl_util.h"
+#if defined(OPENSSL_IS_BORINGSSL)
+#include <openssl/cpu.h>
+#else
+#include <openssl/ssl.h>
+#endif
+#include <openssl/crypto.h>
+#include <openssl/err.h>
#include <stddef.h>
#include <stdint.h>
@@ -11,8 +18,6 @@
#include "base/logging.h"
#include "base/strings/string_piece.h"
-#include "third_party/boringssl/src/include/openssl/crypto.h"
-#include "third_party/boringssl/src/include/openssl/err.h"
namespace crypto {
@@ -35,8 +40,12 @@ int OpenSSLErrorCallback(const char* str
} // namespace
void EnsureOpenSSLInit() {
+#if defined(OPENSSL_IS_BORINGSSL)
// CRYPTO_library_init may be safely called concurrently.
CRYPTO_library_init();
+#else
+ SSL_library_init();
+#endif
}
void ClearOpenSSLERRStack(const tracked_objects::Location& location) {
--- a/crypto/rsa_private_key.h
+++ b/crypto/rsa_private_key.h
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <openssl/base.h>
#include <memory>
#include <vector>
@@ -14,7 +15,6 @@
#include "base/macros.h"
#include "build/build_config.h"
#include "crypto/crypto_export.h"
-#include "third_party/boringssl/src/include/openssl/base.h"
namespace crypto {
--- a/crypto/secure_hash.cc
+++ b/crypto/secure_hash.cc
@@ -4,14 +4,18 @@
#include "crypto/secure_hash.h"
+#if defined(OPENSSL_IS_BORINGSSL)
+#include <openssl/mem.h>
+#else
+#include <openssl/crypto.h>
+#endif
+#include <openssl/sha.h>
#include <stddef.h>
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/pickle.h"
#include "crypto/openssl_util.h"
-#include "third_party/boringssl/src/include/openssl/mem.h"
-#include "third_party/boringssl/src/include/openssl/sha.h"
namespace crypto {