summaryrefslogtreecommitdiffstats
path: root/openpgp/src/packet/literal.rs
AgeCommit message (Collapse)Author
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-04-09openpgp: Rename PacketParserBuilder::finalize to build.Justus Winter
- Writers should be finalized, builders should be built.
2020-04-02openpgp: Implement Default for packet::Literal.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-20openpgp: Add test demonstrating partial reads of literal packets.Justus Winter
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-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: Store literal data in struct Literal.Justus Winter
- With this change, packet::Common is only used by container packets.
2019-12-03openpgp: Make Literal::set_filename polymorphic over AsRef<[u8]>.Justus Winter
- And drop Literal::set_filename_from_bytes.
2019-12-03openpgp: Use Timestamp in packet::Literal.Justus Winter
2019-11-25openpgp: Rename openpgp::constants to openpgp::types.Justus Winter
- Fixes #381.
2019-11-21openpgp: Replace time crate with std::time.Justus Winter
- In sq and sqv, use chrono to interface with the user. - Fixes #341.
2019-09-27openpgp: Clean up deprecated range syntaxDaniel Silverstone
The `...` syntax is deprecated in favour of `..=` since 1.26 and is an idiom lint in the 2018 edition. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
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-03-22openpgp, core: Return old value in setters.Justus Winter
- Fixes #147.
2019-02-18openpgp: Move Serialize::to_vec to SerializeInto::to_vec.Justus Winter
- Here, we have .serialized_len() to compute the capacity needed, and .to_vec() is not a streaming interface.
2019-02-06openpgp: Return previous value in setters.Justus Winter
- See #147.
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-14openpgp: Add roundtrip tests for packages.Justus Winter
2018-12-13openpgp: Make fields of Literal private.Justus Winter
2018-12-05openpgp: Treat packet bodies consistently.Justus Winter
- When setting the body of packets, treat zero-length bodies as no bodies.
2018-12-05openpgp: Treat filenames consistently.Justus Winter
- When setting the filename of a literal data packet, treat filenames of length zero as no filename.
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.