| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } | 191 } |
| 192 } while (error_code != 0); | 192 } while (error_code != 0); |
| 193 return ERR_FAILED; | 193 return ERR_FAILED; |
| 194 default: | 194 default: |
| 195 // TODO(joth): Implement full mapping. | 195 // TODO(joth): Implement full mapping. |
| 196 LOG(WARNING) << "Unknown OpenSSL error " << err; | 196 LOG(WARNING) << "Unknown OpenSSL error " << err; |
| 197 return ERR_SSL_PROTOCOL_ERROR; | 197 return ERR_SSL_PROTOCOL_ERROR; |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 NetLog::ParametersCallback CreateNetLogOpenSSLErrorCallback( | 201 NetLogParametersCallback CreateNetLogOpenSSLErrorCallback( |
| 202 int net_error, | 202 int net_error, |
| 203 int ssl_error, | 203 int ssl_error, |
| 204 const OpenSSLErrorInfo& error_info) { | 204 const OpenSSLErrorInfo& error_info) { |
| 205 return base::Bind(&NetLogOpenSSLErrorCallback, | 205 return base::Bind(&NetLogOpenSSLErrorCallback, |
| 206 net_error, ssl_error, error_info); | 206 net_error, ssl_error, error_info); |
| 207 } | 207 } |
| 208 | 208 |
| 209 int GetNetSSLVersion(SSL* ssl) { | 209 int GetNetSSLVersion(SSL* ssl) { |
| 210 switch (SSL_version(ssl)) { | 210 switch (SSL_version(ssl)) { |
| 211 case TLS1_VERSION: | 211 case TLS1_VERSION: |
| (...skipping 28 matching lines...) Expand all Loading... |
| 240 for (size_t i = 0; i < os_handles.size(); i++) { | 240 for (size_t i = 0; i < os_handles.size(); i++) { |
| 241 ScopedX509 x509 = OSCertHandleToOpenSSL(os_handles[i]); | 241 ScopedX509 x509 = OSCertHandleToOpenSSL(os_handles[i]); |
| 242 if (!x509) | 242 if (!x509) |
| 243 return nullptr; | 243 return nullptr; |
| 244 sk_X509_push(stack.get(), x509.release()); | 244 sk_X509_push(stack.get(), x509.release()); |
| 245 } | 245 } |
| 246 return stack; | 246 return stack; |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace net | 249 } // namespace net |
| OLD | NEW |