summaryrefslogtreecommitdiffstats
path: root/net/src/wkd.rs
AgeCommit message (Collapse)Author
2023-11-23net: Improve the errors returned from wkd::get.Justus Winter
- Notably, check the http status code.
2023-11-22net: Fix wkd::get to return a Vec<Result<Cert>>.Justus Winter
- We may not understand all of the certs, but that is no reason not to return them.
2023-11-15net: Deduplicate code.Justus Winter
- This was duplicated by accident in bc1f27770002690f6117eaec59e8b11ca6196489.
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: Port the WKD code to reqwest.Justus Winter
- Fixes #992.
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>
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-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-03-07net: Allow checking if cert contains User ID for given domain.Wiktor Kwapisiewicz
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-10-28net, openpgp: Fix private documentation.Nora Widdecke
2021-10-11net: Correct link.Nora Widdecke
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-08-27Convert markdown to intra-doc links.Nora Widdecke
- Apply cargo intraconv.
2021-04-09Lint: Remove redundant clone().Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
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-03-31net: Protect against redirection loops in WKD requests.Wiktor Kwapisiewicz
- Use explicit depth to indicate how many redirects have been executed and break the loop if the number is bigger than 10. - Using `reqwest` was considered but rejected due to Tokio version incompatibility (`reqwest` insists on using Tokio 1 while Sequoia uses 0.2 in many places).
2021-03-31net: Follow redirects when using WKD lookup.Wiktor Kwapisiewicz
- See: https://lists.gnupg.org/pipermail/gnupg-devel/2018-May/033736.html - This solves lookups on domains that do redirects such as kernel.org - Fixes #666.
2021-01-21net: Release 0.23.0.net/v0.23.0Justus Winter
2020-11-28net: do not implement openpgp::serialize traits for KeyRingAzul
- We might implement it for an iterator over certs at some point. But in this case a simple `export` function is all we need. - This will also allow us to seal the `Serialize` and `Marshal` traits.
2020-11-27openpgp: Add Cert::merge_public and Cert::merge_public_and_secret.Justus Winter
- Secret key material is not authenticated by OpenPGP, so care must be taken when merging certificates. - Rename Cert::merge to Cert::merge_public_and_secret. - Add new function Cert::merge_public. This function can be used to merge certificates from untrusted sources as it ignores secret key material that cannot be authenticated by OpenPGP. - Fixes #584.
2020-11-12openpgp: Make crypto::Hash::digest fallible.Justus Winter
2020-10-23update net to futures=0.2amesgen
2020-10-14Use 'Examples' for the examples section.Justus Winter
- See #480.
2020-10-14Replace most 'extern crate' directives with 'use'.Justus Winter
- See #480.
2020-03-16net: Drop domain prefix from WKD paths.Justus Winter
- Previously, the paths generated included the top-level domain, but that assumes that the top-level directory of the web root is called like that. For me that was very surprising and inconvenient, so I changed it.
2020-03-11net: Create WKD policy file.Justus Winter
- Fixes #420.
2020-03-09Switch from failure to anyhow.Justus Winter
- 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.
2020-03-03openpgp: Only impl Serialize for objects that are normally exported.Neal H. Walfield
- Add two new traits: `Marshal` and `MarshalInto`. - Implement them instead of `Serialize` and `SerializeInto`. - Only implement `Serialize` and `SerializeInto` for data structures that are normally exported. - This should prevent users from accidentally serializing a bare signature (`Signature`) when they meant to serialize a signature packet (`Packet`), for instance. - Fixes #368.
2020-02-26openpgp: Don't unnecessarily use ComponentAmalgamation::bundle.Neal H. Walfield
- A `ComponentAmalgamation` derefs to a `ComponentBundle`. Don't use `ComponentAmalgamation::bundle` if it is unnecessary and doesn't improve legibility.
2020-02-26openpgp: Add a prelude file to import things related to certificatesNeal H. Walfield
- Add `openpgp/src/cert/prelude.rs` to import most types and traits related to certificates. - Use it instead of using the types and traits individually.
2020-02-06openpgp: Rename ComponentBinding to ComponentBundle, etc.Justus Winter
- Likewise KeyBinding, UserIDBinding, UserAttributeBinding, UnknownBinding, etc. - Reason: a self-signature on a component is a binding, but revocations and TPSes are not bindings. - Consistently call collections of components and associated signatures bundles now. Likewise for fields, methods. - Fixes #425.
2020-01-20openpgp: Rename ComponentIter::components to bindings.Neal H. Walfield
- `ComponentIter::components` returns `ComponentBindings`. It is more accurate to call it `ComponentIter::component_bindings`. But, since it is called on a component, just use the shorter name, `ComponentIter::bindings`.
2020-01-20openpgp: Use the new framework for Cert::userid.Justus Winter
- Fixes #414.
2020-01-07Fix broken links in the documentation.Justus Winter
2019-12-20net: Use openpgp crypto API for SHA1 hashIgor Matuszewski
2019-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-06openpgp: Replace RFC 2822 parser with a de factor parserNeal H. Walfield
- RFC 4880 says that "by convention, [a User ID Packet] includes an RFC 2822 [RFC2822] mail name-addr." This is not the actual convention, and attempting to parse User IDs using an RFC 2822 parser means that many common User IDs cannot be parsed. - Disparities between the actual convention and the stated convention include: - Neither users nor the software they use to create keys correctly quotes User IDs: - 'Nachname, Vorname <name@example.org>' is not valid, because it contains an unquoted comma. It should be 'Nachname\, Vorname <name@example.org>' or '"Nachname, Vorname" <name@example.org>'. (The same goes for dots, single quotes, etc.) - 'user@example.org <user@example.org>' is not valid, because it contains an unquoted at symbol. - 'Bj=?utf-8?q?=C3=B6?=rn <bjoern@example.net>' is encoded using RFC 2047, which is what RFC 2822 mandates when using non-ASCII characters, but no OpenPGP software would decode this User ID. In practice, everyone just uses UTF-8 (in this case: 'Björn <bjoern@example.net>'). - There are many examples of User IDs containing raw email addresses ('user@example.org'). But, these are not "name-addr"s. At best, they are RFC 2822 "mailbox"es. - Some User IDs only contain a name (e.g, "Frank PGP"). - RFC 2822 also includes a lot of complexity that no one uses or needs. For instance, CFWS (comments and folding whitespace) can be placed everywhere, and the rules for parsing them are complex. - Instead of continuing to bend the RFC 2822 parser to our will, we instead accept reality. - This patch replaces the RFC 2822 parser with a significantly simpler parser, which is based on actual convention (i.e., User IDs in the wild). - This parser is based on dkg's mail to the OpenPGP working group mailing list. Message-ID: <87woe7zx7o.fsf@fifthhorseman.net> https://mailarchive.ietf.org/arch/msg/openpgp/wNo27-0STfGR9JZSlC7s6OYOJkI - This initial version has one notable regression with respect to the RFC 2822 parser: it doesn't handle User IDs holding URIs.
2019-10-27Fix more spelling errors caught by codespellDaniel Kahn Gillmor
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-09-10net: Make function private.Justus Winter
2019-09-10net: Improve error handling.Justus Winter
2019-09-09net: Introduce enum wkd::Variant.Justus Winter
2019-09-09net: Update existing TPKs in a WKD.Justus Winter
2019-09-09net: Strip local signatures when creating WKD.Justus Winter
2019-09-09net: Rework WKD building, insert one TPK at a time.Justus Winter
- This improves error handling, and the API resembles collections.
2019-09-09net: Do not diddle with the permissions.Justus Winter