summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-05-02Simplify example.Justus Winter
2018-05-02openpgp: Rename 'BufferedReaderState' to 'Cookie'.Justus Winter
- The former is too unwieldy, and both are equally expressive in this context.
2018-05-02openpgp: Rework parsing and improve robustness.Justus Winter
- When parsing the packets, dup the reader and when the parsing fails, return an unknown packet with the original reader intact. - Parsing now has two states. First, we parse the framing and headers. Then, we return control to the callee. - If parsing fails, then an unknown packet is returned. This notably includes the case of truncated packets, which are now handled like any other kind of malformed input. - Any other read errors still terminate the parsing. - This is also an opportunity to add some assertions to the tests that were previously removed.
2018-05-02openpgp: Rework some parser tests.Justus Winter
- Use the public API for creating packet parsers.
2018-05-01tool: Add new tool, sqv.Neal H. Walfield
2018-05-01openpgp: Improve TPKParse's debugging output.Neal H. Walfield
2018-05-01openpgp: Add a function to hash arbitrary files.Neal H. Walfield
- This functionality is required for checking detached signatures.
2018-04-30openpgp: Add a function to iterate over all of a TPK's keys.Neal H. Walfield
- Add TPK::keys() to iterate over a TPK's primary key *and* its subkeys.
2018-04-30openpgp: Use UnsupportedHashAlgorithm for unsupported algorithms.Neal H. Walfield
- We distinguish between unknown and unsupported algorithms. Use the more appropriate error code. - Fixes b7f222e.
2018-04-30openpgp: Remove redundant code, consolidate comments.Neal H. Walfield
- Signature::parse included an implementation of Signature::hash. Consolidate them.
2018-04-30openpgp: Rework TPK parsing.Neal H. Walfield
- Instead of providing packets one at a time, pass a packet iterator to TPKParse::new(). - Change TPKParser to parse not just a single TPK, but as many TPKs as there are in the packet stream. - Parse the TPKs lazily (by making TPKParser implement an iter) so that if just the first TPK is required, we don't do any unnecessary work. - Allow TPKs without User IDs. - Since TPK::canonicalize now can't fail, update its return type and its callers appropriately.
2018-04-30openpgp: Provide a function to turn a PacketParser into an iterator.Neal H. Walfield
- Note: when turned into an iterator, packets are fully buffered.
2018-04-27openpgp: Remove (From|To)Primitive dep from Tag.Kai Michaelis
Moves Tag enum into own file and turns it into a regular enum. Replaces from_numeric/to_numeric with from/into. Adds Display and Arbitrary impl.
2018-04-27openpgp: Remove 'mod.rs' hack.Justus Winter
2018-04-27openpgp: Remove debugging remnant.Justus Winter
2018-04-27openpgp: Document PK and compression algo enumsKai Michaelis
2018-04-27openpgp: move HashAlgo -> OID func into hash.rsKai Michaelis
2018-04-26openpgp: Add signature verification support.Neal H. Walfield
2018-04-26openpgp: Add support for parsing MPIs.Neal H. Walfield
2018-04-26openpgp: Implement 'Serialize' for BodyLength.Justus Winter
2018-04-26openpgp: Implement 'Serialize' for the CTBs.Justus Winter
2018-04-26openpgp: Add constructors for CTBs.Justus Winter
2018-04-26openpgp: Add an error for invalid arguments.Justus Winter
2018-04-26openpgp: Emit only new-style CTBs.Justus Winter
- RFC 4880, section 4.2: If interoperability [with PGP 2.6.x] is not an issue, the new packet format is RECOMMENDED.
2018-04-26openpgp: Implement streaming packet serialization.Justus Winter
2018-04-25openpgp: Introduce traits for packet serialization.Justus Winter
- All packets implemented both 'serialize()' and 'to_vec()'. Make this explicit by introducing two traits.
2018-04-25openpgp: Fix date handling.Justus Winter
- Do not encode the date when we store it in the object. This is done during serialization.
2018-04-23openpgp: extend SKESK to all supported ciphers.Kai Michaelis
Also fixed a bug where ESK-less SKESK with simple S2K were accepted despite the RFC forbidding it.
2018-04-23openpgp: Rustify and extend S2K.Kai Michaelis
Turns S2K into an enum and moves the definition into s2k.rs. Adds functions for encodding and decoding the coded iterations count and finding the nearest encodable number of iterations for a given value.
2018-04-23openpgp: Enums for various alogrithmsKai Michaelis
Adds enums for cryptographic and compression algorithms. Functions that operate on algo identifiers are now member functions (hash_context -> HashAlgo::context()). The identifiers support convertions from and to u8 as well as Display.
2018-04-23openpgp: Honor trace setting.Justus Winter
2018-04-23openpgp: Update comment.Justus Winter
2018-04-19buffered-reader: Fix performance problem.Neal H. Walfield
- Fix the "linked list" performance problem described in 9619dff for BufferedReaderDup.
2018-04-16openpgp: Simplify test.Justus Winter
- Avoid using parser internals in the test.
2018-04-14openpgp: Fix last commit.Neal H. Walfield
2018-04-14openpgp: Add support for OnePassSig packets.Neal H. Walfield
- Handling OnePassSig packets in an unbuffered manner introduces a layering violation: when we encounter a OnePassSig packet, we want to push a HashedReader on the BufferedReader stack, but that is popped when the readers associated with the OnePassSig are popped! Thus, we need to introduce a bit of ugliness (OnePassSig::parse needs to pop its readers and then push the HashedReader at the high level). This is unfortunate, but it appears to be necessary. - Hashing literal data packets is ugly! Only the content of a literal data packet is hashed; neither the packet's headers, the packet's meta-data nor the length information is included in the hash. This, in particular, adds some ugliness to the BufferedReaderPartialBodyFilter implementation: it needs to disable hashing when decoding a literal data packet. - This implementation has several limitations: - We only handle a single level of Signature nesting. That is, we don't support things like having two OnePassSig packets, both of which have their 'last' bit set (meaning that the outer signature is over the inner Signature and the content, not just the content). If the parser encounters such a message, it silently ignores the nesting. In practice, this functionality is rarely used: GnuPG neither produces such messages nor does it correctly handle them. - Each OnePassSig packet pushes another HashedReader on the BufferedReader stack. This can cause a stack overflow if there are too many OnePassSig packets. Instead, there should only be a single HashedReader per level of nesting, and the amount of nesting must be limited. - If there are multiple OnePassSig packets at a nesting level using the same hash algorithm, we don't reuse hashes, because Nettle doesn't currently support cloning hashes.
2018-04-14openpgp: Ensure subsequent calls to PacketParser::finish are noopsNeal H. Walfield
- Make sure PacketParser::finish is a noop if it is called more than once on a given packet.
2018-04-14openpgp: Improve some code comments.Neal H. Walfield
2018-04-14openpgp: Improve debugging output.Neal H. Walfield
2018-04-13openpgp: Use the where clause to constrain the trait.Justus Winter
- This prevents the emacs indentation from going crazy.
2018-04-13openpgp: Remove superfluous imports.Justus Winter
2018-04-13openpgp: Tweak some headlines.Justus Winter
2018-04-13openpgp: Rename 'packet::PacketCommon' to 'packet::Common'.Justus Winter
2018-04-13openpgp: Use the trait name when invoking 'PacketCommon::default()'.Justus Winter
2018-04-13openpgp: Move Message-related functionality to openpgp::message.Justus Winter
2018-04-13openpgp: Move the packet iterators to openpgp::packet.Justus Winter
2018-04-13openpgp: Move the container type to openpgp::Packet.Justus Winter
2018-04-13openpgp: Move some packet-related types to openpgp::packet.Justus Winter
- Also, make openpgp::packet public.
2018-04-13openpgp: Move CTB-related types to openpgp::ctb.Justus Winter
2018-04-12openpgp: Rework 'PacketParserOrBufferedReader'.Justus Winter