summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize
AgeCommit message (Collapse)Author
2022-12-12openpgp: Make hash_update_text more idomatic.Neal H. Walfield
- Make `hash_update_text` a method on `HashingMode<Digest>`, `HashingMode<Digest>::update`.
2022-05-12openpgp: Rename `iv_size` to `nonce_size` leaving `iv_size`.Wiktor Kwapisiewicz
- Rename `iv_size` to `nonce_size`. - Introduce `iv_size` that forwards to `nonce_size` for compatibility reasons. - Change all calls to `iv_size` to `nonce_size`.
2022-05-06autocrypt, net: openpgp: Rewrite all usages of `Reader::new`.Wiktor Kwapisiewicz
2022-02-22openpgp: Fix emitting multiple signatures.Justus Winter
- Previously, stream::Signer did not properly bracket OPS/Sig packets when using more than one signer, i.e. OPS_a OPS_b Literal Sig_a Sig_b instead of OPS_a OPS_b Literal Sig_b Sig_a. - This is a regression introduced in 5bef3bde45f71126cdca3e8ad30b1047287c843a. - Fixes #816.
2022-02-15openpgp: Skip test if algorithm is not supported.Justus Winter
2022-02-14openpgp: Refactor AEAD encryption and decryption.Justus Winter
- Introduce a trait that schedules nonce and additional authenticated data for each AEAD chunk. - Factoring that out allows us to support different schemes, and decouple memory encryption from the OpenPGP schedules.
2022-01-10openpgp: Generalize test.Justus Winter
2021-12-31openpgp: Add ability to restrict hash algorithms for signing.Wiktor Kwapisiewicz
2021-11-29Drop unnecessary lifetime annotations.Nora Widdecke
- Continuation of e6a335b93a10620bcb7cbfa32e232949758f0c99.
2021-11-29Fix Acronym spelling.Nora Widdecke
- In CamelCase, acronyms count as one word. Apply this rule where API and lalrpop are not impacted. - Found by clippy::upper_case_acronyms.
2021-11-29Remove unnecessary borrows.Nora Widdecke
- Fixed with the help of clippy::needless_borrow.
2021-11-18openpgp: Use a WASM-friendly SystemTime::now wrapper.Justus Winter
- Fixes #769.
2021-09-30Allow short single-character argument and variable namesLars Wirzenius
Generally speaking, single-character names are not great for the person reading the code later. They don't usually act as a cognitive aid to understand the code. However, this in code implementing cryptographic operations that implements mathematical formulas that canonically use single-letter names it's clearer to use the same name in the code. Thus, I only tell clippy those names are OK in these cases. Found by clippy lint many_single_char_names: https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
2021-09-30Allow ::new to not return SelfLars Wirzenius
It is Rust custom that the new method for a type returns an instance of that type. However, sometimes that's not wanted. Tell clippy that these cases are OK. I opted to not do this globally, because that would prevent clippy from catching future cases. Found by clippy warning new_ret_no_self: https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self
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-30Replace .filter_map with just .filter when possibleLars Wirzenius
If the function or closure passed into .filter_map doesn't do any filtering or mapping. the method call can be replaced with a simple .map or .filter. The clippy lint suggests which. In this change, we can always replace .filter_map with .filter. We also need to change the closure to return a boolean value, since that's what .filter expects. Found by clippy lint unnecessary_filter_map: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
2021-09-30Drop unnecessary lifetime notationsLars Wirzenius
Rust can automatically deduce lifetimes in some cases ("lifetime elision"). While adding unnecessary lifetime annotations is not incorrect, it can make it harder to follow the code: why is there a lifetime annotation here? What is the reason why it's needed? Is something unusual going on. This removes a few unnecessary lifetime annotations, as found by the clippy lint needless_lifetimes: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
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-08-19openpgp: Implement PartialEq for TSK.Justus Winter
- Comparing Certs ignores any secret key material, in accordance with our definition of equality based on the serialized form. To take secret key material into account, define equality of TSKs. - Fixes #701.
2021-08-18openpgp: Simplify TSK's filter mechanism.Justus Winter
2021-04-28openpgp: Implement Encryptor::with_session_key.Justus Winter
- Fixes #390.
2021-04-28openpgp: Fix documentation.Justus Winter
2021-04-28openpgp: Simplify code.Justus Winter
2021-04-20openpgp: Fix some more links.Justus Winter
2021-04-20lint: Remove unnecessary trailing semicolons.Nora Widdecke
- rustc 1.51 has activated the redundant_semicolons lint. https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#redundant-semicolons
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: 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-03-19openpgp: Simplify key serialization code.Justus Winter
2021-03-05openpgp: Do not recommend padding by default.Justus Winter
- We discovered compatibility problems with the padding mechanism, so we should caution against its use when compatibility with certain implementations is required. Also, don't use padding in the module's example.
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-02-24openpgp: Improve example.Justus Winter
2021-02-24openpgp: Fix links.Justus Winter
2021-02-24openpgp: Verify messages using the Cleartext Signature Framework.Justus Winter
- Implement verification of messages using the Cleartext Signature Framework by detecting them in the armor reader, and transforming them on the fly to inline signed messages. - The transformation is not perfect. We need to synthesize one-pass-signatures, but we only know the hash algorithm(s) used. Luckily, this is the only information the packet parser needs. - We only enable the transformation when using stream::Verifier. The transformation is transparent to the caller. Currently, there is no way to disable this. In the next major revision, we may add ways to control this behavior. - Fixes #151.
2021-02-24openpgp: Sign messages using the Cleartext Signature Framework.Justus Winter
- See #151.
2021-02-10openpgp: Generalize streaming Signer modes.Justus Winter
2021-01-12openpgp: Simplify certificate serialization.Justus Winter
2020-12-22openpgp: Implement TSK::armored.Neal H. Walfield
- `Cert::armored` conveniently wraps a `Cert` with ASCII armor and adds nice comments. - Provide the same mechanism for `TSK`s.
2020-12-22openpgp: Clean up documentation.Neal H. Walfield
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-11openpgp: Standardize fn main() in doctests.Azul
- Avoid the additional `fn f()`.
2020-12-11openpgp: Fix example.Justus Winter
2020-12-08openpgp: Tweak the assert_send_and_sync macro.Justus Winter
- Declare trait bounds using a where clause. It looks a bit odd if there is no bound, but not worse than before.
2020-12-08openpgp: Add assert_send_and_sync! for more types.Azul
- All types that are `Send` and `Sync` are checked now. - Fixes #627.
2020-12-08openpgp: Use parens for assert_send_and_sync!.Azul
2020-12-08openpgp: Add assert_send_and_sync! for more types.Azul
- With !928 merged more types are `Send` and `Sync` now. - See #627.