Age | Commit message (Collapse) | Author |
|
|
|
- While we correctly ignored marker packets in the CertParser, we
did not ignore them in the CertValidator. This made sq inspect
complain about marker packets in certrings.
|
|
- In contrast to UnsupportedCert, this variant carries all the
packets that we failed to parse into a cert. Notably, this
includes primary keys that we don't understand. Keeping the
packets with the errors allows us to at least roundtrip the
packets.
|
|
|
|
- Replace manual implementations of Default where the derive(Default)
is identical.
- Suggested by clippy,
https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impl
|
|
- Instead of creating a default struct and immediately afterwards
changing a field, use this type of initialization syntax:
Struct { field: value, ..Default::default() }.
- Suggested by clippy::field_reassign_with_default.
|
|
Certain method names are typically provided by traits, and it can be
confusing to readers when a method uses that name without the type
implementing the trait. Mark the cases we have to tell clippy these
cases are OK. Implementing the corresponding traits would have changed
API so I opted not to do that.
Found by clippy lint new_without_default:
https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
|
|
Instead of this:
if foo {
if bar {
...
}
}
do this:
if foo && bar {
...
}
Nesting statements implies a more complicated code structure than it
really is. Thus it's arguably simpler to write a combined condition by
joining the two conditions with a logical and operation.
Found by clippy lint collapsible_if:
https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
|
|
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
Sponsored-by: author
|
|
- 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.
|
|
Preserve the filters through CertParser::reset.
|
|
- Consider a keyring of the form: `[ Alice, NUL, Bob ]`. The
CertParser should return `[ Ok(Alice), Err(SomeError), Ok(Bob) ]`.
Currently, we get `[ Err(SomeError), Ok(Alice), Ok(Bob) ]`,
because the error is returned eagerly.
- Fix it.
- Fixes #699.
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
|
|
- 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#useless_conversion
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
|
|
|
|
- Avoid the additional `fn f()`.
|
|
- See #480.
|
|
- See #615.
|
|
- This way the entire `BufferedReader<C>` will be `Send` and `Sync`.
- Modify all other crates accordingly.
- See #615.
|
|
|
|
|
|
- Fixes #256.
|
|
|
|
- See #480.
|
|
- Three of the five vectors will never contain any values.
|
|
- See #466.
|
|
- Implement `From<Vec<Result<Packet>>>` and `From<Vec<Packet>>` for
`CertParser`.
|
|
- Add a unit test that checks that `CertParser` correctly handles
invalid and out of place packets.
|
|
- When parsing a certificate in `Cert::parse`, stop when we
encounter an invalid packet.
- Stop if the first packet is not a valid start of a certificate.
- Stop if the packet is not valid for a certificate.
- Change `Cert::merge_packets` to check for invalid packets.
- If we have a valid certificate followed by an invalid packet,
then `Cert::parse` will not immediately return an error, but
return the valid certificate. Only if the caller asks for a
second certificate will it return an error.
|
|
- This slipped in in 6550051e23704d7e6c47e8553e55f0653b14c8cc.
|
|
|
|
- Instead of taking an iterator over `Result<Packet>`, take an
`Into<Result<Packet>>>`.
|
|
- Fix `CertParser::iter`'s type to be a `Box<'a +
Iterator<Item=Result<Packet>>>` rather than trying to be generic.
|
|
- Having removed the `PacketSource::PacketParser` variant, the
`PacketSource` enum is basically an `Option`. So, just turn it
into one.
|
|
- Now that `PacktSource::Iter` returns a `Result<Packet>` instead of
a `Packet`, we can implement `PacketSource::PacketParser` in terms
of `PacktSource::Iter`.
|
|
- Change `CertParser` to take a fallible iterator.
- This change allows the iterator to propagate parse errors as such.
Otherwise, parse errors are indistinguishable from EOF.
|
|
|
|
- Don't export CertValidity, KeyringValidator, KeyringValidity, or
MessageValidity.
- Fixes #490.
|
|
- Keyring is spelt keyring, not key ring.
- Cf. https://tools.ietf.org/html/rfc4880#section-3.6
|
|
- Make CertValidator `pub(crate)` instead of `pub`.
- Remove unused methods.
- Mark `push_token` as `#[cfg(test)]` as it is used only in tests.
|
|
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.
|
|
|
|
- `cert::components` is about `ComponentBundle`s, not `Component`s.
|
|
- See #462.
|
|
- Use the anyhow crate instead of failure to implement the dynamic
side of our error handling. anyhow::Error derefs to dyn
std::error::Error, allowing better interoperability with other
stdlib-based error handling libraries.
- Fixes #444.
|