summaryrefslogtreecommitdiffstats
path: root/sq
AgeCommit message (Collapse)Author
2021-12-07fix: change how signed file is mangledLars Wirzenius
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.
2021-12-06autocrypt: Release 0.24.0.autocrypt/v0.24.0Justus Winter
2021-12-06net: Release 0.24.0.net/v0.24.0Justus Winter
2021-12-01Update tokio to 1.13.1.Nora Widdecke
- tokio 1.12 has RUSTSEC-2021-0124.
2021-11-29sq: Simplify nested match expression.Nora Widdecke
- Found with clippy::collapsible_match.
2021-11-29Use std::mem::take instead of std::mem::replace, for clarity.Nora Widdecke
- 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
2021-11-29openpgp, sq: Drop unneeded clone on a Copy value.Nora Widdecke
- Found by clippy::clone_on_copy lint.
2021-11-29Prefer vec! macro.Nora Widdecke
- 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.
2021-11-29Remove unnecessary borrows.Nora Widdecke
- Fixed with the help of clippy::needless_borrow.
2021-11-29sq: Clarify output.Nora Widdecke
- The empty line is printed as first statement in both branches, so it's unconditional. Make that clear. - Found by clippy::branches_sharing_code
2021-11-22sq: Fix argument parsing.Nora Widdecke
- 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
2021-11-03sq: Delegate crypto operations to private key store if set.Wiktor Kwapisiewicz
- 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.
2021-11-03sq: Add parameter for specifying private key storeWiktor Kwapisiewicz
- Extend the decrypt and sign operations with private-key-store parameter. - Reduce the number of parameters by using wrapper structs.
2021-10-27sq: add scaffolding for an integration/acceptance test suiteLars Wirzenius
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.
2021-10-25ffi, net, sq: Update to tokio 1.0.Nora Widdecke
- 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.
2021-10-15sq: When merging keyrings, produce output in a reproducible orderLars Wirzenius
The output keyring now has keys in fingerprint order. Closes #762
2021-10-05sq: Don't panic if reading the password fails.Neal H. Walfield
Reported by: Jörg Knobloch <jorgk@jorgk.com>.
2021-09-30Annotate function to allow if_let_some_resultLars Wirzenius
2021-09-30Revert "Simplify tests for OK"Lars Wirzenius
This reverts commit 666c5731e5c705bc85007625524bf93a41994ee9.
2021-09-30Annotate functions where clippy::redundant_pattern_matching is OKLars Wirzenius
See https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
2021-09-30Tell clippy loops that never loop are OKLars Wirzenius
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
2021-09-30Join nested if statements with logical and into one statementLars Wirzenius
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
2021-09-30Rename variable to be clearerLars Wirzenius
Instead of using a variable named foo, which usually a placeholder, use a more descriptive name.
2021-09-30Simplify tests for OKLars Wirzenius
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.
2021-09-30Use .find() in an iteratorLars Wirzenius
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
2021-09-30Use .starts_with instead of .chars().next()Lars Wirzenius
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
2021-09-30Drop pointless @_ match pattern bindingsLars Wirzenius
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
2021-09-30Avoid naming field setting it from variable of the same nameLars Wirzenius
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
2021-09-30Use .cloned() on iterators, instead of .map(|x| x.clone())Lars Wirzenius
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
2021-09-30When returning an error, use "return" instead of "?"Lars Wirzenius
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
2021-09-30Use .is_empty() for clarity, instead of .len() == 0Lars Wirzenius
This was found by clippy lint len_zero: https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
2021-04-28sq: Implement sq key password.Justus Winter
2021-04-26openpgp: Add high-level interface for attested certifications.Justus Winter
- Fixes #335.
2021-04-26openpgp: Expose low-level functions for attestation key signatures.Justus Winter
- See #335.
2021-04-26openpgp: Expose support for attested certifications.Justus Winter
- This is a low-level interface. We will provide nicer abstractions in a followup. - See #335.
2021-04-26sq: Improve dumping of unknown variants.Justus Winter
- Some enums are non-exhaustive, so we need to handle unknown variants. Make this case more useful by falling back to the debug representation.
2021-04-13bench: Disable libtest benchmark harness.Nora Widdecke
- 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
2021-04-12Include LICENSE.txt in all published cratesFabio Valentini
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.
2021-04-09Lint: Remove redundant clone().Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
2021-04-09Lint: Use char for single characters.Nora Widdecke
- 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
2021-04-09Lint: Remove unecessary imports.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
2021-04-09Lint: Use next instead of nth(0).Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
2021-04-09Lint: Use is_empty().Nora Widdecke
- 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
2021-04-09Lint: Remove redundant returns.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
2021-04-09Lint: Use matches! macro.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
2021-04-09Lint: Remove redundant closures.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
2021-04-09Lint: Remove unnecessary conversions.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
2021-04-09Lint: Use lazy evaluation.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
2021-04-09openpgp, sq: Remove redundant semicolons.Wiktor Kwapisiewicz
- Compiling with 1.51 toolchains prints warnings about redundant semicolons. Remove them.
2021-03-19sq: Dump trust packets using the hex dumper.Justus Winter