Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: net/socket/ssl_client_socket_nss.cc

Issue 1579063002: Implement a skeleton version of Expect CT reports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3107 matching lines...) Expand 10 before | Expand all | Expand 10 after
3118 // Note that this is a completely synchronous operation: The CT Log Verifier 3118 // Note that this is a completely synchronous operation: The CT Log Verifier
3119 // gets all the data it needs for SCT verification and does not do any 3119 // gets all the data it needs for SCT verification and does not do any
3120 // external communication. 3120 // external communication.
3121 cert_transparency_verifier_->Verify( 3121 cert_transparency_verifier_->Verify(
3122 server_cert_verify_result_.verified_cert.get(), 3122 server_cert_verify_result_.verified_cert.get(),
3123 core_->state().stapled_ocsp_response, 3123 core_->state().stapled_ocsp_response,
3124 core_->state().sct_list_from_tls_extension, &ct_verify_result_, net_log_); 3124 core_->state().sct_list_from_tls_extension, &ct_verify_result_, net_log_);
3125 // TODO(ekasper): wipe stapled_ocsp_response and sct_list_from_tls_extension 3125 // TODO(ekasper): wipe stapled_ocsp_response and sct_list_from_tls_extension
3126 // from the state after verification is complete, to conserve memory. 3126 // from the state after verification is complete, to conserve memory.
3127 3127
3128 if (policy_enforcer_ && 3128 if (policy_enforcer_) {
3129 (server_cert_verify_result_.cert_status & CERT_STATUS_IS_EV)) {
3130 scoped_refptr<ct::EVCertsWhitelist> ev_whitelist = 3129 scoped_refptr<ct::EVCertsWhitelist> ev_whitelist =
3131 SSLConfigService::GetEVCertsWhitelist(); 3130 SSLConfigService::GetEVCertsWhitelist();
3132 if (!policy_enforcer_->DoesConformToCTEVPolicy( 3131 if (!policy_enforcer_->DoesConformToCTEVPolicy(
Ryan Sleevi 2016/01/12 04:39:12 Seems like this method should be renamed?
3133 server_cert_verify_result_.verified_cert.get(), ev_whitelist.get(), 3132 server_cert_verify_result_.verified_cert.get(), ev_whitelist.get(),
3134 ct_verify_result_, net_log_)) { 3133 ct_verify_result_, net_log_)) {
3135 // TODO(eranm): Log via the BoundNetLog, see crbug.com/437766 3134 // TODO(eranm): Log via the BoundNetLog, see crbug.com/437766
3136 VLOG(1) << "EV certificate for " 3135 VLOG(1)
3137 << server_cert_verify_result_.verified_cert->subject() 3136 << "Certificate for "
3138 .GetDisplayName() 3137 << server_cert_verify_result_.verified_cert->subject()
3139 << " does not conform to CT policy, removing EV status."; 3138 .GetDisplayName()
3139 << " does not conform to CT policy, removing EV status if present.";
3140 server_cert_verify_result_.cert_status |= 3140 server_cert_verify_result_.cert_status |=
3141 CERT_STATUS_CT_COMPLIANCE_FAILED; 3141 CERT_STATUS_CT_COMPLIANCE_FAILED;
3142 server_cert_verify_result_.cert_status &= ~CERT_STATUS_IS_EV; 3142 server_cert_verify_result_.cert_status &= ~CERT_STATUS_IS_EV;
3143 } 3143 }
3144 } 3144 }
3145 } 3145 }
3146 3146
3147 void SSLClientSocketNSS::EnsureThreadIdAssigned() const { 3147 void SSLClientSocketNSS::EnsureThreadIdAssigned() const {
3148 base::AutoLock auto_lock(lock_); 3148 base::AutoLock auto_lock(lock_);
3149 if (valid_thread_id_ != base::kInvalidThreadId) 3149 if (valid_thread_id_ != base::kInvalidThreadId)
(...skipping 28 matching lines...) Expand all
3178 return channel_id_service_; 3178 return channel_id_service_;
3179 } 3179 }
3180 3180
3181 SSLFailureState SSLClientSocketNSS::GetSSLFailureState() const { 3181 SSLFailureState SSLClientSocketNSS::GetSSLFailureState() const {
3182 if (completed_handshake_) 3182 if (completed_handshake_)
3183 return SSL_FAILURE_NONE; 3183 return SSL_FAILURE_NONE;
3184 return SSL_FAILURE_UNKNOWN; 3184 return SSL_FAILURE_UNKNOWN;
3185 } 3185 }
3186 3186
3187 } // namespace net 3187 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698