| 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..eb897f849d9bd6cca418734415a6ea26141adb8f 100644
|
| --- a/components/certificate_transparency/single_tree_tracker.h
|
| +++ b/components/certificate_transparency/single_tree_tracker.h
|
| @@ -5,11 +5,12 @@
|
| #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 "components/certificate_transparency/timestamped_leaf.h"
|
| #include "net/cert/ct_verifier.h"
|
| #include "net/cert/signed_tree_head.h"
|
| #include "net/cert/sth_observer.h"
|
| @@ -25,6 +26,9 @@ struct SignedCertificateTimestamp;
|
| } // namespace net
|
|
|
| namespace certificate_transparency {
|
| +struct OrderByTimestamp {
|
| + bool operator()(const TimestampedLeaf& lhs, const TimestampedLeaf& 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 +100,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<TimestampedLeaf, OrderByTimestamp> pending_new_sth_;
|
| +
|
| + // Set of log entries pending inclusion check.
|
| + std::set<TimestampedLeaf, OrderByTimestamp> pending_inclusion_check_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SingleTreeTracker);
|
| };
|
|
|