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(sha1_hash)); | 26 engine_cert_hashes_.push_back(net::HashValue(sha1_hash)); |
27 | 27 |
28 net::SHA256HashValue sha256_hash; | 28 net::SHA256HashValue sha256_hash; |
29 sha256_hash = net::X509Certificate::CalculateFingerprint256( | 29 sha256_hash = net::X509Certificate::CalculateFingerprint256( |
30 engine_cert_->os_cert_handle()); | 30 engine_cert_->os_cert_handle()); |
31 engine_cert_hashes_.push_back(net::HashValue(sha256_hash)); | 31 engine_cert_hashes_.push_back(net::HashValue(sha256_hash)); |
32 } | 32 } |
33 | 33 |
34 ExactMatchCertVerifier::~ExactMatchCertVerifier() {} | 34 ExactMatchCertVerifier::~ExactMatchCertVerifier() {} |
35 | 35 |
36 int ExactMatchCertVerifier::Verify(net::X509Certificate* cert, | 36 int ExactMatchCertVerifier::Verify(const RequestParams& params, |
37 const std::string& hostname, | |
38 const std::string& ocsp_response, | |
39 int flags, | |
40 net::CRLSet* crl_set, | 37 net::CRLSet* crl_set, |
41 net::CertVerifyResult* verify_result, | 38 net::CertVerifyResult* verify_result, |
42 const net::CompletionCallback& callback, | 39 const net::CompletionCallback& callback, |
43 std::unique_ptr<Request>* out_req, | 40 std::unique_ptr<Request>* out_req, |
44 const net::BoundNetLog& net_log) { | 41 const net::BoundNetLog& net_log) { |
45 verify_result->Reset(); | 42 verify_result->Reset(); |
46 verify_result->verified_cert = engine_cert_; | 43 verify_result->verified_cert = engine_cert_; |
47 | 44 |
48 if (!cert->Equals(engine_cert_.get())) { | 45 if (!params.certificate()->Equals(engine_cert_.get())) { |
49 verify_result->cert_status = net::CERT_STATUS_INVALID; | 46 verify_result->cert_status = net::CERT_STATUS_INVALID; |
50 return net::ERR_CERT_INVALID; | 47 return net::ERR_CERT_INVALID; |
51 } | 48 } |
52 | 49 |
53 verify_result->public_key_hashes = engine_cert_hashes_; | 50 verify_result->public_key_hashes = engine_cert_hashes_; |
54 return net::OK; | 51 return net::OK; |
55 } | 52 } |
56 | 53 |
57 } // namespace blimp | 54 } // namespace blimp |
OLD | NEW |