summaryrefslogtreecommitdiffstats
path: root/autocrypt
AgeCommit message (Collapse)Author
2023-01-11autocrypt: Release 0.25.0.autocrypt/v0.25.0Justus Winter
2023-01-05Don't select a cryptograhic backend in non-leaf crates.Justus Winter
- This way, only the leaf package has to concern itself with the selection of a cryptographic backend for Sequoia. Notably, we don't have to repeat all of sequoia-openpgp's features in all crates that use sequoia-openpgp. - Enable the new feature resolver which allows for this method. - A complication arises because we want to make `cargo test` work by default for the intermediate crates without developers having to select a cryptographic backend. To make that work, we implicitly select a backend in the dev dependencies which are enabled when compiling the tests. To make it even more convenient, we select the most convenient backend, which is CNG for Windows and Nettle, our default, for every other platform. - Now that we have implicitly selected CNG on Windows for running the tests, when the user wants to use Nettle on Windows, and does `cargo test --features sequoia-openpgp/crypto-nettle`, then two backends are selected: the implicitly selected CNG and the explicitly selected Nettle. In this case, we detect that an implicit selection has been made, and ignore the implicitly selected backend. Now, this has already been compiled by cargo (remember that we cannot influence the set of dependencies at the time the build script is run), but we can still ignore the implicit backend using conditional compilation (i.e. it will not be included in the resulting binary). The same happens on non-Windows platforms where Nettle is the implicit default for tests when the user explicitly requests a different backend. In both cases, Nettle and CNG are slim wrappers around native libraries, so the wasted compilation time is low.
2022-12-23Port to Rust Edition 2021.Justus Winter
2022-10-18Document MSRV in Cargo.toml.Nora Widdecke
- Use Cargo.toml's rust-version field instead of a rust-toolchain file. It is more flexible and does not prevent use of newer compilers.
2022-10-07autocrypt: use a char instead of a string with one characterHeiko Schaefer
A char as a pattern makes it more explicit that we're matching a single char. Sponsored-by: pep.foundation
2022-06-09openpgp: Rename PacketParser::{set_,}encrypted to processed.Wiktor Kwapisiewicz
- 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.
2022-05-06autocrypt, net: openpgp: Rewrite all usages of `Reader::new`.Wiktor Kwapisiewicz
2021-12-06autocrypt: Release 0.24.0.autocrypt/v0.24.0Justus Winter
2021-11-29Drop unnecessary lifetime annotations.Nora Widdecke
- Continuation of e6a335b93a10620bcb7cbfa32e232949758f0c99.
2021-11-29Remove unnecessary slicing.Nora Widdecke
- Found by clippy::redundant_slicing.
2021-10-18Relicense to LGPL 2.0 or later.Neal H. Walfield
- Change Sequoia's license from GPL 2.0 or later to LGPL 2.0 or later as unanimously decided on October 18, 2021 by: - Christof Wahl <cw@pep.security> (pEp security CEO) - Heiko Schaefer <heiko.schaefer@posteo.de> (pEp Foundation employee, Sequoia developer) - Justus Winter <justus@sequoia-pgp.org> (pEp Foundation employee, Sequoia Founder) - Neal H. Walfield <neal@pep.foundation> (pEp Foundation employee, Sequoia Founder) - Patrick Meier <pm@pep.security> (pEp security Chief Product and Service Officer) - Rudolf Bohli <rb@pep.security> (pEp security Chairman of the Board) - Volker Birk <vb@pep.security> (pEp security Founder, pEp Foundation Council)
2021-09-30Use strip_{prefix,suffix} for code that's easier to followLars Wirzenius
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
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-30Simplify &foo == &bar into foo == barLars Wirzenius
This was found by clippy lint op_ref: https://rust-lang.github.io/rust-clippy/master/index.html#op_ref
2021-09-30Use a clearer and shorter += or /= operationLars Wirzenius
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
2021-08-27autocrypt: Fix crash the autocrypt header parser.Nora Widdecke
- Fixes #743.
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 unecessary imports.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
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 byte literals.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
2021-04-09Lint: Remove unnecessary conversions.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
2021-03-08autocrypt: Release 0.23.1.autocrypt/v0.23.1Justus Winter
- Fixes #688.
2021-03-02openpgp, autocrypt, guide: Make tests more robust.Justus Winter
- Use a more stable formatting when comparing fingerprints.
2021-01-26autocrypt: Include at least one user id in cleaned certs.Justus Winter
2021-01-21autocrypt: Release 0.23.0.autocrypt/v0.23.0Justus Winter
2021-01-20Turn missing documentation into a warning in all crates.Justus Winter
2021-01-20autocrypt, ipc: Add missing documentation.Justus Winter
2021-01-20Add branding to all crates.Justus Winter
2020-12-16Release 1.0.0.v1.0.0Justus Winter
- Release buffered-reader 1.0.0, sequoia-openpgp 1.0.0, and sequoia-sqv 1.0.0. - Also release sequoia-sop 0.22.0.
2020-12-15openpgp: Make ComponentAmalgamation return iterator for signatures.Wiktor Kwapisiewicz
- 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).
2020-12-11Release 0.21.0.v0.21.0Justus Winter
2020-12-11Relax minimum dependencies.Nora Widdecke
- Relaxes those dependencies that were unnecessarily strict and patched by debian.
2020-12-10buffered-reader: Require Cookies to be Send and Sync.Azul
- This way the entire `BufferedReader<C>` will be `Send` and `Sync`. - Modify all other crates accordingly. - See #615.
2020-12-07openpgp: Make serialize::stream::Message Send + Sync.Justus Winter
- See #615.
2020-11-28autocrypt: do not implement openpgp::serialize traitsAzul
- 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.
2020-11-26openpgp: Add a lifetime to CertBuilder.Justus Winter
- This will allow us to use the CertBuilder to change certificates with detached secret keys in the future. - Fixes #608.
2020-10-14Release 0.20.0.v0.20.0Justus Winter
2020-10-14openpgp, autocrypt: Port to base64 0.13.Justus Winter
2020-10-12Allow to opt out of default features for sequoia-* dependenciesIgor Matuszewski
Cargo features are inherently additive, which means that if: - package A walts to build package C with features ABC, - package B walts to build package C with features BCD, the package C will be built with *both* ABC and BCD enabled. There is currently no way to specify mutually exclusive features and these have to be implemented using existing, additive, ones. That's problematic for us, because currently the cryptographic backend in sequoia-openpgp is selected globally at build-time and thus at most one can be selected for the compilation to succeed. It's worth noting that we can't use Cargo build scripts to emit the `--cfg`-passing [directive] because it does *not* affect Cargo's dependency resolution and that's needed in order to skip unbuildable backends on certain OSes (e.g. nettle when using Windows MSVC ABI). To allow for other local crates, most notably sequoia-openpgp-ffi, to build with different backends, we expose and forward any features that may be used by the crates they transitively depend on. At the time of writing, these different features seem to be implemented: - buffered-reader: compression support - openpgp: compression support and cryptographic backend - store: background-services feature [directive](https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-cfgkeyvalue)
2020-10-07autocrypt, openpgp: Unpin base64.Nora Widdecke
2020-09-21autocrypt: Extract test data to files.Nora Widdecke
2020-08-21Release 0.19.0.v0.19.0Justus Winter
2020-08-05openpgp: Don't implement Default for the Bitflags types.Justus Winter
- See #525.
2020-07-31Release 0.18.0.v0.18.0Justus Winter
2020-07-28openpgp: Reimplement the KeyFlags struct using Bitfield.Justus Winter
- This also drops the implementation of PartialOrd since we did not use it in the key selection after all. - Fixes #525.
2020-07-24openpgp: Improve PacketParserResult::as_ref, as_mut, and map.Justus Winter
- 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.
2020-06-12Release 0.17.0.v0.17.0Justus Winter
2020-06-12Relax dependency on base64.Justus Winter