| 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/crypto.h> | |
| 8 #include <openssl/err.h> | |
| 9 #include <stddef.h> | 7 #include <stddef.h> |
| 10 #include <stdint.h> | 8 #include <stdint.h> |
| 11 | 9 |
| 12 #include "base/logging.h" | 10 #include "base/logging.h" |
| 13 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
| 12 #include "third_party/boringssl/src/include/openssl/crypto.h" |
| 13 #include "third_party/boringssl/src/include/openssl/err.h" |
| 14 | 14 |
| 15 namespace crypto { | 15 namespace crypto { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 // Callback routine for OpenSSL to print error messages. |str| is a | 19 // Callback routine for OpenSSL to print error messages. |str| is a |
| 20 // NULL-terminated string of length |len| containing diagnostic information | 20 // NULL-terminated string of length |len| containing diagnostic information |
| 21 // such as the library, function and reason for the error, the file and line | 21 // such as the library, function and reason for the error, the file and line |
| 22 // where the error originated, plus potentially any context-specific | 22 // where the error originated, plus potentially any context-specific |
| 23 // information about the error. |context| contains a pointer to user-supplied | 23 // information about the error. |context| contains a pointer to user-supplied |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 std::string message; | 46 std::string message; |
| 47 location.Write(true, true, &message); | 47 location.Write(true, true, &message); |
| 48 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message; | 48 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message; |
| 49 ERR_print_errors_cb(&OpenSSLErrorCallback, NULL); | 49 ERR_print_errors_cb(&OpenSSLErrorCallback, NULL); |
| 50 } else { | 50 } else { |
| 51 ERR_clear_error(); | 51 ERR_clear_error(); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace crypto | 55 } // namespace crypto |
| OLD | NEW |