Age | Commit message (Collapse) | Author |
|
- One of the brainpool curves was not included in our enum Curve,
because at the time we implemented ECC support, it wasn't part of
the RFC4880bis document.
- Unfortunately, we failed to mark enum Curve as non-exhaustive, so
we cannot add a variant without breaking the API.
- We can, however, support the curve by matching on its OID.
|
|
|
|
These are typos in comments only.
|
|
- It is sometimes useful to iterate over all variants of a
given enum.
- Add the `variants` method to AsymmetricAlgorithm
`PublicKeyAlgorithm`, `SymmetricAlgorithm`, `AEADAlgorithm`,
`CompressionAlgorithm`, `HashAlgorithm`, `SignatureType`,
`ReasonForRevocation`, `DataFormat`, `packet::Tag`, and
`SubpacketTag` to do this.
|
|
- Adjust the attribute to reduce the number of #[allow]s.
|
|
- Long names are still supported using the alternate format specifier.
- Update NEWS file.
- Fixes #803.
|
|
- Long names are still supported using the alternate format specifier.
|
|
- Leave long names as alternate format.
|
|
- Deprecate the enum variant in preparation for v2 removal to let API
clients adjust their code as early as possible.
- Update NEWS.
- See #863.
|
|
- Make the previously long description available using the "alternate"
(#) format specifier.
- Make the default description short.
- Update subplot tests to use short algorithm names.
- Fixes #803.
|
|
|
|
|
|
- We cannot assert that an algorithm is supported in tests.
|
|
- We cannot make that kind of assumption in a test.
|
|
- Adapt to the new API:
- Gen is now a struct, not a Trait, and replaces StdThreadGen.
- The rand re-export has been removed. As a consequence, we need
our own function to generate an arbitrary value from a range.
|
|
- If the round_up clampes the value to u32::MAX, the precision does
not apply.
- Closes #784.
|
|
- Found by clippy::clone_on_copy lint.
|
|
- Continuation of e6a335b93a10620bcb7cbfa32e232949758f0c99.
|
|
- Use range syntac instad of manual comparisons. This is arguably
better to read.
- Found by clippy::manual_range_contains.
|
|
- Fixes #769.
|
|
|
|
It is customary for Rust data container structures to have both
is_empty and len, methods, because is_empty can both more to the point
and also faster to implement.
Sometimes is_empty makes no sense, as it doesn't for
openpgp::types::Curve, which isn't a container structure. Arguably it
would be better to rename Curve::len to something like Curve::bits,
but as that would change the API, I've opted to tell clippy that not
having is_empty in this case is OK.
Found by clippy lint len_without_is_empty:
https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
|
|
Just call the .iter() method instead of .into_iter() when either is
OK. The shorter form is shorter and should thus be easier to read.
Found by clippy lint into_iter_on_ref:
https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
|
|
Rewrite:
i = i + 1
as
i += 1
For a simple variable this is shorter, and a little bit clearer. For
more complex expressions it avoids making the reader having to
visually check that the left and right hand side of the assignment
really do have the same expression and that nothing tricky is going
on.
This was found by the clippy lint assign_op_pattern:
https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
|
|
The extra & in a pattern (match arm or if let) is unnecessary and only
makes the code harder to read. In most places it's enough to just
remove the & from the pattern, but in a few places a dereference (*)
needs to be added where the value captured in the pattern is used, as
removing the & changes the type of the captured value to be a
reference.
Overall, the changes are almost mechanical. Although the diff is huge,
it should be easy to read.
The clippy lint match_ref_pats warns about this. See:
https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats
|
|
|
|
|
|
- Some link targets have moved or were replaced since the link's
creation. Make them point to the new location or replacement.
|
|
- openpgp: Make broken relative links absolute:
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+packet),\1crate::packet,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+cert),\1crate::cert,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+parse),\1crate::parse,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+policy),\1crate::policy,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+serialize),\1crate::serialize,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+armor),\1crate::armor,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+types),\1crate::types,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!] *(\[`PacketPile`\]):).*$,\1 crate::PacketPile,' {} +
- openpgp: Link to PacketParser and Policy structs, not the modules.
- ffi: Make links to sequoia_openpgp and sequoia_net absolute
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+sequoia_openpgp),\1sequoia_openpgp,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+sequoia_net),\1sequoia_net,' {} +
|
|
- Apply cargo intraconv.
|
|
- The documentation refers to this function, however, until now it
was missing. Adding it is simple enough, but technically breaks
the API, because it breaks callers invoking
ValidCert::revocation_keys, which would previously deref to
Cert::revocation_keys.
- Avoid the breakage by adding an optional argument, which should be
None but can be Some(_) in order to appease existing users. See
#725.
|
|
- Conservatively consider unknown algorithms encryption- and
signing-capable.
- Fixes parsing of PKESK and Signature packets using unknown
algorithms.
- Fixes #722.
|
|
- See #335.
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
- https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
|
- The size of SystemTime is an implementation detail of the
standard library and does not give a direct indication whether
values larger that i32::MAX will fit in it.
- Adjust the test to observe if we are on a system can represent
a large value as a SystemTime or not, and assert that the values
are clamped correctly.
|
|
@nwalfield suggested this correction in #697
|
|
on Debian GNU/Linux systems, time_t is 4 octets for i386 (rust calls
this platform target_arch "x86"), armel ("arm"), armhf ("arm"), and
mipsel ("mips"). I've pulled these arch names from platforms [0].
[0] https://github.com/RustSec/platforms-crate/blob/main/src/target/arch.rs
There are likely other platforms that have a 32-bit time_t (and indeed,
some variants of 32-bit platforms like musl may have a 64-bit time_t [1]),
so this gating mechanism still isn't quite right. But it's an improvement
over the status quo of just gating on target_arch = "x86".
[1] https://musl.libc.org/time64.html
|
|
|
|
- SystemTime's underlying datatype may be only `i32`, e.g. on 32bit Unix.
As OpenPGP's timestamp datatype is `u32`, there are timestamps (`i32::MAX + 1`
to `u32::MAX`) which are not representable on such systems.
- To keep the API stable, instead of making the conversion fallible,
clamp those too large values to i32::MAX.
|
|
|
|
|
|
- Note that the spec is still in flux, therefore we don't expose it.
|
|
- January 1st is a holiday in much of the world.
- When we disable an algorithm, things will almost certainly break
somewhere.
- Reduce the chance that things break when people are on vacation by
using February 1st as the cutoff day instead of January 1st.
|
|
- Add `Duration::years`.
- This function assumes that there are 365.2425 days in a year,
which is the average number of days in a year in the Gregorian
calendar.
|
|
- Make `Duration::seconds` a const fn.
|
|
- Remove the function.
- Remove associated tests.
- Cert::revocation_keys does examine all live self-signatures.
- Fixes #629.
|
|
- Avoid the additional `fn f()`.
|