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

Side by Side Diff: ios/web/net/cert_host_pair.cc

Issue 2000503002: Remove the fingerprint and ca_fingerprint from X509Certificate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_cache
Patch Set: Fix IDN test Created 4 years, 6 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 | « ios/web/net/cert_host_pair.h ('k') | ios/web/net/cert_host_pair_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ios/web/net/cert_host_pair.h" 5 #include "ios/web/net/cert_host_pair.h"
6 6
7 #include "net/cert/x509_certificate.h" 7 #include "net/cert/x509_certificate.h"
8 8
9 namespace web { 9 namespace web {
10 10
11 CertHostPair::CertHostPair(const scoped_refptr<net::X509Certificate>& cert, 11 CertHostPair::CertHostPair(scoped_refptr<net::X509Certificate> cert,
12 const std::string& host) 12 std::string host)
13 : cert(cert), host(host) {} 13 : cert_(std::move(cert)),
14 host_(std::move(host)),
15 cert_hash_(net::X509Certificate::CalculateChainFingerprint256(
16 cert_->os_cert_handle(),
17 cert_->GetIntermediateCertificates())) {}
14 18
15 CertHostPair::CertHostPair(const CertHostPair& other) = default; 19 CertHostPair::CertHostPair(const CertHostPair& other) = default;
16 20
17 CertHostPair::~CertHostPair() {} 21 CertHostPair::~CertHostPair() {}
18 22
19 bool CertHostPair::operator<(const CertHostPair& other) const { 23 bool CertHostPair::operator<(const CertHostPair& other) const {
20 if (host != other.host) 24 if (host_ != other.host_)
21 return host < other.host; 25 return host_ < other.host_;
22 return net::X509Certificate::LessThan()(cert, other.cert); 26 return net::SHA256HashValueLessThan()(cert_hash_, other.cert_hash_);
23 } 27 }
24 28
25 } // web 29 } // web
OLDNEW
« no previous file with comments | « ios/web/net/cert_host_pair.h ('k') | ios/web/net/cert_host_pair_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698