| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived | 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived |
| 6 // from AuthCertificateCallback() in | 6 // from AuthCertificateCallback() in |
| 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. | 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. |
| 8 | 8 |
| 9 /* ***** BEGIN LICENSE BLOCK ***** | 9 /* ***** BEGIN LICENSE BLOCK ***** |
| 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| (...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 } | 1878 } |
| 1879 // Done! | 1879 // Done! |
| 1880 } else { | 1880 } else { |
| 1881 PRErrorCode prerr = PR_GetError(); | 1881 PRErrorCode prerr = PR_GetError(); |
| 1882 net_error = HandleNSSError(prerr, true); | 1882 net_error = HandleNSSError(prerr, true); |
| 1883 | 1883 |
| 1884 // Some network devices that inspect application-layer packets seem to | 1884 // Some network devices that inspect application-layer packets seem to |
| 1885 // inject TCP reset packets to break the connections when they see | 1885 // inject TCP reset packets to break the connections when they see |
| 1886 // TLS 1.1 in ClientHello or ServerHello. See http://crbug.com/130293. | 1886 // TLS 1.1 in ClientHello or ServerHello. See http://crbug.com/130293. |
| 1887 // | 1887 // |
| 1888 // Only allow ERR_CONNECTION_RESET to trigger a TLS 1.1 -> TLS 1.0 | 1888 // Only allow ERR_CONNECTION_RESET/ABORTED to trigger a TLS 1.1 -> TLS 1.0 |
| 1889 // fallback. We don't lose much in this fallback because the explicit | 1889 // fallback. We don't lose much in this fallback because the explicit IV |
| 1890 // IV for CBC mode in TLS 1.1 is approximated by record splitting in | 1890 // for CBC mode in TLS 1.1 is approximated by record splitting in TLS 1.0. |
| 1891 // TLS 1.0. | |
| 1892 // | 1891 // |
| 1893 // ERR_CONNECTION_RESET is a common network error, so we don't want it | 1892 // ERR_CONNECTION_RESET/ABORTED are common network errors, so we don't want |
| 1894 // to trigger a version fallback in general, especially the TLS 1.0 -> | 1893 // them to trigger a version fallback in general, especially the TLS 1.0 -> |
| 1895 // SSL 3.0 fallback, which would drop TLS extensions. | 1894 // SSL 3.0 fallback, which would drop TLS extensions. |
| 1896 if (prerr == PR_CONNECT_RESET_ERROR && | 1895 // |
| 1896 // ERR_CONNECTION_ABORTED was added because we get this error message when |
| 1897 // using non-blocking reads instead of async/overlapped reads. See |
| 1898 // crbug.com/178672. |
| 1899 if ((prerr == PR_CONNECT_RESET_ERROR || |
| 1900 prerr == PR_CONNECT_ABORTED_ERROR) && |
| 1897 ssl_config_.version_max == SSL_PROTOCOL_VERSION_TLS1_1) { | 1901 ssl_config_.version_max == SSL_PROTOCOL_VERSION_TLS1_1) { |
| 1898 net_error = ERR_SSL_PROTOCOL_ERROR; | 1902 net_error = ERR_SSL_PROTOCOL_ERROR; |
| 1899 } | 1903 } |
| 1900 | 1904 |
| 1901 // If not done, stay in this state | 1905 // If not done, stay in this state |
| 1902 if (net_error == ERR_IO_PENDING) { | 1906 if (net_error == ERR_IO_PENDING) { |
| 1903 GotoState(STATE_HANDSHAKE); | 1907 GotoState(STATE_HANDSHAKE); |
| 1904 } else { | 1908 } else { |
| 1905 PostOrRunCallback( | 1909 PostOrRunCallback( |
| 1906 FROM_HERE, | 1910 FROM_HERE, |
| (...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3439 EnsureThreadIdAssigned(); | 3443 EnsureThreadIdAssigned(); |
| 3440 base::AutoLock auto_lock(lock_); | 3444 base::AutoLock auto_lock(lock_); |
| 3441 return valid_thread_id_ == base::PlatformThread::CurrentId(); | 3445 return valid_thread_id_ == base::PlatformThread::CurrentId(); |
| 3442 } | 3446 } |
| 3443 | 3447 |
| 3444 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { | 3448 ServerBoundCertService* SSLClientSocketNSS::GetServerBoundCertService() const { |
| 3445 return server_bound_cert_service_; | 3449 return server_bound_cert_service_; |
| 3446 } | 3450 } |
| 3447 | 3451 |
| 3448 } // namespace net | 3452 } // namespace net |
| OLD | NEW |