Chromium Code Reviews| 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. |