OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef NET_SSL_OPENSSL_SSL_UTIL_H_ | 5 #ifndef NET_SSL_OPENSSL_SSL_UTIL_H_ |
6 #define NET_SSL_OPENSSL_SSL_UTIL_H_ | 6 #define NET_SSL_OPENSSL_SSL_UTIL_H_ |
7 | 7 |
8 #include "net/base/net_log.h" | 8 #include "net/base/net_log.h" |
9 | 9 |
10 namespace crypto { | 10 namespace crypto { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 OpenSSLErrorInfo() : error_code(0), file(NULL), line(0) {} | 44 OpenSSLErrorInfo() : error_code(0), file(NULL), line(0) {} |
45 | 45 |
46 uint32_t error_code; | 46 uint32_t error_code; |
47 const char* file; | 47 const char* file; |
48 int line; | 48 int line; |
49 }; | 49 }; |
50 | 50 |
51 // Converts an OpenSSL error code into a net error code, walking the OpenSSL | 51 // Converts an OpenSSL error code into a net error code, walking the OpenSSL |
52 // error stack if needed. If a value on the stack is used, the error code and | 52 // error stack if needed. If a value on the stack is used, the error code and |
53 // associated information are returned in |*out_error_info|. Otherwise its | 53 // associated information are returned in |*out_error_info|. Otherwise its |
54 // fields are set to 0 and NULL. | 54 // fields are set to 0 and NULL. This function will never return OK, so |
| 55 // SSL_ERROR_ZERO_RETURN must be handled externally. |
55 // | 56 // |
56 // Note that |tracer| is not currently used in the implementation, but is passed | 57 // Note that |tracer| is not currently used in the implementation, but is passed |
57 // in anyway as this ensures the caller will clear any residual codes left on | 58 // in anyway as this ensures the caller will clear any residual codes left on |
58 // the error stack. | 59 // the error stack. |
59 int MapOpenSSLErrorWithDetails(int err, | 60 int MapOpenSSLErrorWithDetails(int err, |
60 const crypto::OpenSSLErrStackTracer& tracer, | 61 const crypto::OpenSSLErrStackTracer& tracer, |
61 OpenSSLErrorInfo* out_error_info); | 62 OpenSSLErrorInfo* out_error_info); |
62 | 63 |
63 // Creates NetLog callback for an OpenSSL error. | 64 // Creates NetLog callback for an OpenSSL error. |
64 NetLog::ParametersCallback CreateNetLogOpenSSLErrorCallback( | 65 NetLog::ParametersCallback CreateNetLogOpenSSLErrorCallback( |
65 int net_error, | 66 int net_error, |
66 int ssl_error, | 67 int ssl_error, |
67 const OpenSSLErrorInfo& error_info); | 68 const OpenSSLErrorInfo& error_info); |
68 | 69 |
69 } // namespace net | 70 } // namespace net |
70 | 71 |
71 #endif // NET_SSL_OPENSSL_SSL_UTIL_H_ | 72 #endif // NET_SSL_OPENSSL_SSL_UTIL_H_ |
OLD | NEW |