Chromium Code Reviews| Index: components/certificate_transparency/single_tree_tracker.h |
| diff --git a/components/certificate_transparency/single_tree_tracker.h b/components/certificate_transparency/single_tree_tracker.h |
| index f7afe72c3b449ed80396f12f54744cce005f38cf..4e9b50576781e305256d649ab77fa753eea5a0d3 100644 |
| --- a/components/certificate_transparency/single_tree_tracker.h |
| +++ b/components/certificate_transparency/single_tree_tracker.h |
| @@ -5,12 +5,13 @@ |
| #ifndef COMPONENTS_CERTIFICATE_TRANSPARENCY_SINGLE_TREE_TRACKER_H_ |
| #define COMPONENTS_CERTIFICATE_TRANSPARENCY_SINGLE_TREE_TRACKER_H_ |
| -#include <map> |
| +#include <set> |
| #include <string> |
| #include "base/memory/ref_counted.h" |
| #include "base/time/time.h" |
| #include "net/cert/ct_verifier.h" |
| +#include "net/cert/merkle_tree_leaf.h" |
| #include "net/cert/signed_tree_head.h" |
| #include "net/cert/sth_observer.h" |
| @@ -25,6 +26,10 @@ struct SignedCertificateTimestamp; |
| } // namespace net |
| namespace certificate_transparency { |
| +struct OrderByTimestamp { |
| + bool operator()(const net::ct::MerkleTreeLeaf& lhs, |
| + const net::ct::MerkleTreeLeaf& rhs); |
| +}; |
| // Tracks the state of an individual Certificate Transparency Log's Merkle Tree. |
| // A CT Log constantly issues Signed Tree Heads, for which every older STH must |
| @@ -96,17 +101,23 @@ class SingleTreeTracker : public net::CTVerifier::Observer, |
| const net::ct::SignedCertificateTimestamp* sct); |
| private: |
| + // Returns true if |leaf| is pending a newer STH. |
| + bool EntryPendingNewSTH(const net::ct::MerkleTreeLeaf& leaf); |
| + |
| + // Returns true if |leaf| is pending inclusion check. |
| + bool EntryPendingInclusionProof(const net::ct::MerkleTreeLeaf& leaf); |
| + |
| // Holds the latest STH fetched and verified for this log. |
| net::ct::SignedTreeHead verified_sth_; |
| // The log being tracked. |
| scoped_refptr<const net::CTLogVerifier> ct_log_; |
| - // List of log entries pending inclusion check. |
| - // TODO(eranm): Rather than rely on the timestamp, extend to to use the |
| - // whole MerkleTreeLeaf (RFC6962, section 3.4.) as a key. See |
| - // https://crbug.com/506227#c22 and https://crbug.com/613495 |
| - std::map<base::Time, SCTInclusionStatus> entries_status_; |
| + // Set of log entries pending a fresh STH. |
| + std::set<net::ct::MerkleTreeLeaf, OrderByTimestamp> pending_new_sth_; |
|
Rob Percival
2016/05/26 17:33:15
Are you thinking of adding a timestamp to MerkleTr
Eran Messeri
2016/06/30 19:58:28
I've added another class.
|
| + |
| + // Set of log entries pending inclusion check. |
| + std::set<net::ct::MerkleTreeLeaf, OrderByTimestamp> pending_inclusion_check_; |
| DISALLOW_COPY_AND_ASSIGN(SingleTreeTracker); |
| }; |