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

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: Passing this CL to RyanChung for further work. Created 5 years, 1 month 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
« no previous file with comments | « net/cert/cert_verify_result.h ('k') | net/socket/nss_ssl_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/mock_cert_verifier.cc
diff --git a/net/cert/mock_cert_verifier.cc b/net/cert/mock_cert_verifier.cc
index 6ee23d6483c1c885cfaf9036d15af117666145f7..d579d7e29b3de2a095a86c26163c0620747c55c0 100644
--- a/net/cert/mock_cert_verifier.cc
+++ b/net/cert/mock_cert_verifier.cc
@@ -46,15 +46,17 @@ int MockCertVerifier::Verify(X509Certificate* cert,
const CompletionCallback& callback,
scoped_ptr<Request>* 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 (!base::MatchPattern(hostname, it->hostname))
- continue;
- *verify_result = it->result;
- return it->rv;
+ if (cert) {
+ 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 (!base::MatchPattern(hostname, it->hostname))
+ continue;
+ *verify_result = it->result;
+ return it->rv;
+ }
}
// Fall through to the default.
« no previous file with comments | « net/cert/cert_verify_result.h ('k') | net/socket/nss_ssl_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698