summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
AgeCommit message (Collapse)Author
2019-12-20openpgp: Simplify key iteration interface.Neal H. Walfield
- Cert::keys_valid() is just a short-cut for Cert::keys_all().alive().revoked(false). - Remove Cert::keys_valid() and rename Cert::keys_all() to Cert::keys().
2019-12-19openpgp: Change KeyIter to return a struct instead of a tuple.Neal H. Walfield
- A tuple is just an unnamed, inflexible struct. Use a struct instead. - Fixes #400.
2019-12-18openpgp: Make SubpacketValue::EmbeddedSignature take a Signature.Justus Winter
- Now that we eagerly check the syntax, there no longer is the need for storing Unknown packets there.
2019-12-18openpgp: Tune field names to make them fit in the hex dump.Justus Winter
2019-12-18openpgp: Handle malformed subpackets when parsing.Justus Winter
- If a syntactically malformed subpacket is encountered, we do the same as for malformed packets, we turn the whole signature into an unknown packet. - Fixes #200.
2019-12-17openpgp: Make Subpacket own the data.Justus Winter
- The subpacket areas now have a vector of subpackets. Change some accessors here and there to accommodate this. - This requires bit-perfect roundtripping of subpackets so that signatures are not invalidated. - First step towards fixing #200.
2019-12-13openpgp: Rename the hash prefix to digest prefix.Justus Winter
2019-12-13openpgp: Likewise for MDC.Justus Winter
2019-12-13openpgp: Call the computed hash a digest.Justus Winter
2019-12-13openpgp: Remove hash algorithm from computed hash.Justus Winter
- The signature knows the hash algorithm.
2019-12-11openpgp: Make the PacketPileParser interface safe.Justus Winter
- Do not expose the PacketParserResult, improve error handling. - Fixes #278.
2019-12-09openpgp: Return Result from Signature::key_alive.Justus Winter
- See #371.
2019-12-09openpgp: Return Result from Signature::signature_alive.Justus Winter
- See #371.
2019-12-04openpgp: Rename KeyFlag's accessors.Justus Winter
- Fixes #359.
2019-12-04openpgp: Rename KeyIter filters.Justus Winter
- See #359.
2019-12-04openpgp: Account for clock skew when using the streaming verifiers.Neal H. Walfield
- Modify the streaming verifiers to account for clock skew when using the current time.
2019-12-03openpgp: Rename openpgp::conversions to openpgp::fmt.Justus Winter
2019-12-03openpgp: Make Literal::set_filename polymorphic over AsRef<[u8]>.Justus Winter
- And drop Literal::set_filename_from_bytes.
2019-12-03openpgp: Remove all calls to Time::canonicalize.Justus Winter
- Now that we store timestamps in OpenPGP's native encoding, the canonicalization happens when converting to it.
2019-12-03openpgp: Convert uses of Time::from_pgp.Justus Winter
2019-12-03openpgp: Use Timestamp in packet::Literal.Justus Winter
2019-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-27openpgp: Fix issuer handling in the streaming verifier.Justus Winter
- To that end, make VerificationHelper::get_public_keys take KeyHandles for all the issuers.
2019-11-27openpgp: Fix Signature::get_issuer to return set of issuers.Justus Winter
- A signature can contain multiple hints as to who created the signature. Return all those hints to the caller. - Adapt all callers accordingly. - Fixes #264.
2019-11-27openpgp: Improve test case.Justus Winter
2019-11-27openpgp: Make variants of VerificationResult struct-like, add infos.Justus Winter
2019-11-25openpgp: Rename openpgp::constants to openpgp::types.Justus Winter
- Fixes #381.
2019-11-22openpgp: Make constructors specific to their public parts.Justus Winter
2019-11-22openpgp: Make conversions into Key<SecretParts, _> fallible.Justus Winter
- Fixes #380.
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-11-19openpgp: Use the builder pattern for stream::LiteralWriter.Justus Winter
- See #375.
2019-11-19openpgp: Use the builder pattern for stream::Signer.Justus Winter
- See #375.
2019-11-19openpgp: Be tolerant when deciding wheter a signature is alive.Neal H. Walfield
- Consider the following scenario: computer A's clock says 9:00.00 and signs and sends a message to computer B. Computer B's clock says 8:59.59, it receives the message and tries to verify it. From Computer B's perspective, the signature is not valid, because it was generated in the future. - This situation occured, because the two clocks were not completely synchronized. Unfortunately, a few seconds of clock skew are not unusual, particularly when dealing with VMs. - Since it is almost always better to consider such messages as valid, be tolerant when deciding whether a signature is alive.
2019-11-18spell "detached" correctlyDaniel Kahn Gillmor
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-11-10openpgp: Remove gratuitious code from last commit.Neal H. Walfield
- The last commit introduced a gratuitious and unreachable "else if" branch, remove it.
2019-11-10openpgp: Distinguish bad signatures from those that are not alive.Neal H. Walfield
- Return a different `VerificationResult` for signatures that are not alive (BadSignature) from signatures that are actually bad (BadCheck).
2019-11-09openpgp: Break apart function.Neal H. Walfield
- The original function was nested too much.
2019-11-08openpgp: Split long running test.Neal H. Walfield
2019-11-07openpgp: Speed up test by managing the buffer more smartly.Neal H. Walfield
2019-11-07openpgp: Use a Vec instead of a HashMap.Neal H. Walfield
- A SignatureGroup currently contains a hash mapping hash algorithms to hash contexts. Typically this will only contain one or two mappings. At most it will contain one mapping for each algorithm that we support (currently, we support 7 hash algorithms). - Given the small expected and small maximum size, a vector is the better data structure: - The small number of elements means that look up time will be comparable whether we do a linear scan or look in a hash (in fact, the linear scan is probably cache friendlier). - Iterating over a vector is faster than iterating over a hash map. The is the fast path. - A vector takes up less space. - Change SignatureGroup::hashes to use a Vec instead of a HashMap.
2019-11-07openpgp: Use vec_truncate instead of Vec::truncate.Neal H. Walfield
2019-11-01openpgp: Fix Transform::read_helper.Neal H. Walfield
- To avoid an infinite loop, we need to not only read data, but also consume it. - Add a regression test. - Fixes #349.
2019-10-30openpgp,buffered-reader: Optimize Vec<u8>::truncate manuallyNeal H. Walfield
- On debug builds, Vec<u8>::truncate is very, very slow. For instance, running the decrypt_test_stream test takes 51 seconds on my (Neal's) computer using Vec<u8>::truncate and <0.1 seconds using `unsafe { v.set_len(len); }`. The issue is that the compiler calls drop on every element that is dropped, even though a u8 doesn't have a drop implementation. The compiler optimizes this away at high optimization levels, but those levels make debugging harder.
2019-10-30openpgp: Fix indentation.Neal H. Walfield
2019-10-30buffered-reader: Fix Generic::data_helper.Neal H. Walfield
- The `Generic::data_helper` was not sufficiently careful when dealing with errors. In particular: - If `Generic::data_hard(1)` was called, and an error occured, and nothing was buffered or read, `Generic::data_helper` would return the empty string instead of the error. - If `Generic::data(n)` was called, and an error occured, but some data (< n bytes) was buffered, `Generic::data_helper` would return the error instead of the data that was read. - Fix these bugs. - Also, simplify the code and don't save whether we hit EOF or the error (which we can only return once, anyway). Instead, rely on the underlying reader to return EOF or the error again. - Fixes #174.
2019-10-30openpgp: Fix test.Neal H. Walfield
- The correct header is "-----BEGIN PGP SIGNATURE-----", not "-----BEGIN SIGNATURE-----".
2019-10-28openpgp: Break the longest-running test into two.Justus Winter
2019-10-27Fix more spelling errors caught by codespellDaniel Kahn Gillmor
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-10-22openpgp: Fix AEAD encryption.Neal H. Walfield
- The AEAD implementation did not correctly handle messages where the last chunk was a bit smaller than the chunk size. Specifically, assume that the chunk size is 32 bytes and the digest size is 16 bytes, and consider a message with 17 bytes of data. That message will be encrypted as follows: [ chunk1 ][ tag1 ][ tagF ] 17B 16B 16B If we read a chunk and a digest, we'll successfully read 48 bytes of data. Unfortunately, we'll have over read: the last 15 bytes are from the final tag. To correctly handle this case, we have to make sure that there are at least a tag worth of bytes left over when we read a chunk and a tag. - Test encrypting and decrypting more message sizes using AEAD. - Also, check that the AEAD implementation correctly handles corruption (specifically, a corrupted final tag).
2019-10-11openpgp: To trial decrypt an AEAD chunk, use more one chunk of data.Neal H. Walfield
- A correct AEAD implementation ensures that the final tag is correct (currently we don't see issue #346). When doing a trial decryption of a single chunk, we need to provide more than a single chunk of data to the decryptor otherwise it might think the file reached EOF and assume the chunk was a partial chunk, and then the AEAD tags won't match.