Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/callback.h" | |
| 6 #include "base/macros.h" | |
| 7 #include "base/memory/scoped_ptr.h" | |
| 8 #include "blimp/net/exact_match_cert_verifier.h" | |
|
Ryan Sleevi
2016/02/19 22:56:08
STYLE: This should be at the top of the file, befo
Kevin M
2016/02/22 22:53:32
Done.
| |
| 9 #include "net/base/net_errors.h" | |
| 10 #include "net/cert/cert_verifier.h" | |
| 11 #include "net/cert/cert_verify_result.h" | |
| 12 #include "net/cert/x509_certificate.h" | |
| 13 | |
| 14 namespace blimp { | |
| 15 | |
| 16 ExactMatchCertVerifier::ExactMatchCertVerifier( | |
| 17 scoped_refptr<net::X509Certificate> engine_cert) | |
| 18 : engine_cert_(engine_cert) {} | |
|
Ryan Sleevi
2016/02/19 22:56:08
STYLE: You're passing a scoped_refptr<> as non-con
Kevin M
2016/02/22 22:53:31
Done. I converted this parameter into a const refe
Ryan Sleevi
2016/02/23 02:26:26
https://groups.google.com/a/chromium.org/d/msg/chr
Kevin M
2016/02/23 20:26:46
Done.
| |
| 19 | |
| 20 ExactMatchCertVerifier::~ExactMatchCertVerifier() {} | |
| 21 | |
| 22 int ExactMatchCertVerifier::Verify(net::X509Certificate* cert, | |
| 23 const std::string&, | |
| 24 const std::string&, | |
| 25 int, | |
| 26 net::CRLSet*, | |
| 27 net::CertVerifyResult* verify_result, | |
| 28 const net::CompletionCallback&, | |
| 29 scoped_ptr<net::CertVerifier::Request>*, | |
| 30 const net::BoundNetLog&) { | |
| 31 verify_result->Reset(); | |
| 32 | |
| 33 if (!cert->Equals(engine_cert_.get())) { | |
|
Ryan Sleevi
2016/02/19 22:56:08
BUG: You return an error code but fail to set the
Kevin M
2016/02/22 22:53:32
Done.
| |
| 34 return net::ERR_CERT_INVALID; | |
| 35 } | |
| 36 | |
| 37 verify_result->verified_cert = cert; | |
|
Ryan Sleevi
2016/02/19 22:56:08
POTENTIAL BUG: You fail to fill in public_key_hash
Kevin M
2016/02/22 22:53:31
Done.
| |
| 38 return net::OK; | |
| 39 } | |
| 40 | |
| 41 } // namespace blimp | |
| OLD | NEW |