Age | Commit message (Collapse) | Author |
|
- Convert `encrypted` to `processed`.
- Since `set_encrypted` is internal API it was directly renamed without
forwarder stub.
- `encrypted()` is public API thus the old function is converted to a
forwarder of the negation of `processed()`.
- `unprocessed()` marked as deprecated.
- Update docs and NEWS file.
- Fixes #845.
|
|
|
|
- Continuation of e6a335b93a10620bcb7cbfa32e232949758f0c99.
|
|
- Found by clippy::redundant_slicing.
|
|
Instead of:
if text.starts_with(prefix) {
&text[prefix.len()..]
} else {
&text
}
use this:
if let Some(rest) = text.strip_prefix(prefix) {
rest
} else {
&text
}
The strip_prefix is easier to understand, and also removes the
dependency between the if condition and the computation to get the
slice after the prefix. The dependency is reasonably clear, but the
compiler does not understand it so it's plausible that a future change
might change the condition but not the slice. The approach using
strip_prefix avoids that.
This was found by the clippy lint manual_strip:
https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
|
|
When creating a struct with a field foo, using a variable also named
foo, it's not necessary to name the field explicitly. Thus, instead
of:
Self { foo: foo }
use this:
Self { foo }
The shorter form is more idiomatic and thus less confusing to
experienced Rust programmers.
This was found by the clippy lint redundant_field_names:
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
Sponsored-by: author
|
|
This was found by clippy lint op_ref:
https://rust-lang.github.io/rust-clippy/master/index.html#op_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
|
|
- Fixes #743.
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
|
|
- 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#needless_return
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
|
- Use a more stable formatting when comparing fingerprints.
|
|
|
|
|
|
|
|
|
|
|
|
- Adjust `self_signatures`, `certifications`, `self_revocations` and
`other_revocations` to return `impl Iterator` over the signatures.
- Adjust all call-sites including doc tests.
- Adjust downstream projects (sq, autocrypt).
|
|
- This way the entire `BufferedReader<C>` will be `Send` and `Sync`.
- Modify all other crates accordingly.
- See #615.
|
|
- See #615.
|
|
- An autocrypt header is not serialized the same way a Cert is.
We might extend the Serialize trait to also allow for armored output.
This would make no sense for an autocrypt header.
- So just implement a `serialize` function
independently of the openpgp crates serialize module.
|
|
|
|
- Previously, these method withheld information in the EOF case (and
in case of `map` this loss is irrecoverable). Fix this by
returning a Result instead.
|
|
Authentication subkeys are not needed for autocrypt, let's reduce the
size of the export.
- Fixes #506
|
|
- Drop `Cert::from_packet_pile`.
- Fixes #462.
|
|
- Rename `Cert::revoked`, `ValidCert::revoked`,
`ValidAmalgamation::revoked`, and `ComponentBundle::revoked` to
revocation_status to more accurately match what it does.
- Don't rename `ValidComponentAmalgamationIter::revoked` or
`ValidKeyAmalgamationIter::revoked`. They don't return the
revocation status; they check whether the key is revoked.
|
|
- Add a new constructor that takes headers. This allows us to make
the header argument polymorphic.
|
|
- Previously, PartialBodyFilter::drop made an effort to finalize the
filter. This, however, is only a best-effort mechanism: It cannot
report errors.
- Because of this, we now believe that it actually exacerbates the
problem of downstream users not finalizing the filter: It will
work most of the time, but sometimes fail.
- Drop the implementation of Drop. Fix all the problematic test
cases.
|
|
This reverts commit 2e1eec5fe4157a391a13554ff7df3075cfe043cc.
|
|
- This avoids the partial implementation imitating
std::option::Option, replacing it with std::result::Result.
- As a benefit, std::result::Result is in the prelude, simplifying a
lot of parsing loops.
|
|
|
|
- `decrypted` implies that the packet was previously encrypted.
However, If we parse a signed-only message, the literal packet was
never encrypted. Provide the inverse predicate instead, which is
less misleading.
|
|
|
|
- See #462.
|
|
- Refactor parsing of Autocrypt headers into own function.
- Key gossip uses the same format as specified in the spec [0].
- Add tests from attached ticket.
- Fixes #394.
[0]: https://autocrypt.org/level1.html#key-gossip
|
|
|
|
- When creating an Autocrypt header, make sure the components are
valid according to the policy and not revoked, and include the
current valid binding signature, not the newest one, whose
creation time may be in the future.
|
|
- A `ComponentAmalgamation` derefs to a `ComponentBundle`. Don't
use `ComponentAmalgamation::bundle` if it is unnecessary and
doesn't improve legibility.
|
|
- Add `openpgp/src/cert/prelude.rs` to import most types and traits
related to certificates.
- Use it instead of using the types and traits individually.
|
|
- Add the `bundle()` method to the Amalgamation trait instead of
implementing it on each struct.
|
|
- The Amalgamation trait only applies to ValidComponents. Rename it
accordingly.
|
|
|
|
- Move the autocrypt-related functionality to a new crate.
- Fixes #424.
|