OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #include "blimp/net/exact_match_cert_verifier.h" | 5 #include "blimp/net/exact_match_cert_verifier.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 engine_cert_hashes_.push_back(net::HashValue(sha256_hash)); | 26 engine_cert_hashes_.push_back(net::HashValue(sha256_hash)); |
27 } | 27 } |
28 | 28 |
29 ExactMatchCertVerifier::~ExactMatchCertVerifier() {} | 29 ExactMatchCertVerifier::~ExactMatchCertVerifier() {} |
30 | 30 |
31 int ExactMatchCertVerifier::Verify(const RequestParams& params, | 31 int ExactMatchCertVerifier::Verify(const RequestParams& params, |
32 net::CRLSet* crl_set, | 32 net::CRLSet* crl_set, |
33 net::CertVerifyResult* verify_result, | 33 net::CertVerifyResult* verify_result, |
34 const net::CompletionCallback& callback, | 34 const net::CompletionCallback& callback, |
35 std::unique_ptr<Request>* out_req, | 35 std::unique_ptr<Request>* out_req, |
36 const net::BoundNetLog& net_log) { | 36 const net::NetLogWithSource& net_log) { |
37 verify_result->Reset(); | 37 verify_result->Reset(); |
38 verify_result->verified_cert = engine_cert_; | 38 verify_result->verified_cert = engine_cert_; |
39 | 39 |
40 if (!params.certificate()->Equals(engine_cert_.get())) { | 40 if (!params.certificate()->Equals(engine_cert_.get())) { |
41 verify_result->cert_status = net::CERT_STATUS_INVALID; | 41 verify_result->cert_status = net::CERT_STATUS_INVALID; |
42 return net::ERR_CERT_INVALID; | 42 return net::ERR_CERT_INVALID; |
43 } | 43 } |
44 | 44 |
45 verify_result->public_key_hashes = engine_cert_hashes_; | 45 verify_result->public_key_hashes = engine_cert_hashes_; |
46 return net::OK; | 46 return net::OK; |
47 } | 47 } |
48 | 48 |
49 } // namespace blimp | 49 } // namespace blimp |
OLD | NEW |