summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-01-03core,net: Avoid 'unwrap()' in examples.Justus Winter
- We should not even suggest to use unwrap in our examples.
2018-01-02openpgp: Improve error message.Neal H. Walfield
2018-01-02openpgp: Preliminary serialization support.Neal H. Walfield
- Support serializing `CompressedData` and `Literal` packets.
2018-01-02openpgp: Provide a mechanism to compare packets and messages.Neal H. Walfield
2018-01-02openpgp: Implement Tag::to_numeric.Neal H. Walfield
- When serializing packets, we need to convert the symbolic representation of a Tag to its numeric representation.
2018-01-02openpgp: Improve trace output.Neal H. Walfield
2018-01-02openpgp: Don't push forwarding filters.Neal H. Walfield
- Given that `BufferedReader`s now track what packet they belong to, we no longer have to have a fixed number of filters per container / packet. This means we can even have 0, which is useful for non-decompression compressed packets, and packets with an Indeterminate body length. - Note: this change should also bring the parser closer inline with GnuPG with respect to decompression packets with an indeterminate length: now when we pop a compressed packet with an indeterminate length, we will drain it until the decompressor returns EOF and not until the end of the message, since we no longer need to push an "unlimited" limitor to make sure we had something to pop.
2018-01-02openpgp: Independently track PacketParser and BufferedReader depth.Neal H. Walfield
- Store the level that a `BufferedReader` applies to in the `BufferedReader`'s cookie. This is useful, because when we pop a container, figuring out how many filters it pushed on the `BufferedReader` stack is fragile. Using this information, we just remove `BufferedReader`s until we are the right level. - This mechanism also requires passing the recursion depth to the container parser functions. Do it for all of the packet parser functions and set the recursion depth there.
2018-01-02buffered_reader: Allow the user to store data in a BufferedReader.Neal H. Walfield
- We want to associate some data with a BufferedReader instance. Because a BufferedReader points to another BufferedReader, we can't use a wrapper object. This change provides a mechanism to store any required data inside the actual `BufferedReader`. Note: this is a zero-cost abstraction. If no data needs to be stored, then there is no cost.
2018-01-02buffered-reader: Restore missing import.Neal H. Walfield
- e03cca1d751d907c490d1f3d145086d391639979 removed the `use std::str` clause, which was not actually used by the main code, but was used by a test case. Restore the import, but only when it is actually needed.
2018-01-02buffered-reader: Remove unused import.Justus Winter
2018-01-02ffi: Remove unused import.Justus Winter
2017-12-24Revert "tools: Use a PacketParser to parse packets. Improve dumps output."Neal H. Walfield
This reverts commit 217e7595584418e68c8c634533b72a59a76ee02d. This commit was actually a part of e0354af157e31421c2c65310b9f49d3f87d66814 and 217e7595584418e68c8c634533b72a59a76ee02d reverted it. Whoops.
2017-12-24tools: Use a PacketParser to parse packets. Improve dumps output.Neal H. Walfield
- Using openpgp::Message::from_reader is convenient, but buffers the whole message. Use a `PacketParser` so that we only need to buffer a single packet. (This can be improved by streaming literal data packets.) - Improve the output by indenting packets according to their recursion depth.
2017-12-24tools: Put the main function in a help function returning a Result.Neal H. Walfield
- We'd like to use `?` to handle error results rather than using unwrap. Put the main function into a helper function that returns a Result and have main call that function, and print any error.
2017-12-24openpgp: Don't export Container::pretty_print.Neal H. Walfield
2017-12-24openpgp: Publicly export Packet::tag.Neal H. Walfield
2017-12-24openpgp: Document the basic OpenPGP types, and iterators.Neal H. Walfield
2017-12-24openpgp: Rename PacketCommon::iter to ::descendants.Neal H. Walfield
- Make PacketCommon's iterator interface consistent with the `Message` and `Container` iterator interfaces.
2017-12-24openpgp: Improve the parser documentation.Neal H. Walfield
- Provide module-level documentation. - Mention the `MessageParser` interface when comparing interfaces. - Improve text.
2017-12-24openpgp: Change PacketParser interface to return absolute position.Neal H. Walfield
- Change `PacketParser::next()` and `PacketParser::parse()` to return the absolute recursion depth of the old packet and the new packet parser instead of just returning the relative position of the `PacketParser` with respect to the old packet.
2017-12-23openpgp: Don't circumvent the wrapper around PackeParser::reader.Neal H. Walfield
- PacketParser::buffer_unread_content should set PacketParser::content_was_read. This is set when reading directly from the PacketParser, but not when using PacketParser::reader. Use the former.
2017-12-23openpgp: Add a new message processing interface, MessageParser.Neal H. Walfield
- `PacketParser` has the disadvantage that the caller needs to assemble the `Message`. `Message::deserialize` has the disadvantage that packets cannot be streamed, whether to recurse is a global property of the parser, and parsing cannot be aborted. `MessageParser` solves these problems with a nice interface. It is a tiny bit more expensive than `Message::deserialize`, however.
2017-12-22openpgp: Rename PacketParser::deserialize to ::to_message.Neal H. Walfield
2017-12-22openpgp: Add a function to pretty print Messages.Neal H. Walfield
2017-12-22openpgp: Fix typo.Neal H. Walfield
2017-12-22openpgp: Improve documentation for OpenPGP header types and parsing.Neal H. Walfield
2017-12-22openpgp: Fix missing value in enum.Neal H. Walfield
- For some reason, I forgot to explicitly assign the OnePassSig tag a numeric value. Let's be explicit.
2017-12-22openpgp: Make packet header parsing routines public.Neal H. Walfield
2017-12-22openpgp: Rename PacketCommon:content to PacketCommon:body.Neal H. Walfield
2017-12-22openpgp: Don't require users to know about num::FromPrimitiveNeal H. Walfield
- Provide Tag::from_numeric and PacketLengthType::from_numeric to convert a numeric value to a Tag or PacketLengthType, respectively. - Update users.
2017-12-21tool: New crate.Justus Winter
- A command line tool to interact with Sequoia. Useful for debugging and development.
2017-12-20openpgp: Make the Subpacket's fields public.Neal H. Walfield
- Subpackets are returned to users, and are only useful if the content is readable.
2017-12-20openpgp: Improve subpacket documentation.Neal H. Walfield
2017-12-19Improve the 'sequoia' crate.Justus Winter
- Improve the documentation. - Re-export 'openpgp'. - Re-export the other crates without prefix.
2017-12-19openpgp: Fix link.Justus Winter
2017-12-19openpgp: Improve test.Justus Winter
2017-12-19openpgp: Add 'TPK.fingerprint()'.Justus Winter
2017-12-19openpgp: Add 'Fingerprint.to_hex()'.Justus Winter
2017-12-19Make the Result types public.Justus Winter
2017-12-18openpgp: Fix benign warning.Neal H. Walfield
2017-12-18openpgp: Move partial_body module to be a submodule of parse.Neal H. Walfield
- The partial_body module is only used by parse. So, this is the right place. - Also, there is now no reason for body_length_new_format to be public. So, make it private.
2017-12-18openpgp: Rename Message::deserialize to ::from_buffered_reader.Neal H. Walfield
- Most callers won't actually have a `BufferedReader`, so giving the nice name to this interface doesn't make sense. Also, the new name is more consistent with PacketParser and PacketParserBuilder. - Update users.
2017-12-18openpgp: Change Message::from_file to accept a path.Neal H. Walfield
- `Message::from_reader` already accepts an object implementing a `std::io::Read` interface. - Update users of `Message`.
2017-12-18Documentation improvements.Neal H. Walfield
2017-12-16openpgp: Add an option to PacketParser to trace its executionNeal H. Walfield
- To make it easier to understand what the PacketParser is doing, add an option trace its execution.
2017-12-16openpgp: Add a setting to the PacketParser to buffer unread contentNeal H. Walfield
- Add a setting to the PacketParser to enable buffering of unread content when the PacketParser is advanced.
2017-12-16buffered-reader: Fix buglet.Neal H. Walfield
- Fix how the amount of data to consume is computed in BufferedReaderMemory::data_consume.
2017-12-15openpgp: Store PacketParser settings in a struct.Neal H. Walfield
- To support the easy propagation of multiple settings and their clear separation from the other state, bundle all settings in a struct.
2017-12-15openpgp: Implement the builder pattern for the Message struct.Neal H. Walfield