Age | Commit message (Collapse) | Author |
|
The "binary signature" Subplot scenario was a little flaky. I could
reproduce this locally by running it repeatedly, and it would
invariably fail before the 300th repetition.
The problem is that the signature file produced by sq did not always
look like what the scenario expected. The fix is to change how the
signed file is modified: always remove the third line, after the
"BEGIN PGP SIGNATURE" and empty lines. Also, don't insist on the exit
code 1 for failure, until we've established what sq's exit codes can
be.
Fixes #786. This passes over 2000 runs of the "binary signature" test
run.
|
|
|
|
|
|
- tokio 1.12 has RUSTSEC-2021-0124.
|
|
- Found with clippy::collapsible_match.
|
|
- 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
|
|
- Found by clippy::clone_on_copy lint.
|
|
- The vec![] macro is more performant and often easier to read than
multiple push calls.
- Allow push to a Vec straight after creation in tests. Performance
is not that great of an issue in tests, and the fix would impact
legibility.
- Found by clippy::vec_init_then_push.
|
|
- Fixed with the help of clippy::needless_borrow.
|
|
- The empty line is printed as first statement in both branches, so
it's unconditional. Make that clear.
- Found by clippy::branches_sharing_code
|
|
- sq keyserver get expects a fingerprint or keyid, but only ever used
the keyhandle parsed as a fingerprint. Fix this by parsing as a
KeyHandle, instead.
- Found with clippy lint if_same_then_else:
https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
|
|
- If certificates contain secret keys try to decrypt the in place.
- If certificates contain only public bits and the private key store
has been set try to decrypt it using the sequoia_net::pks functions.
|
|
- Extend the decrypt and sign operations with private-key-store
parameter.
- Reduce the number of parameters by using wrapper structs.
|
|
Add support for an integration and acceptance test suite using the
Subplot tool (https://subplot.liw.fi/). There are the initial, very
simple test scenarios, to get us started. The goal is to introduce the
scaffolding for integration tests, so that further tests can be added
with ease later.
The tests are documented and defined in sq-subplot.md. In build.rs, we
call Subplot to generate test code from the markdown file. The tests
are run via "cargo test", as usual.
Subplot can also generate a typeset test document from sq-subplot.md,
but we don't do that here.
|
|
- net: hyper has two vulnerabilities:
- RUSTSEC-2021-0079: "Integer overflow in `hyper`'s parsing of the
`Transfer-Encoding` header leads to data loss" (vulnerability)
- RUSTSEC-2021-0078: "Lenient `hyper` header parsing of
`Content-Length` could allow request smuggling" (vulnerability)
Both are fixed in hyper 0.14.10., which depends on tokio 1. tokio
0.2 is incompatible to tokio 1, so we need to update that too, also
in the dependents sq and ffi.
hyper-tls 0.4 is incompatible to hyper 0.14., update to hyper-tls
0.5.
|
|
The output keyring now has keys in fingerprint order.
Closes #762
|
|
Reported by: Jörg Knobloch <jorgk@jorgk.com>.
|
|
|
|
This reverts commit 666c5731e5c705bc85007625524bf93a41994ee9.
|
|
See
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
|
|
We have two loops where the last statement is a return or a break,
without there being a continue. This means the loops will never loop.
This is a symptom of the code being hard to understand. We should
probably rewrite the logic without a loop, but I did not feel
confident doing that yet.
Found by clippy lint never_loop:
https://rust-lang.github.io/rust-clippy/master/index.html#never_loop
|
|
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
|
|
Instead of using a variable named foo, which usually a placeholder,
use a more descriptive name.
|
|
Instead of this:
if let Some(()) = key.secret_mut().decrypt_in_place(algo, &p).ok() { ... }
use this:
if key.secret_mut().decrypt_in_place(algo, &p).is_ok() { ... }
It's more to the point and easier to understand.
|
|
Instead of
iter().filter(|x| pred(x)).next()
use this:
iter().find(|x| pred(x))
This is more to the point, and thus easier to understand.
Found by clippy lint filter_next:
https://rust-lang.github.io/rust-clippy/master/index.html#filter_next
|
|
Instead of this:
name.chars().next() == Some('!')
use this:
name.starts_with('!')
It's more to the point, and does not require the reader to reason
about iterators and possible values returneed by .next().
Found by clippy lint chars_next_cmp:
https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp
|
|
In a match arm, instead of binding the matched value to the name "_",
just don't bind. Its shorter and easier to understand
Found by clippy lint redundant_patter:
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern
|
|
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
|
|
The dedicated method on iterators is shorter and more to the point,
and should thus be easier to understand.
Found by clippy lint map_clone:
https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
|
|
Instead of
Err(...)?;
which is correct but not idiomatic, write this:
return Err(...);
This was found by clippy lintt try_err:
https://rust-lang.github.io/rust-clippy/master/index.html#try_err
Sponsored-by: author
|
|
This was found by clippy lint len_zero:
https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
|
|
|
- Fixes #335.
|
|
- See #335.
|
|
- This is a low-level interface. We will provide nicer abstractions
in a followup.
- See #335.
|
|
- Some enums are non-exhaustive, so we need to handle unknown
variants. Make this case more useful by falling back to the debug
representation.
|
|
- The libtest benchmark harness that is automatically added by cargo
interferes with criterion. Disable it everywhere where there are no
benchmarks.
- https://github.com/rust-lang/rust/issues/47241
- https://bheisler.github.io/criterion.rs/book/faq.html
|
|
Having the license file in the root directory is not enough, since
cargo actions for workspace members will not consider this file.
This commit adds a symbolic link to the license file in the root
directory of all workspace members, so "cargo publish" will include
the LICENSE.txt file when publishing crates.
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
- https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
|
|
- 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#needless_return
|
|
- 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
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
|
|
- Compiling with 1.51 toolchains prints warnings about redundant
semicolons. Remove them.
|
|
|