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 3072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3083 // recover when the file system comes back. Until this NSS or SQLite bug | 3083 // recover when the file system comes back. Until this NSS or SQLite bug |
3084 // is fixed, we need to avoid using the NSS database for non-essential | 3084 // is fixed, we need to avoid using the NSS database for non-essential |
3085 // purposes. See https://bugzilla.mozilla.org/show_bug.cgi?id=508081 and | 3085 // purposes. See https://bugzilla.mozilla.org/show_bug.cgi?id=508081 and |
3086 // http://crbug.com/15630 for more info. | 3086 // http://crbug.com/15630 for more info. |
3087 | 3087 |
3088 const CertStatus cert_status = server_cert_verify_result_.cert_status; | 3088 const CertStatus cert_status = server_cert_verify_result_.cert_status; |
3089 if (transport_security_state_ && | 3089 if (transport_security_state_ && |
3090 (result == OK || | 3090 (result == OK || |
3091 (IsCertificateError(result) && IsCertStatusMinorError(cert_status))) && | 3091 (IsCertificateError(result) && IsCertStatusMinorError(cert_status))) && |
3092 !transport_security_state_->CheckPublicKeyPins( | 3092 !transport_security_state_->CheckPublicKeyPins( |
3093 host_and_port_.host(), | 3093 host_and_port_, server_cert_verify_result_.is_issued_by_known_root, |
3094 server_cert_verify_result_.is_issued_by_known_root, | |
3095 server_cert_verify_result_.public_key_hashes, | 3094 server_cert_verify_result_.public_key_hashes, |
3096 &pinning_failure_log_)) { | 3095 core_->state().server_cert.get(), |
| 3096 server_cert_verify_result_.verified_cert.get(), |
| 3097 TransportSecurityState::ENABLE_PIN_REPORTS, &pinning_failure_log_)) { |
3097 result = ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN; | 3098 result = ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN; |
3098 } | 3099 } |
3099 | 3100 |
3100 if (result == OK) { | 3101 if (result == OK) { |
3101 // Only check Certificate Transparency if there were no other errors with | 3102 // Only check Certificate Transparency if there were no other errors with |
3102 // the connection. | 3103 // the connection. |
3103 VerifyCT(); | 3104 VerifyCT(); |
3104 | 3105 |
3105 // Only cache the session if the certificate verified successfully. | 3106 // Only cache the session if the certificate verified successfully. |
3106 core_->CacheSessionIfNecessary(); | 3107 core_->CacheSessionIfNecessary(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3183 return channel_id_service_; | 3184 return channel_id_service_; |
3184 } | 3185 } |
3185 | 3186 |
3186 SSLFailureState SSLClientSocketNSS::GetSSLFailureState() const { | 3187 SSLFailureState SSLClientSocketNSS::GetSSLFailureState() const { |
3187 if (completed_handshake_) | 3188 if (completed_handshake_) |
3188 return SSL_FAILURE_NONE; | 3189 return SSL_FAILURE_NONE; |
3189 return SSL_FAILURE_UNKNOWN; | 3190 return SSL_FAILURE_UNKNOWN; |
3190 } | 3191 } |
3191 | 3192 |
3192 } // namespace net | 3193 } // namespace net |
OLD | NEW |