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

Side by Side Diff: net/cert/signed_certificate_timestamp.cc

Issue 997533002: Certificate Transparency: Correctly handle SCT origin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/cert/signed_certificate_timestamp.h" 5 #include "net/cert/signed_certificate_timestamp.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 namespace ct { 11 namespace ct {
12 12
13 bool SignedCertificateTimestamp::LessThan::operator()( 13 bool SignedCertificateTimestamp::LessThan::operator()(
14 const scoped_refptr<SignedCertificateTimestamp>& lhs, 14 const scoped_refptr<SignedCertificateTimestamp>& lhs,
15 const scoped_refptr<SignedCertificateTimestamp>& rhs) const { 15 const scoped_refptr<SignedCertificateTimestamp>& rhs) const {
16 if (lhs.get() == rhs.get()) 16 if (lhs.get() == rhs.get())
17 return false; 17 return false;
18 if (lhs->signature.signature_data != rhs->signature.signature_data) 18 if (lhs->signature.signature_data != rhs->signature.signature_data)
19 return lhs->signature.signature_data < rhs->signature.signature_data; 19 return lhs->signature.signature_data < rhs->signature.signature_data;
20 if (lhs->log_id != rhs->log_id) 20 if (lhs->log_id != rhs->log_id)
21 return lhs->log_id < rhs->log_id; 21 return lhs->log_id < rhs->log_id;
22 if (lhs->timestamp != rhs->timestamp) 22 if (lhs->timestamp != rhs->timestamp)
23 return lhs->timestamp < rhs->timestamp; 23 return lhs->timestamp < rhs->timestamp;
24 if (lhs->extensions != rhs->extensions) 24 if (lhs->extensions != rhs->extensions)
25 return lhs->extensions < rhs->extensions; 25 return lhs->extensions < rhs->extensions;
26 if (lhs->origin != rhs->origin)
27 return lhs->origin < rhs->origin;
26 return lhs->version < rhs->version; 28 return lhs->version < rhs->version;
27 } 29 }
28 30
29 SignedCertificateTimestamp::SignedCertificateTimestamp() {} 31 SignedCertificateTimestamp::SignedCertificateTimestamp() {}
30 32
31 SignedCertificateTimestamp::~SignedCertificateTimestamp() {} 33 SignedCertificateTimestamp::~SignedCertificateTimestamp() {}
32 34
33 void SignedCertificateTimestamp::Persist(Pickle* pickle) { 35 void SignedCertificateTimestamp::Persist(Pickle* pickle) {
34 CHECK(pickle->WriteInt(version)); 36 CHECK(pickle->WriteInt(version));
35 CHECK(pickle->WriteString(log_id)); 37 CHECK(pickle->WriteString(log_id));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 93
92 bool DigitallySigned::SignatureParametersMatch( 94 bool DigitallySigned::SignatureParametersMatch(
93 HashAlgorithm other_hash_algorithm, 95 HashAlgorithm other_hash_algorithm,
94 SignatureAlgorithm other_signature_algorithm) const { 96 SignatureAlgorithm other_signature_algorithm) const {
95 return (hash_algorithm == other_hash_algorithm) && 97 return (hash_algorithm == other_hash_algorithm) &&
96 (signature_algorithm == other_signature_algorithm); 98 (signature_algorithm == other_signature_algorithm);
97 } 99 }
98 } // namespace ct 100 } // namespace ct
99 101
100 } // namespace net 102 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/signed_certificate_timestamp.h ('k') | net/cert/signed_certificate_timestamp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698