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

Side by Side Diff: blimp/net/exact_match_cert_verifier.cc

Issue 2632803002: Remove all blimp network code. (Closed)
Patch Set: merge from origin/master for good measure Created 3 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « blimp/net/exact_match_cert_verifier.h ('k') | blimp/net/fake_blimp_message_processor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 "blimp/net/exact_match_cert_verifier.h"
6
7 #include <memory>
8
9 #include "base/callback.h"
10 #include "base/macros.h"
11 #include "net/base/net_errors.h"
12 #include "net/cert/cert_verifier.h"
13 #include "net/cert/cert_verify_result.h"
14 #include "net/cert/x509_certificate.h"
15
16 namespace blimp {
17
18 ExactMatchCertVerifier::ExactMatchCertVerifier(
19 scoped_refptr<net::X509Certificate> engine_cert)
20 : engine_cert_(std::move(engine_cert)) {
21 DCHECK(engine_cert_);
22
23 net::SHA256HashValue sha256_hash;
24 sha256_hash = net::X509Certificate::CalculateFingerprint256(
25 engine_cert_->os_cert_handle());
26 engine_cert_hashes_.push_back(net::HashValue(sha256_hash));
27 }
28
29 ExactMatchCertVerifier::~ExactMatchCertVerifier() {}
30
31 int ExactMatchCertVerifier::Verify(const RequestParams& params,
32 net::CRLSet* crl_set,
33 net::CertVerifyResult* verify_result,
34 const net::CompletionCallback& callback,
35 std::unique_ptr<Request>* out_req,
36 const net::NetLogWithSource& net_log) {
37 verify_result->Reset();
38 verify_result->verified_cert = engine_cert_;
39
40 if (!params.certificate()->Equals(engine_cert_.get())) {
41 verify_result->cert_status = net::CERT_STATUS_INVALID;
42 return net::ERR_CERT_INVALID;
43 }
44
45 verify_result->public_key_hashes = engine_cert_hashes_;
46 return net::OK;
47 }
48
49 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/exact_match_cert_verifier.h ('k') | blimp/net/fake_blimp_message_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698