OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "crypto/openssl_util.h" | 5 #include "crypto/openssl_util.h" |
6 | 6 |
7 #include <openssl/err.h> | 7 #include <openssl/err.h> |
8 #include <openssl/ssl.h> | 8 #include <openssl/ssl.h> |
9 #include <openssl/cpu.h> | 9 #include <openssl/cpu.h> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 // allowing the global environment to leak at least ensures it is | 43 // allowing the global environment to leak at least ensures it is |
44 // available for those other singletons to reliably cleanup. | 44 // available for those other singletons to reliably cleanup. |
45 return Singleton<OpenSSLInitSingleton, | 45 return Singleton<OpenSSLInitSingleton, |
46 LeakySingletonTraits<OpenSSLInitSingleton> >::get(); | 46 LeakySingletonTraits<OpenSSLInitSingleton> >::get(); |
47 } | 47 } |
48 private: | 48 private: |
49 friend struct DefaultSingletonTraits<OpenSSLInitSingleton>; | 49 friend struct DefaultSingletonTraits<OpenSSLInitSingleton>; |
50 OpenSSLInitSingleton() { | 50 OpenSSLInitSingleton() { |
51 SSL_load_error_strings(); | 51 SSL_load_error_strings(); |
52 SSL_library_init(); | 52 SSL_library_init(); |
53 OpenSSL_add_all_algorithms(); | |
davidben
2014/09/12 00:31:28
Removing this line because it's #define-d to SSL_l
| |
54 int num_locks = CRYPTO_num_locks(); | 53 int num_locks = CRYPTO_num_locks(); |
55 locks_.reserve(num_locks); | 54 locks_.reserve(num_locks); |
56 for (int i = 0; i < num_locks; ++i) | 55 for (int i = 0; i < num_locks; ++i) |
57 locks_.push_back(new base::Lock()); | 56 locks_.push_back(new base::Lock()); |
58 CRYPTO_set_locking_callback(LockingCallback); | 57 CRYPTO_set_locking_callback(LockingCallback); |
59 CRYPTO_THREADID_set_callback(CurrentThreadId); | 58 CRYPTO_THREADID_set_callback(CurrentThreadId); |
60 | 59 |
61 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) | 60 #if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) |
62 const bool has_neon = | 61 const bool has_neon = |
63 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; | 62 (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 std::string message; | 121 std::string message; |
123 location.Write(true, true, &message); | 122 location.Write(true, true, &message); |
124 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message; | 123 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message; |
125 ERR_print_errors_cb(&OpenSSLErrorCallback, NULL); | 124 ERR_print_errors_cb(&OpenSSLErrorCallback, NULL); |
126 } else { | 125 } else { |
127 ERR_clear_error(); | 126 ERR_clear_error(); |
128 } | 127 } |
129 } | 128 } |
130 | 129 |
131 } // namespace crypto | 130 } // namespace crypto |
OLD | NEW |