summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet/unknown.rs
AgeCommit message (Collapse)Author
2023-12-05openpgp: Preserve more information when cloning packet::Unknown.Justus Winter
- anyhow::Error isn't Clone, so we cannot, in general, duplicate the error without losing information. We can try to downcast to the most likely errors, and clone them, but this can never cover all possibilities. - Further, the error wrapped in std::io::Error isn't clone, so we necessarily lose information when cloning this, even after we changed Sequoia to return concrete errors. - I think this is the best we can do, at least for now. - Fixes #1068.
2023-06-14openpgp: Deprecate `Packet::MDC` variant.Wiktor Kwapisiewicz
- Crypto refresh changes MDC to not be a standalone packet but an implementation detail of the SEIPDv1 packet. - Adjust use-sites to allow for deprecations. - See https://gitlab.com/sequoia-pgp/sequoia/-/issues/860
2022-06-08openpgp: Implement TryFrom<Packet> for Unknown.Justus Winter
2021-11-29Remove unnecessary borrows.Nora Widdecke
- Fixed with the help of clippy::needless_borrow.
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.
2020-12-11openpgp: Pass the hash algo's security reqs to Policy::signature.Neal H. Walfield
- If the signer controls the data that is being signed, then the hash algorithm only needs second pre-image resistance. - This observation can be used to extend the life of hash algorithms that have been weakened, as is the case for SHA-1. - Introduces a new `enum HashAlgoSecurity`, which is now passed to `Policy::signature`. - See #595.
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-03-27openpgp: Improve documentation.Justus Winter
2020-03-27openpgp: Define equality using the serialized OpenPGP form.Justus Winter
- All packets should be considered equal if the serialized OpenPGP form is equal, modulo framing (i.e. CTB type, packet length encoding, partial body chunking). - In cases this may lead to surprising outcomes, discuss this in the documentation, and provide additional equality predicates. - Fixes #92.
2020-03-26Remove redundant field names.Wiktor Kwapisiewicz
2020-03-26openpgp: Change packet bodies to be tristate.Justus Winter
- Packet bodies can now be either unprocessed (e.g. compressed, encrypted), processed (e.g. uncompressed, decrypted), or structured (e.g. parsed into packets). - Make the container types deref to Container, and container deref to packet bodies. - This cleanly avoids the confusion when serializing containers: We can serialize compressed data packets with either body, but we can only serialize encryption containers with unprocessed bodies. - Fixes #187.
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-01-08openpgp: Explicitly implement PartialEq, Hash for packets.Justus Winter
- We explicitly exclude the common fields. - See #92.
2019-12-20openpgp: Fix comparing streamed containers.Justus Winter
- Compute a digest over the streamed data and use it to implement equality. - Fixes #93.
2019-12-20openpgp: Use Container for Literal, Unknown.Justus Winter
- Embed Container in Literal and Unknown. This reuses code. - More importantly, Literal and Unknown now correctly implement PartialEq. - Unknown cannot implement Ord. Remove PartialOrd as well, it seems like an obscure use case to order packets. - An unfortunate consequence of Unknown not implementing Eq is that Cert cannot, because it holds unknown packets. We consider that unacceptable. - See #93.
2019-12-20openpgp: Use weaker ordering function.Justus Winter
- Previously, Cert::canonicalize relied on Unknown implenting Ord. However, due to streaming, it cannot. Use a weaker ordering function.
2019-12-20openpgp: Embed struct Container in the container packets.Justus Winter
- This allows us to implement PartialEq and related traits more selectively. See #93.
2019-12-20openpgp: Store unknown packet data in struct Unknown.Justus Winter
2019-12-20openpgp: Move fields from Common to Container.Justus Winter
2019-09-02openpgp: Implement Ord for UnknownNeal H. Walfield
- Sort by tag, then the body (lexographically).
2019-09-02openpgp: When comparing Unknowns, only compare their valuesNeal H. Walfield
- Ignore the common bits when comparing two Unknowns for equality; just consider their bodies.
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-02-06openpgp: Return previous value in setters.Justus Winter
- See #147.
2019-02-06openpgp: Store parsing errors in the Unknown packet.Justus Winter
- This improves diagnostics on soft errors producing unknown packets. - Fixes #65.
2019-02-06openpgp: Rename consuming conversion functions.Justus Winter
- Rename functions that consume their receiver but are called .to_...() to .into_...(). - For the packet types, simply drop the conversion function in favor of using the From trait. - Fixes #160.
2018-12-13openpgp: Make fields of Unknown private.Justus Winter
2018-10-16openpgp: Refactor.Justus Winter
- Move tag to openpgp::packet.
2018-10-16openpgp: Refactor.Justus Winter
- Move the modules containing the packet types to the openpgp::packet module, aligning the layout of the files with the exposed API.