Age | Commit message (Collapse) | Author |
|
|
|
- The former is too unwieldy, and both are equally expressive in
this context.
|
|
- 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.
|
|
- Use the public API for creating packet parsers.
|
|
|
|
|
|
- This functionality is required for checking detached signatures.
|
|
- Add TPK::keys() to iterate over a TPK's primary key *and* its
subkeys.
|
|
- We distinguish between unknown and unsupported algorithms. Use
the more appropriate error code.
- Fixes b7f222e.
|
|
- Signature::parse included an implementation of Signature::hash.
Consolidate them.
|
|
- 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.
|
|
- Note: when turned into an iterator, packets are fully buffered.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- RFC 4880, section 4.2: If interoperability [with PGP 2.6.x] is not
an issue, the new packet format is RECOMMENDED.
|
|
|
|
- All packets implemented both 'serialize()' and 'to_vec()'. Make
this explicit by introducing two traits.
|
|
- Do not encode the date when we store it in the object. This is
done during serialization.
|
|
Also fixed a bug where ESK-less SKESK with simple S2K were accepted
despite the RFC forbidding it.
|
|
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.
|
|
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.
|
|
|
|
|
|
- Fix the "linked list" performance problem described in 9619dff for
BufferedReaderDup.
|
|
- Avoid using parser internals in the test.
|
|
|
|
- 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.
|
|
- Make sure PacketParser::finish is a noop if it is called more than
once on a given packet.
|
|
|
|
|
|
- This prevents the emacs indentation from going crazy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Also, make openpgp::packet public.
|
|
|
|
|