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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 } // namespace | 111 } // namespace |
112 | 112 |
113 void EnsureOpenSSLInit() { | 113 void EnsureOpenSSLInit() { |
114 (void)OpenSSLInitSingleton::GetInstance(); | 114 (void)OpenSSLInitSingleton::GetInstance(); |
115 } | 115 } |
116 | 116 |
117 void ClearOpenSSLERRStack(const tracked_objects::Location& location) { | 117 void ClearOpenSSLERRStack(const tracked_objects::Location& location) { |
118 if (logging::DEBUG_MODE && VLOG_IS_ON(1)) { | 118 if (logging::DEBUG_MODE && VLOG_IS_ON(1)) { |
119 int error_num = ERR_peek_error(); | 119 uint32_t error_num = ERR_peek_error(); |
120 if (error_num == 0) | 120 if (error_num == 0) |
121 return; | 121 return; |
122 | 122 |
123 std::string message; | 123 std::string message; |
124 location.Write(true, true, &message); | 124 location.Write(true, true, &message); |
125 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message; | 125 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message; |
126 ERR_print_errors_cb(&OpenSSLErrorCallback, NULL); | 126 ERR_print_errors_cb(&OpenSSLErrorCallback, NULL); |
127 } else { | 127 } else { |
128 ERR_clear_error(); | 128 ERR_clear_error(); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 } // namespace crypto | 132 } // namespace crypto |
OLD | NEW |