Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 namespace net { | 7 namespace net { |
| 8 | 8 |
| 9 namespace ct { | 9 namespace ct { |
| 10 | 10 |
| 11 bool SignedCertificateTimestamp::LessThan::operator()( | |
| 12 const scoped_refptr<SignedCertificateTimestamp>& lhs, | |
| 13 const scoped_refptr<SignedCertificateTimestamp>& rhs) const { | |
| 14 if (lhs.get() == rhs.get()) | |
| 15 return false; | |
| 16 if (lhs->signature.signature_data < rhs->signature.signature_data) | |
| 17 return true; | |
| 18 if (lhs->signature.signature_data == rhs->signature.signature_data) { | |
| 19 if (lhs->log_id < rhs->log_id) | |
| 20 return true; | |
| 21 if (lhs->log_id == rhs->log_id) { | |
| 22 if (lhs->timestamp < rhs->timestamp) | |
| 23 return true; | |
| 24 if (lhs->timestamp == rhs->timestamp) { | |
| 25 if (lhs->extensions < rhs->extensions) | |
| 26 return true; | |
| 27 if (lhs->extensions == rhs->extensions) | |
| 28 return lhs->version < rhs->version; | |
| 29 } | |
| 30 } | |
| 31 } | |
| 32 return false; | |
|
wtc
2013/11/21 03:13:47
Thanks for implementing this.
This is more compli
alcutter
2013/11/21 10:56:39
That's a much more pleasing way of doing it, thank
| |
| 33 } | |
| 34 | |
| 11 SignedCertificateTimestamp::SignedCertificateTimestamp() {} | 35 SignedCertificateTimestamp::SignedCertificateTimestamp() {} |
| 12 | 36 |
| 13 SignedCertificateTimestamp::~SignedCertificateTimestamp() {} | 37 SignedCertificateTimestamp::~SignedCertificateTimestamp() {} |
| 14 | 38 |
| 15 LogEntry::LogEntry() {} | 39 LogEntry::LogEntry() {} |
| 16 | 40 |
| 17 LogEntry::~LogEntry() {} | 41 LogEntry::~LogEntry() {} |
| 18 | 42 |
| 19 void LogEntry::Reset() { | 43 void LogEntry::Reset() { |
| 20 type = LogEntry::LOG_ENTRY_TYPE_X509; | 44 type = LogEntry::LOG_ENTRY_TYPE_X509; |
| 21 leaf_certificate.clear(); | 45 leaf_certificate.clear(); |
| 22 tbs_certificate.clear(); | 46 tbs_certificate.clear(); |
| 23 } | 47 } |
| 24 | 48 |
| 25 DigitallySigned::DigitallySigned() {} | 49 DigitallySigned::DigitallySigned() {} |
| 26 | 50 |
| 27 DigitallySigned::~DigitallySigned() {} | 51 DigitallySigned::~DigitallySigned() {} |
| 28 | 52 |
| 29 } // namespace ct | 53 } // namespace ct |
| 30 | 54 |
| 31 } // namespace net | 55 } // namespace net |
| OLD | NEW |