Age | Commit message (Collapse) | Author |
|
Replacing the closure with just the value it returns would be simpler,
but it would result in more computation happening at runtime if the
result is Ok.
See
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
This clippy warning wasn't caught by CI, because we don't yet have
clippy in CI.
|
|
A chain of if statements is not guaranteed to test every possible
case, the way match does. Thus it seems better to use match here, when
there are three possible results from a comparison.
Found by clippy lint comparison_chain:
https://rust-lang.github.io/rust-clippy/master/index.html#comparison_chain
|
|
- This makes the code more succinct and also more robust (consider
for example that `field_sz - r.value().len()` may underflow.
|
|
- Cryptographic values are often expected to have a certain size.
Handling this is repetitive and error prone.
- This is especially problematic because MPI-encoding strips leading
zero bytes. Introduce two methods for that purpose.
- Fixes #759.
|
|
- Cryptographic values are often expected to have a certain size.
Handling this is repetitive and error prone. Introduce two
functions for that purpose.
|
|
|
|
- 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.
|
|
|
|
- See #627.
|
|
|
|
- This is only used to communicate with the GnuPG agent, so it
should not be in the openpgp crate.
|
|
- This will be used by all the implementations of crypto::Decryptor,
and if we don't want them to end up in the openpgp crate, we need
to make it public.
|
|
- See #474.
|
|
- Previously, we provided hash_reader to downstream users to verify
detached signatures. Nowadays, we have the DetachedVerifier that
does the same in a much more convenient way. Therefore, we drop
hash_reader, and move its non-public sibling hash_buffered_reader
to a more appropriate location.
|
|
- Text signatures require normalizing the line endings to "\r\n"
before the text is hashed. This change implements this for the
consumption of signatures. The next commit will handle the
production of such signatures.
- See #530.
|
|
- See #474.
|
|
- See #474.
|
|
- See #474.
|
|
- See #474.
|
|
- See #474.
|
|
|
|
|
|
To keep it consistent with other re-exports and to easier see at a
glance what is re-exported from the module.
|
|
To be consistent; we don't use plural forms for modules anywhere else
and Rust always uses singular forms.
|
|
|
|
|
|
- Previously, we used a thread-local cache of the Yarrow CPRNG
state. However, without fork(2)-detection this is not safe. For
now, just initialize a fresh one on every invocation.
|
|
|
|
- The hash context knows the algorithm now.
|
|
- The context knows the algorithm now.
|
|
- The module contains only one exported item.
|
|
|
|
|
|
|
|
- Remove direct access, provide Password::map instead.
|
|
|
|
- Fixes #381.
|
|
- A SignatureGroup currently contains a hash mapping hash algorithms
to hash contexts. Typically this will only contain one or two
mappings. At most it will contain one mapping for each algorithm
that we support (currently, we support 7 hash algorithms).
- Given the small expected and small maximum size, a vector is the
better data structure:
- The small number of elements means that look up time will be
comparable whether we do a linear scan or look in a hash (in
fact, the linear scan is probably cache friendlier).
- Iterating over a vector is faster than iterating over a hash
map. The is the fast path.
- A vector takes up less space.
- Change SignatureGroup::hashes to use a Vec instead of a HashMap.
|
|
|
|
- This is the result of running `cargo fix --edition`, with some
manual adjustments.
- The vast majority of changes merely qualify module paths with
'crate::'.
- Two instances of adding an anonymous pattern to a trait's
function.
- `async` is a keyword in Rust 2018, and hence it needs to be
escaped (e.g. in the case of the net::r#async module).
- The manual adjustments were needed due to various shortcomings of
the analysis employed by `cargo fix`, e.g. unexpanded macros,
procedural macros, lalrpop grammars.
|
|
- Add and use a function that fills a buffer with a thread-local
random number generator.
|
|
|
|
- See #302.
|
|
|
|
- Create a new module for memory protection. Move common code from
`Password` and `SessionKey` to a new type `Protected`.
|
|
|
|
- *S-Expressions* as described in the internet draft
[S-Expressions], are a way to communicate cryptographic primitives
like keys, signatures, and ciphertexts between agents or
implementations.
[S-Expressions]: https://people.csail.mit.edu/rivest/Sexp.txt
|
|
|
|
- Fixes #267.
|