summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)Author
2017-11-21Make iterators public.Justus Winter
- Make the iterators so that they can be used by the frontend.
2017-11-21Fix comment.Justus Winter
- This is actually a five octet length. The first octet is already consumed at this point. Also, RFC 4880 refers to this as five octet length.
2017-11-16Clean up the decompression code.Neal H. Walfield
2017-11-16Remove unnecessary lifetime annotation.Neal H. Walfield
2017-11-16Change Message::deserialize to take a reference to the reader.Neal H. Walfield
- Taking ownership of the BufferedReader object is not idiomatic Rust.
2017-11-16Make literal_body generic.Neal H. Walfield
2017-11-16Don't gratuitously cast to a trait object.Neal H. Walfield
- Because the Read trait is implemented for references, there is no need to coerce a &[u8] to a std::io::Read object. Not doing so means that we avoid a level of indirection when dispatching. - This change means that we can remove the ?Sized bound on BufferedReaderGeneric.
2017-11-01Add an iterator for Messages and Packets.Neal H. Walfield
- The iterator does a depth-first traversal of the OpenPGP message.
2017-11-01Convert CompressedData to use a Message for any containing PacketsNeal H. Walfield
- Don't just save the decompressed content. Instead, use Message::deserialize to process the compressed data.
2017-11-01Add a Message struct, which contains zero or more packetsNeal H. Walfield
- Make parse_message a Message constructor.
2017-11-01Provide better Debug trait implementations for the OpenPGP packetsNeal H. Walfield
- The default implementations print everything, as is. Instead, only show a summary of very long content. - Since text is not guaranteed to be valid UTF-8, it is not stored as a String, but as a &[u8]. When displaying these fields, try to display them as strings.
2017-10-28Add support for parsing compressed data packets.Neal H. Walfield
- Use the flate2 and bzip2 crates for the actual decompression.
2017-10-24Don't expect packets to be in memory. Use a reader instead.Neal H. Walfield
- The reader is a new trait (BufferedReader). It is designed to avoid extra copies (buffered data doesn't need to be copied to a caller supplied buffer). In this regard, it is like the BufRead trait, but it has additional functionality. Specifically, it is possible to control how much data should be buffered, and the interface for accessing the data is much nicer. In particular, there are fewer gymnastics to avoid lifetime issues. For instance, using the BufRead interface, processing data looks like: let amount = { let buffer = bufread.fill_buf(); ... X }; bufread.consume(amount); But, using the BufferedReader interface, we can do: { let buffer = bio.data_consume(X); ... } - BufferedReaders can be chained so that later BufferedReaders can act like filters. This commit includes two such filters. BufferedReaderLimitor places a limit on the amount of data that can be read (this is useful to limit the amount of data that a packet can read to the packets stated size in its header). And, BufferedReaderPartialBodyFilter processes partial body chunks. - Since the lifetime of Packets is no longer guaranteed to be longer than their buffers, we need to change from using slices to Boxed data.
2017-10-16openpgp: Add the start of a parser in nom.Neal H. Walfield