Nick Mathewson
6ddf55f799
Enforce that the periods in a consensus lifetime are nonempty.
...
To be valid, a lifetime must have valid_after < fresh_until <
valid_until.
2020-12-04 15:00:06 -05:00
Nick Mathewson
402d501020
Update a few comments.
2020-12-04 14:03:05 -05:00
Nick Mathewson
b56223f382
Dirmgr: Add a feature to keep the directory up-to-date.
...
This required me to move the sqlite connection from a rwlock into mutex,
since it isn't actually Sync.
2020-12-04 13:53:51 -05:00
Nick Mathewson
a72437a1c7
Abandon directory circuits on most kinds of directory failure.
...
(There are more cases that this _doesn't_ handle, but it's a start
for now.)
2020-12-02 09:46:35 -05:00
Nick Mathewson
db55c84c89
tor-dirmgr: retry up to 3 times on download failure.
2020-12-01 09:38:59 -05:00
Nick Mathewson
85cf6c09b3
Make mmap usage optional.
2020-12-01 07:56:36 -05:00
Nick Mathewson
d7b79095c8
tor-dirmgr: tests for storage.rs
2020-12-01 07:44:47 -05:00
Nick Mathewson
b0fc36c06a
Add a decorrelated-jitter implementation.
...
This is the algorithm we use on download failure to back off before
we retry.
2020-11-30 16:43:36 -05:00
Nick Mathewson
ffd4ed16a0
only expire dorectory info on a successful bootstrap.
2020-11-30 12:54:56 -05:00
Nick Mathewson
a1d02d4154
Add tests for blob_fname failing cases
2020-11-30 12:35:33 -05:00
Nick Mathewson
39bc39ddd5
More tests for sqlite.rs
2020-11-30 12:26:11 -05:00
Nick Mathewson
c3c3d24973
Initial tests for authcert storage
2020-11-30 11:59:41 -05:00
Nick Mathewson
baba0773c3
tor-dirmgr: Refactor storage not to take AuthCert type.
...
Add a new AuthCertMeta type to make it easier to test.
2020-11-30 11:26:03 -05:00
Nick Mathewson
e979bd5cb2
tor-dirmgr: Refactor storage not to take Microdesc type.
...
Since all it needs is an MDDigest, that's what it should take. This
will make it easier to test.
2020-11-30 11:11:39 -05:00
Nick Mathewson
1806135313
Add a test for sha3_dual
2020-11-30 11:00:58 -05:00
Nick Mathewson
e18b4e07cb
Upgrade a couple of dependencies
2020-11-28 14:17:42 -05:00
Nick Mathewson
ce221476d5
Fetch microdescriptors in parallel.
2020-11-24 11:59:56 -05:00
Nick Mathewson
142116c031
A little better logging on bootstrap.
2020-11-24 10:57:20 -05:00
Nick Mathewson
ea27328c67
Make legacy-store code disabled by default.
...
In the long run we might not want it at all.
2020-11-24 10:43:16 -05:00
Nick Mathewson
e3d4a6e114
Turn client-demo into a mostly-good client.
2020-11-24 10:33:38 -05:00
Nick Mathewson
f9d741ab36
Add a function to load a directory from cache.
2020-11-24 09:00:45 -05:00
Nick Mathewson
9749022fa2
When a consensus has enough descriptors, mark it non-pending.
2020-11-24 07:08:41 -05:00
Nick Mathewson
7af214b594
When storing consensuses, index them by the sha3 of the whole file.
2020-11-23 11:11:17 -05:00
Nick Mathewson
525f6b2bfa
Document and de-warning the rest of tor-dirmgr
2020-11-23 10:41:41 -05:00
Nick Mathewson
5f361d9529
Less copying of the authority list.
2020-11-23 09:33:43 -05:00
Nick Mathewson
b4831da536
A little documentation in tor-dirmgr
2020-11-23 09:23:20 -05:00
Nick Mathewson
3f89b3db7b
Make "storage" module private
2020-11-20 16:29:55 -05:00
Nick Mathewson
99e0b1d9f5
Remove a couple of #[allow]s.
2020-11-20 15:30:32 -05:00
Nick Mathewson
61593e1c59
Teach DirMgr to use its own NetDir, if present, to bootstrap itself.
2020-11-20 15:11:20 -05:00
Nick Mathewson
7a78bef0d1
Add a better way to get a shared directory out of a DirMgr.
2020-11-20 15:07:38 -05:00
Nick Mathewson
48da54d8c5
Remove needless Arc<> for DirStoreHandle. And DirStoreHandle itself.
2020-11-20 14:52:59 -05:00
Nick Mathewson
999706ee8f
Move a few more responsibilities into NetDirConfig.
...
Also start a DirMgr type.
2020-11-20 14:46:22 -05:00
Nick Mathewson
7e50c4ad3a
Move storage and config logic from netdir to dirmgr.
2020-11-20 12:20:43 -05:00
Nick Mathewson
9f4230fb1b
Initial pass on directory-manager code.
...
This code can now bootstrap from the network, cache the results, and
reload from cache.
There's lots more work to do here, including a big pile of tidying
and refactoring and testing and documentation.
2020-11-19 19:11:10 -05:00