summaryrefslogtreecommitdiffstats
path: root/net
AgeCommit message (Collapse)Author
2023-10-11openpgp: Add non-allocating accessors for parsed User ID components.Justus Winter
- Now that we use OnceCell for the cache, we can hand out references to the cached data. This closes the gap between UserID and ConventionallyParsedUserID, hence I think this addresses the concern in #377. - Deprecate the allocating variants. - Fixes #377.
2023-09-19net: Demonstrate how to use Tor.Justus Winter
- Fixes #104.
2023-09-19net: Alpha conversion: use the more appropriate URL instead of URI.Justus Winter
2023-09-19net: Port the WKD code to reqwest.Justus Winter
- Fixes #992.
2023-09-19net: Port the HKP code to reqwest.Justus Winter
2023-09-19net: Drop the network policy mechanism.Justus Winter
- This seems over-engineered in retrospect.
2023-09-15Bump MSRV to 1.67.Wiktor Kwapisiewicz
- Fixes https://gitlab.com/sequoia-pgp/sequoia/-/issues/1038
2023-08-24net: Use the new crypto::ecdh::decrypt_unwrap2.Justus Winter
2023-06-15net: Use z-base-32 instead of zbase32 for a permissive licenseDylan Aïssi
zbase32 is distributed under LGPL-3+ which is incompatible with some projects. Use the MIT licensed implementation z-base-32 instead. Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
2023-05-16net: Upgrade base64.Neal H. Walfield
- Upgrade base64 to version 0.21.
2023-03-24net: Release 0.27.0net/v0.27.0Neal H. Walfield
2023-01-26net: Switch to OpenSSL for DNSSEC validation.Wiktor Kwapisiewicz
2023-01-11net: Release 0.26.0.net/v0.26.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-07net: derive Default implementation instead of hand coding itHeiko Schaefer
Less code to maintain this way. Sponsored-by: pep.foundation
2022-10-07net: use Option::and_then instead of .map and .flattenHeiko Schaefer
More idiomatic this way. Sponsored-by: pep.foundation
2022-09-15net: Add support for DANE certificate retrieval.Wiktor Kwapisiewicz
- Add dane::get. - Make EmailAddress functions pub(crate) to use them from the DANE module. - Add tests for generating correct FQDN. - See #865.
2022-08-15ipc, net: Fix assert_send_and_sync's doctests.Nora Widdecke
- Previously, the doctests for the macros were not run, and hence not tested. Fix the few issues that came up when Rust 1.62 started running doctests. - We cannot test the macros in doctests, because the macros are not public. Add equivalent unit tests instead. - Changes copied from 9d4be0b243b6a0d61c7fa1b33d6b1f978f1b6601. - Fixes #916.
2022-07-14net: Release 0.25.0.net/v0.25.0Justus Winter
2022-06-12net: fix WKD URL generationLars Wirzenius
In WKD, when a URL is generated for an email, the local part is added to the URL as a query parameter exactly as it's in the input. Sequoia was previously converting it to lower case. This fixes it to avoid the change. However, the local part still needs to be converted to lower case for hash computation, so we do that when we compute the hash. Fixes #874 Sponsored-by: pep.foundation
2022-05-06autocrypt, net: openpgp: Rewrite all usages of `Reader::new`.Wiktor Kwapisiewicz
2022-04-22net: Assert that public types are Send + Sync.Justus Winter
2022-04-22net: Make AClient Send and SyncErik Escher
This allows futures with a Keyserver in scope to be Send, allowing them to be used with multithreaded async libraries such as tokio.
2022-03-07net: Allow checking if cert contains User ID for given domain.Wiktor Kwapisiewicz
2022-02-25ipc,net: Update rand dependency to 0.8Nora Widdecke
- Fixes #824.
2022-01-12net: Fix link.Neal H. Walfield
- Detected by the rustdoc::bare-urls lint.
2022-01-10pks: Fix "capability" parameter not being appended.Wiktor Kwapisiewicz
- Previous refactoring inadvertently broke capability URL construction. - Fix the bug by moving `append_pair` after `join`. - Add test cases to capability URL construction code.
2021-12-31pks: Use appropriate Error objects instead of raw strings.Wiktor Kwapisiewicz
2021-12-31pks: Return correct acceptable hashes for the remote signer.Wiktor Kwapisiewicz
2021-12-29pks: Add support for SHA-384 hash algorithm.Wiktor Kwapisiewicz
2021-12-13net: Use Content-Type header to pass hash algorithmWiktor Kwapisiewicz
This change aligns Private Key Store support to the newest version and changes how the hash algorithm is passed. Previously it was in the query parameters and the routine to add that parameter was prone to abuse on malformed input. Passing the correct algorithm in the `Content-Type` header is cleaner and simpler for both clients and servers.
2021-12-06net: Release 0.24.0.net/v0.24.0Justus Winter
2021-12-06net: Only enable hyper's server feature for tests.Justus Winter
2021-12-01Update tokio to 1.13.1.Nora Widdecke
- tokio 1.12 has RUSTSEC-2021-0124.
2021-11-29Drop unnecessary lifetime annotations.Nora Widdecke
- Continuation of e6a335b93a10620bcb7cbfa32e232949758f0c99.
2021-11-29Remove unnecessary borrows.Nora Widdecke
- Fixed with the help of clippy::needless_borrow.
2021-11-03net: Implement Signer and Decryptor for remote keys.Wiktor Kwapisiewicz
- Add sequoia_net::pks::unlock_signer. - Add sequoia_net::pks::unlock_decryptor.
2021-10-28net, openpgp: Fix private documentation.Nora Widdecke
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-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-10-11net: Correct link.Nora Widdecke
2021-09-30Allow if conditions that use complex codeLars Wirzenius
An if condition is an expression and can be as complex as the programmer wants. However, the more complex a condition is, the harder it tends to be to understand. I marked functions with such if conditions so that clippy won't complain about the code. I probably should have simplified the code, perhaps by extracting the condition to its own function, but it would have been much harder to do, so I didn't. Found by clippy lint blocks_in_if_conditions: https://rust-lang.github.io/rust-clippy/master/index.html#blocks_in_if_conditions
2021-09-30Add an is_empty method when len is thereLars Wirzenius
It is customary for Rust data container structures to have both is_empty and len, methods, because is_empty can both more to the point and also faster to implement. Sometimes is_empty makes no sense, as it doesn't for openpgp::types::Curve, which isn't a container structure. Arguably it would be better to rename Curve::len to something like Curve::bits, but as that would change the API, I've opted to tell clippy that not having is_empty in this case is OK. Found by clippy lint len_without_is_empty: https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
2021-09-30Avoid redundant closuresLars Wirzenius
If a closure just passes the argument it gets to a function, the closure is usually redundant and you can just use the function instead of the closure. Thus, instead of this: iter().map(|x| foo(x)) you can write this: iter().map(foo) This is shorter and simpler. Sometimes it doesn't work and the closure is necessary. Such locations can be marked with `#[allow(clippy::redundant_closure)]`. Found by clippy lint redundant_closure: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
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-30Drop unnecessary clone on a value that implements CopyLars Wirzenius
This was found by the clippy clone_on_copy lint: https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
2021-09-21Avoid matching on &Foo, when a plain Foo pattern worksLars Wirzenius
The extra & in a pattern (match arm or if let) is unnecessary and only makes the code harder to read. In most places it's enough to just remove the & from the pattern, but in a few places a dereference (*) needs to be added where the value captured in the pattern is used, as removing the & changes the type of the captured value to be a reference. Overall, the changes are almost mechanical. Although the diff is huge, it should be easy to read. The clippy lint match_ref_pats warns about this. See: https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats