summaryrefslogtreecommitdiffstats
path: root/openpgp/src/keyid.rs
AgeCommit message (Collapse)Author
2024-01-25openpgp: Reject short key IDs.Neal H. Walfield
- When parsing a key ID string, reject short key IDs. - Note: we can't reject short key IDs in `KeyID::from_bytes`, because that function in infallible. But, that function does return `KeyID::Invalid` when presented with a short key ID. - Fixes #388.
2023-09-29openpgp: Change the hex parsing to accept odd number of nibbles.Justus Winter
- This came up as the new leak tests use our hex parsing functions to parse /proc/self/maps and apparently Linux will drop leading zeros from addresses. - Fix this by allowing these functions to operate on an odd number of nibbles. I see no reason no reason not to do that, except for the fact that we don't want to establish that it is okay to drop leading zeros from key IDs and fingerprints, hence I preserved the behavior of parsing key IDs and fingerprints.
2023-02-10openpgp: Optimize writing KeyIDs using Formatter API.Wiktor Kwapisiewicz
2022-02-22openpgp: Support v5 fingerprints.Justus Winter
- Supporting v5 fingerprints is important so that we can process signature subpackets containing them, even if we don't yet support any v5 formats. Consider being part of a group of recipients where one of the recipients has a v5 key: then, the intended recipient fingerprint subpacket contains a v5 fingerprint for that v5 recipient. See also #820.
2021-12-13ipc, openpgp: Bump quickcheck to 1.0.3.Nora Widdecke
- Adapt to the new API: - Gen is now a struct, not a Trait, and replaces StdThreadGen. - The rand re-export has been removed. As a consequence, we need our own function to generate an arbitrary value from a range.
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
2021-08-27ffi, openpgp: Cleanup links after cargo intraconv.Nora Widdecke
- openpgp: Make broken relative links absolute: - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+packet),\1crate::packet,' {} + - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+cert),\1crate::cert,' {} + - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+parse),\1crate::parse,' {} + - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+policy),\1crate::policy,' {} + - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+serialize),\1crate::serialize,' {} + - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+armor),\1crate::armor,' {} + - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+types),\1crate::types,' {} + - find -name "*.rs" -exec sed -i -E 's,^( *//[/!] *(\[`PacketPile`\]):).*$,\1 crate::PacketPile,' {} + - openpgp: Link to PacketParser and Policy structs, not the modules. - ffi: Make links to sequoia_openpgp and sequoia_net absolute - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+sequoia_openpgp),\1sequoia_openpgp,' {} + - find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+sequoia_net),\1sequoia_net,' {} +
2021-08-27Convert markdown to intra-doc links.Nora Widdecke
- Apply cargo intraconv.
2021-04-09Lint: Use byte literals.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
2021-03-02openpgp: Fix documentation.Justus Winter
2021-03-02openpgp: Drop spaces from default string representation.Justus Winter
- Spaces in key ids and fingerprints make them awkward to copy and pass as command line arguments. Change the default representation. For the rare occasions that we expect users to manually verify fingerprints, the previously introduced *::to_hex_pretty functions can be used. - Fixes #422.
2021-03-02openpgp: Add methods for hexadecimal representation with spaces.Justus Winter
- These are explicitly intended for manual comparison of key ids and fingerprints. - See #422.
2021-01-21openpgp: Typos.Justus Winter
2020-12-08openpgp: Use parens for assert_send_and_sync!.Azul
2020-12-08openpgp: Ensure public types are Send and Sync.Azul
- See #627.
2020-11-30openpgp: Improve documentation of Fingerprint, KeyID, and KeyHandle.Nora Widdecke
- Fixes #465.
2020-11-06openpgp: Use non_exhaustive attribute.Nora Widdecke
- Fixes #563 - With an MSRV >= 1.40.0, we can use #[non_exhaustive], as mentioned in #406. - This is also a clippy lint: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
2020-10-14Replace most 'extern crate' directives with 'use'.Justus Winter
- See #480.
2020-09-22openpgp: Remove `quickcheck` feature.Wiktor Kwapisiewicz
- Adjust code to test for `cfg(test)` only, - Remove `quickcheck` and `rand` from dependencies so that they stay only in dev-dependencies, - Remove mention of `x-quickcheck` feature from the documentation, - Fixes #545.
2020-06-11openpgp: Mark enum Fingerprint as non-exhaustive.Justus Winter
2020-06-11openpgp: Mark enum KeyID as non-exhaustive.Justus Winter
2020-06-11openpgp: Improve documentation.Justus Winter
- Issuer fingerprint and intended recipient subpackets do contain a version number. - Typo.
2020-06-08openpgp: Introduce feature flag for quickcheck.Nora Widdecke
- Make quickcheck dependency optional. - Make quickcheck a dev-dependency for tests. - Fix doctests for - cert::ValidCert::user_attributes, - cert::builder::CertBuilder::add_user_attribute, - cert::revoke::UserAttributeRevocationBuilder - cert::revoke::UserAttributeRevocationBuilder::build. Doctests do not use cfg(test), so we cannot use quickcheck in there.
2020-05-11openpgp: Use {to,from}_be_bytes.Nora Widdecke
- Replace bitshifts with the conversion functions from the standard library.
2020-04-29openpgp: Re-add KeyID/Fingerprint::from/to_hex.Wiktor Kwapisiewicz
- Add KeyID::to_hex. - Add KeyID::from_hex. - Add Fingerprint::to_hex. - Add Fingerprint::from_hex. - Fixes #456.
2020-04-06openpgp: Rename as_slice to as_bytes.Nora Widdecke
- KeyID::as_slice and KeyID::from_bytes mirror each other. This should be reflected in the functions' names. Also, as_bytes is more descriptive. - Same for Fingerprint::as_slice and Fingerprint::as_bytes. - KeyHandle::as_slice renamed for consistency.
2020-04-02openpgp: Actually drop KeyID::from_hex.Justus Winter
2020-04-02openpgp: Drop Fingerprint::from_hex in favor of FromStr.Justus Winter
- See #462.
2020-04-02openpgp: Drop KeyID::from_hex in favor of FromStr.Justus Winter
- See #462.
2020-03-31openpgp: Improve summary line of modules and types.Justus Winter
- Avoid repeating the type name. - Avoid self referential, trivial descriptions. - Avoid the terms OpenPGP and Sequoia. - Fix mistakes from the Message -> PacketPile rework.
2020-03-31openpgp: Move definition of struct KeyID.Justus Winter
2020-03-20openpgp: Remove `to_hex` in KeyHandle, KeyID and Fingerprint.Wiktor Kwapisiewicz
- Replace all usages of `to_hex` with formatting string with :X specifier. - Fixes #456.
2020-03-18openpgp: Allow formatting KeyID with X and xWiktor Kwapisiewicz
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-01oopenpgp: Add a conversion from [u8; 8] to a KeyID.Neal H. Walfield
2020-02-06openpgp: Drop explicit implementation of ToString.Justus Winter
2019-12-03openpgp: Rename openpgp::conversions to openpgp::fmt.Justus Winter
2019-11-26openpgp: Implement From<Fingerprint> for KeyID.Justus Winter
- Remove Fingerprint::to_keyid, use From instead.
2019-09-03openpgp: Assert that central types are Send and Sync.Justus Winter
- Add compile-time assertions that public types like Packet, TPK, Message... can be send across thread boundaries, and can be safely accessed from multiple threads. - Fixes #334.
2019-08-26openpgp: Implement FromStr for some types.Justus Winter
- This implements std::str::FromStr for types that have string-representations and are reasonably likely to be encountered by downstream users, e.g. fingerprints or messages. This allows us to do `"xxx".parse()?`. - Fixes #320.
2019-07-15Prepare for Rust 2018.Justus Winter
- This is the result of running `cargo fix --edition`, with some manual adjustments. - The vast majority of changes merely qualify module paths with 'crate::'. - Two instances of adding an anonymous pattern to a trait's function. - `async` is a keyword in Rust 2018, and hence it needs to be escaped (e.g. in the case of the net::r#async module). - The manual adjustments were needed due to various shortcomings of the analysis employed by `cargo fix`, e.g. unexpanded macros, procedural macros, lalrpop grammars.
2019-06-14openpgp: Add test.Justus Winter
2019-05-30openpgp: Implement From<u64> for KeyID.Justus Winter
2018-12-14openpgp: Implement Arbitrary for KeyID.Justus Winter
2018-11-20openpgp: Add basic support for old-style sigs to the Verifier.Neal H. Walfield
- Although the PacketParser doesn't support old-style signatures (see issue #128), the Verifier should not choke on them. - This change prevents the Verifier from choking by processing all old-style signatures in the usual manner. However, because the old-style signatures will have a computed hash of 000..., they will appear to be bad.
2018-09-27openpgp: Add predicate.Justus Winter
2018-08-29openpgp: Add conversion from KeyIDs to u64.Justus Winter
2018-08-24openpgp: Make functions parsing key ids, fingerprints return Result.Justus Winter
- Fixes #13.
2018-08-13openpgp: Move hex conversion functions, add tests.Justus Winter
2018-06-20openpgp: Make KeyID parsing more robust by accepting fingerprints.Justus Winter
- A fingerprint contains more information than a keyid, I see no reason not to parsing it to a keyid, other than to annoy any users.