| 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 #include "net/ssl/openssl_ssl_util.h" | 5 #include "net/ssl/openssl_ssl_util.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <openssl/err.h> | 8 #include <openssl/err.h> |
| 9 #include <openssl/ssl.h> | 9 #include <openssl/ssl.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 ERR_GET_REASON(previous) == SSL_R_HANDSHAKE_FAILURE_ON_CLIENT_HELLO) { | 110 ERR_GET_REASON(previous) == SSL_R_HANDSHAKE_FAILURE_ON_CLIENT_HELLO) { |
| 111 return ERR_SSL_VERSION_OR_CIPHER_MISMATCH; | 111 return ERR_SSL_VERSION_OR_CIPHER_MISMATCH; |
| 112 } | 112 } |
| 113 return ERR_SSL_PROTOCOL_ERROR; | 113 return ERR_SSL_PROTOCOL_ERROR; |
| 114 } | 114 } |
| 115 default: | 115 default: |
| 116 return ERR_SSL_PROTOCOL_ERROR; | 116 return ERR_SSL_PROTOCOL_ERROR; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 scoped_ptr<base::Value> NetLogOpenSSLErrorCallback( | 120 std::unique_ptr<base::Value> NetLogOpenSSLErrorCallback( |
| 121 int net_error, | 121 int net_error, |
| 122 int ssl_error, | 122 int ssl_error, |
| 123 const OpenSSLErrorInfo& error_info, | 123 const OpenSSLErrorInfo& error_info, |
| 124 NetLogCaptureMode /* capture_mode */) { | 124 NetLogCaptureMode /* capture_mode */) { |
| 125 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 125 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 126 dict->SetInteger("net_error", net_error); | 126 dict->SetInteger("net_error", net_error); |
| 127 dict->SetInteger("ssl_error", ssl_error); | 127 dict->SetInteger("ssl_error", ssl_error); |
| 128 if (error_info.error_code != 0) { | 128 if (error_info.error_code != 0) { |
| 129 dict->SetInteger("error_lib", ERR_GET_LIB(error_info.error_code)); | 129 dict->SetInteger("error_lib", ERR_GET_LIB(error_info.error_code)); |
| 130 dict->SetInteger("error_reason", ERR_GET_REASON(error_info.error_code)); | 130 dict->SetInteger("error_reason", ERR_GET_REASON(error_info.error_code)); |
| 131 } | 131 } |
| 132 if (error_info.file != NULL) | 132 if (error_info.file != NULL) |
| 133 dict->SetString("file", error_info.file); | 133 dict->SetString("file", error_info.file); |
| 134 if (error_info.line != 0) | 134 if (error_info.line != 0) |
| 135 dict->SetInteger("line", error_info.line); | 135 dict->SetInteger("line", error_info.line); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 for (size_t i = 0; i < os_handles.size(); i++) { | 238 for (size_t i = 0; i < os_handles.size(); i++) { |
| 239 ScopedX509 x509 = OSCertHandleToOpenSSL(os_handles[i]); | 239 ScopedX509 x509 = OSCertHandleToOpenSSL(os_handles[i]); |
| 240 if (!x509) | 240 if (!x509) |
| 241 return nullptr; | 241 return nullptr; |
| 242 sk_X509_push(stack.get(), x509.release()); | 242 sk_X509_push(stack.get(), x509.release()); |
| 243 } | 243 } |
| 244 return stack; | 244 return stack; |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace net | 247 } // namespace net |
| OLD | NEW |