summaryrefslogtreecommitdiffstats
path: root/openpgp/src/cert.rs
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-12-14 22:45:43 +0100
committerNeal H. Walfield <neal@pep.foundation>2020-12-14 22:52:43 +0100
commitc31ceb8dab94d2ea08879e36ad450547136ca2e1 (patch)
tree63c6402bdcfe4fcc41063793d220fe49c1218118 /openpgp/src/cert.rs
parent360da4f78448dc0b2c2724f5e13a12874604ce3e (diff)
openpgp: Simplify hash policies.
- The standard policy currently has two policies related to hash algorithms: when a hash algorithm should be rejected for normal signatures, and when a hash algorithm should be rejected for revocation sigantures. - If we distinguish two security contexts, then we'll have four policies (the cross product). - If the currently state is not already unmanageable, then this certainly is. - Simplify this by using a single scalar to represent how long a revocation certificate using a broken hash should continue to be accepted. - This is probably sufficiently expressive in practice as this is a largely inexact science. And, if a more nuanced policy is required, it is always possible to wrap `StandardPolicy`.
Diffstat (limited to 'openpgp/src/cert.rs')
-rw-r--r--openpgp/src/cert.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs
index 648be37a..5a840ab5 100644
--- a/openpgp/src/cert.rs
+++ b/openpgp/src/cert.rs
@@ -5324,7 +5324,7 @@ Pu1xwz57O4zo1VYf6TqHJzVC3OMvMUM2hhdecMUe5x6GorNaj6g=
// signatures. The standard policy reject SHA-1. So, use a
// custom policy.
let p = &P::new();
- let sha1 = p.hash_cutoffs(HashAlgorithm::SHA1).0.unwrap();
+ let sha1 = p.hash_cutoff(HashAlgorithm::SHA1).unwrap();
let p = &P::at(sha1 - std::time::Duration::from_secs(1));
let cert = Cert::from_bytes(