when deciding whether to discard an old cert from our cache.
We don't check it at all with respect to current time.
So if an authority generates a signing key in January, and then generates ten more signing keys within a week, and now it's April, we'll still keep all of them until they expire or until a new signing key shows up that's more than 7 days newer than them.
This cannot be the right logic.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
so we wait 7 days before deleting any unexpired certs, in case we see them again (and earlier in the function we ensure that we never delete the newest cert for a given authority).
Relatively quick review. The rewrite seems to solve this and #11457 (moved).
Thoughts:
if the first cert in the list is very expired and all subsequent certs are from the future, we don't remove it until we reach the future.
I think similar scenario to #11457 (moved), where one cert is created then soon after another is created, after two days all tors will discard the original cert. if the authority then starts reusing the original, everyone will re-request it every hour? This is much less bad than #11457 (moved), but it's a side-effect of discarding unexpired, superseded certs.
should we remember the signing key digest of the certs we download, and not discard superseded certs which we redownload often?
I wonder what other weird edge cases exist.
Minor consmetic changes
diff --git a/src/or/routerlist.c b/src/or/routerlist.cindex 7112282..83d1c69 100644--- a/src/or/routerlist.c+++ b/src/or/routerlist.c@@ -498,7 +498,7 @@ trusted_dirs_remove_old_certs(void) * Remove it. */ should_remove = 1; } else if (next_cert_published + SUPERSEDED_CERT_LIFETIME < now) {- /* Certificate has been superseded for OLD_CERT_LIFETIME.+ /* Certificate has been superseded for SUPERSEDED_CERT_LIFETIME. * Remove it. */ should_remove = 1;@@ -512,7 +512,7 @@ trusted_dirs_remove_old_certs(void) } DIGESTMAP_FOREACH_END; #undef DEAD_CERT_LIFETIME-#undef OLD_CERT_LIFETIME+#undef SUPERSEDED_CERT_LIFETIME trusted_dirs_flush_certs_to_disk(); }