Home | History | Annotate | Download | only in patch
      1 # Chrome asumes boringssl, while system installed ssl library may not.
      2 
      3 --- a/crypto/openssl_util.cc
      4 +++ b/crypto/openssl_util.cc
      5 @@ -4,6 +4,13 @@
      6  
      7  #include "crypto/openssl_util.h"
      8  
      9 +#if defined(OPENSSL_IS_BORINGSSL)
     10 +#include <openssl/cpu.h>
     11 +#else
     12 +#include <openssl/ssl.h>
     13 +#endif
     14 +#include <openssl/crypto.h>
     15 +#include <openssl/err.h>
     16  #include <stddef.h>
     17  #include <stdint.h>
     18  
     19 @@ -11,8 +18,6 @@
     20  
     21  #include "base/logging.h"
     22  #include "base/strings/string_piece.h"
     23 -#include "third_party/boringssl/src/include/openssl/crypto.h"
     24 -#include "third_party/boringssl/src/include/openssl/err.h"
     25  
     26  namespace crypto {
     27  
     28 @@ -35,8 +40,12 @@ int OpenSSLErrorCallback(const char* str
     29  }  // namespace
     30  
     31  void EnsureOpenSSLInit() {
     32 +#if defined(OPENSSL_IS_BORINGSSL)
     33    // CRYPTO_library_init may be safely called concurrently.
     34    CRYPTO_library_init();
     35 +#else
     36 +  SSL_library_init();
     37 +#endif
     38  }
     39  
     40  void ClearOpenSSLERRStack(const tracked_objects::Location& location) {
     41 --- a/crypto/rsa_private_key.h
     42 +++ b/crypto/rsa_private_key.h
     43 @@ -7,6 +7,7 @@
     44  
     45  #include <stddef.h>
     46  #include <stdint.h>
     47 +#include <openssl/base.h>
     48  
     49  #include <memory>
     50  #include <vector>
     51 @@ -14,7 +15,6 @@
     52  #include "base/macros.h"
     53  #include "build/build_config.h"
     54  #include "crypto/crypto_export.h"
     55 -#include "third_party/boringssl/src/include/openssl/base.h"
     56  
     57  namespace crypto {
     58  
     59 --- a/crypto/secure_hash.cc
     60 +++ b/crypto/secure_hash.cc
     61 @@ -4,14 +4,18 @@
     62  
     63  #include "crypto/secure_hash.h"
     64  
     65 +#if defined(OPENSSL_IS_BORINGSSL)
     66 +#include <openssl/mem.h>
     67 +#else
     68 +#include <openssl/crypto.h>
     69 +#endif
     70 +#include <openssl/sha.h>
     71  #include <stddef.h>
     72  
     73  #include "base/logging.h"
     74  #include "base/memory/ptr_util.h"
     75  #include "base/pickle.h"
     76  #include "crypto/openssl_util.h"
     77 -#include "third_party/boringssl/src/include/openssl/mem.h"
     78 -#include "third_party/boringssl/src/include/openssl/sha.h"
     79  
     80  namespace crypto {
     81  
     82 
     83