From 7e78e716610ac3a9bff86035c52b344b437951a2 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 6 Jan 2020 10:29:13 +0100 Subject: openpgp: Pass a timestamp to the KeyIter instead of each filter. - KeyIter::revoked and KeyIter::key_flags (and its variants) didn't take a time stamp so they could only be used for filtering keys based on their current state, not their state at some time in the past. Adding a time stamp to each of the filters would have fixed the problem, but it would have made the interface ugly: callers always want the same time stamp for all filters. - Split KeyIter into two structures: a KeyIter and a ValidKeyIter. - Add KeyIter::policy. It takes a time stamp, which is then used for filters like `alive` and `revoked`, and it returns a ValidKeyIter, which exposes filters that require a time stamp. --- store/src/backend/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'store') diff --git a/store/src/backend/mod.rs b/store/src/backend/mod.rs index ccb80551..b9fc1a9a 100644 --- a/store/src/backend/mod.rs +++ b/store/src/backend/mod.rs @@ -806,7 +806,7 @@ impl KeyServer { /// Keeps the mapping of (sub)KeyIDs to keys up-to-date. fn reindex_subkeys(c: &Connection, key_id: ID, cert: &Cert) -> Result<()> { - for key in cert.keys().map(|ka| ka.key()) { + for key in cert.keys() { let keyid = key.keyid().as_u64() .expect("computed keyid is valid"); -- cgit v1.2.3