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

Unified Diff: net/cert/mock_cert_verifier.cc

Issue 994743003: Support for client certs in ssl_server_socket. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: net/cert/mock_cert_verifier.cc
diff --git a/net/cert/mock_cert_verifier.cc b/net/cert/mock_cert_verifier.cc
index ea5538e8c860bcb75a725b7c270bebecb0d6ec5b..f9aa41575d336fd1c54dfad636a5ae966c5259c3 100644
--- a/net/cert/mock_cert_verifier.cc
+++ b/net/cert/mock_cert_verifier.cc
@@ -44,15 +44,17 @@ int MockCertVerifier::Verify(X509Certificate* cert,
const CompletionCallback& callback,
RequestHandle* out_req,
const BoundNetLog& net_log) {
- RuleList::const_iterator it;
- for (it = rules_.begin(); it != rules_.end(); ++it) {
- // Check just the server cert. Intermediates will be ignored.
- if (!it->cert->Equals(cert))
- continue;
- if (!MatchPattern(hostname, it->hostname))
- continue;
- *verify_result = it->result;
- return it->rv;
+ if (cert) {
Ryan Sleevi 2015/03/19 04:38:24 Why this change? The API contract of CertVerifier
+ RuleList::const_iterator it;
+ for (it = rules_.begin(); it != rules_.end(); ++it) {
+ // Check just the server cert. Intermediates will be ignored.
+ if (!it->cert->Equals(cert))
+ continue;
+ if (!MatchPattern(hostname, it->hostname))
+ continue;
+ *verify_result = it->result;
+ return it->rv;
+ }
}
// Fall through to the default.

Powered by Google App Engine
This is Rietveld 408576698