summaryrefslogtreecommitdiffstats
path: root/openpgp/src/policy
AgeCommit message (Collapse)Author
2022-11-18openpgp: Improve error message when rejecting a packet.Neal H. Walfield
- When we reject a particular version of a packet, indicate what version of the packet we rejected.
2022-11-17openpgp: Allow setting a policy for specific versions of a packet.Neal H. Walfield
- For some packets we'd like to have different policies depending on the version. This in particular applies to Signatures: by default we want to reject v3 signatures, but accept v4 signatures. - By default, reject v3 signatures as of 2007. - Fixes: #945
2022-11-15openpgp: Simplify using a good list with a StandardPolicy.Neal H. Walfield
- To use a good list, we need to reject all options by default and then only enable those on the good list. - Add a mechanism to reject all options in a particular category (hash algorithms, critical subpackets, asymmetric algorithms, symmetric algorithms, AEAD algorithms, and packet tags). - See #941.
2021-11-29Use std::mem::take instead of std::mem::replace, for clarity.Nora Widdecke
- Replace let bar = std::mem::replace(&foo, Default::Default()); with let bar = std::mem::take(&foo); The new version seems a little clearer. - Found by clippy: https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default
2021-04-09Lint: Use lazy evaluation.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
2020-12-14openpgp: Simplify hash policies.Neal H. Walfield
- 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`.
2020-02-10openpgp: Extend StandardPolicy to consider hash algorithms.Neal H. Walfield
- Extend `StandardPolicy` to consider hash functions when evaluating signatures. - Use defaults that are based on published attacks. - Provide an interface to modify the policy.